From 69271df4944d2af9c5722e2c6d2b62a2dd7636fe Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 19 Aug 2026 05:53:27 +0000 Subject: [PATCH 1/4] Configurations: 'specification/securityinsights/resource-manager/Microsoft.SecurityInsights/SecurityInsights/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: '120cdc984d09afe0cf1d79b29ecfce1bc3bc90b0' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6718553 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 1728 ++++- .../README.md | 12 +- .../SAMPLE.md | 6534 ++++++++++++++--- .../pom.xml | 12 +- .../SecurityInsightsManager.java | 853 ++- .../fluent/ActionsClient.java | 74 +- .../fluent/AlertRuleOperationsClient.java | 81 + .../fluent/AlertRuleTemplatesClient.java | 52 +- .../fluent/AlertRulesClient.java | 68 +- .../fluent/AutomationRulesClient.java | 27 +- .../fluent/BillingStatisticsClient.java | 74 + .../fluent/BookmarkOperationsClient.java | 50 + .../fluent/BookmarkRelationsClient.java | 151 + .../fluent/BookmarksClient.java | 68 +- .../ContentPackageOperationsClient.java | 78 + .../fluent/ContentPackagesClient.java | 85 + .../fluent/ContentTemplatesClient.java | 120 + .../ContentTemplatesOperationsClient.java | 68 + .../DataConnectorDefinitionsClient.java | 141 + ...torsCheckRequirementsOperationsClient.java | 49 + .../fluent/DataConnectorsClient.java | 130 +- .../fluent/EntitiesClient.java | 209 + .../fluent/EntitiesGetTimelinesClient.java | 50 + .../fluent/EntitiesRelationsClient.java | 52 + .../fluent/EntityQueriesClient.java | 140 + .../fluent/EntityQueryTemplatesClient.java | 77 + .../fluent/EntityRelationsClient.java | 48 + .../fluent/FileImportsClient.java | 173 + .../fluent/GetRecommendationsClient.java | 43 + .../GetTriggeredAnalyticsRuleRunsClient.java | 43 + .../securityinsights/fluent/GetsClient.java | 46 + .../fluent/HuntCommentsClient.java | 151 + .../fluent/HuntRelationsClient.java | 151 + .../securityinsights/fluent/HuntsClient.java | 140 + .../fluent/IncidentCommentsClient.java | 94 +- .../fluent/IncidentRelationsClient.java | 90 +- .../fluent/IncidentTasksClient.java | 145 + .../fluent/IncidentsClient.java | 126 +- .../fluent/MetadatasClient.java | 176 + .../fluent/OfficeConsentsClient.java | 103 + .../fluent/OperationsClient.java | 2 +- .../fluent/ProductPackagesClient.java | 46 + .../ProductPackagesOperationsClient.java | 63 + .../fluent/ProductSettingsClient.java | 135 + .../fluent/ProductTemplatesClient.java | 46 + .../ProductTemplatesOperationsClient.java | 54 + .../fluent/ReevaluatesClient.java | 46 + .../fluent/ResourceProvidersClient.java | 86 + .../fluent/SecurityInsights.java | 167 - .../SecurityInsightsManagementClient.java | 468 ++ .../SecurityMLAnalyticsSettingsClient.java | 70 +- .../SentinelOnboardingStatesClient.java | 10 +- .../fluent/SourceControlOperationsClient.java | 48 + .../fluent/SourceControlsClient.java | 142 + ...eatIntelligenceIndicatorMetricsClient.java | 6 +- .../ThreatIntelligenceIndicatorsClient.java | 146 +- ...ntelligenceIndicatorsOperationsClient.java | 6 +- .../fluent/ThreatIntelligencesClient.java | 83 + ...geredAnalyticsRuleRunOperationsClient.java | 46 + .../fluent/UpdatesClient.java | 50 + .../fluent/WatchlistItemsClient.java | 90 +- .../fluent/WatchlistsClient.java | 160 +- .../WorkspaceManagerAssignmentJobsClient.java | 145 + .../WorkspaceManagerAssignmentsClient.java | 146 + .../WorkspaceManagerConfigurationsClient.java | 146 + .../fluent/WorkspaceManagerGroupsClient.java | 144 + .../fluent/WorkspaceManagerMembersClient.java | 144 + .../AADCheckRequirementsProperties.java | 71 + ...s.java => AADDataConnectorProperties.java} | 46 +- .../AATPCheckRequirementsProperties.java | 71 + ....java => AATPDataConnectorProperties.java} | 44 +- .../ASCCheckRequirementsProperties.java | 86 + ...s.java => ASCDataConnectorProperties.java} | 42 +- .../models/AccountEntityProperties.java | 25 +- .../models/ActionRequestProperties.java | 24 +- .../fluent/models/ActionResponseInner.java | 89 +- .../models/ActionResponseProperties.java | 45 +- .../ActivityEntityQueriesProperties.java | 362 + ...ActivityEntityQueryTemplateProperties.java | 212 + .../fluent/models/AlertRuleInner.java | 88 +- .../fluent/models/AlertRuleTemplateInner.java | 31 +- .../AnalyticsRuleRunTriggerProperties.java | 94 + .../models/AnomaliesSettingsProperties.java | 73 + ...SecurityMLAnalyticsSettingsProperties.java | 53 +- .../fluent/models/ApiPollingParameters.java | 117 + .../fluent/models/AutomationRuleInner.java | 70 +- .../models/AutomationRuleProperties.java | 38 +- .../AwsCloudTrailDataConnectorProperties.java | 22 +- .../models/AwsS3DataConnectorProperties.java | 173 + .../models/AzureResourceEntityProperties.java | 13 +- .../fluent/models/BillingStatisticInner.java | 212 + .../models/BookmarkExpandResponseInner.java | 93 + .../fluent/models/BookmarkInner.java | 120 +- .../fluent/models/BookmarkProperties.java | 111 +- .../CloudApplicationEntityProperties.java | 13 +- .../fluent/models/CodelessParameters.java | 87 + ...omizableConnectorDefinitionProperties.java | 185 + .../models/DataConnectorDefinitionInner.java | 215 + .../fluent/models/DataConnectorInner.java | 132 +- .../DataConnectorRequirementsStateInner.java | 98 + .../fluent/models/DnsEntityProperties.java | 13 +- ...ynamics365CheckRequirementsProperties.java | 71 + .../Dynamics365DataConnectorProperties.java | 101 + .../models/EnrichmentDomainWhoisInner.java | 169 + .../models/EnrichmentIpGeodataInner.java | 350 + .../models/EntityAnalyticsProperties.java | 90 + .../models/EntityExpandResponseInner.java | 93 + .../EntityGetInsightsResponseInner.java | 96 + .../fluent/models/EntityQueryInner.java | 216 + .../fluent/models/EntityQueryItemInner.java | 184 + .../models/EntityQueryTemplateInner.java | 181 + .../models/EntityTimelineResponseInner.java | 95 + .../ExpansionEntityQueriesProperties.java | 169 + .../models/EyesOnSettingsProperties.java | 73 + .../fluent/models/FileEntityProperties.java | 13 +- .../models/FileHashEntityProperties.java | 13 +- .../fluent/models/FileImportInner.java | 326 + .../fluent/models/FileImportProperties.java | 330 + .../models/FusionAlertRuleProperties.java | 90 +- .../FusionAlertRuleTemplateProperties.java | 139 +- .../models/GCPDataConnectorProperties.java | 173 + .../fluent/models/HostEntityProperties.java | 28 +- .../fluent/models/HuntCommentInner.java | 194 + .../fluent/models/HuntCommentProperties.java | 86 + .../fluent/models/HuntInner.java | 360 + .../fluent/models/HuntProperties.java | 294 + .../fluent/models/HuntRelationInner.java | 217 + .../fluent/models/HuntRelationProperties.java | 164 + .../models/HuntingBookmarkProperties.java | 160 +- .../fluent/models/IncidentAlertListInner.java | 36 +- .../models/IncidentBookmarkListInner.java | 37 +- .../fluent/models/IncidentCommentInner.java | 95 +- .../models/IncidentCommentProperties.java | 63 +- .../models/IncidentEntitiesResponseInner.java | 44 +- .../fluent/models/IncidentInner.java | 309 +- .../fluent/models/IncidentProperties.java | 399 +- .../fluent/models/IncidentTaskInner.java | 307 + .../fluent/models/IncidentTaskProperties.java | 236 + .../IoTCheckRequirementsProperties.java | 86 + .../models/IoTDataConnectorProperties.java | 99 + .../models/IoTDeviceEntityProperties.java | 204 +- .../fluent/models/IpEntityProperties.java | 19 +- .../fluent/models/JobInner.java | 209 + .../fluent/models/JobProperties.java | 146 + .../MCASCheckRequirementsProperties.java | 71 + .../models/MCASDataConnectorProperties.java | 99 + .../MDATPCheckRequirementsProperties.java | 71 + ...java => MDATPDataConnectorProperties.java} | 44 +- ...LBehaviorAnalyticsAlertRuleProperties.java | 239 + ...rAnalyticsAlertRuleTemplateProperties.java | 256 + .../MSTICheckRequirementsProperties.java | 71 + .../models/MSTIDataConnectorProperties.java | 99 + .../MTPCheckRequirementsProperties.java | 71 + .../models/MTPDataConnectorProperties.java | 128 + .../models/MailClusterEntityProperties.java | 13 +- .../models/MailMessageEntityProperties.java | 113 +- .../models/MailboxEntityProperties.java | 21 +- .../models/MalwareEntityProperties.java | 13 +- .../fluent/models/MetadataModelInner.java | 637 ++ .../fluent/models/MetadataProperties.java | 637 ++ .../models/MetadataPropertiesPatch.java | 636 ++ ...ProtectionCheckRequirementsProperties.java | 74 + ...tionProtectionDataConnectorProperties.java | 105 + ...tyIncidentCreationAlertRuleProperties.java | 25 +- ...ntCreationAlertRuleTemplateProperties.java | 293 +- .../fluent/models/NicEntityProperties.java | 146 + .../fluent/models/NrtAlertRuleProperties.java | 614 ++ .../NrtAlertRuleTemplateProperties.java | 376 + ...365ProjectCheckRequirementsProperties.java | 71 + ...fice365ProjectDataConnectorProperties.java | 101 + .../OfficeATPCheckRequirementsProperties.java | 71 + .../OfficeATPDataConnectorProperties.java | 117 + .../fluent/models/OfficeConsentInner.java | 161 + .../models/OfficeConsentProperties.java | 91 + .../models/OfficeDataConnectorProperties.java | 48 +- .../OfficeIRMCheckRequirementsProperties.java | 71 + ... => OfficeIRMDataConnectorProperties.java} | 56 +- ...icePowerBICheckRequirementsProperties.java | 71 + .../OfficePowerBIDataConnectorProperties.java | 101 + .../fluent/models/OperationInner.java | 63 +- .../fluent/models/PackageModelInner.java | 713 ++ .../fluent/models/PackageProperties.java | 350 + .../PremiumMdtiDataConnectorProperties.java | 168 + .../models/ProcessEntityProperties.java | 28 +- .../models/ProductPackageModelInner.java | 405 + .../models/ProductPackageProperties.java | 521 ++ .../models/ProductTemplateModelInner.java | 416 ++ .../models/ProductTemplateProperties.java | 540 ++ ...rviewAuditCheckRequirementsProperties.java | 71 + .../PurviewAuditDataConnectorProperties.java | 188 + .../fluent/models/QueryProperties.java | 86 + .../fluent/models/RecommendationInner.java | 255 + .../models/RecommendationProperties.java | 249 + .../models/ReevaluateResponseInner.java | 81 + .../models/RegistryKeyEntityProperties.java | 13 +- .../models/RegistryValueEntityProperties.java | 13 +- .../fluent/models/RelationInner.java | 61 +- .../fluent/models/RelationProperties.java | 18 +- .../fluent/models/RepoInner.java | 127 + .../fluent/models/RepositoryAccess.java | 229 + .../fluent/models/RepositoryAccessObject.java | 216 + .../RestApiPollerDataConnectorProperties.java | 328 + .../SapSolutionUsageStatisticProperties.java | 77 + .../models/ScheduledAlertRuleProperties.java | 75 +- .../ScheduledAlertRuleTemplateProperties.java | 258 +- .../models/SecurityAlertProperties.java | 31 +- .../models/SecurityGroupEntityProperties.java | 21 +- .../SecurityMLAnalyticsSettingInner.java | 79 +- .../models/SentinelOnboardingStateInner.java | 63 +- .../SentinelOnboardingStateProperties.java | 10 +- .../SentinelOnboardingStatesListInner.java | 37 +- .../fluent/models/SettingsInner.java | 222 + .../fluent/models/SourceControlInner.java | 412 ++ .../models/SourceControlProperties.java | 379 + .../SubmissionMailEntityProperties.java | 28 +- .../models/TICheckRequirementsProperties.java | 71 + .../models/TIDataConnectorProperties.java | 54 +- .../models/TIObjectCommonProperties.java | 235 + .../fluent/models/TIObjectInner.java | 320 + .../fluent/models/TemplateModelInner.java | 798 ++ .../fluent/models/TemplateProperties.java | 845 +++ ...ThreatIntelligenceAlertRuleProperties.java | 239 + ...telligenceAlertRuleTemplateProperties.java | 256 + .../models/ThreatIntelligenceCountInner.java | 75 + ...ThreatIntelligenceIndicatorProperties.java | 23 +- .../ThreatIntelligenceInformationInner.java | 79 +- .../ThreatIntelligenceMetricsListInner.java | 37 +- .../TiTaxiiCheckRequirementsProperties.java | 71 + .../TiTaxiiDataConnectorProperties.java | 335 + .../TriggeredAnalyticsRuleRunInner.java | 210 + .../TriggeredAnalyticsRuleRunProperties.java | 156 + .../fluent/models/UebaProperties.java | 90 + .../fluent/models/UrlEntityProperties.java | 13 +- .../fluent/models/WarningInner.java | 74 + .../fluent/models/WatchlistInner.java | 114 +- .../fluent/models/WatchlistItemInner.java | 61 +- .../models/WatchlistItemProperties.java | 28 +- .../fluent/models/WatchlistProperties.java | 122 +- .../WorkspaceManagerAssignmentInner.java | 231 + .../WorkspaceManagerAssignmentProperties.java | 158 + .../WorkspaceManagerConfigurationInner.java | 185 + ...rkspaceManagerConfigurationProperties.java | 89 + .../models/WorkspaceManagerGroupInner.java | 230 + .../WorkspaceManagerGroupProperties.java | 146 + .../models/WorkspaceManagerMemberInner.java | 210 + .../WorkspaceManagerMemberProperties.java | 119 + .../fluent/models/package-info.java | 2 +- .../securityinsights/fluent/package-info.java | 2 +- .../implementation/ActionResponseImpl.java | 5 +- .../implementation/ActionsClientImpl.java | 653 +- .../implementation/ActionsImpl.java | 38 +- .../implementation/AlertRuleImpl.java | 10 +- .../AlertRuleOperationsClientImpl.java | 272 + .../AlertRuleOperationsImpl.java | 44 + .../implementation/AlertRuleTemplateImpl.java | 2 +- .../AlertRuleTemplatesClientImpl.java | 342 +- .../AlertRuleTemplatesImpl.java | 32 +- .../implementation/AlertRulesClientImpl.java | 596 +- .../implementation/AlertRulesImpl.java | 38 +- .../implementation/AutomationRuleImpl.java | 2 +- .../AutomationRulesClientImpl.java | 462 +- .../implementation/AutomationRulesImpl.java | 10 +- .../implementation/BillingStatisticImpl.java | 54 + .../BillingStatisticsClientImpl.java | 358 + .../implementation/BillingStatisticsImpl.java | 65 + .../BookmarkExpandResponseImpl.java | 38 + .../implementation/BookmarkImpl.java | 46 +- .../BookmarkOperationsClientImpl.java | 166 + .../BookmarkOperationsImpl.java | 56 + .../BookmarkRelationsClientImpl.java | 644 ++ .../implementation/BookmarkRelationsImpl.java | 177 + .../implementation/BookmarksClientImpl.java | 598 +- .../implementation/BookmarksImpl.java | 30 +- .../ContentPackageOperationsClientImpl.java | 256 + .../ContentPackageOperationsImpl.java | 46 + .../ContentPackagesClientImpl.java | 446 ++ .../implementation/ContentPackagesImpl.java | 66 + .../ContentTemplatesClientImpl.java | 372 + .../implementation/ContentTemplatesImpl.java | 142 + .../ContentTemplatesOperationsClientImpl.java | 415 ++ .../ContentTemplatesOperationsImpl.java | 49 + .../DataConnectorDefinitionImpl.java | 54 + .../DataConnectorDefinitionsClientImpl.java | 572 ++ .../DataConnectorDefinitionsImpl.java | 98 + .../implementation/DataConnectorImpl.java | 10 +- .../DataConnectorRequirementsStateImpl.java | 38 + ...CheckRequirementsOperationsClientImpl.java | 165 + ...ectorsCheckRequirementsOperationsImpl.java | 56 + .../DataConnectorsClientImpl.java | 741 +- .../implementation/DataConnectorsImpl.java | 59 +- .../EnrichmentDomainWhoisImpl.java | 54 + .../EnrichmentIpGeodataImpl.java | 96 + .../implementation/EntitiesClientImpl.java | 885 +++ .../EntitiesGetTimelinesClientImpl.java | 165 + .../EntitiesGetTimelinesImpl.java | 56 + .../implementation/EntitiesImpl.java | 125 + .../EntitiesRelationsClientImpl.java | 336 + .../implementation/EntitiesRelationsImpl.java | 47 + .../EntityExpandResponseImpl.java | 38 + .../EntityGetInsightsResponseImpl.java | 45 + .../EntityQueriesClientImpl.java | 578 ++ .../implementation/EntityQueriesImpl.java | 96 + .../implementation/EntityQueryImpl.java | 54 + .../implementation/EntityQueryItemImpl.java | 45 + .../EntityQueryTemplateImpl.java | 50 + .../EntityQueryTemplatesClientImpl.java | 384 + .../EntityQueryTemplatesImpl.java | 68 + .../EntityRelationsClientImpl.java | 162 + .../implementation/EntityRelationsImpl.java | 54 + .../EntityTimelineResponseImpl.java | 45 + .../implementation/FileImportImpl.java | 181 + .../implementation/FileImportsClientImpl.java | 718 ++ .../implementation/FileImportsImpl.java | 154 + .../GetRecommendationsClientImpl.java | 262 + .../GetRecommendationsImpl.java | 45 + ...tTriggeredAnalyticsRuleRunsClientImpl.java | 271 + .../GetTriggeredAnalyticsRuleRunsImpl.java | 48 + .../implementation/GetsClientImpl.java | 156 + .../implementation/GetsImpl.java | 55 + .../implementation/HuntCommentImpl.java | 149 + .../HuntCommentsClientImpl.java | 641 ++ .../implementation/HuntCommentsImpl.java | 176 + .../implementation/HuntImpl.java | 224 + .../implementation/HuntRelationImpl.java | 168 + .../HuntRelationsClientImpl.java | 642 ++ .../implementation/HuntRelationsImpl.java | 176 + .../implementation/HuntsClientImpl.java | 616 ++ .../implementation/HuntsImpl.java | 155 + .../implementation/IncidentAlertListImpl.java | 2 +- .../IncidentBookmarkListImpl.java | 2 +- .../implementation/IncidentCommentImpl.java | 10 +- .../IncidentCommentsClientImpl.java | 790 +- .../implementation/IncidentCommentsImpl.java | 36 +- .../IncidentEntitiesResponseImpl.java | 2 +- .../implementation/IncidentImpl.java | 116 +- .../IncidentRelationsClientImpl.java | 776 +- .../implementation/IncidentRelationsImpl.java | 142 +- .../implementation/IncidentTaskImpl.java | 196 + .../IncidentTasksClientImpl.java | 579 ++ .../implementation/IncidentTasksImpl.java | 179 + .../implementation/IncidentsClientImpl.java | 1016 ++- .../implementation/IncidentsImpl.java | 69 +- .../implementation/JobImpl.java | 78 + .../implementation/MetadataModelImpl.java | 444 ++ .../implementation/MetadatasClientImpl.java | 715 ++ .../implementation/MetadatasImpl.java | 155 + .../implementation/OfficeConsentImpl.java | 53 + .../OfficeConsentsClientImpl.java | 443 ++ .../implementation/OfficeConsentsImpl.java | 73 + .../implementation/OperationImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 129 +- .../implementation/OperationsImpl.java | 2 +- .../implementation/PackageModelImpl.java | 348 + .../ProductPackageModelImpl.java | 178 + .../ProductPackagesClientImpl.java | 153 + .../implementation/ProductPackagesImpl.java | 53 + .../ProductPackagesOperationsClientImpl.java | 388 + .../ProductPackagesOperationsImpl.java | 47 + .../ProductSettingsClientImpl.java | 547 ++ .../implementation/ProductSettingsImpl.java | 91 + .../ProductTemplateModelImpl.java | 189 + .../ProductTemplatesClientImpl.java | 153 + .../implementation/ProductTemplatesImpl.java | 53 + .../ProductTemplatesOperationsClientImpl.java | 356 + .../ProductTemplatesOperationsImpl.java | 47 + .../implementation/RecommendationImpl.java | 105 + .../ReevaluateResponseImpl.java | 33 + .../implementation/ReevaluatesClientImpl.java | 156 + .../implementation/ReevaluatesImpl.java | 54 + .../implementation/RelationImpl.java | 34 +- .../implementation/RepoImpl.java | 50 + .../implementation/ResourceManagerUtils.java | 2 +- .../ResourceProvidersClientImpl.java | 275 + .../implementation/ResourceProvidersImpl.java | 79 + .../implementation/SecurityInsightsImpl.java | 544 -- ...urityInsightsManagementClientBuilder.java} | 62 +- .../SecurityInsightsManagementClientImpl.java | 1252 ++++ .../SecurityMLAnalyticsSettingImpl.java | 10 +- ...SecurityMLAnalyticsSettingsClientImpl.java | 632 +- .../SecurityMLAnalyticsSettingsImpl.java | 48 +- .../SentinelOnboardingStateImpl.java | 2 +- .../SentinelOnboardingStatesClientImpl.java | 346 +- .../SentinelOnboardingStatesImpl.java | 18 +- .../SentinelOnboardingStatesListImpl.java | 2 +- .../implementation/SettingsImpl.java | 54 + .../implementation/SourceControlImpl.java | 227 + .../SourceControlOperationsClientImpl.java | 282 + .../SourceControlOperationsImpl.java | 50 + .../SourceControlsClientImpl.java | 574 ++ .../implementation/SourceControlsImpl.java | 128 + .../implementation/TIObjectImpl.java | 106 + .../implementation/TemplateModelImpl.java | 407 + .../ThreatIntelligenceCountImpl.java | 32 + ...ntelligenceIndicatorMetricsClientImpl.java | 88 +- ...hreatIntelligenceIndicatorMetricsImpl.java | 10 +- ...hreatIntelligenceIndicatorsClientImpl.java | 1096 +-- .../ThreatIntelligenceIndicatorsImpl.java | 98 +- ...ligenceIndicatorsOperationsClientImpl.java | 213 +- ...tIntelligenceIndicatorsOperationsImpl.java | 2 +- .../ThreatIntelligenceInformationImpl.java | 10 +- .../ThreatIntelligenceMetricsListImpl.java | 2 +- .../ThreatIntelligencesClientImpl.java | 406 + .../ThreatIntelligencesImpl.java | 71 + .../TriggeredAnalyticsRuleRunImpl.java | 78 + ...dAnalyticsRuleRunOperationsClientImpl.java | 153 + ...iggeredAnalyticsRuleRunOperationsImpl.java | 53 + .../implementation/UpdatesClientImpl.java | 165 + .../implementation/UpdatesImpl.java | 57 + .../implementation/WarningImpl.java | 33 + .../implementation/WatchlistImpl.java | 36 +- .../implementation/WatchlistItemImpl.java | 2 +- .../WatchlistItemsClientImpl.java | 739 +- .../implementation/WatchlistItemsImpl.java | 36 +- .../implementation/WatchlistsClientImpl.java | 823 ++- .../implementation/WatchlistsImpl.java | 49 +- .../WorkspaceManagerAssignmentImpl.java | 170 + ...kspaceManagerAssignmentJobsClientImpl.java | 631 ++ .../WorkspaceManagerAssignmentJobsImpl.java | 98 + ...WorkspaceManagerAssignmentsClientImpl.java | 624 ++ .../WorkspaceManagerAssignmentsImpl.java | 166 + .../WorkspaceManagerConfigurationImpl.java | 144 + ...kspaceManagerConfigurationsClientImpl.java | 629 ++ .../WorkspaceManagerConfigurationsImpl.java | 166 + .../WorkspaceManagerGroupImpl.java | 168 + .../WorkspaceManagerGroupsClientImpl.java | 621 ++ .../WorkspaceManagerGroupsImpl.java | 158 + .../WorkspaceManagerMemberImpl.java | 152 + .../WorkspaceManagerMembersClientImpl.java | 626 ++ .../WorkspaceManagerMembersImpl.java | 159 + .../models/ActionsList.java | 56 +- .../models/AlertRuleTemplatesList.java | 56 +- .../models/AlertRulesList.java | 56 +- .../models/AutomationRulesList.java | 51 +- .../models/BillingStatisticList.java | 96 + .../models/BookmarkList.java | 56 +- ...nnectorDefinitionArmCollectionWrapper.java | 97 + .../models/DataConnectorList.java | 56 +- .../implementation/models/EntityList.java | 95 + .../models/EntityQueryList.java | 95 + .../models/EntityQueryTemplateList.java | 96 + .../implementation/models/FileImportList.java | 95 + .../models/GetQueriesResponse.java | 95 + .../models/HuntCommentList.java | 95 + .../implementation/models/HuntList.java | 95 + .../models/HuntRelationList.java | 95 + .../models/IncidentCommentList.java | 56 +- .../models/IncidentList.java | 56 +- .../models/IncidentTaskList.java | 94 + .../implementation/models/JobList.java | 95 + .../implementation/models/MetadataList.java | 94 + .../models/OfficeConsentList.java | 95 + .../models/OperationsList.java | 38 +- .../implementation/models/PackageList.java | 94 + .../models/ProductPackageList.java | 95 + .../models/ProductTemplateList.java | 95 + .../models/RecommendationList.java | 96 + .../models/RelationList.java | 56 +- .../implementation/models/RepoList.java | 94 + .../SecurityMLAnalyticsSettingsList.java | 57 +- .../implementation/models/SettingList.java | 95 + .../models/SourceControlList.java | 94 + .../implementation/models/TemplateList.java | 94 + .../ThreatIntelligenceInformationList.java | 57 +- .../models/ThreatIntelligenceList.java | 95 + .../models/TriggeredAnalyticsRuleRuns.java | 96 + .../models/WatchlistItemList.java | 56 +- .../models/WatchlistList.java | 56 +- .../WorkspaceManagerAssignmentList.java | 97 + .../WorkspaceManagerConfigurationList.java | 97 + .../models/WorkspaceManagerGroupList.java | 96 + .../models/WorkspaceManagerMembersList.java | 96 + .../implementation/package-info.java | 2 +- .../models/AADCheckRequirements.java | 116 + .../models/AATPCheckRequirements.java | 116 + .../models/ASCCheckRequirements.java | 115 + .../securityinsights/models/AWSAuthModel.java | 134 + .../models/AadDataConnector.java | 40 +- .../models/AatpDataConnector.java | 34 +- .../models/AccountEntity.java | 29 +- .../models/ActionPropertiesBase.java | 18 +- .../models/ActionRequest.java | 14 +- .../models/ActionResponse.java | 4 +- .../securityinsights/models/ActionType.java | 11 +- .../securityinsights/models/Actions.java | 62 +- .../models/ActivityCustomEntityQuery.java | 406 + ...tityQueriesPropertiesQueryDefinitions.java | 87 + .../models/ActivityEntityQuery.java | 288 + .../models/ActivityEntityQueryTemplate.java | 240 + ...eryTemplatePropertiesQueryDefinitions.java | 95 + .../models/ActivityTimelineItem.java | 213 + .../AddIncidentTaskActionProperties.java | 115 + .../securityinsights/models/AlertDetail.java | 6 +- .../models/AlertDetailsOverride.java | 32 +- .../models/AlertProperty.java | 91 + .../models/AlertPropertyMapping.java | 113 + .../securityinsights/models/AlertRule.java | 18 +- .../models/AlertRuleKind.java | 23 +- .../models/AlertRuleOperations.java | 41 + .../models/AlertRuleTemplate.java | 6 +- .../models/AlertRuleTemplateDataSource.java | 38 +- .../AlertRuleTemplatePropertiesBase.java | 262 + .../AlertRuleTemplateWithMitreProperties.java | 251 + .../models/AlertRuleTemplates.java | 44 +- .../securityinsights/models/AlertRules.java | 64 +- .../models/AlertSeverity.java | 10 +- .../securityinsights/models/AlertStatus.java | 12 +- .../models/AlertsDataTypeOfDataConnector.java | 14 +- .../models/AnalyticsRuleRunTrigger.java | 101 + .../securityinsights/models/Anomalies.java | 188 + .../AnomalySecurityMLAnalyticsSettings.java | 27 +- .../models/AnomalyTimelineItem.java | 274 + .../models/AntispamMailDirection.java | 10 +- .../models/ApiKeyAuthModel.java | 189 + .../models/AscDataConnector.java | 34 +- .../models/AssignmentItem.java | 85 + .../models/AttackPattern.java | 260 + .../securityinsights/models/AttackTactic.java | 36 +- .../models/AutomationRule.java | 2 +- .../models/AutomationRuleAction.java | 14 +- .../AutomationRuleAddIncidentTaskAction.java | 119 + .../AutomationRuleBooleanCondition.java | 119 + ...RuleBooleanConditionSupportedOperator.java | 52 + .../models/AutomationRuleCondition.java | 16 +- .../AutomationRuleModifyPropertiesAction.java | 14 +- ...rayChangedConditionSupportedArrayType.java | 10 +- ...ayChangedConditionSupportedChangeType.java | 4 +- ...lePropertyArrayChangedValuesCondition.java | 10 +- ...yConditionSupportedArrayConditionType.java | 55 + ...pertyArrayConditionSupportedArrayType.java | 60 + ...ationRulePropertyArrayValuesCondition.java | 153 + ...yChangedConditionSupportedChangedType.java | 6 +- ...ChangedConditionSupportedPropertyType.java | 8 +- ...ulePropertyConditionSupportedOperator.java | 18 +- ...ulePropertyConditionSupportedProperty.java | 138 +- ...ionRulePropertyValuesChangedCondition.java | 10 +- ...AutomationRulePropertyValuesCondition.java | 10 +- .../AutomationRuleRunPlaybookAction.java | 14 +- .../models/AutomationRuleTriggeringLogic.java | 26 +- .../models/AutomationRules.java | 22 +- .../securityinsights/models/Availability.java | 113 + .../models/AvailabilityStatus.java | 49 + .../AwsCloudTrailCheckRequirements.java | 75 + .../models/AwsCloudTrailDataConnector.java | 22 +- .../AwsCloudTrailDataConnectorDataTypes.java | 14 +- ...sCloudTrailDataConnectorDataTypesLogs.java | 12 +- .../models/AwsS3CheckRequirements.java | 74 + .../models/AwsS3DataConnector.java | 272 + .../models/AwsS3DataConnectorDataTypes.java | 86 + .../AwsS3DataConnectorDataTypesLogs.java | 70 + .../models/AzureDevOpsResourceInfo.java | 91 + .../models/AzureResourceEntity.java | 24 +- .../models/BasicAuthModel.java | 131 + .../models/BillingStatistic.java | 64 + .../models/BillingStatisticKind.java | 46 + .../models/BillingStatistics.java | 67 + .../securityinsights/models/Bookmark.java | 109 +- .../models/BookmarkEntityMappings.java | 116 + .../models/BookmarkExpandParameters.java | 148 + .../models/BookmarkExpandResponse.java | 33 + .../models/BookmarkExpandResponseValue.java | 94 + .../models/BookmarkOperations.java | 44 + .../models/BookmarkRelations.java | 160 + .../models/BookmarkTimelineItem.java | 222 + .../securityinsights/models/Bookmarks.java | 58 +- .../models/BooleanConditionProperties.java | 103 + .../models/CcpAuthConfig.java | 119 + .../securityinsights/models/CcpAuthType.java | 96 + .../models/CcpResponseConfig.java | 381 + .../securityinsights/models/ClientInfo.java | 23 +- .../models/CloudApplicationEntity.java | 24 +- .../CodelessApiPollingDataConnector.java | 227 + ...odelessConnectorPollingAuthProperties.java | 444 ++ ...elessConnectorPollingConfigProperties.java | 205 + ...elessConnectorPollingPagingProperties.java | 321 + ...lessConnectorPollingRequestProperties.java | 405 + ...essConnectorPollingResponseProperties.java | 176 + .../CodelessUiConnectorConfigProperties.java | 417 ++ ...figPropertiesConnectivityCriteriaItem.java | 86 + ...onnectorConfigPropertiesDataTypesItem.java | 82 + ...ectorConfigPropertiesGraphQueriesItem.java | 94 + ...rConfigPropertiesInstructionStepsItem.java | 99 + ...ctorConfigPropertiesSampleQueriesItem.java | 83 + .../models/CodelessUiDataConnector.java | 202 + .../models/ConditionClause.java | 160 + .../models/ConditionProperties.java | 123 + .../models/ConditionType.java | 18 +- .../models/ConfidenceLevel.java | 8 +- .../models/ConfidenceScoreStatus.java | 11 +- .../models/ConnectAuthKind.java | 56 + .../models/ConnectedEntity.java | 93 + .../securityinsights/models/Connective.java | 51 + .../models/ConnectivityCriteria.java | 115 + .../models/ConnectivityCriterion.java | 117 + .../models/ConnectivityType.java | 46 + .../models/ConnectorDataType.java | 117 + .../ConnectorDefinitionsAvailability.java | 117 + .../ConnectorDefinitionsPermissions.java | 181 + .../ConnectorDefinitionsResourceProvider.java | 216 + .../models/ConnectorInstructionModelBase.java | 117 + .../models/ContentPackageOperations.java | 48 + .../models/ContentPackages.java | 78 + .../models/ContentTemplates.java | 145 + .../models/ContentTemplatesOperations.java | 62 + .../securityinsights/models/ContentType.java | 71 + .../securityinsights/models/CountQuery.java | 98 + .../models/CustomEntityQuery.java | 180 + .../models/CustomEntityQueryKind.java | 46 + .../models/CustomPermissionDetails.java | 114 + .../models/CustomizableConnectionsConfig.java | 118 + .../CustomizableConnectorDefinition.java | 275 + .../models/CustomizableConnectorUiConfig.java | 419 ++ .../securityinsights/models/Customs.java | 80 + .../models/CustomsPermission.java | 113 + .../models/DCRConfiguration.java | 144 + .../models/DataConnector.java | 18 +- .../DataConnectorAuthorizationState.java | 51 + .../models/DataConnectorConnectBody.java | 376 + .../models/DataConnectorDataTypeCommon.java | 11 +- .../models/DataConnectorDefinition.java | 64 + .../models/DataConnectorDefinitionKind.java | 46 + .../models/DataConnectorDefinitions.java | 130 + .../models/DataConnectorKind.java | 105 +- .../models/DataConnectorLicenseState.java | 56 + .../DataConnectorRequirementsState.java | 34 + .../models/DataConnectorTenantId.java | 86 + .../DataConnectorWithAlertsProperties.java | 13 +- .../models/DataConnectors.java | 121 +- .../DataConnectorsCheckRequirements.java | 136 + ...ConnectorsCheckRequirementsOperations.java | 42 + .../models/DataTypeDefinitions.java | 74 + .../models/DataTypeState.java | 6 +- .../securityinsights/models/DeleteStatus.java | 56 + .../models/DeliveryAction.java | 12 +- .../models/DeliveryLocation.java | 20 +- .../securityinsights/models/Deployment.java | 149 + .../models/DeploymentFetchStatus.java | 56 + .../models/DeploymentInfo.java | 110 + .../models/DeploymentResult.java | 56 + .../models/DeploymentState.java | 61 + .../models/DeviceImportance.java | 61 + .../securityinsights/models/DnsEntity.java | 24 +- .../models/Dynamics365CheckRequirements.java | 116 + .../models/Dynamics365DataConnector.java | 226 + .../Dynamics365DataConnectorDataTypes.java | 89 + ...ctorDataTypesDynamics365CdsActivities.java | 73 + .../models/ElevationToken.java | 8 +- .../models/EnrichmentDomainBody.java | 85 + .../models/EnrichmentDomainWhois.java | 62 + .../models/EnrichmentDomainWhoisContact.java | 229 + .../models/EnrichmentDomainWhoisContacts.java | 127 + .../models/EnrichmentDomainWhoisDetails.java | 129 + ...EnrichmentDomainWhoisRegistrarDetails.java | 161 + .../models/EnrichmentIpAddressBody.java | 85 + .../models/EnrichmentIpGeodata.java | 141 + .../models/EnrichmentType.java | 46 + .../securityinsights/models/Entities.java | 187 + .../models/EntitiesGetTimelines.java | 44 + .../models/EntitiesRelations.java | 47 + .../securityinsights/models/Entity.java | 28 +- .../models/EntityAnalytics.java | 203 + .../models/EntityCommonProperties.java | 10 +- .../securityinsights/models/EntityEdges.java | 95 + .../models/EntityExpandParameters.java | 148 + .../models/EntityExpandResponse.java | 33 + .../models/EntityExpandResponseValue.java | 94 + .../models/EntityFieldMapping.java | 113 + .../models/EntityGetInsightsParameters.java | 185 + .../models/EntityGetInsightsResponse.java | 34 + .../models/EntityInsightItem.java | 130 + .../EntityInsightItemQueryTimeInterval.java | 99 + .../models/EntityItemQueryKind.java | 46 + .../models/EntityKindEnum.java | 49 +- .../EntityManualTriggerRequestBody.java | 143 + .../models/EntityMapping.java | 13 +- .../models/EntityMappingType.java | 38 +- .../models/EntityProviders.java | 51 + .../models/EntityQueries.java | 127 + .../securityinsights/models/EntityQuery.java | 64 + .../models/EntityQueryItem.java | 47 + .../models/EntityQueryItemProperties.java | 178 + ...ntityQueryItemPropertiesDataTypesItem.java | 76 + .../models/EntityQueryKind.java | 56 + .../models/EntityQueryTemplate.java | 55 + .../models/EntityQueryTemplateKind.java | 76 + .../models/EntityQueryTemplates.java | 69 + .../models/EntityRelations.java | 43 + .../models/EntityTimelineItem.java | 105 + .../models/EntityTimelineKind.java | 61 + .../models/EntityTimelineParameters.java | 181 + .../models/EntityTimelineResponse.java | 34 + .../securityinsights/models/EntityType.java | 151 + .../securityinsights/models/Error.java | 92 + .../models/EventGroupingAggregationKind.java | 6 +- .../models/EventGroupingSettings.java | 10 +- .../models/ExpansionEntityQuery.java | 241 + .../models/ExpansionResultAggregation.java | 127 + .../models/ExpansionResultsMetadata.java | 77 + .../securityinsights/models/EyesOn.java | 188 + .../securityinsights/models/FieldMapping.java | 10 +- .../securityinsights/models/FileEntity.java | 24 +- .../securityinsights/models/FileFormat.java | 56 + .../models/FileHashAlgorithm.java | 12 +- .../models/FileHashEntity.java | 24 +- .../securityinsights/models/FileImport.java | 266 + .../models/FileImportContentType.java | 56 + .../models/FileImportState.java | 76 + .../securityinsights/models/FileImports.java | 151 + .../securityinsights/models/FileMetadata.java | 173 + .../securityinsights/models/Flag.java | 51 + .../models/FusionAlertRule.java | 68 +- .../models/FusionAlertRuleTemplate.java | 143 +- .../FusionScenarioExclusionPattern.java | 115 + .../models/FusionSourceSettings.java | 150 + .../models/FusionSourceSubTypeSetting.java | 165 + .../models/FusionSubTypeSeverityFilter.java | 106 + .../FusionSubTypeSeverityFiltersItem.java | 118 + .../models/FusionTemplateSourceSetting.java | 97 + .../models/FusionTemplateSourceSubType.java | 112 + .../FusionTemplateSubTypeSeverityFilter.java | 100 + .../securityinsights/models/GCPAuthModel.java | 159 + .../models/GCPAuthProperties.java | 144 + .../models/GCPDataConnector.java | 271 + .../models/GCPRequestProperties.java | 117 + .../models/GenericBlobSbsAuthModel.java | 138 + .../securityinsights/models/GeoLocation.java | 32 +- .../models/GetInsightsError.java | 46 + .../models/GetInsightsErrorKind.java | 109 + .../models/GetInsightsResultsMetadata.java | 95 + .../models/GetRecommendations.java | 38 + .../models/GetTriggeredAnalyticsRuleRuns.java | 38 + .../securityinsights/models/Gets.java | 41 + .../models/GitHubAuthModel.java | 104 + .../models/GitHubResourceInfo.java | 74 + .../securityinsights/models/GraphQueries.java | 141 + .../securityinsights/models/GraphQuery.java | 147 + .../models/GroupingConfiguration.java | 23 +- .../securityinsights/models/HostEntity.java | 42 +- .../models/HttpMethodVerb.java | 61 + .../securityinsights/models/Hunt.java | 459 ++ .../securityinsights/models/HuntComment.java | 223 + .../securityinsights/models/HuntComments.java | 160 + .../securityinsights/models/HuntOwner.java | 197 + .../securityinsights/models/HuntRelation.java | 245 + .../models/HuntRelations.java | 160 + .../models/HuntingBookmark.java | 182 +- .../securityinsights/models/Hunts.java | 152 + .../models/HypothesisStatus.java | 56 + .../securityinsights/models/Identity.java | 260 + .../securityinsights/models/Incident.java | 355 +- .../models/IncidentAdditionalData.java | 68 +- .../models/IncidentAlertList.java | 2 +- .../models/IncidentBookmarkList.java | 2 +- .../models/IncidentClassification.java | 10 +- .../models/IncidentClassificationReason.java | 10 +- .../models/IncidentComment.java | 18 +- .../models/IncidentComments.java | 80 +- .../models/IncidentConfiguration.java | 13 +- .../models/IncidentEntitiesResponse.java | 2 +- .../IncidentEntitiesResultsMetadata.java | 70 +- .../securityinsights/models/IncidentInfo.java | 10 +- .../models/IncidentLabel.java | 17 +- .../models/IncidentLabelType.java | 6 +- .../models/IncidentOwnerInfo.java | 23 +- .../models/IncidentPropertiesAction.java | 16 +- .../models/IncidentRelations.java | 113 +- .../models/IncidentSeverity.java | 10 +- .../models/IncidentStatus.java | 8 +- .../securityinsights/models/IncidentTask.java | 374 + .../models/IncidentTaskStatus.java | 51 + .../models/IncidentTasks.java | 154 + .../securityinsights/models/Incidents.java | 107 +- .../securityinsights/models/Indicator.java | 279 + .../models/IndicatorObservablesItem.java | 91 + .../models/IngestionMode.java | 56 + .../models/InsightQueryItem.java | 145 + .../models/InsightQueryItemProperties.java | 278 + ...ghtQueryItemPropertiesAdditionalQuery.java | 93 + ...htQueryItemPropertiesDefaultTimeRange.java | 93 + ...QueryItemPropertiesReferenceTimeRange.java | 76 + .../InsightQueryItemPropertiesTableQuery.java | 102 + ...rtiesTableQueryColumnsDefinitionsItem.java | 115 + ...rtiesTableQueryQueriesDefinitionsItem.java | 137 + ...QueriesDefinitionsPropertiesItemsItem.java | 98 + .../models/InsightsTableResult.java | 97 + .../InsightsTableResultColumnsItem.java | 92 + .../models/InstructionStep.java | 179 + .../models/InstructionStepDetails.java | 115 + .../models/InstructionSteps.java | 144 + .../InstructionStepsInstructionsItem.java | 84 + .../models/IoTCheckRequirements.java | 115 + .../models/IoTDataConnector.java | 225 + .../models/IoTDeviceEntity.java | 126 +- .../securityinsights/models/IpEntity.java | 24 +- .../securityinsights/models/Job.java | 92 + .../securityinsights/models/JobItem.java | 128 + .../models/JobProvisioningState.java | 61 + .../securityinsights/models/JwtAuthModel.java | 320 + .../models/KillChainIntent.java | 67 +- .../securityinsights/models/Kind.java | 152 + .../models/LastDataReceivedDataType.java | 115 + .../models/MCASCheckRequirements.java | 116 + .../models/MDATPCheckRequirements.java | 117 + .../models/MLBehaviorAnalyticsAlertRule.java | 291 + .../MLBehaviorAnalyticsAlertRuleTemplate.java | 262 + .../models/MSTICheckRequirements.java | 116 + .../models/MSTIDataConnector.java | 225 + .../models/MSTIDataConnectorDataTypes.java | 90 + .../models/MTPDataConnector.java | 248 + .../models/MTPDataConnectorDataTypes.java | 115 + .../MTPDataConnectorDataTypesAlerts.java | 70 + .../MTPDataConnectorDataTypesIncidents.java | 71 + .../models/MailClusterEntity.java | 24 +- .../models/MailMessageEntity.java | 143 +- .../models/MailboxEntity.java | 27 +- .../models/MalwareEntity.java | 24 +- .../models/ManualTriggerRequestBody.java | 114 + .../models/MatchingMethod.java | 8 +- .../models/McasDataConnector.java | 66 +- .../models/McasDataConnectorDataTypes.java | 18 +- .../models/MdatpDataConnector.java | 34 +- .../models/MetadataAuthor.java | 141 + .../models/MetadataCategories.java | 116 + .../models/MetadataDependencies.java | 236 + .../models/MetadataDependencyOperator.java | 51 + .../models/MetadataModel.java | 890 +++ .../models/MetadataPatch.java | 617 ++ .../models/MetadataSource.java | 142 + .../models/MetadataSupport.java | 170 + .../securityinsights/models/Metadatas.java | 153 + ...nformationProtectionCheckRequirements.java | 119 + ...formationProtectionConnectorDataTypes.java | 91 + ...ationProtectionConnectorDataTypesLogs.java | 73 + ...iewInformationProtectionDataConnector.java | 231 + ...softSecurityIncidentCreationAlertRule.java | 22 +- ...dentCreationAlertRuleCommonProperties.java | 19 +- ...rityIncidentCreationAlertRuleTemplate.java | 239 +- .../models/MicrosoftSecurityProductName.java | 24 +- .../securityinsights/models/Mode.java | 51 + ...rDataTypesMicrosoftEmergingThreatFeed.java | 105 + .../models/MtpCheckRequirements.java | 115 + .../models/MtpFilteredProviders.java | 92 + .../securityinsights/models/MtpProvider.java | 51 + .../securityinsights/models/NicEntity.java | 215 + .../models/NoneAuthModel.java | 74 + .../securityinsights/models/NrtAlertRule.java | 614 ++ .../models/NrtAlertRuleTemplate.java | 324 + .../securityinsights/models/OAuthModel.java | 508 ++ .../securityinsights/models/OSFamily.java | 12 +- .../Office365ProjectCheckRequirements.java | 118 + .../Office365ProjectConnectorDataTypes.java | 88 + ...ffice365ProjectConnectorDataTypesLogs.java | 71 + .../models/Office365ProjectDataConnector.java | 227 + .../models/OfficeATPCheckRequirements.java | 117 + .../models/OfficeATPDataConnector.java | 226 + .../models/OfficeConsent.java | 62 + .../models/OfficeConsents.java | 94 + .../models/OfficeDataConnector.java | 54 +- .../models/OfficeDataConnectorDataTypes.java | 20 +- .../OfficeDataConnectorDataTypesExchange.java | 12 +- ...fficeDataConnectorDataTypesSharePoint.java | 12 +- .../OfficeDataConnectorDataTypesTeams.java | 12 +- .../models/OfficeIRMCheckRequirements.java | 116 + .../models/OfficeIRMDataConnector.java | 226 + .../OfficePowerBICheckRequirements.java | 117 + .../OfficePowerBIConnectorDataTypes.java | 88 + .../OfficePowerBIConnectorDataTypesLogs.java | 71 + .../models/OfficePowerBIDataConnector.java | 226 + .../securityinsights/models/Operation.java | 2 +- .../models/OperationDisplay.java | 60 +- .../securityinsights/models/Operations.java | 2 +- .../securityinsights/models/Operator.java | 171 + .../models/OracleAuthModel.java | 187 + .../securityinsights/models/OutputType.java | 61 + .../securityinsights/models/OwnerType.java | 10 +- .../models/PackageBaseProperties.java | 716 ++ .../securityinsights/models/PackageKind.java | 51 + .../securityinsights/models/PackageModel.java | 961 +++ .../models/PermissionProviderScope.java | 56 + .../securityinsights/models/Permissions.java | 119 + .../models/PermissionsCustomsItem.java | 80 + .../PermissionsResourceProviderItem.java | 120 + .../models/PlaybookActionProperties.java | 31 +- .../models/PollingFrequency.java | 56 + .../PremiumMdtiDataConnectorDataTypes.java | 88 + ...umMdtiDataConnectorDataTypesConnector.java | 71 + ...icrosoftDefenderForThreatIntelligence.java | 279 + .../models/ProcessEntity.java | 42 +- .../models/ProductPackageModel.java | 241 + .../models/ProductPackages.java | 41 + .../models/ProductPackagesOperations.java | 58 + .../models/ProductSettings.java | 125 + .../models/ProductTemplateModel.java | 251 + .../models/ProductTemplates.java | 41 + .../models/ProductTemplatesOperations.java | 49 + ...opertyArrayChangedConditionProperties.java | 14 +- .../PropertyArrayConditionProperties.java | 106 + .../PropertyChangedConditionProperties.java | 14 +- .../models/PropertyConditionProperties.java | 14 +- .../securityinsights/models/ProviderName.java | 77 + .../models/ProviderPermissionsScope.java | 56 + .../models/ProvisioningState.java | 66 + .../securityinsights/models/PullRequest.java | 89 + .../models/PullRequestState.java | 51 + .../models/PurviewAuditCheckRequirements.java | 117 + .../PurviewAuditConnectorDataTypes.java | 88 + .../PurviewAuditConnectorDataTypesLogs.java | 71 + .../models/PurviewAuditDataConnector.java | 297 + .../securityinsights/models/Query.java | 169 + .../models/QueryCondition.java | 148 + .../securityinsights/models/QuerySortBy.java | 113 + .../models/Recommendation.java | 128 + .../models/RecommendationPatch.java | 85 + .../models/RecommendationPatchProperties.java | 86 + .../models/RecommendedSuggestion.java | 146 + .../models/ReevaluateResponse.java | 27 + .../securityinsights/models/Reevaluates.java | 41 + .../securityinsights/models/RegistryHive.java | 22 +- .../models/RegistryKeyEntity.java | 24 +- .../models/RegistryValueEntity.java | 24 +- .../models/RegistryValueKind.java | 18 +- .../securityinsights/models/Relation.java | 8 +- .../securityinsights/models/Relationship.java | 260 + .../models/RelationshipHint.java | 91 + .../securityinsights/models/Repo.java | 48 + .../securityinsights/models/RepoType.java | 51 + .../securityinsights/models/Repository.java | 158 + .../models/RepositoryAccessKind.java | 56 + .../models/RepositoryAccessProperties.java | 216 + .../models/RepositoryResourceInfo.java | 118 + .../models/RequiredPermissions.java | 169 + .../models/ResourceProvider.java | 197 + .../ResourceProviderRequiredPermissions.java | 173 + .../models/ResourceProviders.java | 75 + .../models/ResourceWithEtag.java | 10 +- .../models/RestApiPollerDataConnector.java | 392 + .../models/RestApiPollerRequestConfig.java | 530 ++ .../RestApiPollerRequestPagingConfig.java | 144 + .../RestApiPollerRequestPagingKind.java | 76 + .../models/SampleQueries.java | 113 + .../models/SapSolutionUsageStatistic.java | 195 + .../models/ScheduledAlertRule.java | 56 +- .../ScheduledAlertRuleCommonProperties.java | 43 +- .../models/ScheduledAlertRuleTemplate.java | 286 +- .../models/SecurityAlert.java | 42 +- ...yAlertPropertiesConfidenceReasonsItem.java | 12 +- .../models/SecurityAlertTimelineItem.java | 272 + .../models/SecurityGroupEntity.java | 27 +- .../models/SecurityMLAnalyticsSetting.java | 18 +- .../models/SecurityMLAnalyticsSettings.java | 64 +- ...SecurityMLAnalyticsSettingsDataSource.java | 10 +- .../SecurityMLAnalyticsSettingsKind.java | 4 +- .../models/SentinelEntityMapping.java | 85 + .../models/SentinelOnboardingState.java | 2 +- .../models/SentinelOnboardingStates.java | 10 +- .../models/SentinelOnboardingStatesList.java | 2 +- .../models/ServicePrincipal.java | 140 + .../models/SessionAuthModel.java | 305 + .../securityinsights/models/SettingKind.java | 61 + .../securityinsights/models/SettingType.java | 56 + .../securityinsights/models/Settings.java | 64 + .../models/SettingsStatus.java | 6 +- .../models/SortingDirection.java | 51 + .../securityinsights/models/Source.java | 51 - .../models/SourceControl.java | 365 + .../models/SourceControlOperations.java | 42 + .../models/SourceControls.java | 129 + .../securityinsights/models/SourceKind.java | 61 + .../securityinsights/models/SourceType.java | 51 + .../securityinsights/models/State.java | 66 + .../securityinsights/models/Status.java | 81 + .../models/SubmissionMailEntity.java | 29 +- .../securityinsights/models/SupportTier.java | 56 + .../models/TICheckRequirements.java | 115 + .../models/TIDataConnector.java | 56 +- .../models/TIDataConnectorDataTypes.java | 14 +- .../TIDataConnectorDataTypesIndicators.java | 12 +- .../securityinsights/models/TIObject.java | 132 + .../securityinsights/models/TIObjectKind.java | 66 + .../models/TeamInformation.java | 140 + .../models/TemplateModel.java | 1112 +++ .../models/TemplateStatus.java | 8 +- .../securityinsights/models/ThreatActor.java | 260 + .../models/ThreatIntelligence.java | 12 +- .../models/ThreatIntelligenceAlertRule.java | 291 + .../ThreatIntelligenceAlertRuleTemplate.java | 261 + .../models/ThreatIntelligenceAppendTags.java | 10 +- .../models/ThreatIntelligenceCount.java | 27 + .../ThreatIntelligenceExternalReference.java | 10 +- .../ThreatIntelligenceFilteringCriteria.java | 13 +- ...hreatIntelligenceGranularMarkingModel.java | 10 +- .../ThreatIntelligenceIndicatorMetrics.java | 6 +- .../ThreatIntelligenceIndicatorModel.java | 22 +- .../models/ThreatIntelligenceIndicators.java | 138 +- ...hreatIntelligenceIndicatorsOperations.java | 6 +- .../models/ThreatIntelligenceInformation.java | 18 +- .../ThreatIntelligenceKillChainPhase.java | 10 +- .../models/ThreatIntelligenceMetric.java | 69 +- .../ThreatIntelligenceMetricEntity.java | 38 +- .../models/ThreatIntelligenceMetrics.java | 30 +- .../models/ThreatIntelligenceMetricsList.java | 2 +- .../ThreatIntelligenceParsedPattern.java | 13 +- ...eatIntelligenceParsedPatternTypeValue.java | 10 +- .../ThreatIntelligenceResourceInnerKind.java | 4 +- .../ThreatIntelligenceSortingCriteria.java | 10 +- .../ThreatIntelligenceSortingOrder.java | 8 +- .../models/ThreatIntelligences.java | 72 + .../models/TiTaxiiCheckRequirements.java | 116 + .../models/TiTaxiiDataConnector.java | 410 ++ .../models/TiTaxiiDataConnectorDataTypes.java | 88 + ...axiiDataConnectorDataTypesTaxiiClient.java | 71 + .../securityinsights/models/TiType.java | 46 + .../models/TimelineAggregation.java | 92 + .../models/TimelineError.java | 109 + .../models/TimelineResultsMetadata.java | 113 + .../models/TriggerOperator.java | 10 +- .../models/TriggeredAnalyticsRuleRun.java | 92 + .../TriggeredAnalyticsRuleRunOperations.java | 41 + .../securityinsights/models/TriggersOn.java | 6 +- .../securityinsights/models/TriggersWhen.java | 6 +- .../securityinsights/models/Ueba.java | 203 + .../models/UebaDataSources.java | 61 + .../securityinsights/models/Updates.java | 44 + .../securityinsights/models/UrlEntity.java | 24 +- .../securityinsights/models/UserInfo.java | 23 +- .../models/ValidationError.java | 92 + .../securityinsights/models/Version.java | 51 + .../securityinsights/models/Warning.java | 26 + .../securityinsights/models/WarningBody.java | 109 + .../securityinsights/models/WarningCode.java | 71 + .../securityinsights/models/Watchlist.java | 128 +- .../models/WatchlistItem.java | 4 +- .../models/WatchlistItems.java | 66 +- .../models/WatchlistProvisioningState.java | 76 + .../securityinsights/models/Watchlists.java | 69 +- .../securityinsights/models/Webhook.java | 136 + .../models/WorkloadIdentityFederation.java | 137 + .../models/WorkspaceManagerAssignment.java | 250 + .../WorkspaceManagerAssignmentJobs.java | 134 + .../models/WorkspaceManagerAssignments.java | 156 + .../models/WorkspaceManagerConfiguration.java | 197 + .../WorkspaceManagerConfigurations.java | 156 + .../models/WorkspaceManagerGroup.java | 267 + .../models/WorkspaceManagerGroups.java | 155 + .../models/WorkspaceManagerMember.java | 240 + .../models/WorkspaceManagerMembers.java | 155 + .../securityinsights/models/package-info.java | 2 +- .../securityinsights/package-info.java | 2 +- .../src/main/java/module-info.java | 3 +- ...urcemanager-securityinsights_metadata.json | 1 + .../proxy-config.json | 2 +- ...esourcemanager-securityinsights.properties | 1 + .../ActionsCreateOrUpdateSamples.java | 6 +- .../generated/ActionsDeleteSamples.java | 6 +- .../generated/ActionsGetSamples.java | 6 +- .../ActionsListByAlertRuleSamples.java | 6 +- ...ertRuleOperationTriggerRuleRunSamples.java | 28 + .../AlertRuleTemplatesGetSamples.java | 6 +- .../AlertRuleTemplatesListSamples.java | 6 +- .../AlertRulesCreateOrUpdateSamples.java | 309 +- .../generated/AlertRulesDeleteSamples.java | 6 +- .../generated/AlertRulesGetSamples.java | 28 +- .../generated/AlertRulesListSamples.java | 6 +- .../AutomationRulesCreateOrUpdateSamples.java | 6 +- .../AutomationRulesDeleteSamples.java | 6 +- .../generated/AutomationRulesGetSamples.java | 6 +- .../generated/AutomationRulesListSamples.java | 6 +- .../BillingStatisticsGetSamples.java | 24 + .../BillingStatisticsListSamples.java | 23 + .../BookmarkOperationExpandSamples.java | 30 + ...ookmarkRelationsCreateOrUpdateSamples.java | 28 + .../BookmarkRelationsDeleteSamples.java | 25 + .../BookmarkRelationsGetSamples.java | 25 + .../BookmarkRelationsListSamples.java | 25 + .../BookmarksCreateOrUpdateSamples.java | 23 +- .../generated/BookmarksDeleteSamples.java | 6 +- .../generated/BookmarksGetSamples.java | 6 +- .../generated/BookmarksListSamples.java | 6 +- ...ContentPackageOperationInstallSamples.java | 33 + ...ntentPackageOperationUninstallSamples.java | 25 + .../generated/ContentPackagesGetSamples.java | 25 + .../generated/ContentPackagesListSamples.java | 24 + .../ContentTemplateDeleteSamples.java | 24 + .../generated/ContentTemplateGetSamples.java | 24 + .../ContentTemplateInstallSamples.java | 58 + .../ContentTemplatesOperationListSamples.java | 25 + ...ectorDefinitionsCreateOrUpdateSamples.java | 82 + ...DataConnectorDefinitionsDeleteSamples.java | 25 + .../DataConnectorDefinitionsGetSamples.java | 25 + .../DataConnectorDefinitionsListSamples.java | 23 + ...CheckRequirementsOperationPostSamples.java | 313 + .../DataConnectorsConnectSamples.java | 64 + .../DataConnectorsCreateOrUpdateSamples.java | 493 +- .../DataConnectorsDeleteSamples.java | 141 +- .../DataConnectorsDisconnectSamples.java | 25 + .../generated/DataConnectorsGetSamples.java | 310 +- .../generated/DataConnectorsListSamples.java | 6 +- .../generated/EntitiesExpandSamples.java | 30 + .../generated/EntitiesGetInsightsSamples.java | 32 + .../generated/EntitiesGetSamples.java | 300 + .../EntitiesGetTimelineListSamples.java | 30 + .../generated/EntitiesListSamples.java | 22 + .../generated/EntitiesQueriesSamples.java | 26 + .../EntitiesRelationsListSamples.java | 25 + .../generated/EntitiesRunPlaybookSamples.java | 24 + .../EntityQueriesCreateOrUpdateSamples.java | 56 + .../generated/EntityQueriesDeleteSamples.java | 24 + .../generated/EntityQueriesGetSamples.java | 40 + .../generated/EntityQueriesListSamples.java | 25 + .../EntityQueryTemplatesGetSamples.java | 25 + .../EntityQueryTemplatesListSamples.java | 26 + .../EntityRelationsGetRelationSamples.java | 24 + .../generated/FileImportsCreateSamples.java | 35 + .../generated/FileImportsDeleteSamples.java | 23 + .../generated/FileImportsGetSamples.java | 24 + .../generated/FileImportsListSamples.java | 24 + .../GetRecommendationsListSamples.java | 23 + .../GetSingleRecommendationSamples.java | 24 + ...TriggeredAnalyticsRuleRunsListSamples.java | 23 + .../HuntCommentsCreateOrUpdateSamples.java | 27 + .../generated/HuntCommentsDeleteSamples.java | 24 + .../generated/HuntCommentsGetSamples.java | 24 + .../generated/HuntCommentsListSamples.java | 24 + .../HuntRelationsCreateOrUpdateSamples.java | 31 + .../generated/HuntRelationsDeleteSamples.java | 24 + .../generated/HuntRelationsGetSamples.java | 24 + .../generated/HuntRelationsListSamples.java | 24 + .../generated/HuntsCreateOrUpdateSamples.java | 40 + .../generated/HuntsDeleteSamples.java | 24 + .../generated/HuntsGetSamples.java | 24 + .../generated/HuntsListSamples.java | 22 + ...IncidentCommentsCreateOrUpdateSamples.java | 10 +- .../IncidentCommentsDeleteSamples.java | 10 +- .../generated/IncidentCommentsGetSamples.java | 11 +- .../IncidentCommentsListSamples.java | 10 +- ...ncidentRelationsCreateOrUpdateSamples.java | 24 +- .../IncidentRelationsDeleteSamples.java | 6 +- .../IncidentRelationsGetSamples.java | 6 +- .../IncidentRelationsListSamples.java | 6 +- .../IncidentTasksCreateOrUpdateSamples.java | 31 + .../generated/IncidentTasksDeleteSamples.java | 24 + .../generated/IncidentTasksGetSamples.java | 24 + .../generated/IncidentTasksListSamples.java | 23 + .../IncidentsCreateOrUpdateSamples.java | 23 +- .../generated/IncidentsDeleteSamples.java | 10 +- .../generated/IncidentsGetSamples.java | 10 +- .../generated/IncidentsListAlertsSamples.java | 13 +- .../IncidentsListBookmarksSamples.java | 12 +- .../IncidentsListEntitiesSamples.java | 12 +- .../generated/IncidentsListSamples.java | 10 +- .../IncidentsRunPlaybookSamples.java | 25 + .../generated/MetadataCreateSamples.java | 100 + .../generated/MetadataDeleteSamples.java | 22 + .../generated/MetadataGetSamples.java | 23 + .../generated/MetadataListSamples.java | 35 + .../generated/MetadataUpdateSamples.java | 30 + .../OfficeConsentsDeleteSamples.java | 25 + .../generated/OfficeConsentsGetSamples.java | 24 + .../generated/OfficeConsentsListSamples.java | 23 + .../generated/OperationsListSamples.java | 6 +- .../generated/ProductPackageGetSamples.java | 24 + .../ProductPackagesOperationListSamples.java | 24 + .../ProductSettingsDeleteSamples.java | 23 + .../generated/ProductSettingsGetSamples.java | 22 + .../generated/ProductSettingsListSamples.java | 22 + .../ProductSettingsUpdateSamples.java | 27 + .../generated/ProductTemplateGetSamples.java | 24 + .../ProductTemplatesOperationListSamples.java | 24 + .../ReevaluateRecommendationSamples.java | 25 + ...esourceProviderListGeodataByIpSamples.java | 28 + ...ourceProviderListWhoisByDomainSamples.java | 28 + ...nalyticsSettingsCreateOrUpdateSamples.java | 9 +- ...urityMLAnalyticsSettingsDeleteSamples.java | 6 +- ...SecurityMLAnalyticsSettingsGetSamples.java | 6 +- ...ecurityMLAnalyticsSettingsListSamples.java | 6 +- ...SentinelOnboardingStatesCreateSamples.java | 6 +- ...SentinelOnboardingStatesDeleteSamples.java | 6 +- .../SentinelOnboardingStatesGetSamples.java | 6 +- .../SentinelOnboardingStatesListSamples.java | 6 +- ...ntrolOperationListRepositoriesSamples.java | 31 + .../SourceControlsCreateSamples.java | 45 + .../SourceControlsDeleteSamples.java | 32 + .../generated/SourceControlsGetSamples.java | 24 + .../generated/SourceControlsListSamples.java | 23 + .../ThreatIntelligenceCountSamples.java | 26 + ...ntelligenceIndicatorAppendTagsSamples.java | 6 +- ...igenceIndicatorCreateIndicatorSamples.java | 8 +- ...eatIntelligenceIndicatorCreateSamples.java | 6 +- ...eatIntelligenceIndicatorDeleteSamples.java | 6 +- ...ThreatIntelligenceIndicatorGetSamples.java | 6 +- ...telligenceIndicatorMetricsListSamples.java | 6 +- ...igenceIndicatorQueryIndicatorsSamples.java | 10 +- ...telligenceIndicatorReplaceTagsSamples.java | 6 +- ...ligenceIndicatorsOperationListSamples.java | 6 +- .../ThreatIntelligenceQuerySamples.java | 41 + ...edAnalyticsRuleRunOperationGetSamples.java | 25 + .../UpdateRecommendationSamples.java | 30 + .../WatchlistItemsCreateOrUpdateSamples.java | 6 +- .../WatchlistItemsDeleteSamples.java | 6 +- .../generated/WatchlistItemsGetSamples.java | 6 +- .../generated/WatchlistItemsListSamples.java | 6 +- .../WatchlistsCreateOrUpdateSamples.java | 18 +- .../generated/WatchlistsDeleteSamples.java | 9 +- .../generated/WatchlistsGetSamples.java | 6 +- .../generated/WatchlistsListSamples.java | 6 +- ...aceManagerAssignmentJobsCreateSamples.java | 25 + ...aceManagerAssignmentJobsDeleteSamples.java | 25 + ...kspaceManagerAssignmentJobsGetSamples.java | 25 + ...spaceManagerAssignmentJobsListSamples.java | 25 + ...nagerAssignmentsCreateOrUpdateSamples.java | 34 + ...kspaceManagerAssignmentsDeleteSamples.java | 25 + ...WorkspaceManagerAssignmentsGetSamples.java | 25 + ...orkspaceManagerAssignmentsListSamples.java | 24 + ...erConfigurationsCreateOrUpdateSamples.java | 30 + ...aceManagerConfigurationsDeleteSamples.java | 24 + ...kspaceManagerConfigurationsGetSamples.java | 24 + ...spaceManagerConfigurationsListSamples.java | 24 + ...aceManagerGroupsCreateOrUpdateSamples.java | 32 + .../WorkspaceManagerGroupsDeleteSamples.java | 25 + .../WorkspaceManagerGroupsGetSamples.java | 25 + .../WorkspaceManagerGroupsListSamples.java | 24 + ...ceManagerMembersCreateOrUpdateSamples.java | 29 + .../WorkspaceManagerMembersDeleteSamples.java | 25 + .../WorkspaceManagerMembersGetSamples.java | 25 + .../WorkspaceManagerMembersListSamples.java | 24 + .../AADCheckRequirementsPropertiesTests.java | 25 + .../generated/AADCheckRequirementsTests.java | 26 + ...a => AADDataConnectorPropertiesTests.java} | 20 +- .../AATPCheckRequirementsPropertiesTests.java | 25 + .../generated/AATPCheckRequirementsTests.java | 26 + ... => AATPDataConnectorPropertiesTests.java} | 23 +- .../ASCCheckRequirementsPropertiesTests.java | 25 + .../generated/ASCCheckRequirementsTests.java | 26 + .../ASCDataConnectorPropertiesTests.java | 34 + .../generated/AWSAuthModelTests.java | 28 + .../generated/AadDataConnectorTests.java | 22 +- .../generated/AatpDataConnectorTests.java | 22 +- .../AccountEntityPropertiesTests.java | 10 +- .../generated/AccountEntityTests.java | 10 +- .../generated/ActionPropertiesBaseTests.java | 12 +- .../ActionRequestPropertiesTests.java | 14 +- .../generated/ActionRequestTests.java | 18 +- .../generated/ActionResponseInnerTests.java | 21 +- .../ActionResponsePropertiesTests.java | 17 +- ...nsCreateOrUpdateWithResponseMockTests.java | 24 +- .../ActionsDeleteWithResponseMockTests.java | 10 +- .../ActionsGetWithResponseMockTests.java | 16 +- .../ActionsListByAlertRuleMockTests.java | 18 +- .../generated/ActionsListTests.java | 31 +- .../ActivityCustomEntityQueryTests.java | 72 + ...ueriesPropertiesQueryDefinitionsTests.java | 26 + .../ActivityEntityQueriesPropertiesTests.java | 73 + ...mplatePropertiesQueryDefinitionsTests.java | 20 + ...ityEntityQueryTemplatePropertiesTests.java | 28 + .../ActivityEntityQueryTemplateTests.java | 28 + .../generated/ActivityEntityQueryTests.java | 29 + .../generated/ActivityTimelineItemTests.java | 26 + .../AddIncidentTaskActionPropertiesTests.java | 29 + .../generated/AlertDetailsOverrideTests.java | 39 +- .../generated/AlertPropertyMappingTests.java | 29 + .../generated/AlertRuleInnerTests.java | 10 +- .../AlertRuleTemplateDataSourceTests.java | 18 +- .../AlertRuleTemplateInnerTests.java | 10 +- .../AlertRuleTemplatePropertiesBaseTests.java | 25 + ...tRuleTemplateWithMitrePropertiesTests.java | 28 + ...RuleTemplatesGetWithResponseMockTests.java | 10 +- .../AlertRuleTemplatesListMockTests.java | 10 +- .../AlertRuleTemplatesListTests.java | 16 +- ...esCreateOrUpdateWithResponseMockTests.java | 12 +- ...AlertRulesDeleteWithResponseMockTests.java | 8 +- .../AlertRulesGetWithResponseMockTests.java | 12 +- .../generated/AlertRulesListMockTests.java | 12 +- .../generated/AlertRulesListTests.java | 18 +- .../AlertsDataTypeOfDataConnectorTests.java | 10 +- ...nalyticsRuleRunTriggerPropertiesTests.java | 28 + .../AnalyticsRuleRunTriggerTests.java | 28 + .../AnomaliesSettingsPropertiesTests.java | 22 + .../generated/AnomaliesTests.java | 26 + ...ityMLAnalyticsSettingsPropertiesTests.java | 89 +- ...omalySecurityMLAnalyticsSettingsTests.java | 98 +- .../generated/AnomalyTimelineItemTests.java | 30 + .../generated/AscDataConnectorTests.java | 16 +- .../generated/AssignmentItemTests.java | 25 + .../generated/AttackPatternTests.java | 17 + .../generated/AutomationRuleActionTests.java | 10 +- ...omationRuleAddIncidentTaskActionTests.java | 33 + .../AutomationRuleBooleanConditionTests.java | 31 + .../AutomationRuleConditionTests.java | 2 +- .../generated/AutomationRuleInnerTests.java | 48 +- ...mationRuleModifyPropertiesActionTests.java | 70 +- .../AutomationRulePropertiesTests.java | 46 +- ...pertyArrayChangedValuesConditionTests.java | 10 +- ...RulePropertyArrayValuesConditionTests.java | 40 + ...lePropertyValuesChangedConditionTests.java | 16 +- ...ationRulePropertyValuesConditionTests.java | 22 +- .../AutomationRuleRunPlaybookActionTests.java | 25 +- .../AutomationRuleTriggeringLogicTests.java | 22 +- ...esCreateOrUpdateWithResponseMockTests.java | 42 +- ...ationRulesDeleteWithResponseMockTests.java | 10 +- ...tomationRulesGetWithResponseMockTests.java | 24 +- .../AutomationRulesListMockTests.java | 24 +- .../generated/AutomationRulesListTests.java | 64 +- .../generated/AvailabilityTests.java | 27 + .../AwsCloudTrailCheckRequirementsTests.java | 22 + ...dTrailDataConnectorDataTypesLogsTests.java | 2 +- ...CloudTrailDataConnectorDataTypesTests.java | 2 +- ...loudTrailDataConnectorPropertiesTests.java | 20 +- .../AwsCloudTrailDataConnectorTests.java | 22 +- .../AwsS3CheckRequirementsTests.java | 22 + .../AwsS3DataConnectorDataTypesLogsTests.java | 26 + .../AwsS3DataConnectorDataTypesTests.java | 28 + .../AwsS3DataConnectorPropertiesTests.java | 40 + .../generated/AwsS3DataConnectorTests.java | 43 + .../AzureDevOpsResourceInfoTests.java | 20 + .../AzureResourceEntityPropertiesTests.java | 10 +- .../generated/AzureResourceEntityTests.java | 10 +- .../generated/BillingStatisticInnerTests.java | 17 + .../generated/BillingStatisticListTests.java | 19 + ...ingStatisticsGetWithResponseMockTests.java | 37 + .../BillingStatisticsListMockTests.java | 37 + .../BookmarkEntityMappingsTests.java | 35 + .../BookmarkExpandParametersTests.java | 34 + .../BookmarkExpandResponseInnerTests.java | 24 + .../BookmarkExpandResponseValueTests.java | 19 + .../generated/BookmarkInnerTests.java | 127 +- .../generated/BookmarkListTests.java | 92 +- ...OperationsExpandWithResponseMockTests.java | 49 + .../generated/BookmarkPropertiesTests.java | 138 +- ...nsCreateOrUpdateWithResponseMockTests.java | 43 + ...kRelationsDeleteWithResponseMockTests.java | 34 + ...markRelationsGetWithResponseMockTests.java | 41 + .../BookmarkRelationsListMockTests.java | 41 + .../generated/BookmarkTimelineItemTests.java | 27 + ...ksCreateOrUpdateWithResponseMockTests.java | 106 +- .../BookmarksDeleteWithResponseMockTests.java | 8 +- .../BookmarksGetWithResponseMockTests.java | 51 +- .../generated/BookmarksListMockTests.java | 52 +- .../BooleanConditionPropertiesTests.java | 34 + .../generated/CcpAuthConfigTests.java | 21 + .../generated/CcpResponseConfigTests.java | 57 + .../generated/ClientInfoTests.java | 29 +- ...CloudApplicationEntityPropertiesTests.java | 10 +- .../CloudApplicationEntityTests.java | 10 +- ...onnectorPollingRequestPropertiesTests.java | 56 + ...nnectorPollingResponsePropertiesTests.java | 37 + .../generated/CodelessParametersTests.java | 197 + ...opertiesConnectivityCriteriaItemTests.java | 34 + ...torConfigPropertiesDataTypesItemTests.java | 30 + ...ConfigPropertiesGraphQueriesItemTests.java | 33 + ...igPropertiesInstructionStepsItemTests.java | 40 + ...onfigPropertiesSampleQueriesItemTests.java | 30 + ...elessUiConnectorConfigPropertiesTests.java | 182 + .../CodelessUiDataConnectorTests.java | 191 + .../generated/ConditionClauseTests.java | 34 + .../generated/ConditionPropertiesTests.java | 45 + .../generated/ConnectedEntityTests.java | 19 + .../generated/ConnectivityCriteriaTests.java | 31 + .../generated/ConnectivityCriterionTests.java | 30 + .../generated/ConnectorDataTypeTests.java | 29 + ...ConnectorDefinitionsAvailabilityTests.java | 28 + .../ConnectorDefinitionsPermissionsTests.java | 63 + ...ectorDefinitionsResourceProviderTests.java | 50 + .../ConnectorInstructionModelBaseTests.java | 29 + ...perationsInstallWithResponseMockTests.java | 129 + ...rationsUninstallWithResponseMockTests.java | 34 + ...ntentPackagesGetWithResponseMockTests.java | 83 + .../ContentPackagesListMockTests.java | 85 + ...tTemplatesDeleteWithResponseMockTests.java | 34 + ...tentTemplatesGetWithResponseMockTests.java | 83 + ...TemplatesInstallWithResponseMockTests.java | 145 + ...ntentTemplatesOperationsListMockTests.java | 85 + .../generated/CountQueryTests.java | 43 + .../generated/CustomEntityQueryTests.java | 26 + .../CustomPermissionDetailsTests.java | 27 + .../CustomizableConnectionsConfigTests.java | 29 + ...bleConnectorDefinitionPropertiesTests.java | 271 + .../CustomizableConnectorDefinitionTests.java | 177 + .../CustomizableConnectorUiConfigTests.java | 215 + .../generated/CustomsPermissionTests.java | 27 + .../generated/CustomsTests.java | 27 + .../generated/DCRConfigurationTests.java | 32 + .../DataConnectorDataTypeCommonTests.java | 2 +- ...orDefinitionArmCollectionWrapperTests.java | 20 + .../DataConnectorDefinitionInnerTests.java | 26 + ...nsCreateOrUpdateWithResponseMockTests.java | 41 + ...efinitionsDeleteWithResponseMockTests.java | 34 + ...orDefinitionsGetWithResponseMockTests.java | 39 + ...DataConnectorDefinitionsListMockTests.java | 39 + .../generated/DataConnectorInnerTests.java | 10 +- .../generated/DataConnectorListTests.java | 19 +- .../generated/DataConnectorTenantIdTests.java | 25 + ...ataConnectorWithAlertsPropertiesTests.java | 10 +- .../DataConnectorsCheckRequirementsTests.java | 22 + ...rsCreateOrUpdateWithResponseMockTests.java | 14 +- ...ConnectorsDeleteWithResponseMockTests.java | 9 +- ...ectorsDisconnectWithResponseMockTests.java | 34 + ...ataConnectorsGetWithResponseMockTests.java | 12 +- .../DataConnectorsListMockTests.java | 12 +- .../generated/DataTypeDefinitionsTests.java | 18 + .../generated/DeploymentInfoTests.java | 29 + .../generated/DeploymentTests.java | 26 + .../generated/DnsEntityPropertiesTests.java | 10 +- .../generated/DnsEntityTests.java | 10 +- ...cs365CheckRequirementsPropertiesTests.java | 26 + .../Dynamics365CheckRequirementsTests.java | 26 + ...ataTypesDynamics365CdsActivitiesTests.java | 28 + ...ynamics365DataConnectorDataTypesTests.java | 29 + ...namics365DataConnectorPropertiesTests.java | 34 + .../Dynamics365DataConnectorTests.java | 36 + .../generated/EnrichmentDomainBodyTests.java | 25 + .../EnrichmentDomainWhoisContactTests.java | 28 + .../EnrichmentDomainWhoisContactsTests.java | 58 + .../EnrichmentDomainWhoisDetailsTests.java | 66 + .../EnrichmentDomainWhoisInnerTests.java | 72 + ...hmentDomainWhoisRegistrarDetailsTests.java | 24 + .../EnrichmentIpAddressBodyTests.java | 25 + .../EntitiesExpandWithResponseMockTests.java | 49 + ...itiesGetInsightsWithResponseMockTests.java | 56 + ...GetTimelinesListWithResponseMockTests.java | 54 + .../EntitiesGetWithResponseMockTests.java | 37 + .../generated/EntitiesListMockTests.java | 36 + .../generated/EntitiesQueriesMockTests.java | 41 + .../EntitiesRelationsListMockTests.java | 41 + ...itiesRunPlaybookWithResponseMockTests.java | 39 + .../EntityAnalyticsPropertiesTests.java | 29 + .../generated/EntityAnalyticsTests.java | 32 + .../EntityCommonPropertiesTests.java | 9 +- .../generated/EntityEdgesTests.java | 19 + .../EntityExpandParametersTests.java | 35 + .../EntityExpandResponseInnerTests.java | 24 + .../EntityExpandResponseValueTests.java | 19 + .../generated/EntityFieldMappingTests.java | 27 + .../EntityGetInsightsParametersTests.java | 38 + .../EntityGetInsightsResponseInnerTests.java | 33 + ...tityInsightItemQueryTimeIntervalTests.java | 21 + .../generated/EntityInsightItemTests.java | 28 + .../generated/EntityListTests.java | 19 + .../EntityManualTriggerRequestBodyTests.java | 32 + .../generated/EntityMappingTests.java | 23 +- ...esCreateOrUpdateWithResponseMockTests.java | 41 + ...tyQueriesDeleteWithResponseMockTests.java} | 10 +- ...EntityQueriesGetWithResponseMockTests.java | 39 + .../generated/EntityQueriesListMockTests.java | 40 + .../generated/EntityQueryInnerTests.java | 20 + .../generated/EntityQueryItemInnerTests.java | 21 + ...QueryItemPropertiesDataTypesItemTests.java | 18 + .../EntityQueryItemPropertiesTests.java | 22 + .../generated/EntityQueryListTests.java | 20 + .../EntityQueryTemplateInnerTests.java | 18 + .../EntityQueryTemplateListTests.java | 19 + ...ueryTemplatesGetWithResponseMockTests.java | 37 + .../EntityQueryTemplatesListMockTests.java | 38 + ...tionsGetRelationWithResponseMockTests.java | 41 + .../generated/EntityTests.java | 10 +- .../generated/EntityTimelineItemTests.java | 16 + .../EntityTimelineParametersTests.java | 40 + .../EntityTimelineResponseInnerTests.java | 25 + .../generated/ErrorTests.java | 19 + .../generated/EventGroupingSettingsTests.java | 2 +- ...ExpansionEntityQueriesPropertiesTests.java | 25 + .../generated/ExpansionEntityQueryTests.java | 26 + .../ExpansionResultAggregationTests.java | 24 + .../ExpansionResultsMetadataTests.java | 23 + .../EyesOnSettingsPropertiesTests.java | 22 + .../generated/EyesOnTests.java | 26 + .../generated/FieldMappingTests.java | 14 +- .../generated/FileEntityPropertiesTests.java | 10 +- .../generated/FileEntityTests.java | 10 +- .../FileHashEntityPropertiesTests.java | 10 +- .../generated/FileHashEntityTests.java | 10 +- .../generated/FileImportInnerTests.java | 44 + .../generated/FileImportListTests.java | 28 + .../generated/FileImportPropertiesTests.java | 45 + ...ileImportsCreateWithResponseMockTests.java | 54 + .../FileImportsGetWithResponseMockTests.java | 47 + .../generated/FileImportsListMockTests.java | 48 + .../generated/FileMetadataTests.java | 33 + .../FusionAlertRulePropertiesTests.java | 118 +- ...usionAlertRuleTemplatePropertiesTests.java | 56 +- .../FusionAlertRuleTemplateTests.java | 59 +- .../generated/FusionAlertRuleTests.java | 97 +- .../FusionScenarioExclusionPatternTests.java | 29 + .../generated/FusionSourceSettingsTests.java | 48 + .../FusionSourceSubTypeSettingTests.java | 41 + .../FusionSubTypeSeverityFilterTests.java | 34 + ...FusionSubTypeSeverityFiltersItemTests.java | 30 + .../FusionTemplateSourceSettingTests.java | 24 + .../FusionTemplateSourceSubTypeTests.java | 22 + ...ionTemplateSubTypeSeverityFilterTests.java | 21 + .../generated/GCPAuthModelTests.java | 32 + .../generated/GCPAuthPropertiesTests.java | 32 + .../GCPDataConnectorPropertiesTests.java | 54 + .../generated/GCPDataConnectorTests.java | 57 + .../generated/GCPRequestPropertiesTests.java | 30 + .../generated/GetInsightsErrorKindTests.java | 22 + .../GetInsightsResultsMetadataTests.java | 23 + .../generated/GetQueriesResponseTests.java | 21 + .../GetRecommendationsListMockTests.java | 58 + ...iggeredAnalyticsRuleRunsListMockTests.java | 43 + ...leRecommendationWithResponseMockTests.java | 54 + .../generated/GitHubAuthModelTests.java | 25 + .../generated/GitHubResourceInfoTests.java | 18 + .../generated/GraphQueriesTests.java | 30 + .../generated/GraphQueryTests.java | 31 + .../generated/GroupingConfigurationTests.java | 42 +- .../generated/HostEntityPropertiesTests.java | 13 +- .../generated/HostEntityTests.java | 13 +- .../generated/HuntCommentInnerTests.java | 28 + .../generated/HuntCommentListTests.java | 21 + .../generated/HuntCommentPropertiesTests.java | 25 + ...tsCreateOrUpdateWithResponseMockTests.java | 43 + ...ntCommentsDeleteWithResponseMockTests.java | 35 + .../HuntCommentsGetWithResponseMockTests.java | 40 + .../generated/HuntCommentsListMockTests.java | 41 + .../generated/HuntInnerTests.java | 69 + .../generated/HuntListTests.java | 36 + .../generated/HuntOwnerTests.java | 39 + .../generated/HuntPropertiesTests.java | 66 + .../generated/HuntRelationInnerTests.java | 30 + .../generated/HuntRelationListTests.java | 21 + .../HuntRelationPropertiesTests.java | 30 + ...nsCreateOrUpdateWithResponseMockTests.java | 44 + ...tRelationsDeleteWithResponseMockTests.java | 34 + ...HuntRelationsGetWithResponseMockTests.java | 40 + .../generated/HuntRelationsListMockTests.java | 41 + .../HuntingBookmarkPropertiesTests.java | 68 +- .../generated/HuntingBookmarkTests.java | 69 +- ...tsCreateOrUpdateWithResponseMockTests.java | 72 + .../HuntsDeleteWithResponseMockTests.java | 33 + .../HuntsGetWithResponseMockTests.java | 55 + .../generated/HuntsListMockTests.java | 55 + .../generated/IdentityTests.java | 17 + .../IncidentAdditionalDataTests.java | 10 +- .../IncidentAlertListInnerTests.java | 14 +- .../IncidentBookmarkListInnerTests.java | 96 +- .../generated/IncidentCommentInnerTests.java | 14 +- .../generated/IncidentCommentListTests.java | 24 +- .../IncidentCommentPropertiesTests.java | 10 +- ...tsCreateOrUpdateWithResponseMockTests.java | 20 +- ...ntCommentsDeleteWithResponseMockTests.java | 8 +- ...identCommentsGetWithResponseMockTests.java | 14 +- .../IncidentCommentsListMockTests.java | 14 +- .../generated/IncidentConfigurationTests.java | 49 +- .../IncidentEntitiesResponseInnerTests.java | 25 +- .../IncidentEntitiesResultsMetadataTests.java | 17 +- .../generated/IncidentInfoTests.java | 31 +- .../generated/IncidentInnerTests.java | 98 +- .../generated/IncidentLabelTests.java | 10 +- .../generated/IncidentListTests.java | 114 +- .../generated/IncidentOwnerInfoTests.java | 35 +- .../IncidentPropertiesActionTests.java | 66 +- .../generated/IncidentPropertiesTests.java | 94 +- ...nsCreateOrUpdateWithResponseMockTests.java | 22 +- ...tRelationsDeleteWithResponseMockTests.java | 9 +- ...dentRelationsGetWithResponseMockTests.java | 14 +- .../IncidentRelationsListMockTests.java | 14 +- .../generated/IncidentTaskInnerTests.java | 61 + .../generated/IncidentTaskListTests.java | 32 + .../IncidentTaskPropertiesTests.java | 58 + ...ksCreateOrUpdateWithResponseMockTests.java | 65 + ...identTasksDeleteWithResponseMockTests.java | 35 + ...IncidentTasksGetWithResponseMockTests.java | 51 + .../generated/IncidentTasksListMockTests.java | 51 + ...tsCreateOrUpdateWithResponseMockTests.java | 77 +- .../IncidentsDeleteWithResponseMockTests.java | 9 +- .../IncidentsGetWithResponseMockTests.java | 41 +- ...identsListAlertsWithResponseMockTests.java | 12 +- ...ntsListBookmarksWithResponseMockTests.java | 41 +- ...entsListEntitiesWithResponseMockTests.java | 14 +- .../generated/IncidentsListMockTests.java | 44 +- ...dentsRunPlaybookWithResponseMockTests.java | 38 + .../IndicatorObservablesItemTests.java | 19 + .../generated/IndicatorTests.java | 20 + ...eryItemPropertiesAdditionalQueryTests.java | 19 + ...ryItemPropertiesDefaultTimeRangeTests.java | 20 + ...ItemPropertiesReferenceTimeRangeTests.java | 18 + ...TableQueryColumnsDefinitionsItemTests.java | 22 + ...TableQueryQueriesDefinitionsItemTests.java | 23 + ...esDefinitionsPropertiesItemsItemTests.java | 20 + ...ghtQueryItemPropertiesTableQueryTests.java | 28 + .../InsightQueryItemPropertiesTests.java | 41 + .../generated/InsightQueryItemTests.java | 40 + .../InsightsTableResultColumnsItemTests.java | 20 + .../generated/InsightsTableResultTests.java | 21 + .../InstructionStepDetailsTests.java | 27 + .../generated/InstructionStepTests.java | 141 + ...InstructionStepsInstructionsItemTests.java | 28 + .../generated/InstructionStepsTests.java | 41 + .../IoTCheckRequirementsPropertiesTests.java | 25 + .../generated/IoTCheckRequirementsTests.java | 26 + .../IoTDataConnectorPropertiesTests.java | 34 + .../generated/IoTDataConnectorTests.java | 36 + .../IoTDeviceEntityPropertiesTests.java | 13 +- .../generated/IoTDeviceEntityTests.java | 13 +- .../generated/JobInnerTests.java | 22 + .../generated/JobItemTests.java | 21 + .../generated/JobListTests.java | 23 + .../generated/JobPropertiesTests.java | 21 + .../LastDataReceivedDataTypeTests.java | 29 + .../MCASCheckRequirementsPropertiesTests.java | 25 + .../generated/MCASCheckRequirementsTests.java | 26 + ... => MCASDataConnectorPropertiesTests.java} | 20 +- ...MDATPCheckRequirementsPropertiesTests.java | 25 + .../MDATPCheckRequirementsTests.java | 27 + ...=> MDATPDataConnectorPropertiesTests.java} | 20 +- ...viorAnalyticsAlertRulePropertiesTests.java | 30 + ...yticsAlertRuleTemplatePropertiesTests.java | 30 + ...haviorAnalyticsAlertRuleTemplateTests.java | 30 + .../MLBehaviorAnalyticsAlertRuleTests.java | 32 + .../MSTICheckRequirementsPropertiesTests.java | 25 + .../generated/MSTICheckRequirementsTests.java | 26 + .../MSTIDataConnectorDataTypesTests.java | 35 + .../MSTIDataConnectorPropertiesTests.java | 39 + .../generated/MSTIDataConnectorTests.java | 42 + .../MTPCheckRequirementsPropertiesTests.java | 25 + .../MTPDataConnectorDataTypesAlertsTests.java | 26 + ...PDataConnectorDataTypesIncidentsTests.java | 27 + .../MTPDataConnectorDataTypesTests.java | 33 + .../MTPDataConnectorPropertiesTests.java | 46 + .../generated/MTPDataConnectorTests.java | 47 + .../MailClusterEntityPropertiesTests.java | 10 +- .../generated/MailClusterEntityTests.java | 10 +- .../MailMessageEntityPropertiesTests.java | 39 +- .../generated/MailMessageEntityTests.java | 41 +- .../MailboxEntityPropertiesTests.java | 10 +- .../generated/MailboxEntityTests.java | 10 +- .../MalwareEntityPropertiesTests.java | 10 +- .../generated/MalwareEntityTests.java | 10 +- .../ManualTriggerRequestBodyTests.java | 29 + .../McasDataConnectorDataTypesTests.java | 2 +- .../generated/McasDataConnectorTests.java | 18 +- .../generated/MdatpDataConnectorTests.java | 22 +- .../generated/MetadataAuthorTests.java | 30 + .../generated/MetadataCategoriesTests.java | 31 + .../generated/MetadataDependenciesTests.java | 127 + .../generated/MetadataListTests.java | 52 + .../generated/MetadataModelInnerTests.java | 138 + .../generated/MetadataPatchTests.java | 157 + .../MetadataPropertiesPatchTests.java | 208 + .../generated/MetadataPropertiesTests.java | 154 + .../generated/MetadataSourceTests.java | 33 + .../generated/MetadataSupportTests.java | 37 + .../MetadatasCreateWithResponseMockTests.java | 139 + .../MetadatasDeleteWithResponseMockTests.java | 34 + .../MetadatasGetWithResponseMockTests.java | 77 + .../generated/MetadatasListMockTests.java | 79 + ...ctionCheckRequirementsPropertiesTests.java | 28 + ...ationProtectionCheckRequirementsTests.java | 27 + ...ProtectionConnectorDataTypesLogsTests.java | 29 + ...tionProtectionConnectorDataTypesTests.java | 30 + ...rotectionDataConnectorPropertiesTests.java | 36 + ...formationProtectionDataConnectorTests.java | 37 + ...reationAlertRuleCommonPropertiesTests.java | 31 +- ...identCreationAlertRulePropertiesTests.java | 49 +- ...ationAlertRuleTemplatePropertiesTests.java | 56 +- ...ncidentCreationAlertRuleTemplateTests.java | 58 +- ...ecurityIncidentCreationAlertRuleTests.java | 58 +- ...TypesMicrosoftEmergingThreatFeedTests.java | 32 + .../generated/MtpCheckRequirementsTests.java | 26 + .../generated/MtpFilteredProvidersTests.java | 29 + .../generated/NicEntityPropertiesTests.java | 17 + .../generated/NicEntityTests.java | 17 + .../generated/NoneAuthModelTests.java | 21 + .../NrtAlertRulePropertiesTests.java | 177 + .../NrtAlertRuleTemplatePropertiesTests.java | 49 + .../generated/NrtAlertRuleTemplateTests.java | 49 + .../generated/NrtAlertRuleTests.java | 194 + ...ojectCheckRequirementsPropertiesTests.java | 26 + ...ffice365ProjectCheckRequirementsTests.java | 26 + ...365ProjectConnectorDataTypesLogsTests.java | 27 + ...fice365ProjectConnectorDataTypesTests.java | 28 + ...65ProjectDataConnectorPropertiesTests.java | 33 + .../Office365ProjectDataConnectorTests.java | 36 + ...ceATPCheckRequirementsPropertiesTests.java | 26 + .../OfficeATPCheckRequirementsTests.java | 26 + ...fficeATPDataConnectorPropertiesTests.java} | 20 +- .../OfficeATPDataConnectorTests.java | 36 + .../generated/OfficeConsentInnerTests.java | 20 + .../generated/OfficeConsentListTests.java | 21 + .../OfficeConsentPropertiesTests.java | 20 + ...ceConsentsDeleteWithResponseMockTests.java | 33 + ...fficeConsentsGetWithResponseMockTests.java | 40 + .../OfficeConsentsListMockTests.java | 40 + ...ceDataConnectorDataTypesExchangeTests.java | 2 +- ...DataConnectorDataTypesSharePointTests.java | 10 +- ...fficeDataConnectorDataTypesTeamsTests.java | 10 +- .../OfficeDataConnectorDataTypesTests.java | 10 +- .../OfficeDataConnectorPropertiesTests.java | 22 +- .../generated/OfficeDataConnectorTests.java | 18 +- ...ceIRMCheckRequirementsPropertiesTests.java | 26 + .../OfficeIRMCheckRequirementsTests.java | 26 + ...OfficeIRMDataConnectorPropertiesTests.java | 33 + .../OfficeIRMDataConnectorTests.java | 36 + ...werBICheckRequirementsPropertiesTests.java | 26 + .../OfficePowerBICheckRequirementsTests.java | 26 + ...icePowerBIConnectorDataTypesLogsTests.java | 27 + .../OfficePowerBIConnectorDataTypesTests.java | 28 + ...cePowerBIDataConnectorPropertiesTests.java | 34 + .../OfficePowerBIDataConnectorTests.java | 36 + .../generated/OperationDisplayTests.java | 25 +- .../generated/OperationInnerTests.java | 35 +- .../generated/OperationsListMockTests.java | 22 +- .../generated/OperationsListTests.java | 59 +- .../generated/OracleAuthModelTests.java | 35 + .../generated/PackageBasePropertiesTests.java | 174 + .../generated/PackageListTests.java | 58 + .../generated/PackageModelInnerTests.java | 151 + .../generated/PackagePropertiesTests.java | 244 + .../PermissionsCustomsItemTests.java | 27 + .../PermissionsResourceProviderItemTests.java | 49 + .../generated/PermissionsTests.java | 72 + .../PlaybookActionPropertiesTests.java | 21 +- ...iDataConnectorDataTypesConnectorTests.java | 27 + ...remiumMdtiDataConnectorDataTypesTests.java | 28 + ...emiumMdtiDataConnectorPropertiesTests.java | 41 + ...oftDefenderForThreatIntelligenceTests.java | 44 + .../generated/ProductPackageListTests.java | 60 + .../ProductPackageModelInnerTests.java | 65 + .../ProductPackagePropertiesTests.java | 70 + ...oductPackagesGetWithResponseMockTests.java | 85 + ...roductPackagesOperationsListMockTests.java | 88 + ...ctSettingsDeleteWithResponseMockTests.java | 34 + ...oductSettingsGetWithResponseMockTests.java | 39 + .../ProductSettingsListMockTests.java | 39 + ...ctSettingsUpdateWithResponseMockTests.java | 41 + .../generated/ProductTemplateListTests.java | 58 + .../ProductTemplateModelInnerTests.java | 63 + .../ProductTemplatePropertiesTests.java | 68 + ...ductTemplatesGetWithResponseMockTests.java | 83 + ...oductTemplatesOperationsListMockTests.java | 85 + ...yArrayChangedConditionPropertiesTests.java | 2 +- ...PropertyArrayConditionPropertiesTests.java | 42 + ...opertyChangedConditionPropertiesTests.java | 28 +- .../PropertyConditionPropertiesTests.java | 16 +- .../generated/PullRequestTests.java | 16 + ...AuditCheckRequirementsPropertiesTests.java | 26 + .../PurviewAuditCheckRequirementsTests.java | 26 + ...rviewAuditConnectorDataTypesLogsTests.java | 27 + .../PurviewAuditConnectorDataTypesTests.java | 28 + ...viewAuditDataConnectorPropertiesTests.java | 50 + .../PurviewAuditDataConnectorTests.java | 52 + .../generated/QueryConditionTests.java | 42 + .../generated/QueryPropertiesTests.java | 37 + .../generated/QuerySortByTests.java | 28 + .../generated/QueryTests.java | 67 + .../generated/RecommendationInnerTests.java | 35 + .../generated/RecommendationListTests.java | 39 + .../RecommendationPatchPropertiesTests.java | 26 + .../generated/RecommendationPatchTests.java | 28 + .../RecommendationPropertiesTests.java | 34 + .../generated/RecommendedSuggestionTests.java | 23 + .../ReevaluateResponseInnerTests.java | 19 + ...esRecommendationWithResponseMockTests.java | 38 + .../generated/RelationInnerTests.java | 14 +- .../generated/RelationListTests.java | 21 +- .../generated/RelationPropertiesTests.java | 10 +- .../generated/RelationshipHintTests.java | 20 + .../generated/RelationshipTests.java | 17 + .../generated/RepoInnerTests.java | 22 + .../generated/RepoListTests.java | 22 + .../generated/RepositoryTests.java | 30 + .../generated/RequiredPermissionsTests.java | 33 + ...ourceProviderRequiredPermissionsTests.java | 35 + .../generated/ResourceProviderTests.java | 49 + ...istWhoisByDomainWithResponseMockTests.java | 94 + .../generated/ResourceWithEtagTests.java | 12 +- ...ApiPollerDataConnectorPropertiesTests.java | 159 + .../RestApiPollerDataConnectorTests.java | 161 + .../RestApiPollerRequestConfigTests.java | 84 + ...RestApiPollerRequestPagingConfigTests.java | 34 + .../generated/SampleQueriesTests.java | 27 + ...SolutionUsageStatisticPropertiesTests.java | 17 + .../SapSolutionUsageStatisticTests.java | 17 + ...heduledAlertRuleCommonPropertiesTests.java | 137 +- .../ScheduledAlertRulePropertiesTests.java | 208 +- ...duledAlertRuleTemplatePropertiesTests.java | 143 +- .../ScheduledAlertRuleTemplateTests.java | 137 +- .../generated/ScheduledAlertRuleTests.java | 247 +- ...tPropertiesConfidenceReasonsItemTests.java | 10 +- .../SecurityAlertPropertiesTests.java | 13 +- .../generated/SecurityAlertTests.java | 13 +- .../SecurityAlertTimelineItemTests.java | 30 + .../SecurityGroupEntityPropertiesTests.java | 10 +- .../generated/SecurityGroupEntityTests.java | 10 +- .../SecurityMLAnalyticsSettingInnerTests.java | 10 +- ...gsCreateOrUpdateWithResponseMockTests.java | 14 +- ...ityMLAnalyticsSettingsDataSourceTests.java | 19 +- ...csSettingsDeleteWithResponseMockTests.java | 9 +- ...yticsSettingsGetWithResponseMockTests.java | 12 +- ...urityMLAnalyticsSettingsListMockTests.java | 14 +- .../SecurityMLAnalyticsSettingsListTests.java | 21 +- .../generated/SentinelEntityMappingTests.java | 25 + ...dingStatesDeleteWithResponseMockTests.java | 8 +- .../generated/SettingListTests.java | 20 + .../generated/SettingsInnerTests.java | 26 + .../SubmissionMailEntityPropertiesTests.java | 10 +- .../generated/SubmissionMailEntityTests.java | 10 +- .../TICheckRequirementsPropertiesTests.java | 25 + .../generated/TICheckRequirementsTests.java | 26 + ...DataConnectorDataTypesIndicatorsTests.java | 2 +- .../TIDataConnectorDataTypesTests.java | 10 +- .../TIDataConnectorPropertiesTests.java | 22 +- .../generated/TIDataConnectorTests.java | 28 +- .../TIObjectCommonPropertiesTests.java | 17 + .../generated/TIObjectInnerTests.java | 17 + .../generated/TeamInformationTests.java | 23 + .../generated/TemplateListTests.java | 58 + .../generated/TemplateModelInnerTests.java | 168 + .../generated/TemplatePropertiesTests.java | 189 + .../generated/ThreatActorTests.java | 17 + ...tIntelligenceAlertRulePropertiesTests.java | 29 + ...genceAlertRuleTemplatePropertiesTests.java | 30 + ...eatIntelligenceAlertRuleTemplateTests.java | 30 + .../ThreatIntelligenceAlertRuleTests.java | 32 + .../ThreatIntelligenceAppendTagsTests.java | 12 +- .../ThreatIntelligenceCountInnerTests.java | 16 + ...eatIntelligenceExternalReferenceTests.java | 34 +- ...IntelligenceGranularMarkingModelTests.java | 24 +- ...catorMetricsListWithResponseMockTests.java | 12 +- ...catorsAppendTagsWithResponseMockTests.java | 11 +- ...IndicatorsDeleteWithResponseMockTests.java | 8 +- ...nceIndicatorsGetWithResponseMockTests.java | 12 +- ...enceIndicatorsOperationsListMockTests.java | 12 +- ...reatIntelligenceInformationInnerTests.java | 10 +- ...hreatIntelligenceInformationListTests.java | 19 +- ...ThreatIntelligenceKillChainPhaseTests.java | 14 +- .../ThreatIntelligenceListTests.java | 19 + .../ThreatIntelligenceMetricEntityTests.java | 17 +- .../ThreatIntelligenceMetricTests.java | 45 +- ...reatIntelligenceMetricsListInnerTests.java | 79 +- .../ThreatIntelligenceMetricsTests.java | 46 +- ...telligenceParsedPatternTypeValueTests.java | 16 +- .../generated/ThreatIntelligenceTests.java | 10 +- ...telligencesCountWithResponseMockTests.java | 47 + .../ThreatIntelligencesQueryMockTests.java | 60 + ...TaxiiCheckRequirementsPropertiesTests.java | 25 + .../TiTaxiiCheckRequirementsTests.java | 26 + ...ataConnectorDataTypesTaxiiClientTests.java | 27 + .../TiTaxiiDataConnectorDataTypesTests.java | 28 + .../generated/TimelineAggregationTests.java | 20 + .../generated/TimelineErrorTests.java | 22 + .../TimelineResultsMetadataTests.java | 25 + .../TriggeredAnalyticsRuleRunInnerTests.java | 23 + ...RunOperationsGetWithResponseMockTests.java | 42 + ...ggeredAnalyticsRuleRunPropertiesTests.java | 22 + .../TriggeredAnalyticsRuleRunsTests.java | 24 + .../generated/UebaPropertiesTests.java | 27 + .../securityinsights/generated/UebaTests.java | 30 + ...esRecommendationWithResponseMockTests.java | 59 + .../generated/UrlEntityPropertiesTests.java | 10 +- .../generated/UrlEntityTests.java | 10 +- .../generated/UserInfoTests.java | 16 +- .../generated/ValidationErrorTests.java | 20 + ...hlistItemsDeleteWithResponseMockTests.java | 9 +- .../WorkloadIdentityFederationTests.java | 17 + .../WorkspaceManagerAssignmentInnerTests.java | 32 + ...gnmentJobsCreateWithResponseMockTests.java | 42 + ...gnmentJobsDeleteWithResponseMockTests.java | 34 + ...ssignmentJobsGetWithResponseMockTests.java | 42 + ...aceManagerAssignmentJobsListMockTests.java | 45 + .../WorkspaceManagerAssignmentListTests.java | 21 + ...spaceManagerAssignmentPropertiesTests.java | 34 + ...tsCreateOrUpdateWithResponseMockTests.java | 46 + ...ssignmentsDeleteWithResponseMockTests.java | 34 + ...erAssignmentsGetWithResponseMockTests.java | 40 + ...kspaceManagerAssignmentsListMockTests.java | 40 + ...rkspaceManagerConfigurationInnerTests.java | 27 + ...orkspaceManagerConfigurationListTests.java | 21 + ...ceManagerConfigurationPropertiesTests.java | 27 + ...nsCreateOrUpdateWithResponseMockTests.java | 42 + ...igurationsDeleteWithResponseMockTests.java | 34 + ...onfigurationsGetWithResponseMockTests.java | 40 + ...aceManagerConfigurationsListMockTests.java | 40 + .../WorkspaceManagerGroupInnerTests.java | 33 + .../WorkspaceManagerGroupListTests.java | 22 + .../WorkspaceManagerGroupPropertiesTests.java | 33 + ...psCreateOrUpdateWithResponseMockTests.java | 46 + ...agerGroupsDeleteWithResponseMockTests.java | 33 + ...ManagerGroupsGetWithResponseMockTests.java | 41 + .../WorkspaceManagerGroupsListMockTests.java | 42 + .../WorkspaceManagerMemberInnerTests.java | 29 + ...WorkspaceManagerMemberPropertiesTests.java | 30 + ...rsCreateOrUpdateWithResponseMockTests.java | 43 + ...gerMembersDeleteWithResponseMockTests.java | 34 + ...anagerMembersGetWithResponseMockTests.java | 40 + .../WorkspaceManagerMembersListMockTests.java | 40 + .../WorkspaceManagerMembersListTests.java | 21 + .../tsp-location.yaml | 4 + 1887 files changed, 159018 insertions(+), 19534 deletions(-) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BillingStatisticsClient.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/ContentPackageOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackagesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorDefinitionsClient.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/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/FileImportsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetRecommendationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetTriggeredAnalyticsRuleRunsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntCommentsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntRelationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentTasksClient.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/ProductPackagesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesOperationsClient.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/ProductTemplatesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ReevaluatesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ResourceProvidersClient.java delete 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/SecurityInsightsManagementClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlOperationsClient.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/ThreatIntelligencesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/TriggeredAnalyticsRuleRunOperationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/UpdatesClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentJobsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerConfigurationsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerGroupsClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerMembersClient.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AADCheckRequirementsProperties.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/{AadDataConnectorProperties.java => AADDataConnectorProperties.java} (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AATPCheckRequirementsProperties.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/{AatpDataConnectorProperties.java => AATPDataConnectorProperties.java} (68%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ASCCheckRequirementsProperties.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/{AscDataConnectorProperties.java => ASCDataConnectorProperties.java} (68%) 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/AnalyticsRuleRunTriggerProperties.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/AwsS3DataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BillingStatisticInner.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/CodelessParameters.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CustomizableConnectorDefinitionProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorDefinitionInner.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/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/EntityQueryInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryItemInner.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/FileImportInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GCPDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobProperties.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 rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/{MdatpDataConnectorProperties.java => MDATPDataConnectorProperties.java} (68%) 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/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/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/MicrosoftPurviewInformationProtectionCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NicEntityProperties.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/Office365ProjectCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectDataConnectorProperties.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/OfficeIRMCheckRequirementsProperties.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/{McasDataConnectorProperties.java => OfficeIRMDataConnectorProperties.java} (56%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBICheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBIDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageModelInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PremiumMdtiDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageModelInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateModelInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditCheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/QueryProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ReevaluateResponseInner.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/RepositoryAccess.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccessObject.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RestApiPollerDataConnectorProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SapSolutionUsageStatisticProperties.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/TICheckRequirementsProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectCommonProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateModelInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateProperties.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/ThreatIntelligenceCountInner.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/TriggeredAnalyticsRuleRunInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunProperties.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/WarningInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberInner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsImpl.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/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/ContentPackageOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsImpl.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/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/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/EntityQueryItemImpl.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/FileImportImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTaskImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/JobImpl.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/PackageModelImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageModelImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsImpl.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/ProductTemplateModelImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RecommendationImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluateResponseImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesImpl.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/ResourceProvidersClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersImpl.java delete mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/{SecurityInsightsBuilder.java => SecurityInsightsManagementClientBuilder.java} (63%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsManagementClientImpl.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/SourceControlOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsImpl.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/TIObjectImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TemplateModelImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceCountImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WarningImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMemberImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersClientImpl.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersImpl.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/ActionsList.java (68%) rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/AlertRuleTemplatesList.java (67%) rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/AlertRulesList.java (67%) rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/AutomationRulesList.java (68%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/BillingStatisticList.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/BookmarkList.java (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/DataConnectorDefinitionArmCollectionWrapper.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/DataConnectorList.java (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryTemplateList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/FileImportList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/GetQueriesResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntCommentList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntRelationList.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/IncidentCommentList.java (68%) rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/IncidentList.java (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentTaskList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/JobList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/MetadataList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/OfficeConsentList.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/OperationsList.java (73%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/PackageList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductPackageList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductTemplateList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RecommendationList.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/RelationList.java (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RepoList.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/SecurityMLAnalyticsSettingsList.java (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SettingList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SourceControlList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TemplateList.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/ThreatIntelligenceInformationList.java (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ThreatIntelligenceList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TriggeredAnalyticsRuleRuns.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/WatchlistItemList.java (67%) rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/{ => implementation}/models/WatchlistList.java (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerAssignmentList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerConfigurationList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerGroupList.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerMembersList.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/AATPCheckRequirements.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/AWSAuthModel.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/AddIncidentTaskActionProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertProperty.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertPropertyMapping.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleOperations.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/AlertRuleTemplateWithMitreProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.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/AnomalyTimelineItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ApiKeyAuthModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AssignmentItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanCondition.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanConditionSupportedOperator.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayValuesCondition.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/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/AzureDevOpsResourceInfo.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BasicAuthModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistic.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistics.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkEntityMappings.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/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/BooleanConditionProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthConfig.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpResponseConfig.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/ConditionClause.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionProperties.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/Connective.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/ConnectivityCriterion.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/ConnectorDataType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsAvailability.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.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/ContentPackageOperations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackages.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplates.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplatesOperations.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/CountQuery.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/CustomPermissionDetails.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectionsConfig.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorDefinition.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.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/DCRConfiguration.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/DataConnectorDefinition.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitions.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/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/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/DeleteStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Deployment.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentFetchStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentInfo.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentResult.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeviceImportance.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/EnrichmentDomainBody.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/EnrichmentIpAddressBody.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/EnrichmentType.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/EntityAnalytics.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/EntityFieldMapping.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/EntityManualTriggerRequestBody.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityProviders.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/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/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/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/Error.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/FileFormat.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImport.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportContentType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImports.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileMetadata.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionScenarioExclusionPattern.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSettings.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSubTypeSetting.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFilter.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFiltersItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSetting.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSubType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSubTypeSeverityFilter.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPRequestProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GenericBlobSbsAuthModel.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/GetInsightsErrorKind.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/GetRecommendations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetTriggeredAnalyticsRuleRuns.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Gets.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubAuthModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubResourceInfo.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/GraphQuery.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HttpMethodVerb.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunt.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComment.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComments.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntOwner.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunts.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HypothesisStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Identity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTask.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskStatus.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTasks.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Indicator.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IndicatorObservablesItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionMode.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/InstructionStep.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepDetails.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/IoTCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Job.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobItem.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobProvisioningState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JwtAuthModel.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/MCASCheckRequirements.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/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/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/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/MTPDataConnectorDataTypesAlerts.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/ManualTriggerRequestBody.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/MetadataDependencyOperator.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/MicrosoftPurviewInformationProtectionCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Mode.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/MtpFilteredProviders.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpProvider.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NicEntity.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NoneAuthModel.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/OAuthModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypesLogs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectDataConnector.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/OfficeConsents.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/OfficePowerBICheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypesLogs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIDataConnector.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/OracleAuthModel.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/PackageBaseProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageModel.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/PremiumMdtiDataConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypesConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMicrosoftDefenderForThreatIntelligence.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackages.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackagesOperations.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/ProductTemplateModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplates.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplatesOperations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayConditionProperties.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/ProviderPermissionsScope.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProvisioningState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequest.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequestState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditCheckRequirements.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypes.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypesLogs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryCondition.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QuerySortBy.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Recommendation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatch.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ReevaluateResponse.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Reevaluates.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.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/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/RepositoryAccessKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessProperties.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryResourceInfo.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/ResourceProviderRequiredPermissions.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviders.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingConfig.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.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/SapSolutionUsageStatistic.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/SentinelEntityMapping.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.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/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/SortingDirection.java delete 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/SourceControlOperations.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/SourceKind.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceType.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/State.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Status.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/TIObject.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObjectKind.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/TemplateModel.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatActor.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/ThreatIntelligenceCount.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligences.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/TiType.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/TriggeredAnalyticsRuleRun.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRunOperations.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/Updates.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ValidationError.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Version.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Warning.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningBody.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningCode.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistProvisioningState.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Webhook.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkloadIdentityFederation.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignment.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentJobs.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignments.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfiguration.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfigurations.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroup.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroups.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMember.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMembers.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/azure-resourcemanager-securityinsights_metadata.json create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/azure-resourcemanager-securityinsights.properties create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleOperationTriggerRuleRunSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListSamples.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/ContentPackageOperationInstallSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationUninstallSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateInstallSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListSamples.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/DataConnectorsDisconnectSamples.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/EntitiesRunPlaybookSamples.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/FileImportsCreateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetSingleRecommendationSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookSamples.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/ProductPackageGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationListSamples.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/ProductTemplateGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateRecommendationSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListGeodataByIpSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListWhoisByDomainSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlOperationListRepositoriesSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsCreateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceQuerySamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/UpdateRecommendationSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListSamples.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsTests.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/{AadDataConnectorPropertiesTests.java => AADDataConnectorPropertiesTests.java} (63%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsTests.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/{AscDataConnectorPropertiesTests.java => AATPDataConnectorPropertiesTests.java} (59%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AWSAuthModelTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityCustomEntityQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesQueryDefinitionsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesQueryDefinitionsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplateTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityTimelineItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AddIncidentTaskActionPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertPropertyMappingTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatePropertiesBaseTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateWithMitrePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesSettingsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalyTimelineItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AssignmentItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AttackPatternTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleAddIncidentTaskActionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleBooleanConditionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayValuesConditionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AvailabilityTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3CheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesLogsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureDevOpsResourceInfoTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkEntityMappingsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandParametersTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseValueTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationsExpandWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkTimelineItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BooleanConditionPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpAuthConfigTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpResponseConfigTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingRequestPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingResponsePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessParametersTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesDataTypesItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesGraphQueriesItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesInstructionStepsItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesSampleQueriesItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionClauseTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectedEntityTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriteriaTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriterionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDataTypeTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsAvailabilityTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsPermissionsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsResourceProviderTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorInstructionModelBaseTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsInstallWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsUninstallWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesInstallWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CountQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomEntityQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomPermissionDetailsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectionsConfigTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorUiConfigTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsPermissionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DCRConfigurationTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionArmCollectionWrapperTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorTenantIdTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataTypeDefinitionsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentInfoTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesDynamics365CdsActivitiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainBodyTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisDetailsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisRegistrarDetailsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentIpAddressBodyTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRunPlaybookWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityEdgesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandParametersTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseValueTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityFieldMappingTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsParametersTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsResponseInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemQueryTimeIntervalTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityManualTriggerRequestBodyTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateWithResponseMockTests.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/{WatchlistsDeleteWithResponseMockTests.java => EntityQueriesDeleteWithResponseMockTests.java} (75%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesDataTypesItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineParametersTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineResponseInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ErrorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueriesPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultAggregationTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultsMetadataTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnSettingsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsCreateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileMetadataTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionScenarioExclusionPatternTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSettingsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSubTypeSettingTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFilterTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFiltersItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSettingTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSubTypeTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSubTypeSeverityFilterTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthModelTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPRequestPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsErrorKindTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsResultsMetadataTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetQueriesResponseTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubAuthModelTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubResourceInfoTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueriesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntOwnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IdentityTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorObservablesItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesAdditionalQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesDefaultTimeRangeTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesReferenceTimeRangeTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultColumnsItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepDetailsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsInstructionsItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/LastDataReceivedDataTypeTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsTests.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/{McasDataConnectorPropertiesTests.java => MCASDataConnectorPropertiesTests.java} (67%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsTests.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/{MdatpDataConnectorPropertiesTests.java => MDATPDataConnectorPropertiesTests.java} (62%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRulePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplatePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplateTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesAlertsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesIncidentsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ManualTriggerRequestBodyTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataAuthorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataCategoriesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataDependenciesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataModelInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPatchTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesPatchTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSourceTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSupportTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesLogsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeedTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpFilteredProvidersTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NoneAuthModelTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRulePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplatePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplateTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesLogsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsTests.java rename sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/{AatpDataConnectorPropertiesTests.java => OfficeATPDataConnectorPropertiesTests.java} (60%) create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesLogsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OracleAuthModelTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageBasePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageModelInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackagePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsCustomsItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsResourceProviderItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMicrosoftDefenderForThreatIntelligenceTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageModelInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateModelInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayConditionPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PullRequestTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesLogsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryConditionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QuerySortByTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendedSuggestionTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateResponseInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipHintTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepositoryTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RequiredPermissionsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderRequiredPermissionsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProvidersListWhoisByDomainWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestConfigTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestPagingConfigTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SampleQueriesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTimelineItemTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelEntityMappingTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingsInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectCommonPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TeamInformationTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateModelInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplatePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatActorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRulePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplatePropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplateTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTaxiiClientTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineAggregationTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineErrorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineResultsMetadataTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunsTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ValidationErrorTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkloadIdentityFederationTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberInnerTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberPropertiesTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetWithResponseMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListMockTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListTests.java create mode 100644 sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md index 4f49b3729636..70c3a907bf4b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md @@ -1,14 +1,1734 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2026-08-19) -### Features Added +- Azure Resource Manager Security Insights client library for Java. This package contains Microsoft Azure SDK for Security Insights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package api-version 2025-10-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.AlertRuleTemplatesList` was removed -### Other Changes +#### `models.ActionsList` was removed + +#### `models.WatchlistList` was removed + +#### `models.WatchlistItemList` was removed + +#### `models.IncidentCommentList` was removed + +#### `models.AlertRulesList` was removed + +#### `models.RelationList` was removed + +#### `models.IncidentList` was removed + +#### `models.SecurityMLAnalyticsSettingsList` was removed + +#### `models.Source` was removed + +#### `models.OperationsList` was removed + +#### `models.ThreatIntelligenceInformationList` was removed + +#### `models.AutomationRulesList` was removed + +#### `models.BookmarkList` was removed + +#### `models.DataConnectorList` was removed + +#### `models.Relation$DefinitionStages` was modified + +* `withExistingIncident(java.lang.String,java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.AutomationRuleCondition` was modified + +* `validate()` was removed + +#### `models.IncidentAdditionalData` was modified + +* `IncidentAdditionalData()` was changed to private access +* `validate()` was removed + +#### `models.TIDataConnector` was modified + +* `withEtag(java.lang.String)` was removed +* `validate()` was removed + +#### `models.OfficeDataConnector` was modified + +* `withEtag(java.lang.String)` was removed +* `validate()` was removed + +#### `models.AzureResourceEntity` was modified + +* `AzureResourceEntity()` was changed to private access +* `validate()` was removed + +#### `models.ScheduledAlertRuleTemplate` was modified + +* `ScheduledAlertRuleTemplate()` was changed to private access +* `withQueryFrequency(java.time.Duration)` was removed +* `withAlertDetailsOverride(models.AlertDetailsOverride)` was removed +* `withTactics(java.util.List)` was removed +* `validate()` was removed +* `withCustomDetails(java.util.Map)` was removed +* `withTriggerThreshold(java.lang.Integer)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withRequiredDataConnectors(java.util.List)` was removed +* `withDescription(java.lang.String)` was removed +* `withStatus(models.TemplateStatus)` was removed +* `withQueryPeriod(java.time.Duration)` was removed +* `withVersion(java.lang.String)` was removed +* `withTechniques(java.util.List)` was removed +* `withSeverity(models.AlertSeverity)` was removed +* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed +* `withQuery(java.lang.String)` was removed +* `withTriggerOperator(models.TriggerOperator)` was removed +* `withEventGroupingSettings(models.EventGroupingSettings)` was removed +* `withEntityMappings(java.util.List)` was removed + +#### `models.ActionPropertiesBase` was modified + +* `validate()` was removed + +#### `models.PropertyArrayChangedConditionProperties` was modified + +* `validate()` was removed + +#### `models.FusionAlertRuleTemplate` was modified + +* `FusionAlertRuleTemplate()` was changed to private access +* `withTechniques(java.util.List)` was removed +* `validate()` was removed +* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed +* `withDescription(java.lang.String)` was removed +* `withSeverity(models.AlertSeverity)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withRequiredDataConnectors(java.util.List)` was removed +* `withStatus(models.TemplateStatus)` was removed +* `withTactics(java.util.List)` was removed + +#### `models.Watchlist$Update` was modified + +* `withSource(models.Source)` was removed + +#### `models.IoTDeviceEntity` was modified + +* `IoTDeviceEntity()` was changed to private access +* `java.util.UUID iotSecurityAgentId()` -> `java.lang.String iotSecurityAgentId()` +* `validate()` was removed + +#### `models.GeoLocation` was modified + +* `GeoLocation()` was changed to private access +* `validate()` was removed + +#### `models.Watchlist$Definition` was modified + +* `withSource(models.Source)` was removed + +#### `models.PropertyConditionProperties` was modified + +* `validate()` was removed + +#### `models.ClientInfo` was modified + +* `java.util.UUID objectId()` -> `java.lang.String objectId()` +* `validate()` was removed +* `withObjectId(java.util.UUID)` was removed + +#### `models.PlaybookActionProperties` was modified + +* `java.util.UUID tenantId()` -> `java.lang.String tenantId()` +* `withTenantId(java.util.UUID)` was removed +* `validate()` was removed + +#### `models.AccountEntity` was modified + +* `AccountEntity()` was changed to private access +* `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` +* `validate()` was removed + +#### `models.IncidentPropertiesAction` was modified + +* `validate()` was removed + +#### `models.EntityCommonProperties` was modified + +* `validate()` was removed + +#### `models.IncidentOwnerInfo` was modified + +* `validate()` was removed +* `java.util.UUID objectId()` -> `java.lang.String objectId()` +* `withObjectId(java.util.UUID)` was removed + +#### `models.RegistryKeyEntity` was modified + +* `RegistryKeyEntity()` was changed to private access +* `validate()` was removed + +#### `models.AwsCloudTrailDataConnector` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.AutomationRulePropertyValuesCondition` was modified + +* `validate()` was removed + +#### `models.AutomationRuleTriggeringLogic` was modified + +* `validate()` was removed + +#### `models.Relation$Definition` was modified + +* `withExistingIncident(java.lang.String,java.lang.String,java.lang.String)` was removed + +#### `models.GroupingConfiguration` was modified + +* `validate()` was removed + +#### `models.ScheduledAlertRuleCommonProperties` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligenceMetric` was modified + +* `ThreatIntelligenceMetric()` was changed to private access +* `withLastUpdatedTimeUtc(java.lang.String)` was removed +* `withThreatTypeMetrics(java.util.List)` was removed +* `withPatternTypeMetrics(java.util.List)` was removed +* `validate()` was removed +* `withSourceMetrics(java.util.List)` was removed + +#### `models.OfficeDataConnectorDataTypes` was modified + +* `validate()` was removed + +#### `models.ScheduledAlertRule` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.PropertyChangedConditionProperties` was modified + +* `validate()` was removed + +#### `models.FileHashEntity` was modified + +* `FileHashEntity()` was changed to private access +* `validate()` was removed + +#### `models.AlertDetailsOverride` was modified + +* `validate()` was removed + +#### `models.AlertRuleTemplateDataSource` was modified + +* `AlertRuleTemplateDataSource()` was changed to private access +* `validate()` was removed +* `withDataTypes(java.util.List)` was removed +* `withConnectorId(java.lang.String)` was removed + +#### `models.EventGroupingSettings` was modified + +* `validate()` was removed + +#### `models.MdatpDataConnector` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed +* `withDescription(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed + +#### `models.MicrosoftSecurityIncidentCreationAlertRule` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.Entity` was modified + +* `validate()` was removed + +#### `models.OfficeDataConnectorDataTypesTeams` was modified + +* `validate()` was removed + +#### `models.OfficeDataConnectorDataTypesExchange` was modified + +* `validate()` was removed + +#### `models.IncidentLabel` was modified + +* `validate()` was removed + +#### `models.SubmissionMailEntity` was modified + +* `SubmissionMailEntity()` was changed to private access +* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` +* `validate()` was removed +* `java.util.UUID submissionId()` -> `java.lang.String submissionId()` + +#### `models.AadDataConnector` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.ResourceWithEtag` was modified + +* `validate()` was removed + +#### `models.DataConnectorWithAlertsProperties` was modified + +* `validate()` was removed + +#### `models.MalwareEntity` was modified + +* `MalwareEntity()` was changed to private access +* `validate()` was removed + +#### `models.Watchlist` was modified + +* `models.Source source()` -> `java.lang.String source()` + +#### `models.ThreatIntelligenceSortingCriteria` was modified + +* `validate()` was removed + +#### `models.SecurityAlert` was modified + +* `SecurityAlert()` was changed to private access +* `validate()` was removed +* `withSeverity(models.AlertSeverity)` was removed + +#### `models.CloudApplicationEntity` was modified + +* `CloudApplicationEntity()` was changed to private access +* `validate()` was removed + +#### `models.AscDataConnector` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.ThreatIntelligenceGranularMarkingModel` was modified + +* `validate()` was removed + +#### `models.McasDataConnector` was modified + +* `withEtag(java.lang.String)` was removed +* `validate()` was removed + +#### `models.IncidentConfiguration` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligenceKillChainPhase` was modified + +* `validate()` was removed + +#### `models.SecurityMLAnalyticsSettingsDataSource` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligenceMetricEntity` was modified + +* `ThreatIntelligenceMetricEntity()` was changed to private access +* `validate()` was removed +* `withMetricName(java.lang.String)` was removed +* `withMetricValue(java.lang.Integer)` was removed + +#### `models.MailboxEntity` was modified + +* `MailboxEntity()` was changed to private access +* `validate()` was removed +* `java.util.UUID externalDirectoryObjectId()` -> `java.lang.String externalDirectoryObjectId()` + +#### `SecurityInsightsManager` was modified + +* `fluent.SecurityInsights serviceClient()` -> `fluent.SecurityInsightsManagementClient serviceClient()` + +#### `models.HostEntity` was modified + +* `HostEntity()` was changed to private access +* `withOsFamily(models.OSFamily)` was removed +* `validate()` was removed + +#### `models.AlertsDataTypeOfDataConnector` was modified + +* `validate()` was removed + +#### `models.RegistryValueEntity` was modified + +* `RegistryValueEntity()` was changed to private access +* `validate()` was removed + +#### `models.AwsCloudTrailDataConnectorDataTypesLogs` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligenceExternalReference` was modified + +* `validate()` was removed + +#### `models.AutomationRuleAction` was modified + +* `validate()` was removed + +#### `models.AutomationRulePropertyValuesChangedCondition` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligenceFilteringCriteria` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligenceMetrics` was modified + +* `ThreatIntelligenceMetrics()` was changed to private access +* `validate()` was removed +* `withProperties(models.ThreatIntelligenceMetric)` was removed + +#### `models.SecurityGroupEntity` was modified + +* `SecurityGroupEntity()` was changed to private access +* `validate()` was removed +* `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` + +#### `models.ActionRequest` was modified + +* `validate()` was removed + +#### `models.McasDataConnectorDataTypes` was modified + +* `validate()` was removed + +#### `models.AatpDataConnector` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.AnomalySecurityMLAnalyticsSettings` was modified + +* `java.util.UUID settingsDefinitionId()` -> `java.lang.String settingsDefinitionId()` +* `withSettingsDefinitionId(java.util.UUID)` was removed +* `withEtag(java.lang.String)` was removed +* `validate()` was removed + +#### `models.AwsCloudTrailDataConnectorDataTypes` was modified + +* `validate()` was removed + +#### `models.MicrosoftSecurityIncidentCreationAlertRuleCommonProperties` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligenceIndicatorModel` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.EntityMapping` was modified + +* `validate()` was removed + +#### `models.SecurityAlertPropertiesConfidenceReasonsItem` was modified + +* `SecurityAlertPropertiesConfidenceReasonsItem()` was changed to private access +* `validate()` was removed + +#### `models.MicrosoftSecurityIncidentCreationAlertRuleTemplate` was modified + +* `MicrosoftSecurityIncidentCreationAlertRuleTemplate()` was changed to private access +* `validate()` was removed +* `withRequiredDataConnectors(java.util.List)` was removed +* `withSeveritiesFilter(java.util.List)` was removed +* `withDisplayNamesFilter(java.util.List)` was removed +* `withDescription(java.lang.String)` was removed +* `withProductFilter(models.MicrosoftSecurityProductName)` was removed +* `withDisplayNamesExcludeFilter(java.util.List)` was removed +* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withStatus(models.TemplateStatus)` was removed + +#### `models.ThreatIntelligenceParsedPatternTypeValue` was modified + +* `validate()` was removed + +#### `models.AutomationRuleModifyPropertiesAction` was modified + +* `validate()` was removed + +#### `models.AutomationRulePropertyArrayChangedValuesCondition` was modified + +* `validate()` was removed + +#### `models.DnsEntity` was modified + +* `DnsEntity()` was changed to private access +* `validate()` was removed + +#### `models.Watchlists` was modified + +* `deleteWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `com.azure.core.http.rest.Response deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` + +#### `models.FileEntity` was modified + +* `FileEntity()` was changed to private access +* `validate()` was removed + +#### `models.HuntingBookmark` was modified + +* `HuntingBookmark()` was changed to private access +* `withCreated(java.time.OffsetDateTime)` was removed +* `withCreatedBy(models.UserInfo)` was removed +* `withIncidentInfo(models.IncidentInfo)` was removed +* `withQueryResult(java.lang.String)` was removed +* `withLabels(java.util.List)` was removed +* `withUpdated(java.time.OffsetDateTime)` was removed +* `withQuery(java.lang.String)` was removed +* `withDisplayName(java.lang.String)` was removed +* `validate()` was removed +* `withUpdatedBy(models.UserInfo)` was removed +* `withNotes(java.lang.String)` was removed +* `withEventTime(java.time.OffsetDateTime)` was removed + +#### `models.ThreatIntelligenceAppendTags` was modified + +* `validate()` was removed + +#### `models.MailClusterEntity` was modified + +* `MailClusterEntity()` was changed to private access +* `validate()` was removed + +#### `models.IncidentEntitiesResultsMetadata` was modified + +* `IncidentEntitiesResultsMetadata()` was changed to private access +* `withEntityKind(models.EntityKindEnum)` was removed +* `withCount(int)` was removed +* `validate()` was removed + +#### `models.FusionAlertRule` was modified + +* `validate()` was removed +* `withEtag(java.lang.String)` was removed + +#### `models.IncidentRelations` was modified + +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `define(java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed +* `getById(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.TIDataConnectorDataTypes` was modified + +* `validate()` was removed + +#### `models.DataConnectorDataTypeCommon` was modified + +* `validate()` was removed + +#### `models.AutomationRuleRunPlaybookAction` was modified + +* `validate()` was removed + +#### `models.UserInfo` was modified + +* `validate()` was removed +* `java.util.UUID objectId()` -> `java.lang.String objectId()` +* `withObjectId(java.util.UUID)` was removed + +#### `models.MailMessageEntity` was modified + +* `MailMessageEntity()` was changed to private access +* `withDeliveryLocation(models.DeliveryLocation)` was removed +* `withBodyFingerprintBin3(java.lang.Integer)` was removed +* `withBodyFingerprintBin2(java.lang.Integer)` was removed +* `withDeliveryAction(models.DeliveryAction)` was removed +* `withBodyFingerprintBin4(java.lang.Integer)` was removed +* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` +* `withAntispamDirection(models.AntispamMailDirection)` was removed +* `withBodyFingerprintBin5(java.lang.Integer)` was removed +* `withBodyFingerprintBin1(java.lang.Integer)` was removed +* `validate()` was removed + +#### `models.ThreatIntelligenceParsedPattern` was modified + +* `validate()` was removed + +#### `models.UrlEntity` was modified + +* `UrlEntity()` was changed to private access +* `validate()` was removed + +#### `models.FieldMapping` was modified + +* `validate()` was removed + +#### `models.ThreatIntelligence` was modified + +* `ThreatIntelligence()` was changed to private access +* `validate()` was removed + +#### `models.OfficeDataConnectorDataTypesSharePoint` was modified + +* `validate()` was removed + +#### `models.IpEntity` was modified + +* `IpEntity()` was changed to private access +* `validate()` was removed + +#### `models.ProcessEntity` was modified + +* `ProcessEntity()` was changed to private access +* `withElevationToken(models.ElevationToken)` was removed +* `validate()` was removed + +#### `models.IncidentInfo` was modified + +* `validate()` was removed + +#### `models.TIDataConnectorDataTypesIndicators` was modified + +* `validate()` was removed + +### Features Added + +* `models.InsightQueryItemPropertiesReferenceTimeRange` was added + +* `models.FusionSourceSettings` was added + +* `models.AwsS3CheckRequirements` was added + +* `models.AATPCheckRequirements` was added + +* `models.ExpansionResultsMetadata` was added + +* `models.Metadatas` was added + +* `models.DeploymentState` was added + +* `models.ExpansionEntityQuery` was added + +* `models.WorkspaceManagerGroups` was added + +* `models.ConnectorDefinitionsAvailability` was added + +* `models.EnrichmentDomainWhoisContact` was added + +* `models.EntityQueries` was added + +* `models.SourceKind` was added + +* `models.ThreatIntelligenceAlertRuleTemplate` was added + +* `models.EntityQueryItemProperties` was added + +* `models.ThreatIntelligenceAlertRule` was added + +* `models.Flag` was added + +* `models.Anomalies` was added + +* `models.IoTCheckRequirements` was added + +* `models.Hunt$Update` was added + +* `models.TimelineError` was added + +* `models.EntityTimelineParameters` was added + +* `models.DeploymentFetchStatus` was added + +* `models.AlertPropertyMapping` was added + +* `models.NicEntity` was added + +* `models.TiTaxiiCheckRequirements` was added + +* `models.WorkspaceManagerMember` was added + +* `models.Hunt$DefinitionStages` was added + +* `models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem` was added + +* `models.HuntRelation$Update` was added + +* `models.ThreatIntelligences` was added + +* `models.GitHubResourceInfo` was added + +* `models.ApiKeyAuthModel` was added + +* `models.MetadataDependencies` was added + +* `models.RestApiPollerDataConnector` was added + +* `models.ActivityEntityQueriesPropertiesQueryDefinitions` was added + +* `models.IncidentTask$DefinitionStages` was added + +* `models.BookmarkEntityMappings` was added + +* `models.ResourceProviders` was added + +* `models.EntityGetInsightsResponse` was added + +* `models.RelationshipHint` was added + +* `models.TimelineAggregation` was added + +* `models.EyesOn` was added + +* `models.PropertyArrayConditionProperties` was added + +* `models.ConnectorDefinitionsPermissions` was added + +* `models.FusionSubTypeSeverityFilter` was added + +* `models.Error` was added + +* `models.AutomationRulePropertyArrayConditionSupportedArrayConditionType` was added + +* `models.ProductPackagesOperations` was added + +* `models.ContentType` was added + +* `models.DeviceImportance` was added + +* `models.FusionScenarioExclusionPattern` was added + +* `models.OfficeIRMDataConnector` was added + +* `models.PackageModel$DefinitionStages` was added + +* `models.Office365ProjectCheckRequirements` was added + +* `models.EntityExpandParameters` was added + +* `models.MDATPCheckRequirements` was added + +* `models.SessionAuthModel` was added + +* `models.DataConnectorAuthorizationState` was added + +* `models.PurviewAuditCheckRequirements` was added + +* `models.IndicatorObservablesItem` was added + +* `models.AlertProperty` was added + +* `models.QuerySortBy` was added + +* `models.WorkspaceManagerAssignments` was added + +* `models.InsightsTableResultColumnsItem` was added + +* `models.MTPDataConnector` was added + +* `models.SourceControl` was added + +* `models.ContentPackages` was added + +* `models.EntitiesGetTimelines` was added + +* `models.TiTaxiiDataConnectorDataTypesTaxiiClient` was added + +* `models.ActivityEntityQueryTemplatePropertiesQueryDefinitions` was added + +* `models.ConnectedEntity` was added + +* `models.ConditionProperties` was added + +* `models.PermissionsCustomsItem` was added + +* `models.DataConnectorConnectBody` was added + +* `models.RestApiPollerRequestConfig` was added + +* `models.AutomationRuleAddIncidentTaskAction` was added + +* `models.GitHubAuthModel` was added + +* `models.FusionTemplateSourceSubType` was added + +* `models.ConnectorInstructionModelBase` was added + +* `models.WorkspaceManagerMember$Definition` was added + +* `models.HuntComment$Definition` was added + +* `models.ConnectivityCriteria` was added + +* `models.RepositoryAccessKind` was added + +* `models.WorkspaceManagerGroup$UpdateStages` was added + +* `models.MSTIDataConnectorDataTypes` was added + +* `models.EntityInsightItem` was added + +* `models.MetadataAuthor` was added + +* `models.CcpAuthConfig` was added + +* `models.FusionSubTypeSeverityFiltersItem` was added + +* `models.CustomPermissionDetails` was added + +* `models.CodelessConnectorPollingResponseProperties` was added + +* `models.RecommendationPatchProperties` was added + +* `models.AwsS3DataConnectorDataTypesLogs` was added + +* `models.EntityItemQueryKind` was added + +* `models.QueryCondition` was added + +* `models.EntityType` was added + +* `models.DataConnectorRequirementsState` was added + +* `models.TemplateModel$Definition` was added + +* `models.HuntComment` was added + +* `models.WorkspaceManagerMember$UpdateStages` was added + +* `models.EntityTimelineResponse` was added + +* `models.AutomationRulePropertyArrayValuesCondition` was added + +* `models.AlertRuleTemplatePropertiesBase` was added + +* `models.GCPAuthProperties` was added + +* `models.GetInsightsErrorKind` was added + +* `models.WorkspaceManagerGroup$Definition` was added + +* `models.ProductTemplatesOperations` was added + +* `models.WorkspaceManagerAssignment$UpdateStages` was added + +* `models.EntityInsightItemQueryTimeInterval` was added + +* `models.Connective` was added + +* `models.OfficeATPDataConnector` was added + +* `models.TIObjectKind` was added + +* `models.JobProvisioningState` was added + +* `models.TemplateModel$UpdateStages` was added + +* `models.ProductTemplates` was added + +* `models.HuntComment$UpdateStages` was added + +* `models.ProvisioningState` was added + +* `models.HuntComment$Update` was added + +* `models.SortingDirection` was added + +* `models.BookmarkExpandResponse` was added + +* `models.AlertRuleTemplateWithMitreProperties` was added + +* `models.CustomEntityQueryKind` was added + +* `models.Warning` was added + +* `models.ResourceProvider` was added + +* `models.MicrosoftPurviewInformationProtectionDataConnector` was added + +* `models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs` was added + +* `models.Indicator` was added + +* `models.MetadataModel$UpdateStages` was added + +* `models.PackageModel` was added + +* `models.MetadataSupport` was added + +* `models.PackageModel$Update` was added + +* `models.PurviewAuditConnectorDataTypesLogs` was added + +* `models.WorkspaceManagerConfiguration$Definition` was added + +* `models.ExpansionResultAggregation` was added + +* `models.WorkspaceManagerAssignment` was added + +* `models.ProviderPermissionsScope` was added + +* `models.BookmarkOperations` was added + +* `models.AssignmentItem` was added + +* `models.NrtAlertRule` was added + +* `models.Query` was added + +* `models.WorkspaceManagerConfiguration$Update` was added + +* `models.ActivityTimelineItem` was added + +* `models.TriggeredAnalyticsRuleRun` was added + +* `models.CustomsPermission` was added + +* `models.RecommendationPatch` was added + +* `models.CodelessUiConnectorConfigPropertiesSampleQueriesItem` was added + +* `models.Dynamics365DataConnectorDataTypes` was added + +* `models.ConnectorDataType` was added + +* `models.NoneAuthModel` was added + +* `models.WorkspaceManagerGroup$Update` was added + +* `models.Mode` was added + +* `models.MetadataSource` was added + +* `models.TemplateModel$Update` was added + +* `models.RequiredPermissions` was added + +* `models.Deployment` was added + +* `models.Hunt$Definition` was added + +* `models.MtpProvider` was added + +* `models.BillingStatisticKind` was added + +* `models.MicrosoftPurviewInformationProtectionConnectorDataTypes` was added + +* `models.ContentTemplates` was added + +* `models.AddIncidentTaskActionProperties` was added + +* `models.ReevaluateResponse` was added + +* `models.CodelessConnectorPollingPagingProperties` was added + +* `models.Recommendation` was added + +* `models.InsightQueryItem` was added + +* `models.SentinelEntityMapping` was added + +* `models.TiTaxiiDataConnector` was added + +* `models.Hunt$UpdateStages` was added + +* `models.MetadataModel$DefinitionStages` was added + +* `models.TimelineResultsMetadata` was added + +* `models.AwsCloudTrailCheckRequirements` was added + +* `models.EntityQuery` was added + +* `models.PackageModel$UpdateStages` was added + +* `models.SecurityAlertTimelineItem` was added + +* `models.AwsS3DataConnector` was added + +* `models.MLBehaviorAnalyticsAlertRule` was added + +* `models.PackageKind` was added + +* `models.Permissions` was added + +* `models.CodelessUiDataConnector` was added + +* `models.AzureDevOpsResourceInfo` was added + +* `models.CustomEntityQuery` was added + +* `models.SupportTier` was added + +* `models.MSTIDataConnector` was added + +* `models.OfficeATPCheckRequirements` was added + +* `models.WatchlistProvisioningState` was added + +* `models.BillingStatistics` was added + +* `models.Version` was added + +* `models.LastDataReceivedDataType` was added + +* `models.WorkspaceManagerMember$Update` was added + +* `models.MetadataPatch` was added + +* `models.GetTriggeredAnalyticsRuleRuns` was added + +* `models.ActivityEntityQueryTemplate` was added + +* `models.Office365ProjectConnectorDataTypesLogs` was added + +* `models.RepositoryResourceInfo` was added + +* `models.ValidationError` was added + +* `models.CodelessUiConnectorConfigPropertiesGraphQueriesItem` was added + +* `models.MSTICheckRequirements` was added + +* `models.RepoType` was added + +* `models.TemplateModel$DefinitionStages` was added + +* `models.OfficePowerBIConnectorDataTypes` was added + +* `models.OutputType` was added + +* `models.ConnectivityCriterion` was added + +* `models.SettingKind` was added + +* `models.OfficePowerBICheckRequirements` was added + +* `models.WarningCode` was added + +* `models.Dynamics365CheckRequirements` was added + +* `models.SourceControl$DefinitionStages` was added + +* `models.CodelessUiConnectorConfigProperties` was added + +* `models.PollingFrequency` was added + +* `models.GraphQuery` was added + +* `models.Repository` was added + +* `models.EntityQueryTemplate` was added + +* `models.WorkspaceManagerAssignment$DefinitionStages` was added + +* `models.InstructionStepsInstructionsItem` was added + +* `models.EntityEdges` was added + +* `models.EntityFieldMapping` was added + +* `models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem` was added + +* `models.WorkloadIdentityFederation` was added + +* `models.MetadataModel$Definition` was added + +* `models.WorkspaceManagerConfiguration` was added + +* `models.DeleteStatus` was added + +* `models.PremiumMdtiDataConnectorDataTypesConnector` was added + +* `models.IncidentTask$Update` was added + +* `models.AutomationRuleBooleanCondition` was added + +* `models.DataConnectorsCheckRequirements` was added + +* `models.CodelessConnectorPollingConfigProperties` was added + +* `models.ActivityEntityQuery` was added + +* `models.DeploymentInfo` was added + +* `models.InsightQueryItemPropertiesTableQuery` was added + +* `models.AutomationRulePropertyArrayConditionSupportedArrayType` was added + +* `models.InsightQueryItemPropertiesDefaultTimeRange` was added + +* `models.Updates` was added + +* `models.InsightQueryItemProperties` was added + +* `models.OfficeIRMCheckRequirements` was added + +* `models.AlertRuleOperations` was added + +* `models.RestApiPollerRequestPagingKind` was added + +* `models.EntityAnalytics` was added + +* `models.ProductPackageModel` was added + +* `models.IncidentTaskStatus` was added + +* `models.CodelessUiConnectorConfigPropertiesDataTypesItem` was added + +* `models.EntityExpandResponse` was added + +* `models.IncidentTask$Definition` was added + +* `models.SourceType` was added + +* `models.MLBehaviorAnalyticsAlertRuleTemplate` was added + +* `models.HuntComment$DefinitionStages` was added + +* `models.Relationship` was added + +* `models.TIObject` was added + +* `models.GetRecommendations` was added + +* `models.MicrosoftPurviewInformationProtectionCheckRequirements` was added + +* `models.CustomizableConnectorDefinition` was added + +* `models.BasicAuthModel` was added + +* `models.HttpMethodVerb` was added + +* `models.Repo` was added + +* `models.EntityGetInsightsParameters` was added + +* `models.CustomizableConnectionsConfig` was added + +* `models.TriggeredAnalyticsRuleRunOperations` was added + +* `models.IncidentTask$UpdateStages` was added + +* `models.EntityTimelineKind` was added + +* `models.NrtAlertRuleTemplate` was added + +* `models.AwsS3DataConnectorDataTypes` was added + +* `models.Hunt` was added + +* `models.ProviderName` was added + +* `models.PremiumMdtiDataConnectorDataTypes` was added + +* `models.PermissionsResourceProviderItem` was added + +* `models.PackageBaseProperties` was added + +* `models.BookmarkTimelineItem` was added + +* `models.SourceControls` was added + +* `models.ServicePrincipal` was added + +* `models.PullRequest` was added + +* `models.DataConnectorDefinitions` was added + +* `models.PackageModel$Definition` was added + +* `models.Kind` was added + +* `models.HuntRelation$DefinitionStages` was added + +* `models.InstructionSteps` was added + +* `models.IncidentTasks` was added + +* `models.IncidentTask` was added + +* `models.IngestionMode` was added + +* `models.CodelessConnectorPollingAuthProperties` was added + +* `models.BookmarkExpandResponseValue` was added + +* `models.DataTypeDefinitions` was added + +* `models.FileImport$DefinitionStages` was added + +* `models.GetInsightsError` was added + +* `models.EntityQueryKind` was added + +* `models.GetInsightsResultsMetadata` was added + +* `models.Operator` was added + +* `models.AWSAuthModel` was added + +* `models.MtpCheckRequirements` was added + +* `models.MetadataModel` was added + +* `models.Gets` was added + +* `models.HuntOwner` was added + +* `models.EntityTimelineItem` was added + +* `models.ManualTriggerRequestBody` was added + +* `models.AnomalyTimelineItem` was added + +* `models.DCRConfiguration` was added + +* `models.MtpFilteredProviders` was added + +* `models.HypothesisStatus` was added + +* `models.ContentTemplatesOperations` was added + +* `models.Entities` was added + +* `models.ConnectivityType` was added + +* `models.JwtAuthModel` was added + +* `models.DataConnectorTenantId` was added + +* `models.EnrichmentDomainBody` was added + +* `models.SourceControlOperations` was added + +* `models.ProductTemplateModel` was added + +* `models.PermissionProviderScope` was added + +* `models.PurviewAuditDataConnector` was added + +* `models.OracleAuthModel` was added + +* `models.MetadataModel$Update` was added + +* `models.InsightQueryItemPropertiesAdditionalQuery` was added + +* `models.Job` was added + +* `models.EntityManualTriggerRequestBody` was added + +* `models.SourceControl$Definition` was added + +* `models.DataConnectorLicenseState` was added + +* `models.EntityQueryItem` was added + +* `models.Hunts` was added + +* `models.ThreatActor` was added + +* `models.MCASCheckRequirements` was added + +* `models.ProductPackages` was added + +* `models.ResourceProviderRequiredPermissions` was added + +* `models.SapSolutionUsageStatistic` was added + +* `models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem` was added + +* `models.CustomizableConnectorUiConfig` was added + +* `models.WorkspaceManagerConfiguration$UpdateStages` was added + +* `models.Settings` was added + +* `models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities` was added + +* `models.EntityExpandResponseValue` was added + +* `models.MetadataCategories` was added + +* `models.EntityProviders` was added + +* `models.HuntRelations` was added + +* `models.ConnectorDefinitionsResourceProvider` was added + +* `models.EntitiesRelations` was added + +* `models.CodelessConnectorPollingRequestProperties` was added + +* `models.FileImportState` was added + +* `models.GCPAuthModel` was added + +* `models.ConnectAuthKind` was added + +* `models.PurviewAuditConnectorDataTypes` was added + +* `models.EntityQueryTemplateKind` was added + +* `models.ThreatIntelligenceCount` was added + +* `models.Office365ProjectConnectorDataTypes` was added + +* `models.FileMetadata` was added + +* `models.EnrichmentIpAddressBody` was added + +* `models.FileFormat` was added + +* `models.CcpAuthType` was added + +* `models.CcpResponseConfig` was added + +* `models.FusionSourceSubTypeSetting` was added + +* `models.DataConnectorDefinition` was added + +* `models.EnrichmentDomainWhoisContacts` was added + +* `models.FileImport` was added + +* `models.EntityRelations` was added + +* `models.MetadataDependencyOperator` was added + +* `models.FileImportContentType` was added + +* `models.AnalyticsRuleRunTrigger` was added + +* `models.ContentPackageOperations` was added + +* `models.PullRequestState` was added + +* `models.WarningBody` was added + +* `models.Office365ProjectDataConnector` was added + +* `models.RepositoryAccessProperties` was added + +* `models.EnrichmentDomainWhoisDetails` was added + +* `models.EnrichmentIpGeodata` was added + +* `models.TICheckRequirements` was added + +* `models.WorkspaceManagerMembers` was added + +* `models.ProductSettings` was added + +* `models.HuntComments` was added + +* `models.EntityQueryItemPropertiesDataTypesItem` was added + +* `models.AttackPattern` was added + +* `models.IoTDataConnector` was added + +* `models.WorkspaceManagerConfiguration$DefinitionStages` was added + +* `models.State` was added + +* `models.TeamInformation` was added + +* `models.OfficePowerBIConnectorDataTypesLogs` was added + +* `models.TiType` was added + +* `models.Reevaluates` was added + +* `models.WorkspaceManagerGroup` was added + +* `models.FileImports` was added + +* `models.TiTaxiiDataConnectorDataTypes` was added + +* `models.MTPDataConnectorDataTypesAlerts` was added + +* `models.DataConnectorDefinitionKind` was added + +* `models.TemplateModel` was added + +* `models.ConditionClause` was added + +* `models.Identity` was added + +* `models.WorkspaceManagerAssignment$Update` was added + +* `models.MTPDataConnectorDataTypesIncidents` was added + +* `models.CodelessUiConnectorConfigPropertiesInstructionStepsItem` was added + +* `models.CodelessApiPollingDataConnector` was added + +* `models.ASCCheckRequirements` was added + +* `models.Webhook` was added + +* `models.WorkspaceManagerConfigurations` was added + +* `models.InstructionStep` was added + +* `models.PremiumMicrosoftDefenderForThreatIntelligence` was added + +* `models.DeploymentResult` was added + +* `models.OfficeConsent` was added + +* `models.BooleanConditionProperties` was added + +* `models.AvailabilityStatus` was added + +* `models.ActivityCustomEntityQuery` was added + +* `models.CountQuery` was added + +* `models.RestApiPollerRequestPagingConfig` was added + +* `models.HuntRelation` was added + +* `models.WorkspaceManagerAssignment$Definition` was added + +* `models.WorkspaceManagerAssignmentJobs` was added + +* `models.SettingType` was added + +* `models.InsightsTableResult` was added + +* `models.GraphQueries` was added + +* `models.Status` was added + +* `models.OfficeConsents` was added + +* `models.DataConnectorsCheckRequirementsOperations` was added + +* `models.EnrichmentDomainWhois` was added + +* `models.Dynamics365DataConnector` was added + +* `models.BillingStatistic` was added + +* `models.GCPRequestProperties` was added + +* `models.OfficePowerBIDataConnector` was added + +* `models.EnrichmentDomainWhoisRegistrarDetails` was added + +* `models.OAuthModel` was added + +* `models.BookmarkExpandParameters` was added + +* `models.FileImport$Definition` was added + +* `models.BookmarkRelations` was added + +* `models.GCPDataConnector` was added + +* `models.JobItem` was added + +* `models.WorkspaceManagerMember$DefinitionStages` was added + +* `models.EnrichmentType` was added + +* `models.AutomationRuleBooleanConditionSupportedOperator` was added + +* `models.SampleQueries` was added + +* `models.UebaDataSources` was added + +* `models.HuntRelation$UpdateStages` was added + +* `models.FusionTemplateSubTypeSeverityFilter` was added + +* `models.RecommendedSuggestion` was added + +* `models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem` was added + +* `models.AADCheckRequirements` was added + +* `models.HuntRelation$Definition` was added + +* `models.Customs` was added + +* `models.Ueba` was added + +* `models.MTPDataConnectorDataTypes` was added + +* `models.WorkspaceManagerGroup$DefinitionStages` was added + +* `models.GenericBlobSbsAuthModel` was added + +* `models.Availability` was added + +* `models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed` was added + +* `models.EntityQueryTemplates` was added + +* `models.FusionTemplateSourceSetting` was added + +* `models.InstructionStepDetails` was added + +#### `models.IncidentAdditionalData` was modified + +* `mergedIncidentUrl()` was added +* `providerIncidentUrl()` was added +* `techniques()` was added +* `mergedIncidentNumber()` was added + +#### `models.ScheduledAlertRuleTemplate` was modified + +* `subTechniques()` was added +* `sentinelEntitiesMappings()` was added + +#### `models.FusionAlertRuleTemplate` was modified + +* `subTechniques()` was added +* `sourceSettings()` was added + +#### `models.Watchlist$Update` was modified + +* `withSourceType(models.SourceType)` was added +* `withSource(java.lang.String)` was added + +#### `models.IoTDeviceEntity` was modified + +* `deviceSubType()` was added +* `zone()` was added +* `nicEntityIds()` was added +* `owners()` was added +* `sensor()` was added +* `isScanner()` was added +* `purdueLayer()` was added +* `site()` was added +* `isAuthorized()` was added +* `isProgramming()` was added +* `importance()` was added + +#### `models.Watchlist$Definition` was modified + +* `withSourceType(models.SourceType)` was added +* `withSource(java.lang.String)` was added + +#### `models.Bookmark$Update` was modified + +* `withTactics(java.util.List)` was added +* `withTechniques(java.util.List)` was added +* `withEntityMappings(java.util.List)` was added + +#### `models.ConditionType` was modified + +* `PROPERTY_ARRAY` was added +* `BOOLEAN` was added + +#### `models.ClientInfo` was modified + +* `withObjectId(java.lang.String)` was added + +#### `models.PlaybookActionProperties` was modified + +* `withTenantId(java.lang.String)` was added + +#### `models.MicrosoftSecurityProductName` was modified + +* `OFFICE_365_ADVANCED_THREAT_PROTECTION` was added +* `MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION` was added + +#### `models.IncidentOwnerInfo` was modified + +* `withObjectId(java.lang.String)` was added + +#### `models.AutomationRulePropertyConditionSupportedProperty` was modified + +* `INCIDENT_CUSTOM_DETAILS_KEY` was added +* `INCIDENT_CUSTOM_DETAILS_VALUE` was added +* `INCIDENT_ALERT_TITLE` was added +* `INCIDENT_CUSTOM_DETECTION_RULE_IDS` was added + +#### `models.DataConnectorKind` was modified + +* `MICROSOFT_THREAT_PROTECTION` was added +* `GENERIC_UI` was added +* `OFFICE_ATP` was added +* `PREMIUM_MICROSOFT_DEFENDER_FOR_THREAT_INTELLIGENCE` was added +* `MICROSOFT_THREAT_INTELLIGENCE` was added +* `AMAZON_WEB_SERVICES_S3` was added +* `OFFICE_IRM` was added +* `MICROSOFT_PURVIEW_INFORMATION_PROTECTION` was added +* `DYNAMICS365` was added +* `PURVIEW_AUDIT` was added +* `IOT` was added +* `OFFICE365PROJECT` was added +* `OFFICE_POWER_BI` was added +* `GCP` was added +* `APIPOLLING` was added +* `REST_API_POLLER` was added +* `THREAT_INTELLIGENCE_TAXII` was added + +#### `models.Relation$Definition` was modified + +* `withExistingBookmark(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.Incident$Definition` was modified + +* `withTeamInformation(models.TeamInformation)` was added + +#### `models.ScheduledAlertRuleCommonProperties` was modified + +* `sentinelEntitiesMappings()` was added +* `withSentinelEntitiesMappings(java.util.List)` was added + +#### `models.ScheduledAlertRule` was modified + +* `withSubTechniques(java.util.List)` was added +* `withSentinelEntitiesMappings(java.util.List)` was added +* `subTechniques()` was added +* `sentinelEntitiesMappings()` was added + +#### `models.Bookmark$Definition` was modified + +* `withTechniques(java.util.List)` was added +* `withTactics(java.util.List)` was added +* `withEntityMappings(java.util.List)` was added + +#### `models.AlertDetailsOverride` was modified + +* `withAlertDynamicProperties(java.util.List)` was added +* `alertDynamicProperties()` was added + +#### `models.Watchlist` was modified + +* `sourceType()` was added +* `provisioningState()` was added + +#### `models.ActionType` was modified + +* `ADD_INCIDENT_TASK` was added + +#### `models.Bookmark` was modified + +* `entityMappings()` was added +* `techniques()` was added +* `tactics()` was added + +#### `models.AlertRuleKind` was modified + +* `THREAT_INTELLIGENCE` was added +* `NRT` was added +* `MLBEHAVIOR_ANALYTICS` was added + +#### `models.DataConnectors` was modified + +* `disconnectWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `connectWithResponse(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody,com.azure.core.util.Context)` was added +* `disconnect(java.lang.String,java.lang.String,java.lang.String)` was added +* `connect(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody)` was added + +#### `models.Incidents` was modified + +* `runPlaybook(java.lang.String,java.lang.String,java.lang.String)` was added +* `runPlaybookWithResponse(java.lang.String,java.lang.String,java.lang.String,models.ManualTriggerRequestBody,com.azure.core.util.Context)` was added + +#### `models.Incident` was modified + +* `providerIncidentId()` was added +* `teamInformation()` was added +* `providerName()` was added + +#### `SecurityInsightsManager` was modified + +* `fileImports()` was added +* `huntComments()` was added +* `productTemplates()` was added +* `contentPackageOperations()` was added +* `workspaceManagerGroups()` was added +* `triggeredAnalyticsRuleRunOperations()` was added +* `workspaceManagerMembers()` was added +* `entitiesGetTimelines()` was added +* `billingStatistics()` was added +* `productPackagesOperations()` was added +* `gets()` was added +* `threatIntelligences()` was added +* `sourceControls()` was added +* `getTriggeredAnalyticsRuleRuns()` was added +* `dataConnectorDefinitions()` was added +* `officeConsents()` was added +* `productPackages()` was added +* `sourceControlOperations()` was added +* `hunts()` was added +* `huntRelations()` was added +* `reevaluates()` was added +* `metadatas()` was added +* `workspaceManagerAssignmentJobs()` was added +* `workspaceManagerConfigurations()` was added +* `entitiesRelations()` was added +* `productTemplatesOperations()` was added +* `bookmarkRelations()` was added +* `updates()` was added +* `entities()` was added +* `entityQueries()` was added +* `resourceProviders()` was added +* `entityRelations()` was added +* `contentPackages()` was added +* `getRecommendations()` was added +* `productSettings()` was added +* `dataConnectorsCheckRequirementsOperations()` was added +* `workspaceManagerAssignments()` was added +* `bookmarkOperations()` was added +* `contentTemplates()` was added +* `contentTemplatesOperations()` was added +* `incidentTasks()` was added +* `alertRuleOperations()` was added +* `entityQueryTemplates()` was added + +#### `models.EntityKindEnum` was modified + +* `NIC` was added + +#### `models.AnomalySecurityMLAnalyticsSettings` was modified + +* `withSettingsDefinitionId(java.lang.String)` was added + +#### `models.Watchlists` was modified + +* `delete(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.FusionAlertRule` was modified + +* `withSourceSettings(java.util.List)` was added +* `subTechniques()` was added +* `sourceSettings()` was added +* `withScenarioExclusionPatterns(java.util.List)` was added +* `scenarioExclusionPatterns()` was added + +#### `models.IncidentRelations` was modified + +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.RelationInner)` was added +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.RelationInner,com.azure.core.util.Context)` was added + +#### `models.UserInfo` was modified + +* `withObjectId(java.lang.String)` was added + +#### `models.Incident$Update` was modified + +* `withTeamInformation(models.TeamInformation)` was added ## 1.0.0 (2025-01-03) diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md index 60f3f304b6e2..e973edfe39e1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager SecurityInsights client library for Java +# Azure Resource Manager Security Insights client library for Java -Azure Resource Manager SecurityInsights client library for Java. +Azure Resource Manager Security Insights 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-2022-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Security Insights Management SDK. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package api-version 2025-10-01-preview. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ SecurityInsightsManager manager = SecurityInsightsManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md index bae8fc2da53d..660ed50438b7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md @@ -8,6 +8,10 @@ - [Get](#actions_get) - [ListByAlertRule](#actions_listbyalertrule) +## AlertRuleOperation + +- [TriggerRuleRun](#alertruleoperation_triggerrulerun) + ## AlertRuleTemplates - [Get](#alertruletemplates_get) @@ -27,6 +31,22 @@ - [Get](#automationrules_get) - [List](#automationrules_list) +## BillingStatistics + +- [Get](#billingstatistics_get) +- [List](#billingstatistics_list) + +## BookmarkOperation + +- [Expand](#bookmarkoperation_expand) + +## BookmarkRelations + +- [CreateOrUpdate](#bookmarkrelations_createorupdate) +- [Delete](#bookmarkrelations_delete) +- [Get](#bookmarkrelations_get) +- [List](#bookmarkrelations_list) + ## Bookmarks - [CreateOrUpdate](#bookmarks_createorupdate) @@ -34,13 +54,119 @@ - [Get](#bookmarks_get) - [List](#bookmarks_list) +## ContentPackageOperation + +- [Install](#contentpackageoperation_install) +- [Uninstall](#contentpackageoperation_uninstall) + +## ContentPackages + +- [Get](#contentpackages_get) +- [List](#contentpackages_list) + +## ContentTemplate + +- [Delete](#contenttemplate_delete) +- [Get](#contenttemplate_get) +- [Install](#contenttemplate_install) + +## ContentTemplatesOperation + +- [List](#contenttemplatesoperation_list) + +## DataConnectorDefinitions + +- [CreateOrUpdate](#dataconnectordefinitions_createorupdate) +- [Delete](#dataconnectordefinitions_delete) +- [Get](#dataconnectordefinitions_get) +- [List](#dataconnectordefinitions_list) + ## DataConnectors +- [Connect](#dataconnectors_connect) - [CreateOrUpdate](#dataconnectors_createorupdate) - [Delete](#dataconnectors_delete) +- [Disconnect](#dataconnectors_disconnect) - [Get](#dataconnectors_get) - [List](#dataconnectors_list) +## DataConnectorsCheckRequirementsOperation + +- [Post](#dataconnectorscheckrequirementsoperation_post) + +## Entities + +- [Expand](#entities_expand) +- [Get](#entities_get) +- [GetInsights](#entities_getinsights) +- [List](#entities_list) +- [Queries](#entities_queries) +- [RunPlaybook](#entities_runplaybook) + +## 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) + +## FileImports + +- [Create](#fileimports_create) +- [Delete](#fileimports_delete) +- [Get](#fileimports_get) +- [List](#fileimports_list) + +## Get + +- [SingleRecommendation](#get_singlerecommendation) + +## GetRecommendations + +- [List](#getrecommendations_list) + +## GetTriggeredAnalyticsRuleRuns + +- [List](#gettriggeredanalyticsruleruns_list) + +## HuntComments + +- [CreateOrUpdate](#huntcomments_createorupdate) +- [Delete](#huntcomments_delete) +- [Get](#huntcomments_get) +- [List](#huntcomments_list) + +## HuntRelations + +- [CreateOrUpdate](#huntrelations_createorupdate) +- [Delete](#huntrelations_delete) +- [Get](#huntrelations_get) +- [List](#huntrelations_list) + +## Hunts + +- [CreateOrUpdate](#hunts_createorupdate) +- [Delete](#hunts_delete) +- [Get](#hunts_get) +- [List](#hunts_list) + ## IncidentComments - [CreateOrUpdate](#incidentcomments_createorupdate) @@ -55,6 +181,13 @@ - [Get](#incidentrelations_get) - [List](#incidentrelations_list) +## IncidentTasks + +- [CreateOrUpdate](#incidenttasks_createorupdate) +- [Delete](#incidenttasks_delete) +- [Get](#incidenttasks_get) +- [List](#incidenttasks_list) + ## Incidents - [CreateOrUpdate](#incidents_createorupdate) @@ -64,11 +197,58 @@ - [ListAlerts](#incidents_listalerts) - [ListBookmarks](#incidents_listbookmarks) - [ListEntities](#incidents_listentities) +- [RunPlaybook](#incidents_runplaybook) + +## 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) ## Operations - [List](#operations_list) +## ProductPackage + +- [Get](#productpackage_get) + +## ProductPackagesOperation + +- [List](#productpackagesoperation_list) + +## ProductSettings + +- [Delete](#productsettings_delete) +- [Get](#productsettings_get) +- [List](#productsettings_list) +- [Update](#productsettings_update) + +## ProductTemplate + +- [Get](#producttemplate_get) + +## ProductTemplatesOperation + +- [List](#producttemplatesoperation_list) + +## Reevaluate + +- [Recommendation](#reevaluate_recommendation) + +## ResourceProvider + +- [ListGeodataByIp](#resourceprovider_listgeodatabyip) +- [ListWhoisByDomain](#resourceprovider_listwhoisbydomain) + ## SecurityMLAnalyticsSettings - [CreateOrUpdate](#securitymlanalyticssettings_createorupdate) @@ -83,6 +263,22 @@ - [Get](#sentinelonboardingstates_get) - [List](#sentinelonboardingstates_list) +## SourceControlOperation + +- [ListRepositories](#sourcecontroloperation_listrepositories) + +## SourceControls + +- [Create](#sourcecontrols_create) +- [Delete](#sourcecontrols_delete) +- [Get](#sourcecontrols_get) +- [List](#sourcecontrols_list) + +## ThreatIntelligence + +- [Count](#threatintelligence_count) +- [Query](#threatintelligence_query) + ## ThreatIntelligenceIndicator - [AppendTags](#threatintelligenceindicator_appendtags) @@ -101,6 +297,14 @@ - [List](#threatintelligenceindicatorsoperation_list) +## TriggeredAnalyticsRuleRunOperation + +- [Get](#triggeredanalyticsrulerunoperation_get) + +## Update + +- [Recommendation](#update_recommendation) + ## WatchlistItems - [CreateOrUpdate](#watchlistitems_createorupdate) @@ -114,6 +318,41 @@ - [Delete](#watchlists_delete) - [Get](#watchlists_get) - [List](#watchlists_list) + +## WorkspaceManagerAssignmentJobs + +- [Create](#workspacemanagerassignmentjobs_create) +- [Delete](#workspacemanagerassignmentjobs_delete) +- [Get](#workspacemanagerassignmentjobs_get) +- [List](#workspacemanagerassignmentjobs_list) + +## WorkspaceManagerAssignments + +- [CreateOrUpdate](#workspacemanagerassignments_createorupdate) +- [Delete](#workspacemanagerassignments_delete) +- [Get](#workspacemanagerassignments_get) +- [List](#workspacemanagerassignments_list) + +## WorkspaceManagerConfigurations + +- [CreateOrUpdate](#workspacemanagerconfigurations_createorupdate) +- [Delete](#workspacemanagerconfigurations_delete) +- [Get](#workspacemanagerconfigurations_get) +- [List](#workspacemanagerconfigurations_list) + +## WorkspaceManagerGroups + +- [CreateOrUpdate](#workspacemanagergroups_createorupdate) +- [Delete](#workspacemanagergroups_delete) +- [Get](#workspacemanagergroups_get) +- [List](#workspacemanagergroups_list) + +## WorkspaceManagerMembers + +- [CreateOrUpdate](#workspacemanagermembers_createorupdate) +- [Delete](#workspacemanagermembers_delete) +- [Get](#workspacemanagermembers_get) +- [List](#workspacemanagermembers_list) ### Actions_CreateOrUpdate ```java @@ -122,9 +361,7 @@ */ public final class ActionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * CreateActionOfAlertRule.json + * x-ms-original-file: 2025-10-01-preview/actions/CreateActionOfAlertRule.json */ /** * Sample code: Creates or updates an action of alert rule. @@ -154,9 +391,7 @@ public final class ActionsCreateOrUpdateSamples { */ public final class ActionsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * DeleteActionOfAlertRule.json + * x-ms-original-file: 2025-10-01-preview/actions/DeleteActionOfAlertRule.json */ /** * Sample code: Delete an action of alert rule. @@ -180,9 +415,7 @@ public final class ActionsDeleteSamples { */ public final class ActionsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * GetActionOfAlertRuleById.json + * x-ms-original-file: 2025-10-01-preview/actions/GetActionOfAlertRuleById.json */ /** * Sample code: Get an action of alert rule. @@ -206,9 +439,7 @@ public final class ActionsGetSamples { */ public final class ActionsListByAlertRuleSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * GetAllActionsByAlertRule.json + * x-ms-original-file: 2025-10-01-preview/actions/GetAllActionsByAlertRule.json */ /** * Sample code: Get all actions of alert rule. @@ -224,6 +455,33 @@ public final class ActionsListByAlertRuleSamples { } ``` +### AlertRuleOperation_TriggerRuleRun + +```java +import com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger; +import java.time.OffsetDateTime; + +/** + * Samples for AlertRuleOperation TriggerRuleRun. + */ +public final class AlertRuleOperationTriggerRuleRunSamples { + /* + * x-ms-original-file: 2025-10-01-preview/triggeredAnalyticsRuleRuns/triggerRuleRun_Post.json + */ + /** + * Sample code: triggerRuleRun_Post. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void triggerRuleRunPost(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleOperations() + .triggerRuleRun("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", + new AnalyticsRuleRunTrigger().withExecutionTimeUtc(OffsetDateTime.parse("2022-12-22T15:37:03.074Z")), + com.azure.core.util.Context.NONE); + } +} +``` + ### AlertRuleTemplates_Get ```java @@ -232,9 +490,7 @@ public final class ActionsListByAlertRuleSamples { */ public final class AlertRuleTemplatesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * alertRuleTemplates/GetAlertRuleTemplateById.json + * x-ms-original-file: 2025-10-01-preview/alertRuleTemplates/GetAlertRuleTemplateById.json */ /** * Sample code: Get alert rule template by Id. @@ -258,9 +514,7 @@ public final class AlertRuleTemplatesGetSamples { */ public final class AlertRuleTemplatesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * alertRuleTemplates/GetAlertRuleTemplates.json + * x-ms-original-file: 2025-10-01-preview/alertRuleTemplates/GetAlertRuleTemplates.json */ /** * Sample code: Get all alert rule templates. @@ -279,6 +533,8 @@ public final class AlertRuleTemplatesListSamples { ```java import com.azure.resourcemanager.securityinsights.models.AlertDetail; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.EntityMapping; @@ -287,12 +543,18 @@ import com.azure.resourcemanager.securityinsights.models.EventGroupingAggregatio 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.FusionSourceSettings; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem; 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.SentinelEntityMapping; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.time.Duration; import java.util.Arrays; @@ -304,9 +566,7 @@ import java.util.Map; */ public final class AlertRulesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * CreateFusionAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateFusionAlertRule.json */ /** * Sample code: Creates or updates a Fusion alert rule. @@ -319,14 +579,121 @@ public final class AlertRulesCreateOrUpdateSamples { .createOrUpdateWithResponse("myRg", "myWorkspace", "myFirstFusionRule", new FusionAlertRule().withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") .withAlertRuleTemplateName("f71aba3d-28fb-450b-b192-4e76a83015c8") - .withEnabled(true), + .withEnabled(true) + .withSourceSettings(Arrays.asList( + new FusionSourceSettings().withEnabled(true).withSourceName("Anomalies"), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Alert providers") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Active Directory Identity Protection") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender for IoT") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft 365 Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Cloud App Security") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Endpoint") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Identity") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Office 365") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Sentinel scheduled analytics rules") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))))), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Raw logs from other sources") + .withSourceSubTypes(Arrays.asList(new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Palo Alto Networks") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))))), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * CreateMicrosoftSecurityIncidentCreationAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Creates or updates a MicrosoftSecurityIncidentCreation rule. @@ -345,9 +712,7 @@ public final class AlertRulesCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * CreateScheduledAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateScheduledAlertRule.json */ /** * Sample code: Creates or updates a Scheduled alert rule. @@ -365,6 +730,7 @@ public final class AlertRulesCreateOrUpdateSamples { .withSuppressionDuration(Duration.parse("PT1H")) .withSuppressionEnabled(false) .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) + .withTechniques(Arrays.asList("T1037", "T1021")) .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(true) .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) .withReopenClosedIncident(false) @@ -389,9 +755,178 @@ public final class AlertRulesCreateOrUpdateSamples { 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}}")), + .withAlertDetailsOverride(new AlertDetailsOverride() + .withAlertDisplayNameFormat("Alert from {{Computer}}") + .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_COMPONENT_NAME) + .withValue("ProductComponentNameCustomColumn"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_NAME) + .withValue("ProductNameCustomColumn"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.ALERT_LINK).withValue("Link")))) + .withSentinelEntitiesMappings( + Arrays.asList(new SentinelEntityMapping().withColumnName("Entities"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.json + */ + /** + * Sample code: Creates or updates a Fusion alert rule with scenario exclusion pattern. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAFusionAlertRuleWithScenarioExclusionPattern( + 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) + .withSourceSettings(Arrays.asList( + new FusionSourceSettings().withEnabled(true).withSourceName("Anomalies"), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Alert providers") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Active Directory Identity Protection") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender for IoT") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft 365 Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Cloud App Security") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Endpoint") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Identity") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Office 365") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Sentinel scheduled analytics rules") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))))), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Raw logs from other sources") + .withSourceSubTypes(Arrays.asList(new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Palo Alto Networks") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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\"") + .withDescription("") + .withQuery( + "ProtectionStatus | extend HostCustomEntity = Computer | extend IPCustomEntity = ComputerIP_Hidden") + .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) + .withTechniques(Arrays.asList("T1037", "T1021")) + .withDisplayName("Rule2") + .withEnabled(true) + .withSuppressionDuration(Duration.parse("PT1H")) + .withSuppressionEnabled(false) + .withSeverity(AlertSeverity.HIGH) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(true) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) + .withReopenClosedIncident(false) + .withLookbackDuration(Duration.parse("PT5H")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.HOST, EntityMappingType.ACCOUNT)))) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)), com.azure.core.util.Context.NONE); } @@ -417,9 +952,7 @@ public final class AlertRulesCreateOrUpdateSamples { */ public final class AlertRulesDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * DeleteAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/DeleteAlertRule.json */ /** * Sample code: Delete an alert rule. @@ -442,9 +975,7 @@ public final class AlertRulesDeleteSamples { */ public final class AlertRulesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetScheduledAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/GetScheduledAlertRule.json */ /** * Sample code: Get a Scheduled alert rule. @@ -459,9 +990,21 @@ public final class AlertRulesGetSamples { } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetFusionAlertRule.json + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/alertRules/GetFusionAlertRule.json */ /** * Sample code: Get a Fusion alert rule. @@ -474,9 +1017,7 @@ public final class AlertRulesGetSamples { } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetMicrosoftSecurityIncidentCreationAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Get a MicrosoftSecurityIncidentCreation rule. @@ -500,9 +1041,7 @@ public final class AlertRulesGetSamples { */ public final class AlertRulesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetAllAlertRules.json + * x-ms-original-file: 2025-10-01-preview/alertRules/GetAllAlertRules.json */ /** * Sample code: Get all alert rules. @@ -527,9 +1066,7 @@ import java.util.List; */ public final class AutomationRulesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_CreateOrUpdate.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_CreateOrUpdate.json */ /** * Sample code: AutomationRules_CreateOrUpdate. @@ -558,9 +1095,7 @@ public final class AutomationRulesCreateOrUpdateSamples { */ public final class AutomationRulesDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_Delete.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_Delete.json */ /** * Sample code: AutomationRules_Delete. @@ -584,9 +1119,7 @@ public final class AutomationRulesDeleteSamples { */ public final class AutomationRulesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_Get.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_Get.json */ /** * Sample code: AutomationRules_Get. @@ -609,9 +1142,7 @@ public final class AutomationRulesGetSamples { */ public final class AutomationRulesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_List.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_List.json */ /** * Sample code: AutomationRules_List. @@ -624,1579 +1155,5878 @@ public final class AutomationRulesListSamples { } ``` -### Bookmarks_CreateOrUpdate +### BillingStatistics_Get ```java -import com.azure.resourcemanager.securityinsights.models.UserInfo; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; - /** - * Samples for Bookmarks CreateOrUpdate. + * Samples for BillingStatistics Get. */ -public final class BookmarksCreateOrUpdateSamples { +public final class BillingStatisticsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/bookmarks/ - * CreateBookmark.json + * x-ms-original-file: 2025-10-01-preview/billingStatistics/GetBillingStatistic.json */ /** - * Sample code: Creates or updates a bookmark. + * Sample code: Get a billing statistic. * * @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("2019-01-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("2019-01-01T13:15:30Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) - .create(); + getABillingStatistic(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.billingStatistics() + .getWithResponse("myRg", "myWorkspace", "sapSolutionUsage", com.azure.core.util.Context.NONE); } } ``` -### Bookmarks_Delete +### BillingStatistics_List ```java /** - * Samples for Bookmarks Delete. + * Samples for BillingStatistics List. */ -public final class BookmarksDeleteSamples { +public final class BillingStatisticsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/bookmarks/ - * DeleteBookmark.json + * x-ms-original-file: 2025-10-01-preview/billingStatistics/GetAllBillingStatistics.json */ /** - * Sample code: Delete a bookmark. + * Sample code: Get all Microsoft Sentinel billing statistics. * * @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", - com.azure.core.util.Context.NONE); + public static void getAllMicrosoftSentinelBillingStatistics( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.billingStatistics().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### Bookmarks_Get +### BookmarkOperation_Expand ```java +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import java.time.OffsetDateTime; + /** - * Samples for Bookmarks Get. + * Samples for BookmarkOperation Expand. */ -public final class BookmarksGetSamples { +public final class BookmarkOperationExpandSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/bookmarks/ - * GetBookmarkById.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/expand/PostExpandBookmark.json */ /** - * Sample code: Get a bookmark. + * Sample code: Expand an 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", + 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("27f76e63-c41b-480f-bb18-12ad2e011d49") + .withStartTime(OffsetDateTime.parse("2019-12-25T17:21:00.000Z")), com.azure.core.util.Context.NONE); } } ``` -### Bookmarks_List +### BookmarkRelations_CreateOrUpdate ```java /** - * Samples for Bookmarks List. + * Samples for BookmarkRelations CreateOrUpdate. */ -public final class BookmarksListSamples { +public final class BookmarkRelationsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/bookmarks/ - * GetBookmarks.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/relations/CreateBookmarkRelation.json */ /** - * Sample code: Get all bookmarks. + * Sample code: Creates or updates a bookmark relation. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.bookmarks().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + 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(); } } ``` -### DataConnectors_CreateOrUpdate +### BookmarkRelations_Delete ```java -import com.azure.resourcemanager.securityinsights.models.DataTypeState; -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.TIDataConnector; -import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes; -import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypesIndicators; -import java.time.OffsetDateTime; - /** - * Samples for DataConnectors CreateOrUpdate. + * Samples for BookmarkRelations Delete. */ -public final class DataConnectorsCreateOrUpdateSamples { +public final class BookmarkRelationsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/CreateOfficeDataConnetor.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/relations/DeleteBookmarkRelation.json */ /** - * Sample code: Creates or updates an Office365 data connector. + * Sample code: Delete the bookmark relation. * * @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\"") - .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8") - .withDataTypes(new OfficeDataConnectorDataTypes() - .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.ENABLED)) - .withSharePoint(new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) - .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))), - com.azure.core.util.Context.NONE); + 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", com.azure.core.util.Context.NONE); } +} +``` - /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/CreateThreatIntelligenceDataConnector.json +### BookmarkRelations_Get + +```java +/** + * Samples for BookmarkRelations Get. + */ +public final class BookmarkRelationsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/bookmarks/relations/GetBookmarkRelationByName.json */ /** - * Sample code: Creates or updates an Threat Intelligence Platform data connector. + * Sample code: Get a bookmark relation. * * @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().withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b") - .withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) - .withDataTypes(new TIDataConnectorDataTypes() - .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))), - com.azure.core.util.Context.NONE); + 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", com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_Delete +### BookmarkRelations_List ```java /** - * Samples for DataConnectors Delete. + * Samples for BookmarkRelations List. */ -public final class DataConnectorsDeleteSamples { +public final class BookmarkRelationsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/DeleteOfficeDataConnetor.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/relations/GetAllBookmarkRelations.json */ /** - * Sample code: Delete an Office365 data connector. + * Sample code: Get all bookmark relations. * * @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", + getAllBookmarkRelations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.bookmarkRelations() + .list("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096", null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_Get +### Bookmarks_CreateOrUpdate ```java +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; +import com.azure.resourcemanager.securityinsights.models.EntityFieldMapping; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.Arrays; + /** - * Samples for DataConnectors Get. + * Samples for Bookmarks CreateOrUpdate. */ -public final class DataConnectorsGetSamples { +public final class BookmarksCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAzureSecurityCenterById.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/CreateBookmark.json */ /** - * Sample code: Get a ASC data connector. + * Sample code: Creates or updates a bookmark. * * @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", - com.azure.core.util.Context.NONE); + 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("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("2046feea-040d-4a46-9e2b-91c2941bfa70")) + .withEntityMappings(Arrays.asList(new BookmarkEntityMappings().withEntityType("Account") + .withFieldMappings(Arrays + .asList(new EntityFieldMapping().withIdentifier("Fullname").withValue("johndoe@microsoft.com"))))) + .withTactics(Arrays.asList(AttackTactic.EXECUTION)) + .withTechniques(Arrays.asList("T1609")) + .create(); } +} +``` + +### Bookmarks_Delete +```java +/** + * Samples for Bookmarks Delete. + */ +public final class BookmarksDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetOfficeDataConnetorById.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/DeleteBookmark.json */ /** - * Sample code: Get an Office365 data connector. + * Sample code: Delete a bookmark. * * @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", + public static void deleteABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.bookmarks() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.Context.NONE); } +} +``` +### Bookmarks_Get + +```java +/** + * Samples for Bookmarks Get. + */ +public final class BookmarksGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetMicrosoftCloudAppSecurityById.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/GetBookmarkById.json */ /** - * Sample code: Get a MCAS data connector. + * Sample code: Get a bookmark. * * @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", + public static void getABookmark(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.bookmarks() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.Context.NONE); } +} +``` + +### Bookmarks_List +```java +/** + * Samples for Bookmarks List. + */ +public final class BookmarksListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAmazonWebServicesCloudTrailById.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/GetBookmarks.json */ /** - * Sample code: Get an AwsCloudTrail data connector. + * Sample code: Get all bookmarks. * * @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", - com.azure.core.util.Context.NONE); + public static void getAllBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.bookmarks().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } +} +``` + +### ContentPackageOperation_Install + +```java +import com.azure.resourcemanager.securityinsights.models.PackageKind; +/** + * Samples for ContentPackageOperation Install. + */ +public final class ContentPackageOperationInstallSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAzureAdvancedThreatProtectionById.json + * x-ms-original-file: 2025-10-01-preview/contentPackages/InstallPackage.json */ /** - * Sample code: Get an AATP data connector. + * Sample code: Install a package to the workspace. * * @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", - com.azure.core.util.Context.NONE); + installAPackageToTheWorkspace(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackageOperations() + .define("str.azure-sentinel-solution-str") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("str.azure-sentinel-solution-str") + .withContentProductId("str.azure-sentinel-solution-str-sl-igl6jawr4gwmu") + .withContentKind(PackageKind.SOLUTION) + .withVersion("2.0.0") + .withDisplayName("str") + .create(); } +} +``` + +### ContentPackageOperation_Uninstall +```java +/** + * Samples for ContentPackageOperation Uninstall. + */ +public final class ContentPackageOperationUninstallSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json + * x-ms-original-file: 2025-10-01-preview/contentPackages/UninstallPackage.json */ /** - * Sample code: Get a MDATP data connector. + * Sample code: Uninstall a package from the workspace. * * @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", + uninstallAPackageFromTheWorkspace(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackageOperations() + .uninstallWithResponse("myRg", "myWorkspace", "str.azure-sentinel-solution-str", com.azure.core.util.Context.NONE); } +} +``` - /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/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", - com.azure.core.util.Context.NONE); - } +### ContentPackages_Get +```java +/** + * Samples for ContentPackages Get. + */ +public final class ContentPackagesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAzureActiveDirectoryById.json + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetPackageById.json */ /** - * Sample code: Get an AAD data connector. + * Sample code: Get installed packages by id. * * @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", + getInstalledPackagesById(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackages() + .getWithResponse("myRg", "myWorkspace", "str.azure-sentinel-solution-str", com.azure.core.util.Context.NONE); } } ``` -### DataConnectors_List +### ContentPackages_List ```java /** - * Samples for DataConnectors List. + * Samples for ContentPackages List. */ -public final class DataConnectorsListSamples { +public final class ContentPackagesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetDataConnectors.json + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetPackages.json */ /** - * Sample code: Get all data connectors. + * Sample code: Get all available packages. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getAllDataConnectors(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.dataConnectors().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + getAllAvailablePackages(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackages() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### IncidentComments_CreateOrUpdate +### ContentTemplate_Delete ```java /** - * Samples for IncidentComments CreateOrUpdate. + * Samples for ContentTemplate Delete. */ -public final class IncidentCommentsCreateOrUpdateSamples { +public final class ContentTemplateDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/CreateIncidentComment.json + * x-ms-original-file: 2025-10-01-preview/contentTemplates/DeleteTemplate.json */ /** - * Sample code: Creates or updates an incident comment. + * Sample code: Delete metadata. * * @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(); + public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplates() + .deleteWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); } } ``` -### IncidentComments_Delete +### ContentTemplate_Get ```java /** - * Samples for IncidentComments Delete. + * Samples for ContentTemplate Get. */ -public final class IncidentCommentsDeleteSamples { +public final class ContentTemplateGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/DeleteIncidentComment.json + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetTemplateById.json */ /** - * Sample code: Delete the incident comment. + * Sample code: Get a template. * * @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", com.azure.core.util.Context.NONE); + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplates() + .getWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); } } ``` -### IncidentComments_Get +### ContentTemplate_Install ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.io.IOException; + /** - * Samples for IncidentComments Get. + * Samples for ContentTemplate Install. */ -public final class IncidentCommentsGetSamples { +public final class ContentTemplateInstallSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/GetIncidentCommentById.json + * x-ms-original-file: 2025-10-01-preview/contentTemplates/InstallTemplate.json */ /** - * Sample code: Get an incident comment. + * Sample code: Get a template. * * @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", com.azure.core.util.Context.NONE); + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) + throws IOException { + manager.contentTemplates() + .define("str.azure-sentinel-solution-str") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("8365ebfe-a381-45b7-ad08-7d818070e11f") + .withContentProductId("str.azure-sentinel-solution-str-ar-cbfe4fndz66bi") + .withPackageVersion("1.0.0") + .withVersion("1.0.1") + .withDisplayName("API Protection workbook template") + .withContentKind(Kind.ANALYTICS_RULE) + .withSource(new MetadataSource().withKind(SourceKind.SOLUTION) + .withName("str") + .withSourceId("str.azure-sentinel-solution-str")) + .withAuthor(new MetadataAuthor().withName("Microsoft").withEmail("support@microsoft.com")) + .withSupport(new MetadataSupport().withTier(SupportTier.MICROSOFT) + .withName("Microsoft Corporation") + .withEmail("support@microsoft.com") + .withLink("https://support.microsoft.com/")) + .withPackageId("str.azure-sentinel-solution-str") + .withPackageKind(PackageKind.SOLUTION) + .withPackageName("str") + .withMainTemplate(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\"contentVersion\":\"1.0.1\",\"resources\":[{\"name\":\"8365ebfe-a381-45b7-ad08-7d818070e11f\",\"type\":\"Microsoft.SecurityInsights/AlertRuleTemplates\",\"apiVersion\":\"2022-04-01-preview\",\"kind\":\"Scheduled\",\"location\":\"[parameters('workspace-location')]\",\"properties\":{\"description\":\"Creates an incident when a large number of Critical/High severity CrowdStrike Falcon sensor detections is triggered by a single user\",\"displayName\":\"Critical or High Severity Detections by User\",\"enabled\":false,\"query\":\"...\",\"queryFrequency\":\"PT1H\",\"queryPeriod\":\"PT1H\",\"severity\":\"High\",\"status\":\"Available\",\"suppressionDuration\":\"PT1H\",\"suppressionEnabled\":false,\"triggerOperator\":\"GreaterThan\",\"triggerThreshold\":0}},{\"name\":\"[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',concat('AnalyticsRule-', last(split([resourceId('Microsoft.SecurityInsights/AlertRuleTemplates', 8365ebfe-a381-45b7-ad08-7d818070e11f)],'/'))))]\",\"type\":\"Microsoft.OperationalInsights/workspaces/providers/metadata\",\"apiVersion\":\"2022-01-01-preview\",\"properties\":{\"description\":\"CrowdStrike Falcon Endpoint Protection Analytics Rule 1\",\"author\":{\"name\":\"Microsoft\",\"email\":\"support@microsoft.com\"},\"contentId\":\"4465ebde-b381-45f7-ad08-7d818070a11c\",\"kind\":\"AnalyticsRule\",\"parentId\":\"[resourceId('Microsoft.SecurityInsights/AlertRuleTemplates', 8365ebfe-a381-45b7-ad08-7d818070e11f)]\",\"source\":{\"name\":\"str\",\"kind\":\"Solution\",\"sourceId\":\"str.azure-sentinel-solution-str\"},\"support\":{\"name\":\"Microsoft Corporation\",\"email\":\"support@microsoft.com\",\"link\":\"https://support.microsoft.com/\",\"tier\":\"Microsoft\"},\"version\":\"1.0.0\"}}]}", + Object.class, SerializerEncoding.JSON)) + .create(); } } ``` -### IncidentComments_List +### ContentTemplatesOperation_List ```java /** - * Samples for IncidentComments List. + * Samples for ContentTemplatesOperation List. */ -public final class IncidentCommentsListSamples { +public final class ContentTemplatesOperationListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/GetAllIncidentComments.json + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetTemplates.json */ /** - * Sample code: Get all incident comments. + * Sample code: Get all installed templates. * * @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, + getAllInstalledTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplatesOperations() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### IncidentRelations_CreateOrUpdate +### DataConnectorDefinitions_CreateOrUpdate ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion; +import com.azure.resourcemanager.securityinsights.models.ConnectorDataType; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.azure.resourcemanager.securityinsights.models.GraphQuery; +import com.azure.resourcemanager.securityinsights.models.InstructionStep; +import com.azure.resourcemanager.securityinsights.models.InstructionStepDetails; +import com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import java.io.IOException; +import java.util.Arrays; + /** - * Samples for IncidentRelations CreateOrUpdate. + * Samples for DataConnectorDefinitions CreateOrUpdate. */ -public final class IncidentRelationsCreateOrUpdateSamples { +public final class DataConnectorDefinitionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * relations/CreateIncidentRelation.json + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/CreateCustomizableDataConnectorDefinition.json */ /** - * Sample code: Creates or updates an incident relation. + * Sample code: Create data connector definition. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - createsOrUpdatesAnIncidentRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.incidentRelations() - .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") - .withExistingIncident("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812") - .withRelatedResourceId( - "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096") - .create(); + public static void createDataConnectorDefinition( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager.dataConnectorDefinitions() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new CustomizableConnectorDefinition().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withConnectorUiConfig(new CustomizableConnectorUiConfig().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.") + .withGraphQueries(Arrays.asList(new GraphQuery().withMetricName("Total events received") + .withLegend("GitHub audit log events") + .withBaseQuery("GitHubAuditLogPolling_CL"))) + .withDataTypes(Arrays.asList(new ConnectorDataType().withName("GitHubAuditLogPolling_CL") + .withLastDataReceivedQuery( + "GitHubAuditLogPolling_CL \n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)"))) + .withConnectivityCriteria(Arrays.asList(new ConnectivityCriterion().withType("IsConnectedQuery") + .withValue(Arrays.asList( + "GitHubAuditLogPolling_CL \n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(30d)")))) + .withAvailability(new ConnectorDefinitionsAvailability().withStatus(1).withIsPreview(false)) + .withPermissions(new ConnectorDefinitionsPermissions() + .withResourceProvider(Arrays.asList(new ConnectorDefinitionsResourceProvider() + .withProvider("Microsoft.OperationalInsights/workspaces") + .withPermissionsDisplayText("read and write permissions are required.") + .withProviderDisplayName("Workspace") + .withScope(ProviderPermissionsScope.WORKSPACE) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(false) + .withWrite(true) + .withDelete(false) + .withAction(false)))) + .withCustoms(Arrays.asList(new CustomPermissionDetails() + .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 InstructionStep() + .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 InstructionStepDetails() + .withParameters(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"clientIdLabel\":\"Client ID\",\"clientSecretLabel\":\"Client Secret\",\"connectButtonLabel\":\"Connect\",\"disconnectButtonLabel\":\"Disconnect\"}", + Object.class, SerializerEncoding.JSON)) + .withType("OAuthForm")))))), + com.azure.core.util.Context.NONE); } } ``` -### IncidentRelations_Delete +### DataConnectorDefinitions_Delete ```java /** - * Samples for IncidentRelations Delete. + * Samples for DataConnectorDefinitions Delete. */ -public final class IncidentRelationsDeleteSamples { +public final class DataConnectorDefinitionsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * relations/DeleteIncidentRelation.json + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/DeleteDataConnectorDefinitionById.json */ /** - * Sample code: Delete the incident relation. + * Sample code: Delete data connector definition. * * @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", com.azure.core.util.Context.NONE); + deleteDataConnectorDefinition(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorDefinitions() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); } } ``` -### IncidentRelations_Get +### DataConnectorDefinitions_Get ```java /** - * Samples for IncidentRelations Get. + * Samples for DataConnectorDefinitions Get. */ -public final class IncidentRelationsGetSamples { +public final class DataConnectorDefinitionsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * relations/GetIncidentRelationByName.json + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/GetCustomizableDataConnectorDefinitionById.json */ /** - * Sample code: Get an incident relation. + * Sample code: Get customize data connector definition. * * @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", com.azure.core.util.Context.NONE); + public static void getCustomizeDataConnectorDefinition( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorDefinitions() + .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", + com.azure.core.util.Context.NONE); } } ``` -### IncidentRelations_List +### DataConnectorDefinitions_List ```java /** - * Samples for IncidentRelations List. + * Samples for DataConnectorDefinitions List. */ -public final class IncidentRelationsListSamples { +public final class DataConnectorDefinitionsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * relations/GetAllIncidentRelations.json + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/GetDataConnectorDefinitions.json */ /** - * Sample code: Get all incident relations. + * Sample code: Get all data connector definitions. * * @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, - com.azure.core.util.Context.NONE); + getAllDataConnectorDefinitions(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorDefinitions().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### Incidents_CreateOrUpdate +### DataConnectors_Connect ```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 com.azure.core.management.serializer.SerializerFactory; +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: 2025-10-01-preview/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("fakeTokenPlaceholder") + .withRequestConfigUserInputValues(Arrays.asList(SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"displayText\":\"Organization Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", + Object.class, SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/ConnectAPIPollingV2Logs.json + */ + /** + * Sample code: Connect an APIPolling V2 logs data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void connectAnAPIPollingV2LogsDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager.dataConnectors() + .connectWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new DataConnectorConnectBody().withKind(ConnectAuthKind.APIKEY) + .withApiKey("fakeTokenPlaceholder") + .withDataCollectionEndpoint("https://test.eastus.ingest.monitor.azure.com") + .withDataCollectionRuleImmutableId("dcr-34adsj9o7d6f9de204478b9cgb43b631") + .withOutputStream("Custom-MyTableRawData") + .withRequestConfigUserInputValues(Arrays.asList(SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"displayText\":\"Organization Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", + Object.class, SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); + } +} +``` + +### DataConnectors_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +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.DCRConfiguration; +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.GCPAuthProperties; +import com.azure.resourcemanager.securityinsights.models.GCPDataConnector; +import com.azure.resourcemanager.securityinsights.models.GCPRequestProperties; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnector; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnector; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesAlerts; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesIncidents; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +import com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders; +import com.azure.resourcemanager.securityinsights.models.MtpProvider; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector; +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.OfficePowerBIConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIDataConnector; +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.PremiumMdtiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypesConnector; +import com.azure.resourcemanager.securityinsights.models.PremiumMicrosoftDefenderForThreatIntelligence; +import com.azure.resourcemanager.securityinsights.models.ProviderName; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditDataConnector; +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.UUID; +import java.util.Arrays; /** - * Samples for Incidents CreateOrUpdate. + * Samples for DataConnectors CreateOrUpdate. */ -public final class IncidentsCreateOrUpdateSamples { +public final class DataConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateMicrosoftThreatProtectionDataConnetor.json + */ + /** + * Sample code: Creates or updates a MicrosoftThreatProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAMicrosoftThreatProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new MTPDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new MTPDataConnectorDataTypes() + .withIncidents(new MTPDataConnectorDataTypesIncidents().withState(DataTypeState.DISABLED)) + .withAlerts(new MTPDataConnectorDataTypesAlerts().withState(DataTypeState.ENABLED))) + .withFilteredProviders(new MtpFilteredProviders() + .withAlerts(Arrays.asList(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS))) + .withTenantId("178265c4-3136-4ff6-8ed1-b5b62b4cb5f5"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreatePurviewAuditDataConnector.json + */ + /** + * Sample code: Creates or updates a PurviewAudit data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAPurviewAuditDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new PurviewAuditDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withConnectorDefinitionName("PowerAutomate") + .withSourceType("MicrosoftFlow") + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint( + "https://microsoft-sentinel-datacollectionendpoint-123m.westeurope-1.ingest.monitor.azure.com") + .withDataCollectionRuleImmutableId("dcr-de21b053bd5a44beb99a256c9db85023") + .withStreamName("OFFICEPOWERAUTOMATE_RESTAPI")) + .withDataTypes(new PurviewAuditConnectorDataTypes() + .withLogs(new PurviewAuditConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + /* * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * CreateIncident.json + * 2025-10-01-preview/dataConnectors/CreatePremiumMicrosoftDefenderForThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Creates or updates a PremiumMicrosoftDefenderForThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAPremiumMicrosoftDefenderForThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "8c569548-a86c-4fb4-8ae4-d1e35a6146f8", + new PremiumMicrosoftDefenderForThreatIntelligence() + .withLookbackPeriod(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")) + .withDataTypes(new PremiumMdtiDataConnectorDataTypes().withConnector( + new PremiumMdtiDataConnectorDataTypesConnector().withState(DataTypeState.ENABLED))) + .withTenantId("e4afb3c4-813b-4e68-b6de-e5360866e798"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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\n1. Log into the Qualys Vulnerability Management console with an administrator account, select the **Users** tab and the **Users** subtab. \n2. Click on the **New** drop-down menu and select **Users..**\n3. Create a username and password for the API account. \n4. In the **User Roles** tab, ensure the account role is set to **Manager** and access is allowed to **GUI** and **API**\n4. 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. \n5. Log back into the console using an administrator account and modify the API accounts User Roles, removing access to **GUI**. \n6. 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\n1. Click the **Deploy to Azure** button below. \n\n\t[![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinelqualysvmazuredeploy)\n2. Select the preferred **Subscription**, **Resource Group** and **Location**. \n3. 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. \n4. Mark the checkbox labeled **I agree to the terms and conditions stated above**. \n5. 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\n1. From the Azure Portal, navigate to [Function App](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp), and select **+ Add**.\n2. In the **Basics** tab, ensure Runtime stack is set to **Powershell Core**. \n3. In the **Hosting** tab, ensure the **Consumption (Serverless)** plan type is selected.\n4. Make other preferrable configuration changes, if needed, then click **Create**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("") + .withDescription( + "**2. Import Function App Code**\n\n1. In the newly created Function App, select **Functions** on the left pane and click **+ New Function**.\n2. Select **Timer Trigger**.\n3. Enter a unique Function **Name** and leave the default cron schedule of every 5 minutes, then click **Create**.\n5. Click on **Code + Test** on the left pane. \n6. Copy the [Function App Code](https://aka.ms/sentinelqualysvmazurefunctioncode) and paste into the Function App `run.ps1` editor.\n7. Click **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("") + .withDescription( + "**3. Configure the Function App**\n\n1. In the Function App, select the Function App Name and select **Configuration**.\n2. In the **Application settings** tab, select **+ New application setting**.\n3. 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.\n4. Once all application settings have been entered, click **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("") + .withDescription( + "**4. Configure the host.json**.\n\nDue 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\n1. In the Function App, select the Function App Name and select the **App Service Editor** blade.\n2. Click **Go** to open the editor, then select the **host.json** file under the **wwwroot** directory.\n3. Add the line `\"functionTimeout\": \"00:10:00\",` above the `managedDependancy` line \n4. 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)")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateOffice365ProjectDataConnetor.json + */ + /** + * Sample code: Creates or updates an Office365 Project data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnOffice365ProjectDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new Office365ProjectDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new Office365ProjectConnectorDataTypes() + .withLogs(new Office365ProjectConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateGoogleCloudPlatform.json */ /** - * Sample code: Creates or updates an incident. + * Sample code: Creates or updates a GCP data connector. * * @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(); + createsOrUpdatesAGCPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1", + new GCPDataConnector().withConnectorDefinitionName("GcpConnector") + .withAuth(new GCPAuthProperties() + .withServiceAccountEmail("sentinel-service-account@project-id.iam.gserviceaccount.com") + .withProjectNumber("123456789012") + .withWorkloadIdentityProviderId("sentinel-identity-provider")) + .withRequest(new GCPRequestProperties().withProjectId("project-id") + .withSubscriptionNames(Arrays.asList("sentinel-subscription"))) + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint( + "https://microsoft-sentinel-datacollectionendpoint-123m.westeurope-1.ingest.monitor.azure.com") + .withDataCollectionRuleImmutableId("dcr-de21b053bd5a44beb99a256c9db85023") + .withStreamName("SENTINEL_GCP_AUDIT_LOGS")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateMicrosoftThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Creates or updates a Microsoft Threat Intelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAMicrosoftThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", + new MSTIDataConnector() + .withDataTypes(new MSTIDataConnectorDataTypes().withMicrosoftEmergingThreatFeed( + new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed().withState(DataTypeState.ENABLED) + .withLookbackPeriod(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-10-01-preview/dataConnectors/CreateMicrosoftPurviewInformationProtectionDataConnetor.json + */ + /** + * Sample code: Creates or updates an MicrosoftPurviewInformationProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnMicrosoftPurviewInformationProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new MicrosoftPurviewInformationProtectionDataConnector() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new MicrosoftPurviewInformationProtectionConnectorDataTypes() + .withLogs(new MicrosoftPurviewInformationProtectionConnectorDataTypesLogs() + .withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateOfficePowerBIDataConnector.json + */ + /** + * Sample code: Creates or updates an Office PowerBI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnOfficePowerBIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new OfficePowerBIDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new OfficePowerBIConnectorDataTypes() + .withLogs(new OfficePowerBIConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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("fakeTokenPlaceholder") + .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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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("fakeTokenPlaceholder") + .withApiKeyIdentifier("fakeTokenPlaceholder")) + .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("$")))), + com.azure.core.util.Context.NONE); } } ``` -### Incidents_Delete +### DataConnectors_Delete + +```java +/** + * Samples for DataConnectors Delete. + */ +public final class DataConnectorsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteOffice365ProjectDataConnetor.json + */ + /** + * Sample code: Delete an Office365 Project data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnOffice365ProjectDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-10-01-preview/dataConnectors/DeleteMicrosoftPurviewInformationProtectionDataConnetor.json + */ + /** + * Sample code: Delete an MicrosoftPurviewInformationProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnMicrosoftPurviewInformationProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteGoogleCloudPlatform.json + */ + /** + * Sample code: Delete a GCP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAGCPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteOfficePowerBIDataConnetor.json + */ + /** + * Sample code: Delete an Office PowerBI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAnOfficePowerBIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeletePurviewAuditDataConnector.json + */ + /** + * Sample code: Delete a PurviewAudit data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAPurviewAuditDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteMicrosoftThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Delete an MicrosoftThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnMicrosoftThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-10-01-preview/dataConnectors/DeletePremiumMicrosoftDefenderForThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Deletes a PremiumMicrosoftDefenderForThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deletesAPremiumMicrosoftDefenderForThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "8c569548-a86c-4fb4-8ae4-d1e35a6146f8", + com.azure.core.util.Context.NONE); + } +} +``` + +### DataConnectors_Disconnect + +```java +/** + * Samples for DataConnectors Disconnect. + */ +public final class DataConnectorsDisconnectSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### DataConnectors_Get + +```java +/** + * Samples for DataConnectors Get. + */ +public final class DataConnectorsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetOffice365ProjectDataConnetorById.json + */ + /** + * Sample code: Get an Office365 Project data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnOffice365ProjectDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetIoTById.json + */ + /** + * Sample code: Get a IoT data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAIoTDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "d2e5dc7a-f3a2-429d-954b-939fa8c2932e", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-10-01-preview/dataConnectors/GetMicrosoftPurviewInformationProtectionDataConnetorById.json + */ + /** + * Sample code: Get a MicrosoftPurviewInformationProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftPurviewInformationProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetMicrosoftInsiderRiskManagementById.json + */ + /** + * Sample code: Get an Office IRM data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnOfficeIRMDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetGoogleCloudPlatformById.json + */ + /** + * Sample code: Get a GCP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAGCPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetAzureActiveDirectoryById.json + */ + /** + * Sample code: Get an AADIP (Azure Active Directory Identity Protection) data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAADIPAzureActiveDirectoryIdentityProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetOffice365AdvancedThreatProtectionById.json + */ + /** + * Sample code: Get an Office ATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnOfficeATPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetPurviewAuditDataConnectorById.json + */ + /** + * Sample code: Get a PurviewAudit data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAPurviewAuditDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetPremiumMicrosoftDefenderForThreatIntelligenceById.json + */ + /** + * Sample code: Get a PremiumMicrosoftDefenderForThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAPremiumMicrosoftDefenderForThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "8c569548-a86c-4fb4-8ae4-d1e35a6146f8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetRestApiPollerById.json + */ + /** + * Sample code: Get a RestApiPoller data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getARestApiPollerDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "RestApiPoller_fce27b90-d6f5-4d30-991a-af509a2b50a1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetOfficePowerBIDataConnetorById.json + */ + /** + * Sample code: Get an Office365 PowerBI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnOffice365PowerBIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } +} +``` + +### DataConnectors_List + +```java +/** + * Samples for DataConnectors List. + */ +public final class DataConnectorsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### DataConnectorsCheckRequirementsOperation_Post + +```java +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.IoTCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MCASCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MSTICheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeATPCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeIRMCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBICheckRequirements; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditCheckRequirements; +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: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsOffice365Project.json + */ + /** + * Sample code: Check requirements for Office365Project. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForOffice365Project( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new Office365ProjectCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json + */ + /** + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no authorization. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtectionNoAuthorization( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AADCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsIoT.json + */ + /** + * Sample code: Check requirements for IoT. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + checkRequirementsForIoT(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new IoTCheckRequirements().withSubscriptionId("c0688291-89d7-4bed-87a2-a7b1bff43f4c"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsMicrosoftPurviewInformationProtection.json + */ + /** + * Sample code: Check requirements for MicrosoftPurviewInformationProtection. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMicrosoftPurviewInformationProtection( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new MicrosoftPurviewInformationProtectionCheckRequirements() + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsPurviewAudit.json + */ + /** + * Sample code: Check requirements for PurviewAudit. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + checkRequirementsForPurviewAudit(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new PurviewAuditCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsAzureActiveDirectory.json + */ + /** + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection). + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtection( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AADCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsOfficePowerBI.json + */ + /** + * Sample code: Check requirements for OfficePowerBI. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + checkRequirementsForOfficePowerBI(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new OfficePowerBICheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json + */ + /** + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no license. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtectionNoLicense( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AADCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_Expand + +```java +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import java.time.OffsetDateTime; + +/** + * Samples for Entities Expand. + */ +public final class EntitiesExpandSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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("a77992f3-25e9-4d01-99a4-5ff606cc410a") + .withStartTime(OffsetDateTime.parse("2019-04-25T00:00:00.000Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_Get + +```java +/** + * Samples for Entities Get. + */ +public final class EntitiesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_GetInsights + +```java +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for Entities GetInsights. + */ +public final class EntitiesGetInsightsSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_List + +```java +/** + * Samples for Entities List. + */ +public final class EntitiesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_Queries + +```java +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; + +/** + * Samples for Entities Queries. + */ +public final class EntitiesQueriesSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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() + .queries("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", EntityItemQueryKind.INSIGHT, + com.azure.core.util.Context.NONE); + } +} +``` + +### Entities_RunPlaybook + +```java + +/** + * Samples for Entities RunPlaybook. + */ +public final class EntitiesRunPlaybookSamples { + /* + * x-ms-original-file: 2025-10-01-preview/manualTrigger/Entities_RunPlaybook.json + */ + /** + * Sample code: Entities_RunPlaybook. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entitiesRunPlaybook(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .runPlaybookWithResponse("myRg", "myWorkspace", "72e01a22-5cd2-4139-a149-9f2736ff2ar2", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### EntitiesGetTimeline_List + +```java +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import java.time.OffsetDateTime; + +/** + * Samples for EntitiesGetTimeline List. + */ +public final class EntitiesGetTimelineListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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), + com.azure.core.util.Context.NONE); + } +} +``` + +### EntitiesRelations_List + +```java +/** + * Samples for EntitiesRelations List. + */ +public final class EntitiesRelationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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, + com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueries_CreateOrUpdate + +```java +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: 2025-10-01-preview/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){\nSecurityEvent\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(\nComputer has '@', tostring(split(Computer, '@')[0]),\nComputer has '\\\\', tostring(split(Computer, '\\\\')[1]),\nComputer has '.', tostring(split(Computer, '.')[0]),\nComputer\n)\n| extend Host_NTDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', tostring(split(Computer, '.')[-2]), \nComputer\n)\n| extend Host_DnsDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \nComputer\n)\n| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \nor (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \nor v_Host_AzureID =~ _ResourceId \nor 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};\nGetAccountActions('{{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), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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 +/** + * Samples for EntityQueries Delete. + */ +public final class EntityQueriesDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueries_Get + +```java +/** + * Samples for EntityQueries Get. + */ +public final class EntityQueriesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueries_List + +```java +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; + +/** + * Samples for EntityQueries List. + */ +public final class EntityQueriesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", EntityQueryTemplateKind.EXPANSION, com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueryTemplates_Get + +```java +/** + * Samples for EntityQueryTemplates Get. + */ +public final class EntityQueryTemplatesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### EntityQueryTemplates_List + +```java +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; + +/** + * Samples for EntityQueryTemplates List. + */ +public final class EntityQueryTemplatesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", EntityQueryTemplateKind.ACTIVITY, com.azure.core.util.Context.NONE); + } +} +``` + +### EntityRelations_GetRelation + +```java +/** + * Samples for EntityRelations GetRelation. + */ +public final class EntityRelationsGetRelationSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### FileImports_Create + +```java +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; + +/** + * Samples for FileImports Create. + */ +public final class FileImportsCreateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/CreateFileImport.json + */ + /** + * Sample code: Create a file import. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createAFileImport(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withIngestionMode(IngestionMode.INGEST_ANY_VALID_RECORDS) + .withContentType(FileImportContentType.STIX_INDICATOR) + .withImportFile( + new FileMetadata().withFileFormat(FileFormat.JSON).withFileName("myFile.json").withFileSize(4653)) + .withSource("mySource") + .create(); + } +} +``` + +### FileImports_Delete + +```java +/** + * Samples for FileImports Delete. + */ +public final class FileImportsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/DeleteFileImport.json + */ + /** + * Sample code: Delete a file import. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAFileImport(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .delete("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.Context.NONE); + } +} +``` + +### FileImports_Get + +```java +/** + * Samples for FileImports Get. + */ +public final class FileImportsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/GetFileImportById.json + */ + /** + * Sample code: Get a file import. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileImport(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } +} +``` + +### FileImports_List + +```java +/** + * Samples for FileImports List. + */ +public final class FileImportsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/GetFileImports.json + */ + /** + * Sample code: Get all file imports. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllFileImports(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Get_SingleRecommendation + +```java +/** + * Samples for Get SingleRecommendation. + */ +public final class GetSingleRecommendationSamples { + /* + * x-ms-original-file: 2025-10-01-preview/recommendations/GetRecommendation.json + */ + /** + * Sample code: Get a recommendation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.gets() + .singleRecommendationWithResponse("myRg", "myWorkspace", "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", + com.azure.core.util.Context.NONE); + } +} +``` + +### GetRecommendations_List + +```java +/** + * Samples for GetRecommendations List. + */ +public final class GetRecommendationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/recommendations/GetRecommendations.json + */ + /** + * Sample code: Get Recommendations list. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getRecommendationsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.getRecommendations().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### GetTriggeredAnalyticsRuleRuns_List + +```java +/** + * Samples for GetTriggeredAnalyticsRuleRuns List. + */ +public final class GetTriggeredAnalyticsRuleRunsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/triggeredAnalyticsRuleRuns/triggeredAnalyticsRuleRuns_Get.json + */ + /** + * Sample code: triggeredAnalyticsRuleRuns_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + triggeredAnalyticsRuleRunsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.getTriggeredAnalyticsRuleRuns().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### HuntComments_CreateOrUpdate + +```java +/** + * Samples for HuntComments CreateOrUpdate. + */ +public final class HuntCommentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/CreateHuntComment.json + */ + /** + * Sample code: Creates or updates a hunt comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAHuntComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .define("2216d0e1-91e3-4902-89fd-d2df8c535096") + .withExistingHunt("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f") + .withMessage("This is a test comment.") + .create(); + } +} +``` + +### HuntComments_Delete + +```java +/** + * Samples for HuntComments Delete. + */ +public final class HuntCommentsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/DeleteHuntComment.json + */ + /** + * Sample code: Delete a hunt comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAHuntComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .deleteWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c123456", com.azure.core.util.Context.NONE); + } +} +``` + +### HuntComments_Get + +```java +/** + * Samples for HuntComments Get. + */ +public final class HuntCommentsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntCommentById.json + */ + /** + * Sample code: Get a hunt comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHuntComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .getWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c535096", com.azure.core.util.Context.NONE); + } +} +``` + +### HuntComments_List + +```java +/** + * Samples for HuntComments List. + */ +public final class HuntCommentsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntComments.json + */ + /** + * Sample code: Get all hunt comments. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllHuntComments(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .list("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", null, null, null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### HuntRelations_CreateOrUpdate + +```java +import java.util.Arrays; + +/** + * Samples for HuntRelations CreateOrUpdate. + */ +public final class HuntRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/CreateHuntRelation.json + */ + /** + * Sample code: Creates or updates a hunt relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAHuntRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .define("2216d0e1-91e3-4902-89fd-d2df8c535096") + .withExistingHunt("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f") + .withRelatedResourceId( + "/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/Bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096") + .withLabels(Arrays.asList("Test Label")) + .create(); + } +} +``` + +### HuntRelations_Delete + +```java +/** + * Samples for HuntRelations Delete. + */ +public final class HuntRelationsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/DeleteHuntRelation.json + */ + /** + * Sample code: Delete a hunt relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAHuntRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .deleteWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c535096", com.azure.core.util.Context.NONE); + } +} +``` + +### HuntRelations_Get + +```java +/** + * Samples for HuntRelations Get. + */ +public final class HuntRelationsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntRelationById.json + */ + /** + * Sample code: Get a hunt relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHuntRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .getWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c535096", com.azure.core.util.Context.NONE); + } +} +``` + +### HuntRelations_List + +```java +/** + * Samples for HuntRelations List. + */ +public final class HuntRelationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntRelations.json + */ + /** + * Sample code: Get all hunt relations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllHuntRelations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .list("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", null, null, null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Hunts_CreateOrUpdate + +```java +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.util.Arrays; + +/** + * Samples for Hunts CreateOrUpdate. + */ +public final class HuntsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/CreateHunt.json + */ + /** + * Sample code: Creates or updates a hunt. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAHunt(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts() + .define("163e7b2a-a2ec-4041-aaba-d878a38f265f") + .withExistingWorkspace("myRg", "myWorkspace") + .withDisplayName("Log4J new hunt") + .withDescription("Log4J Hunt Description") + .withStatus(Status.NEW) + .withHypothesisStatus(HypothesisStatus.UNKNOWN) + .withAttackTactics(Arrays.asList(AttackTactic.RECONNAISSANCE)) + .withAttackTechniques(Arrays.asList("T1595")) + .withLabels(Arrays.asList("Label1", "Label2")) + .withOwner(new HuntOwner().withObjectId("873b5263-5d34-4149-b356-ad341b01e123")) + .create(); + } +} +``` + +### Hunts_Delete + +```java +/** + * Samples for Hunts Delete. + */ +public final class HuntsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/DeleteHunt.json + */ + /** + * Sample code: Delete a hunt. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAHunt(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts() + .deleteWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + com.azure.core.util.Context.NONE); + } +} +``` + +### Hunts_Get + +```java +/** + * Samples for Hunts Get. + */ +public final class HuntsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntById.json + */ + /** + * Sample code: Get a hunt. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHunt(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts() + .getWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + com.azure.core.util.Context.NONE); + } +} +``` + +### Hunts_List + +```java +/** + * Samples for Hunts List. + */ +public final class HuntsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHunts.json + */ + /** + * Sample code: Get all hunts. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllHunts(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts().list("myRg", "myWorkspace", null, null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentComments_CreateOrUpdate + +```java +/** + * Samples for IncidentComments CreateOrUpdate. + */ +public final class IncidentCommentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_CreateOrUpdate.json + */ + /** + * Sample code: IncidentComments_CreateOrUpdate. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentCommentsCreateOrUpdate(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 +/** + * Samples for IncidentComments Delete. + */ +public final class IncidentCommentsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_Delete.json + */ + /** + * Sample code: IncidentComments_Delete. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentCommentsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentComments() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentComments_Get + +```java +/** + * Samples for IncidentComments Get. + */ +public final class IncidentCommentsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_Get.json + */ + /** + * Sample code: IncidentComments_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentCommentsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentComments() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentComments_List + +```java +/** + * Samples for IncidentComments List. + */ +public final class IncidentCommentsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_List.json + */ + /** + * Sample code: IncidentComments_List. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentCommentsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentComments() + .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", null, null, null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentRelations_CreateOrUpdate + +```java +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + +/** + * Samples for IncidentRelations CreateOrUpdate. + */ +public final class IncidentRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/relations/CreateIncidentRelation.json + */ + /** + * Sample code: Creates or updates a relation for a given incident. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesARelationForAGivenIncident( + 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"), + com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentRelations_Delete + +```java +/** + * Samples for IncidentRelations Delete. + */ +public final class IncidentRelationsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentRelations_Get + +```java +/** + * Samples for IncidentRelations Get. + */ +public final class IncidentRelationsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentRelations_List + +```java +/** + * Samples for IncidentRelations List. + */ +public final class IncidentRelationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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, + com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentTasks_CreateOrUpdate + +```java +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; + +/** + * Samples for IncidentTasks CreateOrUpdate. + */ +public final class IncidentTasksCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_CreateOrUpdate.json + */ + /** + * Sample code: IncidentTasks_CreateOrUpdate. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentTasksCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingIncident("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withTitle("Task title") + .withStatus(IncidentTaskStatus.NEW) + .withDescription("Task description") + .create(); + } +} +``` + +### IncidentTasks_Delete + +```java +/** + * Samples for IncidentTasks Delete. + */ +public final class IncidentTasksDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_Delete.json + */ + /** + * Sample code: IncidentTasks_Delete. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentTasksDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentTasks_Get + +```java +/** + * Samples for IncidentTasks Get. + */ +public final class IncidentTasksGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_Get.json + */ + /** + * Sample code: IncidentTasks_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentTasksGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} +``` + +### IncidentTasks_List + +```java +/** + * Samples for IncidentTasks List. + */ +public final class IncidentTasksListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_List.json + */ + /** + * Sample code: IncidentTasks_List. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentTasksList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.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; + +/** + * Samples for Incidents CreateOrUpdate. + */ +public final class IncidentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_CreateOrUpdate.json + */ + /** + * Sample code: Incidents_CreateOrUpdate. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentsCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withTitle("My incident") + .withDescription("This is a demo incident") + .withSeverity(IncidentSeverity.HIGH) + .withStatus(IncidentStatus.CLOSED) + .withClassification(IncidentClassification.FALSE_POSITIVE) + .withClassificationReason(IncidentClassificationReason.INACCURATE_DATA) + .withClassificationComment("Not a malicious activity") + .withOwner(new IncidentOwnerInfo().withObjectId("2046feea-040d-4a46-9e2b-91c2941bfa70")) + .withFirstActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:00:30Z")) + .withLastActivityTimeUtc(OffsetDateTime.parse("2019-01-01T13:05:30Z")) + .create(); + } +} +``` + +### Incidents_Delete + +```java +/** + * Samples for Incidents Delete. + */ +public final class IncidentsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_Delete.json + */ + /** + * Sample code: Incidents_Delete. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } +} +``` + +### Incidents_Get + +```java +/** + * Samples for Incidents Get. + */ +public final class IncidentsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_Get.json + */ + /** + * Sample code: Incidents_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } +} +``` + +### Incidents_List + +```java +/** + * Samples for Incidents List. + */ +public final class IncidentsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_List.json + */ + /** + * Sample code: Incidents_List. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Incidents_ListAlerts + +```java +/** + * Samples for Incidents ListAlerts. + */ +public final class IncidentsListAlertsSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentAlerts/Incidents_ListAlerts.json + */ + /** + * Sample code: Incidents_ListAlerts. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentsListAlerts(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .listAlertsWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", + com.azure.core.util.Context.NONE); + } +} +``` + +### Incidents_ListBookmarks + +```java +/** + * Samples for Incidents ListBookmarks. + */ +public final class IncidentsListBookmarksSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentBookmarks/Incidents_ListBookmarks.json + */ + /** + * Sample code: Incidents_ListBookmarks. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentsListBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .listBookmarksWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", + com.azure.core.util.Context.NONE); + } +} +``` + +### Incidents_ListEntities + +```java +/** + * Samples for Incidents ListEntities. + */ +public final class IncidentsListEntitiesSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentEntities/Incidents_ListEntities.json + */ + /** + * Sample code: Incidents_ListEntities. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentsListEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .listEntitiesWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", + com.azure.core.util.Context.NONE); + } +} +``` + +### Incidents_RunPlaybook + +```java + +/** + * Samples for Incidents RunPlaybook. + */ +public final class IncidentsRunPlaybookSamples { + /* + * x-ms-original-file: 2025-10-01-preview/manualTrigger/Incidents_RunPlaybook.json + */ + /** + * Sample code: Incidents_RunPlaybook. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentsRunPlaybook(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .runPlaybookWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ar4", null, + com.azure.core.util.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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +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: 2025-10-01-preview/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("AnalyticsRule") + .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(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withOperator(MetadataDependencyOperator.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")) + .withCustomVersion("1.0") + .withContentSchemaVersion("2.0") + .withThreatAnalysisTactics(Arrays.asList("reconnaissance", "commandandcontrol")) + .withThreatAnalysisTechniques(Arrays.asList("T1548", "T1548.001")) + .withPreviewImages(Arrays.asList("firstImage.png", "secondImage.jpeg")) + .withPreviewImagesDark(Arrays.asList("firstImageDark.png", "secondImageDark.jpeg")) + .create(); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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("AnalyticsRule") + .create(); + } +} +``` + +### Metadata_Delete + +```java +/** + * Samples for Metadata Delete. + */ +public final class MetadataDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### Metadata_Get + +```java +/** + * Samples for Metadata Get. + */ +public final class MetadataGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### Metadata_List + +```java +/** + * Samples for Metadata List. + */ +public final class MetadataListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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, com.azure.core.util.Context.NONE); + } +} +``` + +### Metadata_Update + +```java +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: 2025-10-01-preview/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", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withAuthor(new MetadataAuthor().withName("User Name").withEmail("email@microsoft.com")) + .apply(); + } +} +``` + +### OfficeConsents_Delete + +```java +/** + * Samples for OfficeConsents Delete. + */ +public final class OfficeConsentsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### OfficeConsents_Get + +```java +/** + * Samples for OfficeConsents Get. + */ +public final class OfficeConsentsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### OfficeConsents_List + +```java +/** + * Samples for OfficeConsents List. + */ +public final class OfficeConsentsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/operations/ListOperations.json + */ + /** + * Sample code: Get all operations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllOperations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ProductPackage_Get + +```java +/** + * Samples for ProductPackage Get. + */ +public final class ProductPackageGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetProductPackageById.json + */ + /** + * Sample code: Get a package. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAPackage(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productPackages() + .getWithResponse("myRg", "myWorkspace", "str.azure-sentinel-solution-str", + com.azure.core.util.Context.NONE); + } +} +``` + +### ProductPackagesOperation_List + +```java +/** + * Samples for ProductPackagesOperation List. + */ +public final class ProductPackagesOperationListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetProductPackages.json + */ + /** + * Sample code: Get all available packages. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllAvailablePackages(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productPackagesOperations() + .list("myRg", "myWorkspace", null, null, null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### ProductSettings_Delete + +```java +/** + * Samples for ProductSettings Delete. + */ +public final class ProductSettingsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### ProductSettings_Get + +```java +/** + * Samples for ProductSettings Get. + */ +public final class ProductSettingsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### ProductSettings_List + +```java +/** + * Samples for ProductSettings List. + */ +public final class ProductSettingsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### ProductSettings_Update + +```java +import com.azure.resourcemanager.securityinsights.models.EyesOn; + +/** + * Samples for ProductSettings Update. + */ +public final class ProductSettingsUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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\""), com.azure.core.util.Context.NONE); + } +} +``` + +### ProductTemplate_Get + +```java +/** + * Samples for ProductTemplate Get. + */ +public final class ProductTemplateGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetProductTemplateById.json + */ + /** + * Sample code: Get a template. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productTemplates() + .getWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); + } +} +``` + +### ProductTemplatesOperation_List + +```java +/** + * Samples for ProductTemplatesOperation List. + */ +public final class ProductTemplatesOperationListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetProductTemplates.json + */ + /** + * Sample code: Get all installed templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllInstalledTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productTemplatesOperations() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Reevaluate_Recommendation + +```java +/** + * Samples for Reevaluate Recommendation. + */ +public final class ReevaluateRecommendationSamples { + /* + * x-ms-original-file: 2025-10-01-preview/recommendations/ReevaluateRecommendation.json + */ + /** + * Sample code: Reevaluate a recommendation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + reevaluateARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.reevaluates() + .recommendationWithResponse("myRg", "myWorkspace", "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ListGeodataByIp + +```java +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; + +/** + * Samples for ResourceProvider ListGeodataByIp. + */ +public final class ResourceProviderListGeodataByIpSamples { + /* + * x-ms-original-file: 2025-10-01-preview/enrichment/GetGeodataWithWorkspaceByIp.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.resourceProviders() + .listGeodataByIpWithResponse("myRg", "myWorkspace", EnrichmentType.MAIN, + new EnrichmentIpAddressBody().withIpAddress("1.2.3.4"), com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ListWhoisByDomain + +```java +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; + +/** + * Samples for ResourceProvider ListWhoisByDomain. + */ +public final class ResourceProviderListWhoisByDomainSamples { + /* + * x-ms-original-file: 2025-10-01-preview/enrichment/GetWhoisWithWorkspaceByDomainName.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.resourceProviders() + .listWhoisByDomainWithResponse("myRg", "myWorkspace", EnrichmentType.MAIN, + new EnrichmentDomainBody().withDomain("microsoft.com"), com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityMLAnalyticsSettings_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.AnomalySecurityMLAnalyticsSettings; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsDataSource; +import com.azure.resourcemanager.securityinsights.models.SettingsStatus; +import java.io.IOException; +import java.time.Duration; +import java.util.Arrays; + +/** + * Samples for SecurityMLAnalyticsSettings CreateOrUpdate. + */ +public final class SecurityMLAnalyticsSettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json + */ + /** + * Sample code: Creates or updates a Anomaly Security ML Analytics Settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAAnomalySecurityMLAnalyticsSettings( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager.securityMLAnalyticsSettings() + .createOrUpdateWithResponse("myRg", "myWorkspace", "f209187f-1d17-4431-94af-c141bf5f23db", + new AnomalySecurityMLAnalyticsSettings().withEtag("\"260090e2-0000-0d00-0000-5d6fb8670000\"") + .withDescription( + "When account logs from a source region that has rarely been logged in from during the last 14 days, an anomaly is triggered.") + .withDisplayName("Login from unusual region") + .withEnabled(true) + .withRequiredDataConnectors( + Arrays.asList(new SecurityMLAnalyticsSettingsDataSource().withConnectorId("AWS") + .withDataTypes(Arrays.asList("AWSCloudTrail")))) + .withTactics(Arrays.asList(AttackTactic.EXFILTRATION, AttackTactic.COMMAND_AND_CONTROL)) + .withTechniques(Arrays.asList("T1037", "T1021")) + .withAnomalyVersion("1.0.5") + .withCustomizableObservations(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"multiSelectObservations\":null,\"prioritizeExcludeObservations\":null,\"singleSelectObservations\":[{\"name\":\"Device vendor\",\"description\":\"Select device vendor of network connection logs from CommonSecurityLog\",\"rerun\":\"RerunAlways\",\"sequenceNumber\":1,\"supportedValues\":[\"Palo Alto Networks\",\"Fortinet\",\"Check Point\"],\"supportedValuesKql\":null,\"value\":[\"Palo Alto Networks\"],\"valuesKql\":null}],\"singleValueObservations\":null,\"thresholdObservations\":[{\"name\":\"Daily data transfer threshold in MB\",\"description\":\"Suppress anomalies when daily data transfered (in MB) per hour is less than the chosen value\",\"maximum\":\"100\",\"minimum\":\"1\",\"rerun\":\"RerunAlways\",\"sequenceNumber\":1,\"value\":\"25\"},{\"name\":\"Number of standard deviations\",\"description\":\"Triggers anomalies when number of standard deviations is greater than the chosen value\",\"maximum\":\"10\",\"minimum\":\"2\",\"rerun\":\"RerunAlways\",\"sequenceNumber\":2,\"value\":\"3\"}]}", + Object.class, SerializerEncoding.JSON)) + .withFrequency(Duration.parse("PT1H")) + .withSettingsStatus(SettingsStatus.PRODUCTION) + .withIsDefaultSettings(true) + .withAnomalySettingsVersion(0) + .withSettingsDefinitionId("f209187f-1d17-4431-94af-c141bf5f23db"), + com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityMLAnalyticsSettings_Delete + +```java +/** + * Samples for SecurityMLAnalyticsSettings Delete. + */ +public final class SecurityMLAnalyticsSettingsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json + */ + /** + * Sample code: Delete a Security ML Analytics Settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteASecurityMLAnalyticsSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.securityMLAnalyticsSettings() + .deleteWithResponse("myRg", "myWorkspace", "f209187f-1d17-4431-94af-c141bf5f23db", + com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityMLAnalyticsSettings_Get + +```java +/** + * Samples for SecurityMLAnalyticsSettings Get. + */ +public final class SecurityMLAnalyticsSettingsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json + */ + /** + * Sample code: Get a Anomaly Security ML Analytics Settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAAnomalySecurityMLAnalyticsSettings( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.securityMLAnalyticsSettings() + .getWithResponse("myRg", "myWorkspace", "myFirstAnomalySettings", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityMLAnalyticsSettings_List + +```java +/** + * Samples for SecurityMLAnalyticsSettings List. + */ +public final class SecurityMLAnalyticsSettingsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json + */ + /** + * Sample code: Get all Security ML Analytics Settings. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllSecurityMLAnalyticsSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.securityMLAnalyticsSettings().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### SentinelOnboardingStates_Create + +```java +/** + * Samples for SentinelOnboardingStates Create. + */ +public final class SentinelOnboardingStatesCreateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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 +/** + * Samples for SentinelOnboardingStates Delete. + */ +public final class SentinelOnboardingStatesDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### SentinelOnboardingStates_Get + +```java +/** + * Samples for SentinelOnboardingStates Get. + */ +public final class SentinelOnboardingStatesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### SentinelOnboardingStates_List + +```java +/** + * Samples for SentinelOnboardingStates List. + */ +public final class SentinelOnboardingStatesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### SourceControlOperation_ListRepositories + +```java +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; + +/** + * Samples for SourceControlOperation ListRepositories. + */ +public final class SourceControlOperationListRepositoriesSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControlOperations() + .listRepositories("myRg", "myWorkspace", + new RepositoryAccessProperties().withKind(RepositoryAccessKind.OAUTH) + .withCode("fakeTokenPlaceholder") + .withState("state") + .withClientId("54b3c2c0-1f48-4a1c-af9f-6399c3240b73"), + com.azure.core.util.Context.NONE); + } +} +``` + +### SourceControls_Create + +```java +import com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccess; +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.RepositoryAccessKind; +import java.util.Arrays; + +/** + * Samples for SourceControls Create. + */ +public final class SourceControlsCreateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/sourcecontrols/CreateSourceControl.json + */ + /** + * Sample code: Creates or updates a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControls() + .define("789e0c1f-4a3d-43ad-809c-e713b677b04a") + .withExistingWorkspace("myRg", "myWorkspace") + .withDisplayName("My Source Control") + .withRepoType(RepoType.GITHUB) + .withContentTypes(Arrays.asList(ContentType.ANALYTICS_RULE, ContentType.WORKBOOK)) + .withRepository(new Repository().withUrl("https://github.com/user/repo") + .withBranch("master") + .withDisplayUrl("https://github.com/user/repo")) + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDescription("This is a source control") + .withRepositoryAccess(new RepositoryAccess().withKind(RepositoryAccessKind.OAUTH) + .withCode("fakeTokenPlaceholder") + .withState("state") + .withClientId("54b3c2c0-1f48-4a1c-af9f-6399c3240b73")) + .create(); + } +} +``` + +### SourceControls_Delete + +```java +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; + +/** + * Samples for SourceControls Delete. + */ +public final class SourceControlsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControls() + .deleteWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", + new RepositoryAccessProperties().withKind(RepositoryAccessKind.OAUTH) + .withCode("fakeTokenPlaceholder") + .withState("state") + .withClientId("54b3c2c0-1f48-4a1c-af9f-6399c3240b73"), + com.azure.core.util.Context.NONE); + } +} +``` + +### SourceControls_Get + +```java +/** + * Samples for SourceControls Get. + */ +public final class SourceControlsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControls() + .getWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", + com.azure.core.util.Context.NONE); + } +} +``` + +### SourceControls_List + +```java +/** + * Samples for SourceControls List. + */ +public final class SourceControlsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControls().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligence_Count + +```java +import com.azure.resourcemanager.securityinsights.models.CountQuery; +import com.azure.resourcemanager.securityinsights.models.TiType; + +/** + * Samples for ThreatIntelligence Count. + */ +public final class ThreatIntelligenceCountSamples { + /* + * x-ms-original-file: 2025-10-01-preview/threatintelligence/PostThreatIntelligenceCount.json + */ + /** + * Sample code: Get TI object count. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getTIObjectCount(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligences() + .countWithResponse("myRg", "myWorkspace", TiType.MAIN, new CountQuery(), com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligence_Query + +```java +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.QueryCondition; +import com.azure.resourcemanager.securityinsights.models.QuerySortBy; +import com.azure.resourcemanager.securityinsights.models.SortingDirection; +import com.azure.resourcemanager.securityinsights.models.TiType; +import java.util.Arrays; + +/** + * Samples for ThreatIntelligence Query. + */ +public final class ThreatIntelligenceQuerySamples { + /* + * x-ms-original-file: 2025-10-01-preview/threatintelligence/PostThreatIntelligenceQuery.json + */ + /** + * Sample code: Get TI objects. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getTIObjects(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligences() + .query("myRg", "myWorkspace", TiType.MAIN, + new Query() + .withCondition(new QueryCondition().withStixObjectType("attack-pattern") + .withClauses(Arrays.asList(new ConditionClause().withField("lastUpdatedTimeUtc") + .withOperator(Operator.ON_OR_BEFORE_ABSOLUTE) + .withValues(Arrays.asList("2024-02-09T23:59:59.999Z"))))) + .withSortBy(new QuerySortBy().withDirection(SortingDirection.DESC).withField("lastUpdatedTimeUtc")) + .withMaxPageSize(100) + .withMinPageSize(100), + com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_AppendTags + +```java +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; +import java.util.Arrays; + +/** + * Samples for ThreatIntelligenceIndicator AppendTags. + */ +public final class ThreatIntelligenceIndicatorAppendTagsSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_Create + +```java +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import java.util.Arrays; + +/** + * Samples for ThreatIntelligenceIndicator Create. + */ +public final class ThreatIntelligenceIndicatorCreateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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 ThreatIntelligenceIndicatorModel().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(""), + com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_CreateIndicator + +```java +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import java.util.Arrays; + +/** + * Samples for ThreatIntelligenceIndicator CreateIndicator. + */ +public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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 ThreatIntelligenceIndicatorModel().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(""), + com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_Delete + +```java +/** + * Samples for ThreatIntelligenceIndicator Delete. + */ +public final class ThreatIntelligenceIndicatorDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_Get + +```java +/** + * Samples for ThreatIntelligenceIndicator Get. + */ +public final class ThreatIntelligenceIndicatorGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_QueryIndicators + +```java +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingOrder; +import java.util.Arrays; + +/** + * Samples for ThreatIntelligenceIndicator QueryIndicators. + */ +public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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("fakeTokenPlaceholder") + .withSortOrder(ThreatIntelligenceSortingOrder.DESCENDING))) + .withSources(Arrays.asList("Azure Sentinel")), com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicator_ReplaceTags + +```java +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import java.util.Arrays; + +/** + * Samples for ThreatIntelligenceIndicator ReplaceTags. + */ +public final class ThreatIntelligenceIndicatorReplaceTagsSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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 ThreatIntelligenceIndicatorModel().withEtag("\"0000262c-0000-0800-0000-5e9767060000\"") + .withThreatIntelligenceTags(Arrays.asList("patching tags")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicatorMetrics_List + +```java +/** + * Samples for ThreatIntelligenceIndicatorMetrics List. + */ +public final class ThreatIntelligenceIndicatorMetricsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} +``` + +### ThreatIntelligenceIndicatorsOperation_List ```java /** - * Samples for Incidents Delete. + * Samples for ThreatIntelligenceIndicatorsOperation List. */ -public final class IncidentsDeleteSamples { +public final class ThreatIntelligenceIndicatorsOperationListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * DeleteIncident.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/GetThreatIntelligence.json */ /** - * Sample code: Delete an incident. + * Sample code: Get all threat intelligence indicators. * * @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", - com.azure.core.util.Context.NONE); + public static void + getAllThreatIntelligenceIndicators(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligenceIndicatorsOperations() + .list("myRg", "myWorkspace", null, null, null, null, com.azure.core.util.Context.NONE); } } ``` -### Incidents_Get +### TriggeredAnalyticsRuleRunOperation_Get ```java /** - * Samples for Incidents Get. + * Samples for TriggeredAnalyticsRuleRunOperation Get. */ -public final class IncidentsGetSamples { +public final class TriggeredAnalyticsRuleRunOperationGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetIncidentById.json + * x-ms-original-file: 2025-10-01-preview/triggeredAnalyticsRuleRuns/triggeredAnalyticsRuleRun_Get.json */ /** - * Sample code: Get an incident. + * Sample code: triggeredAnalyticsRuleRun_Get. * * @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", + public static void + triggeredAnalyticsRuleRunGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.triggeredAnalyticsRuleRunOperations() + .getWithResponse("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", com.azure.core.util.Context.NONE); } } ``` -### Incidents_List +### Update_Recommendation ```java +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties; +import com.azure.resourcemanager.securityinsights.models.State; + /** - * Samples for Incidents List. + * Samples for Update Recommendation. */ -public final class IncidentsListSamples { +public final class UpdateRecommendationSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetIncidents.json + * x-ms-original-file: 2025-10-01-preview/recommendations/PatchRecommendation.json */ /** - * Sample code: Get all incidents. + * Sample code: Creates a recommendation. * * @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, + public static void + createsARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.updates() + .recommendationWithResponse("myRg", "myWorkspace", "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", + new RecommendationPatch().withProperties(new RecommendationPatchProperties().withState(State.ACTIVE)), com.azure.core.util.Context.NONE); } } ``` -### Incidents_ListAlerts +### WatchlistItems_CreateOrUpdate ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + /** - * Samples for Incidents ListAlerts. + * Samples for WatchlistItems CreateOrUpdate. */ -public final class IncidentsListAlertsSamples { +public final class WatchlistItemsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetAllIncidentAlerts.json + * x-ms-original-file: 2025-10-01-preview/watchlists/CreateWatchlistItem.json */ /** - * Sample code: Get all incident alerts. + * Sample code: Create or update a watchlist item. * * @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", - com.azure.core.util.Context.NONE); + public static void createOrUpdateAWatchlistItem( + 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(); } } ``` -### Incidents_ListBookmarks +### WatchlistItems_Delete ```java /** - * Samples for Incidents ListBookmarks. + * Samples for WatchlistItems Delete. */ -public final class IncidentsListBookmarksSamples { +public final class WatchlistItemsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetAllIncidentBookmarks.json + * x-ms-original-file: 2025-10-01-preview/watchlists/DeleteWatchlistItem.json */ /** - * Sample code: Get all incident bookmarks. + * Sample code: Delete a watchlist item. * * @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", + deleteAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems() + .deleteWithResponse("myRg", "myWorkspace", "highValueAsset", "4008512e-1d30-48b2-9ee2-d3612ed9d3ea", com.azure.core.util.Context.NONE); } } ``` -### Incidents_ListEntities +### WatchlistItems_Get ```java /** - * Samples for Incidents ListEntities. + * Samples for WatchlistItems Get. */ -public final class IncidentsListEntitiesSamples { +public final class WatchlistItemsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetAllIncidentEntities.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlistItemById.json */ /** - * Sample code: Gets all incident related entities. + * Sample code: Get a watchlist item. * * @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", + public static void getAWatchlistItem(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems() + .getWithResponse("myRg", "myWorkspace", "highValueAsset", "3f8901fe-63d9-4875-9ad5-9fb3b8105797", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### WatchlistItems_List ```java /** - * Samples for Operations List. + * Samples for WatchlistItems List. */ -public final class OperationsListSamples { +public final class WatchlistItemsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/operations/ - * ListOperations.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlistItems.json */ /** - * Sample code: Get all operations. + * Sample code: Get all watchlist Items. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllOperations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void + getAllWatchlistItems(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlistItems().list("myRg", "myWorkspace", "highValueAsset", null, com.azure.core.util.Context.NONE); } } ``` -### SecurityMLAnalyticsSettings_CreateOrUpdate +### Watchlists_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.securityinsights.models.AnomalySecurityMLAnalyticsSettings; -import com.azure.resourcemanager.securityinsights.models.AttackTactic; -import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsDataSource; -import com.azure.resourcemanager.securityinsights.models.SettingsStatus; -import java.io.IOException; -import java.time.Duration; -import java.util.Arrays; -import java.util.UUID; +import com.azure.resourcemanager.securityinsights.models.SourceType; /** - * Samples for SecurityMLAnalyticsSettings CreateOrUpdate. + * Samples for Watchlists CreateOrUpdate. */ -public final class SecurityMLAnalyticsSettingsCreateOrUpdateSamples { +public final class WatchlistsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: 2025-10-01-preview/watchlists/CreateWatchlist.json */ /** - * Sample code: Creates or updates a Anomaly Security ML Analytics Settings. + * Sample code: Create or update a watchlist. * * @param manager Entry point to SecurityInsightsManager. */ - public static void createsOrUpdatesAAnomalySecurityMLAnalyticsSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { - manager.securityMLAnalyticsSettings() - .createOrUpdateWithResponse("myRg", "myWorkspace", "f209187f-1d17-4431-94af-c141bf5f23db", - new AnomalySecurityMLAnalyticsSettings().withEtag("\"260090e2-0000-0d00-0000-5d6fb8670000\"") - .withDescription( - "When account logs from a source region that has rarely been logged in from during the last 14 days, an anomaly is triggered.") - .withDisplayName("Login from unusual region") - .withEnabled(true) - .withRequiredDataConnectors( - Arrays.asList(new SecurityMLAnalyticsSettingsDataSource().withConnectorId("AWS") - .withDataTypes(Arrays.asList("AWSCloudTrail")))) - .withTactics(Arrays.asList(AttackTactic.EXFILTRATION, AttackTactic.COMMAND_AND_CONTROL)) - .withTechniques(Arrays.asList("T1037", "T1021")) - .withAnomalyVersion("1.0.5") - .withCustomizableObservations(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize( - "{\"multiSelectObservations\":null,\"prioritizeExcludeObservations\":null,\"singleSelectObservations\":[{\"name\":\"Device vendor\",\"description\":\"Select device vendor of network connection logs from CommonSecurityLog\",\"rerun\":\"RerunAlways\",\"sequenceNumber\":1,\"supportedValues\":[\"Palo Alto Networks\",\"Fortinet\",\"Check Point\"],\"supportedValuesKql\":null,\"value\":[\"Palo Alto Networks\"],\"valuesKql\":null}],\"singleValueObservations\":null,\"thresholdObservations\":[{\"name\":\"Daily data transfer threshold in MB\",\"description\":\"Suppress anomalies when daily data transfered (in MB) per hour is less than the chosen value\",\"maximum\":\"100\",\"minimum\":\"1\",\"rerun\":\"RerunAlways\",\"sequenceNumber\":1,\"value\":\"25\"},{\"name\":\"Number of standard deviations\",\"description\":\"Triggers anomalies when number of standard deviations is greater than the chosen value\",\"maximum\":\"10\",\"minimum\":\"2\",\"rerun\":\"RerunAlways\",\"sequenceNumber\":2,\"value\":\"3\"}]}", - Object.class, SerializerEncoding.JSON)) - .withFrequency(Duration.parse("PT1H")) - .withSettingsStatus(SettingsStatus.PRODUCTION) - .withIsDefaultSettings(true) - .withAnomalySettingsVersion(0) - .withSettingsDefinitionId(UUID.fromString("f209187f-1d17-4431-94af-c141bf5f23db")), - com.azure.core.util.Context.NONE); + public static void + createOrUpdateAWatchlist(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("watchlist.csv") + .withSourceType(SourceType.LOCAL) + .withDescription("Watchlist from CSV content") + .withItemsSearchKey("header1") + .create(); } -} -``` - -### SecurityMLAnalyticsSettings_Delete -```java -/** - * Samples for SecurityMLAnalyticsSettings Delete. - */ -public final class SecurityMLAnalyticsSettingsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json + * x-ms-original-file: 2025-10-01-preview/watchlists/CreateWatchlistAndWatchlistItems.json */ /** - * Sample code: Delete a Security ML Analytics Settings. + * Sample code: Create or update a watchlist and bulk creates watchlist items. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - deleteASecurityMLAnalyticsSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.securityMLAnalyticsSettings() - .deleteWithResponse("myRg", "myWorkspace", "f209187f-1d17-4431-94af-c141bf5f23db", - com.azure.core.util.Context.NONE); + public static void createOrUpdateAWatchlistAndBulkCreatesWatchlistItems( + 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("watchlist.csv") + .withSourceType(SourceType.LOCAL) + .withDescription("Watchlist from CSV content") + .withNumberOfLinesToSkip(1) + .withRawContent("This line will be skipped\nheader1,header2\nvalue1,value2") + .withItemsSearchKey("header1") + .withContentType("text/csv") + .create(); } } ``` -### SecurityMLAnalyticsSettings_Get +### Watchlists_Delete ```java /** - * Samples for SecurityMLAnalyticsSettings Get. + * Samples for Watchlists Delete. */ -public final class SecurityMLAnalyticsSettingsGetSamples { +public final class WatchlistsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: 2025-10-01-preview/watchlists/DeleteWatchlist.json */ /** - * Sample code: Get a Anomaly Security ML Analytics Settings. + * Sample code: Delete a watchlist. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAAnomalySecurityMLAnalyticsSettings( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.securityMLAnalyticsSettings() - .getWithResponse("myRg", "myWorkspace", "myFirstAnomalySettings", com.azure.core.util.Context.NONE); + public static void deleteAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().delete("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.Context.NONE); } } ``` -### SecurityMLAnalyticsSettings_List +### Watchlists_Get ```java /** - * Samples for SecurityMLAnalyticsSettings List. + * Samples for Watchlists Get. */ -public final class SecurityMLAnalyticsSettingsListSamples { +public final class WatchlistsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlistByAlias.json */ /** - * Sample code: Get all Security ML Analytics Settings. + * Sample code: Get a watchlist. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - getAllSecurityMLAnalyticsSettings(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.securityMLAnalyticsSettings().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + public static void getAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().getWithResponse("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.Context.NONE); } } ``` -### SentinelOnboardingStates_Create +### Watchlists_List ```java /** - * Samples for SentinelOnboardingStates Create. + * Samples for Watchlists List. */ -public final class SentinelOnboardingStatesCreateSamples { +public final class WatchlistsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/CreateSentinelOnboardingState.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlists.json */ /** - * Sample code: Create Sentinel onboarding state. + * Sample code: Get all watchlists. * * @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(); + public static void getAllWatchlists(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.watchlists().list("myRg", "myWorkspace", null, com.azure.core.util.Context.NONE); } } ``` -### SentinelOnboardingStates_Delete +### WorkspaceManagerAssignmentJobs_Create ```java /** - * Samples for SentinelOnboardingStates Delete. + * Samples for WorkspaceManagerAssignmentJobs Create. */ -public final class SentinelOnboardingStatesDeleteSamples { +public final class WorkspaceManagerAssignmentJobsCreateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/DeleteSentinelOnboardingState.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/CreateJob.json */ /** - * Sample code: Delete Sentinel onboarding state. + * Sample code: Creates a job for the specified workspace manager assignment. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - deleteSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates() - .deleteWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); + public static void createsAJobForTheSpecifiedWorkspaceManagerAssignment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignmentJobs() + .createWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + com.azure.core.util.Context.NONE); } } ``` -### SentinelOnboardingStates_Get +### WorkspaceManagerAssignmentJobs_Delete ```java /** - * Samples for SentinelOnboardingStates Get. + * Samples for WorkspaceManagerAssignmentJobs Delete. */ -public final class SentinelOnboardingStatesGetSamples { +public final class WorkspaceManagerAssignmentJobsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/GetSentinelOnboardingState.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/DeleteJob.json */ /** - * Sample code: Get Sentinel onboarding state. + * Sample code: Delete a workspace manager job. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getSentinelOnboardingState(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates() - .getWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); + deleteAWorkspaceManagerJob(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignmentJobs() + .deleteWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + "cfbe1338-8276-4d5d-8b96-931117f9fa0e", com.azure.core.util.Context.NONE); } } ``` -### SentinelOnboardingStates_List +### WorkspaceManagerAssignmentJobs_Get ```java /** - * Samples for SentinelOnboardingStates List. + * Samples for WorkspaceManagerAssignmentJobs Get. */ -public final class SentinelOnboardingStatesListSamples { +public final class WorkspaceManagerAssignmentJobsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/GetAllSentinelOnboardingStates.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetJob.json */ /** - * Sample code: Get all Sentinel onboarding states. + * Sample code: Get a workspace manager job. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getAllSentinelOnboardingStates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.sentinelOnboardingStates().listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + getAWorkspaceManagerJob(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignmentJobs() + .getWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + "cfbe1338-8276-4d5d-8b96-931117f9fa0e", com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicator_AppendTags - -```java -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; -import java.util.Arrays; - +### WorkspaceManagerAssignmentJobs_List + +```java /** - * Samples for ThreatIntelligenceIndicator AppendTags. + * Samples for WorkspaceManagerAssignmentJobs List. */ -public final class ThreatIntelligenceIndicatorAppendTagsSamples { +public final class WorkspaceManagerAssignmentJobsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/AppendTagsThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetAllJobs.json */ /** - * Sample code: Append tags to a threat intelligence indicator. + * Sample code: Get all jobs for the specified Sentinel workspace manager assignment. * * @param manager Entry point to SecurityInsightsManager. */ - public static void appendTagsToAThreatIntelligenceIndicator( + public static void getAllJobsForTheSpecifiedSentinelWorkspaceManagerAssignment( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.threatIntelligenceIndicators() - .appendTagsWithResponse("myRg", "myWorkspace", "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", - new ThreatIntelligenceAppendTags().withThreatIntelligenceTags(Arrays.asList("tag1", "tag2")), + manager.workspaceManagerAssignmentJobs() + .list("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicator_Create +### WorkspaceManagerAssignments_CreateOrUpdate ```java -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; import java.util.Arrays; /** - * Samples for ThreatIntelligenceIndicator Create. + * Samples for WorkspaceManagerAssignments CreateOrUpdate. */ -public final class ThreatIntelligenceIndicatorCreateSamples { +public final class WorkspaceManagerAssignmentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/UpdateThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/CreateOrUpdateWorkspaceManagerAssignment.json */ /** - * Sample code: Update a threat Intelligence indicator. + * Sample code: Creates or updates a workspace manager assignment. * * @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 ThreatIntelligenceIndicatorModel().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(""), - com.azure.core.util.Context.NONE); + public static void createsOrUpdatesAWorkspaceManagerAssignment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignments() + .define("47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58") + .withExistingWorkspace("myRg", "myWorkspace") + .withTargetResourceName("37207a7a-3b8a-438f-a559-c7df400e1b96") + .withItems(Arrays.asList(new AssignmentItem().withResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspac-es/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/microsoftSecurityIncidentCreationRuleExampleOne"), + new AssignmentItem().withResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspac-es/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/microsoftSecurityIncidentCreationRuleExampleTwo"))) + .create(); } } ``` -### ThreatIntelligenceIndicator_CreateIndicator +### WorkspaceManagerAssignments_Delete ```java -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; -import java.util.Arrays; - /** - * Samples for ThreatIntelligenceIndicator CreateIndicator. + * Samples for WorkspaceManagerAssignments Delete. */ -public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { +public final class WorkspaceManagerAssignmentsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/CreateThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/DeleteWorkspaceManagerAssignment.json */ /** - * Sample code: Create a new Threat Intelligence. + * Sample code: Delete a workspace manager assignment. * * @param manager Entry point to SecurityInsightsManager. */ public static void - createANewThreatIntelligence(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.threatIntelligenceIndicators() - .createIndicatorWithResponse("myRg", "myWorkspace", - new ThreatIntelligenceIndicatorModel().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(""), + deleteAWorkspaceManagerAssignment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignments() + .deleteWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicator_Delete +### WorkspaceManagerAssignments_Get ```java /** - * Samples for ThreatIntelligenceIndicator Delete. + * Samples for WorkspaceManagerAssignments Get. */ -public final class ThreatIntelligenceIndicatorDeleteSamples { +public final class WorkspaceManagerAssignmentsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/DeleteThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetWorkspaceManagerAssignment.json */ /** - * Sample code: Delete a threat intelligence indicator. + * Sample code: Get a workspace manager assignment. * * @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", + getAWorkspaceManagerAssignment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignments() + .getWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicator_Get +### WorkspaceManagerAssignments_List ```java /** - * Samples for ThreatIntelligenceIndicator Get. + * Samples for WorkspaceManagerAssignments List. */ -public final class ThreatIntelligenceIndicatorGetSamples { +public final class WorkspaceManagerAssignmentsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/GetThreatIntelligenceById.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetAllWorkspaceManagerAssignments.json */ /** - * Sample code: View a threat intelligence indicator by name. + * Sample code: Get all workspace manager assignments for the Sentinel workspace manager. * * @param manager Entry point to SecurityInsightsManager. */ - public static void viewAThreatIntelligenceIndicatorByName( + public static void getAllWorkspaceManagerAssignmentsForTheSentinelWorkspaceManager( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.threatIntelligenceIndicators() - .getWithResponse("myRg", "myWorkspace", "e16ef847-962e-d7b6-9c8b-a33e4bd30e47", - com.azure.core.util.Context.NONE); + manager.workspaceManagerAssignments() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicator_QueryIndicators +### WorkspaceManagerConfigurations_CreateOrUpdate ```java -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingOrder; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.models.Mode; /** - * Samples for ThreatIntelligenceIndicator QueryIndicators. + * Samples for WorkspaceManagerConfigurations CreateOrUpdate. */ -public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { +public final class WorkspaceManagerConfigurationsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/QueryThreatIntelligence.json + * 2025-10-01-preview/workspaceManagerConfigurations/CreateOrUpdateWorkspaceManagerConfiguration.json */ /** - * Sample code: Query threat intelligence indicators as per filtering criteria. + * Sample code: Create or Update a workspace manager Configuration. * * @param manager Entry point to SecurityInsightsManager. */ - public static void queryThreatIntelligenceIndicatorsAsPerFilteringCriteria( + public static void createOrUpdateAWorkspaceManagerConfiguration( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.threatIntelligenceIndicators() - .queryIndicators("myRg", "myWorkspace", new ThreatIntelligenceFilteringCriteria().withPageSize(100) - .withMinConfidence(25) - .withMaxConfidence(80) - .withMinValidUntil("2020-04-05T17:44:00.114052Z") - .withMaxValidUntil("2020-04-25T17:44:00.114052Z") - .withSortBy(Arrays.asList(new ThreatIntelligenceSortingCriteria().withItemKey("fakeTokenPlaceholder") - .withSortOrder(ThreatIntelligenceSortingOrder.DESCENDING))) - .withSources(Arrays.asList("Azure Sentinel")), com.azure.core.util.Context.NONE); + manager.workspaceManagerConfigurations() + .define("default") + .withExistingWorkspace("myRg", "myWorkspace") + .withMode(Mode.ENABLED) + .create(); } } ``` -### ThreatIntelligenceIndicator_ReplaceTags +### WorkspaceManagerConfigurations_Delete ```java -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; -import java.util.Arrays; - /** - * Samples for ThreatIntelligenceIndicator ReplaceTags. + * Samples for WorkspaceManagerConfigurations Delete. */ -public final class ThreatIntelligenceIndicatorReplaceTagsSamples { +public final class WorkspaceManagerConfigurationsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/ReplaceTagsThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerConfigurations/DeleteWorkspaceManagerConfiguration.json */ /** - * Sample code: Replace tags to a Threat Intelligence. + * Sample code: Delete a workspace manager configuration. * * @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 ThreatIntelligenceIndicatorModel().withEtag("\"0000262c-0000-0800-0000-5e9767060000\"") - .withThreatIntelligenceTags(Arrays.asList("patching tags")), - com.azure.core.util.Context.NONE); + public static void deleteAWorkspaceManagerConfiguration( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerConfigurations() + .deleteWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicatorMetrics_List +### WorkspaceManagerConfigurations_Get ```java /** - * Samples for ThreatIntelligenceIndicatorMetrics List. + * Samples for WorkspaceManagerConfigurations Get. */ -public final class ThreatIntelligenceIndicatorMetricsListSamples { +public final class WorkspaceManagerConfigurationsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/CollectThreatIntelligenceMetrics.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerConfigurations/GetWorkspaceManagerConfiguration.json */ /** - * Sample code: Get threat intelligence indicators metrics. + * Sample code: Get a workspace manager configuration. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getThreatIntelligenceIndicatorsMetrics( - com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.threatIntelligenceIndicatorMetrics() - .listWithResponse("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + public static void + getAWorkspaceManagerConfiguration(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerConfigurations() + .getWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); } } ``` -### ThreatIntelligenceIndicatorsOperation_List +### WorkspaceManagerConfigurations_List ```java /** - * Samples for ThreatIntelligenceIndicatorsOperation List. + * Samples for WorkspaceManagerConfigurations List. */ -public final class ThreatIntelligenceIndicatorsOperationListSamples { +public final class WorkspaceManagerConfigurationsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/GetThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerConfigurations/GetAllWorkspaceManagerConfigurations.json */ /** - * Sample code: Get all threat intelligence indicators. + * Sample code: Get all workspace manager configurations for a Sentinel workspace. * * @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, com.azure.core.util.Context.NONE); + public static void getAllWorkspaceManagerConfigurationsForASentinelWorkspace( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerConfigurations() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### WatchlistItems_CreateOrUpdate +### WorkspaceManagerGroups_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; +import java.util.Arrays; /** - * Samples for WatchlistItems CreateOrUpdate. + * Samples for WorkspaceManagerGroups CreateOrUpdate. */ -public final class WatchlistItemsCreateOrUpdateSamples { +public final class WorkspaceManagerGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * CreateWatchlistItem.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/CreateOrUpdateWorkspaceManagerGroup.json */ /** - * Sample code: Create or update a watchlist item. + * Sample code: Creates or updates a workspace manager group. * * @param manager Entry point to SecurityInsightsManager. */ - public static void createOrUpdateAWatchlistItem( - 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)) + public static void createsOrUpdatesAWorkspaceManagerGroup( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .define("37207a7a-3b8a-438f-a559-c7df400e1b96") + .withExistingWorkspace("myRg", "myWorkspace") + .withDescription("Group of all financial and banking institutions") + .withDisplayName("Banks") + .withMemberResourceNames( + Arrays.asList("afbd324f-6c48-459c-8710-8d1e1cd03812", "f5fa104e-c0e3-4747-9182-d342dc048a9e")) .create(); } } ``` -### WatchlistItems_Delete +### WorkspaceManagerGroups_Delete ```java /** - * Samples for WatchlistItems Delete. + * Samples for WorkspaceManagerGroups Delete. */ -public final class WatchlistItemsDeleteSamples { +public final class WorkspaceManagerGroupsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * DeleteWatchlistItem.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/DeleteWorkspaceManagerGroup.json */ /** - * Sample code: Delete a watchlist item. + * Sample code: Delete a workspace manager group. * * @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", + deleteAWorkspaceManagerGroup(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .deleteWithResponse("myRg", "myWorkspace", "37207a7a-3b8a-438f-a559-c7df400e1b96", com.azure.core.util.Context.NONE); } } ``` -### WatchlistItems_Get +### WorkspaceManagerGroups_Get ```java /** - * Samples for WatchlistItems Get. + * Samples for WorkspaceManagerGroups Get. */ -public final class WatchlistItemsGetSamples { +public final class WorkspaceManagerGroupsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlistItemById.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/GetWorkspaceManagerGroup.json */ /** - * Sample code: Get a watchlist item. + * Sample code: Get a workspace manager group. * * @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", + public static void + getAWorkspaceManagerGroup(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .getWithResponse("myRg", "myWorkspace", "37207a7a-3b8a-438f-a559-c7df400e1b96", com.azure.core.util.Context.NONE); } } ``` -### WatchlistItems_List +### WorkspaceManagerGroups_List ```java /** - * Samples for WatchlistItems List. + * Samples for WorkspaceManagerGroups List. */ -public final class WatchlistItemsListSamples { +public final class WorkspaceManagerGroupsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlistItems.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/GetAllWorkspaceManagerGroups.json */ /** - * Sample code: Get all watchlist Items. + * Sample code: Get all workspace manager groups in the Sentinel workspace manager. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - getAllWatchlistItems(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlistItems().list("myRg", "myWorkspace", "highValueAsset", null, com.azure.core.util.Context.NONE); + public static void getAllWorkspaceManagerGroupsInTheSentinelWorkspaceManager( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); } } ``` -### Watchlists_CreateOrUpdate +### WorkspaceManagerMembers_CreateOrUpdate ```java -import com.azure.resourcemanager.securityinsights.models.Source; - /** - * Samples for Watchlists CreateOrUpdate. + * Samples for WorkspaceManagerMembers CreateOrUpdate. */ -public final class WatchlistsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * CreateWatchlist.json - */ - /** - * Sample code: Create or update a watchlist. - * - * @param manager Entry point to SecurityInsightsManager. - */ - public static void - createOrUpdateAWatchlist(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(); - } - +public final class WorkspaceManagerMembersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * CreateWatchlistAndWatchlistItems.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/CreateOrUpdateWorkspaceManagerMember.json */ /** - * Sample code: Create or update a watchlist and bulk creates watchlist items. + * Sample code: Create or Update a workspace manager member. * * @param manager Entry point to SecurityInsightsManager. */ - public static void createOrUpdateAWatchlistAndBulkCreatesWatchlistItems( + public static void createOrUpdateAWorkspaceManagerMember( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists() - .define("highValueAsset") + manager.workspaceManagerMembers() + .define("afbd324f-6c48-459c-8710-8d1e1cd03812") .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") + .withTargetWorkspaceResourceId( + "/subscriptions/7aef9d48-814f-45ad-b644-b0343316e174/resourceGroups/otherRg/providers/Microsoft.OperationalInsights/workspaces/Example_Workspace") + .withTargetWorkspaceTenantId("f676d436-8d16-42db-81b7-ab578e110ccd") .create(); } } ``` -### Watchlists_Delete +### WorkspaceManagerMembers_Delete ```java /** - * Samples for Watchlists Delete. + * Samples for WorkspaceManagerMembers Delete. */ -public final class WatchlistsDeleteSamples { +public final class WorkspaceManagerMembersDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * DeleteWatchlist.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/DeleteWorkspaceManagerMember.json */ /** - * Sample code: Delete a watchlist. + * Sample code: Delete a workspace manager member. * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists() - .deleteWithResponse("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.Context.NONE); + public static void + deleteAWorkspaceManagerMember(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerMembers() + .deleteWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + com.azure.core.util.Context.NONE); } } ``` -### Watchlists_Get +### WorkspaceManagerMembers_Get ```java /** - * Samples for Watchlists Get. + * Samples for WorkspaceManagerMembers Get. */ -public final class WatchlistsGetSamples { +public final class WorkspaceManagerMembersGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlistByAlias.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/GetWorkspaceManagerMember.json */ /** - * Sample code: Get a watchlist. + * Sample code: Get a workspace manager member. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists().getWithResponse("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.Context.NONE); + public static void + getAWorkspaceManagerMember(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerMembers() + .getWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + com.azure.core.util.Context.NONE); } } ``` -### Watchlists_List +### WorkspaceManagerMembers_List ```java /** - * Samples for Watchlists List. + * Samples for WorkspaceManagerMembers List. */ -public final class WatchlistsListSamples { +public final class WorkspaceManagerMembersListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlists.json + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/GetAllWorkspaceManagerMembers.json */ /** - * Sample code: Get all watchlists. + * Sample code: Get all workspace manager members. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllWatchlists(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists().list("myRg", "myWorkspace", null, com.azure.core.util.Context.NONE); + public static void + getAllWorkspaceManagerMembers(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerMembers() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml b/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml index fa910a0c4cc4..9c944c01019e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -17,8 +17,8 @@ Code generated by Microsoft (R) AutoRest Code Generator. 1.1.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-2022-11. + Microsoft Azure SDK for Security Insights Management + This package contains Microsoft Azure SDK for Security Insights 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 api-version 2025-10-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ Code generated by Microsoft (R) AutoRest Code Generator. UTF-8 0 0 - false + true 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 index de2bd8903d4c..f1b53a16e0fc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights; @@ -22,47 +22,135 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.securityinsights.fluent.SecurityInsights; +import com.azure.resourcemanager.securityinsights.fluent.SecurityInsightsManagementClient; import com.azure.resourcemanager.securityinsights.implementation.ActionsImpl; +import com.azure.resourcemanager.securityinsights.implementation.AlertRuleOperationsImpl; 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.BillingStatisticsImpl; +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.ContentPackageOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ContentPackagesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ContentTemplatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ContentTemplatesOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.DataConnectorDefinitionsImpl; +import com.azure.resourcemanager.securityinsights.implementation.DataConnectorsCheckRequirementsOperationsImpl; import com.azure.resourcemanager.securityinsights.implementation.DataConnectorsImpl; +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.FileImportsImpl; +import com.azure.resourcemanager.securityinsights.implementation.GetRecommendationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.GetTriggeredAnalyticsRuleRunsImpl; +import com.azure.resourcemanager.securityinsights.implementation.GetsImpl; +import com.azure.resourcemanager.securityinsights.implementation.HuntCommentsImpl; +import com.azure.resourcemanager.securityinsights.implementation.HuntRelationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.HuntsImpl; import com.azure.resourcemanager.securityinsights.implementation.IncidentCommentsImpl; import com.azure.resourcemanager.securityinsights.implementation.IncidentRelationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.IncidentTasksImpl; import com.azure.resourcemanager.securityinsights.implementation.IncidentsImpl; +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.SecurityInsightsBuilder; +import com.azure.resourcemanager.securityinsights.implementation.ProductPackagesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductPackagesOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductSettingsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductTemplatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ProductTemplatesOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.ReevaluatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.securityinsights.implementation.SecurityInsightsManagementClientBuilder; import com.azure.resourcemanager.securityinsights.implementation.SecurityMLAnalyticsSettingsImpl; import com.azure.resourcemanager.securityinsights.implementation.SentinelOnboardingStatesImpl; +import com.azure.resourcemanager.securityinsights.implementation.SourceControlOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.SourceControlsImpl; 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.ThreatIntelligencesImpl; +import com.azure.resourcemanager.securityinsights.implementation.TriggeredAnalyticsRuleRunOperationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.UpdatesImpl; import com.azure.resourcemanager.securityinsights.implementation.WatchlistItemsImpl; import com.azure.resourcemanager.securityinsights.implementation.WatchlistsImpl; +import com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerAssignmentJobsImpl; +import com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerAssignmentsImpl; +import com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerConfigurationsImpl; +import com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerGroupsImpl; +import com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerMembersImpl; import com.azure.resourcemanager.securityinsights.models.Actions; +import com.azure.resourcemanager.securityinsights.models.AlertRuleOperations; 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.BillingStatistics; +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.ContentPackageOperations; +import com.azure.resourcemanager.securityinsights.models.ContentPackages; +import com.azure.resourcemanager.securityinsights.models.ContentTemplates; +import com.azure.resourcemanager.securityinsights.models.ContentTemplatesOperations; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitions; import com.azure.resourcemanager.securityinsights.models.DataConnectors; +import com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirementsOperations; +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.FileImports; +import com.azure.resourcemanager.securityinsights.models.GetRecommendations; +import com.azure.resourcemanager.securityinsights.models.GetTriggeredAnalyticsRuleRuns; +import com.azure.resourcemanager.securityinsights.models.Gets; +import com.azure.resourcemanager.securityinsights.models.HuntComments; +import com.azure.resourcemanager.securityinsights.models.HuntRelations; +import com.azure.resourcemanager.securityinsights.models.Hunts; import com.azure.resourcemanager.securityinsights.models.IncidentComments; import com.azure.resourcemanager.securityinsights.models.IncidentRelations; +import com.azure.resourcemanager.securityinsights.models.IncidentTasks; import com.azure.resourcemanager.securityinsights.models.Incidents; +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.ProductPackages; +import com.azure.resourcemanager.securityinsights.models.ProductPackagesOperations; +import com.azure.resourcemanager.securityinsights.models.ProductSettings; +import com.azure.resourcemanager.securityinsights.models.ProductTemplates; +import com.azure.resourcemanager.securityinsights.models.ProductTemplatesOperations; +import com.azure.resourcemanager.securityinsights.models.Reevaluates; +import com.azure.resourcemanager.securityinsights.models.ResourceProviders; import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettings; import com.azure.resourcemanager.securityinsights.models.SentinelOnboardingStates; +import com.azure.resourcemanager.securityinsights.models.SourceControlOperations; +import com.azure.resourcemanager.securityinsights.models.SourceControls; 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.ThreatIntelligences; +import com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRunOperations; +import com.azure.resourcemanager.securityinsights.models.Updates; import com.azure.resourcemanager.securityinsights.models.WatchlistItems; import com.azure.resourcemanager.securityinsights.models.Watchlists; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignmentJobs; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignments; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfigurations; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroups; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMembers; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -71,46 +159,132 @@ * API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. */ public final class SecurityInsightsManager { - private AlertRules alertRules; + private ResourceProviders resourceProviders; - private Actions actions; + private Operations operations; + + private AlertRules alertRules; private AlertRuleTemplates alertRuleTemplates; private AutomationRules automationRules; + private Incidents incidents; + private Bookmarks bookmarks; - private DataConnectors dataConnectors; + private DataConnectorDefinitions dataConnectorDefinitions; - private Incidents incidents; + private DataConnectors dataConnectors; private IncidentComments incidentComments; - private IncidentRelations incidentRelations; + private BookmarkRelations bookmarkRelations; + + private EntityRelations entityRelations; + + private IncidentTasks incidentTasks; private SentinelOnboardingStates sentinelOnboardingStates; private SecurityMLAnalyticsSettings securityMLAnalyticsSettings; + private SourceControls sourceControls; + + private Watchlists watchlists; + + private WatchlistItems watchlistItems; + + private BillingStatistics billingStatistics; + + private Entities entities; + + private EntityQueries entityQueries; + + private EntityQueryTemplates entityQueryTemplates; + + private FileImports fileImports; + + private Hunts hunts; + + private HuntComments huntComments; + + private HuntRelations huntRelations; + + private OfficeConsents officeConsents; + + private ProductSettings productSettings; + + private TriggeredAnalyticsRuleRunOperations triggeredAnalyticsRuleRunOperations; + + private WorkspaceManagerAssignments workspaceManagerAssignments; + + private WorkspaceManagerConfigurations workspaceManagerConfigurations; + + private WorkspaceManagerGroups workspaceManagerGroups; + + private WorkspaceManagerMembers workspaceManagerMembers; + + private AlertRuleOperations alertRuleOperations; + + private Actions actions; + + private BookmarkOperations bookmarkOperations; + + private ContentPackages contentPackages; + + private ContentPackageOperations contentPackageOperations; + + private ProductPackages productPackages; + + private ProductPackagesOperations productPackagesOperations; + + private ProductTemplates productTemplates; + + private ProductTemplatesOperations productTemplatesOperations; + + private ContentTemplates contentTemplates; + + private ContentTemplatesOperations contentTemplatesOperations; + + private IncidentRelations incidentRelations; + + private EntitiesRelations entitiesRelations; + + private Metadatas metadatas; + private ThreatIntelligenceIndicators threatIntelligenceIndicators; private ThreatIntelligenceIndicatorsOperations threatIntelligenceIndicatorsOperations; + private DataConnectorsCheckRequirementsOperations dataConnectorsCheckRequirementsOperations; + + private SourceControlOperations sourceControlOperations; + private ThreatIntelligenceIndicatorMetrics threatIntelligenceIndicatorMetrics; - private Watchlists watchlists; + private ThreatIntelligences threatIntelligences; - private WatchlistItems watchlistItems; + private EntitiesGetTimelines entitiesGetTimelines; - private Operations operations; + private Gets gets; + + private Updates updates; + + private GetRecommendations getRecommendations; + + private Reevaluates reevaluates; + + private GetTriggeredAnalyticsRuleRuns getTriggeredAnalyticsRuleRuns; + + private WorkspaceManagerAssignmentJobs workspaceManagerAssignmentJobs; - private final SecurityInsights clientObject; + private final SecurityInsightsManagementClient 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) + this.clientObject = new SecurityInsightsManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -118,11 +292,11 @@ private SecurityInsightsManager(HttpPipeline httpPipeline, AzureProfile profile, } /** - * Creates an instance of SecurityInsights service API entry point. + * Creates an instance of Security Insights service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the SecurityInsights service API instance. + * @return the Security Insights service API instance. */ public static SecurityInsightsManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -131,11 +305,11 @@ public static SecurityInsightsManager authenticate(TokenCredential credential, A } /** - * Creates an instance of SecurityInsights service API entry point. + * Creates an instance of Security Insights service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the SecurityInsights service API instance. + * @return the Security Insights service API instance. */ public static SecurityInsightsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -157,6 +331,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-securityinsights.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -254,22 +431,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of SecurityInsights service API entry point. + * Creates an instance of Security Insights service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the SecurityInsights service API instance. + * @return the Security Insights service API instance. */ public SecurityInsightsManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.securityinsights") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -316,27 +495,39 @@ public SecurityInsightsManager authenticate(TokenCredential credential, AzurePro } /** - * Gets the resource collection API of AlertRules. + * Gets the resource collection API of ResourceProviders. * - * @return Resource collection API of AlertRules. + * @return Resource collection API of ResourceProviders. */ - public AlertRules alertRules() { - if (this.alertRules == null) { - this.alertRules = new AlertRulesImpl(clientObject.getAlertRules(), this); + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); } - return alertRules; + return resourceProviders; } /** - * Gets the resource collection API of Actions. It manages ActionResponse. + * Gets the resource collection API of Operations. * - * @return Resource collection API of Actions. + * @return Resource collection API of Operations. */ - public Actions actions() { - if (this.actions == null) { - this.actions = new ActionsImpl(clientObject.getActions(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return actions; + return operations; + } + + /** + * Gets the resource collection API of AlertRules. + * + * @return Resource collection API of AlertRules. + */ + public AlertRules alertRules() { + if (this.alertRules == null) { + this.alertRules = new AlertRulesImpl(clientObject.getAlertRules(), this); + } + return alertRules; } /** @@ -363,6 +554,18 @@ public AutomationRules automationRules() { return automationRules; } + /** + * Gets the resource collection API of Incidents. It manages Incident. + * + * @return Resource collection API of Incidents. + */ + public Incidents incidents() { + if (this.incidents == null) { + this.incidents = new IncidentsImpl(clientObject.getIncidents(), this); + } + return incidents; + } + /** * Gets the resource collection API of Bookmarks. It manages Bookmark. * @@ -376,27 +579,28 @@ public Bookmarks bookmarks() { } /** - * Gets the resource collection API of DataConnectors. + * Gets the resource collection API of DataConnectorDefinitions. * - * @return Resource collection API of DataConnectors. + * @return Resource collection API of DataConnectorDefinitions. */ - public DataConnectors dataConnectors() { - if (this.dataConnectors == null) { - this.dataConnectors = new DataConnectorsImpl(clientObject.getDataConnectors(), this); + public DataConnectorDefinitions dataConnectorDefinitions() { + if (this.dataConnectorDefinitions == null) { + this.dataConnectorDefinitions + = new DataConnectorDefinitionsImpl(clientObject.getDataConnectorDefinitions(), this); } - return dataConnectors; + return dataConnectorDefinitions; } /** - * Gets the resource collection API of Incidents. It manages Incident. + * Gets the resource collection API of DataConnectors. * - * @return Resource collection API of Incidents. + * @return Resource collection API of DataConnectors. */ - public Incidents incidents() { - if (this.incidents == null) { - this.incidents = new IncidentsImpl(clientObject.getIncidents(), this); + public DataConnectors dataConnectors() { + if (this.dataConnectors == null) { + this.dataConnectors = new DataConnectorsImpl(clientObject.getDataConnectors(), this); } - return incidents; + return dataConnectors; } /** @@ -412,15 +616,39 @@ public IncidentComments incidentComments() { } /** - * Gets the resource collection API of IncidentRelations. It manages Relation. + * Gets the resource collection API of BookmarkRelations. It manages Relation. * - * @return Resource collection API of IncidentRelations. + * @return Resource collection API of BookmarkRelations. */ - public IncidentRelations incidentRelations() { - if (this.incidentRelations == null) { - this.incidentRelations = new IncidentRelationsImpl(clientObject.getIncidentRelations(), this); + public BookmarkRelations bookmarkRelations() { + if (this.bookmarkRelations == null) { + this.bookmarkRelations = new BookmarkRelationsImpl(clientObject.getBookmarkRelations(), this); } - return incidentRelations; + return bookmarkRelations; + } + + /** + * Gets the resource collection API of EntityRelations. + * + * @return Resource collection API of EntityRelations. + */ + public EntityRelations entityRelations() { + if (this.entityRelations == null) { + this.entityRelations = new EntityRelationsImpl(clientObject.getEntityRelations(), this); + } + return entityRelations; + } + + /** + * Gets the resource collection API of IncidentTasks. It manages IncidentTask. + * + * @return Resource collection API of IncidentTasks. + */ + public IncidentTasks incidentTasks() { + if (this.incidentTasks == null) { + this.incidentTasks = new IncidentTasksImpl(clientObject.getIncidentTasks(), this); + } + return incidentTasks; } /** @@ -449,6 +677,399 @@ public SecurityMLAnalyticsSettings securityMLAnalyticsSettings() { return securityMLAnalyticsSettings; } + /** + * Gets the resource collection API of SourceControls. It manages SourceControl. + * + * @return Resource collection API of SourceControls. + */ + public SourceControls sourceControls() { + if (this.sourceControls == null) { + this.sourceControls = new SourceControlsImpl(clientObject.getSourceControls(), this); + } + return sourceControls; + } + + /** + * Gets the resource collection API of Watchlists. It manages Watchlist. + * + * @return Resource collection API of Watchlists. + */ + public Watchlists watchlists() { + if (this.watchlists == null) { + this.watchlists = new WatchlistsImpl(clientObject.getWatchlists(), this); + } + return watchlists; + } + + /** + * Gets the resource collection API of WatchlistItems. It manages WatchlistItem. + * + * @return Resource collection API of WatchlistItems. + */ + public WatchlistItems watchlistItems() { + if (this.watchlistItems == null) { + this.watchlistItems = new WatchlistItemsImpl(clientObject.getWatchlistItems(), this); + } + return watchlistItems; + } + + /** + * Gets the resource collection API of BillingStatistics. + * + * @return Resource collection API of BillingStatistics. + */ + public BillingStatistics billingStatistics() { + if (this.billingStatistics == null) { + this.billingStatistics = new BillingStatisticsImpl(clientObject.getBillingStatistics(), this); + } + return billingStatistics; + } + + /** + * Gets the resource collection API of Entities. + * + * @return Resource collection API of Entities. + */ + public Entities entities() { + if (this.entities == null) { + this.entities = new EntitiesImpl(clientObject.getEntities(), this); + } + return entities; + } + + /** + * Gets the resource collection API of EntityQueries. + * + * @return Resource collection API of EntityQueries. + */ + public EntityQueries entityQueries() { + if (this.entityQueries == null) { + this.entityQueries = new EntityQueriesImpl(clientObject.getEntityQueries(), this); + } + return entityQueries; + } + + /** + * Gets the resource collection API of EntityQueryTemplates. + * + * @return Resource collection API of EntityQueryTemplates. + */ + public EntityQueryTemplates entityQueryTemplates() { + if (this.entityQueryTemplates == null) { + this.entityQueryTemplates = new EntityQueryTemplatesImpl(clientObject.getEntityQueryTemplates(), this); + } + return entityQueryTemplates; + } + + /** + * Gets the resource collection API of FileImports. It manages FileImport. + * + * @return Resource collection API of FileImports. + */ + public FileImports fileImports() { + if (this.fileImports == null) { + this.fileImports = new FileImportsImpl(clientObject.getFileImports(), this); + } + return fileImports; + } + + /** + * Gets the resource collection API of Hunts. It manages Hunt. + * + * @return Resource collection API of Hunts. + */ + public Hunts hunts() { + if (this.hunts == null) { + this.hunts = new HuntsImpl(clientObject.getHunts(), this); + } + return hunts; + } + + /** + * Gets the resource collection API of HuntComments. It manages HuntComment. + * + * @return Resource collection API of HuntComments. + */ + public HuntComments huntComments() { + if (this.huntComments == null) { + this.huntComments = new HuntCommentsImpl(clientObject.getHuntComments(), this); + } + return huntComments; + } + + /** + * Gets the resource collection API of HuntRelations. It manages HuntRelation. + * + * @return Resource collection API of HuntRelations. + */ + public HuntRelations huntRelations() { + if (this.huntRelations == null) { + this.huntRelations = new HuntRelationsImpl(clientObject.getHuntRelations(), this); + } + return huntRelations; + } + + /** + * Gets the resource collection API of OfficeConsents. + * + * @return Resource collection API of OfficeConsents. + */ + public OfficeConsents officeConsents() { + if (this.officeConsents == null) { + this.officeConsents = new OfficeConsentsImpl(clientObject.getOfficeConsents(), this); + } + return officeConsents; + } + + /** + * Gets the resource collection API of ProductSettings. + * + * @return Resource collection API of ProductSettings. + */ + public ProductSettings productSettings() { + if (this.productSettings == null) { + this.productSettings = new ProductSettingsImpl(clientObject.getProductSettings(), this); + } + return productSettings; + } + + /** + * Gets the resource collection API of TriggeredAnalyticsRuleRunOperations. + * + * @return Resource collection API of TriggeredAnalyticsRuleRunOperations. + */ + public TriggeredAnalyticsRuleRunOperations triggeredAnalyticsRuleRunOperations() { + if (this.triggeredAnalyticsRuleRunOperations == null) { + this.triggeredAnalyticsRuleRunOperations = new TriggeredAnalyticsRuleRunOperationsImpl( + clientObject.getTriggeredAnalyticsRuleRunOperations(), this); + } + return triggeredAnalyticsRuleRunOperations; + } + + /** + * Gets the resource collection API of WorkspaceManagerAssignments. It manages WorkspaceManagerAssignment. + * + * @return Resource collection API of WorkspaceManagerAssignments. + */ + public WorkspaceManagerAssignments workspaceManagerAssignments() { + if (this.workspaceManagerAssignments == null) { + this.workspaceManagerAssignments + = new WorkspaceManagerAssignmentsImpl(clientObject.getWorkspaceManagerAssignments(), this); + } + return workspaceManagerAssignments; + } + + /** + * Gets the resource collection API of WorkspaceManagerConfigurations. It manages WorkspaceManagerConfiguration. + * + * @return Resource collection API of WorkspaceManagerConfigurations. + */ + public WorkspaceManagerConfigurations workspaceManagerConfigurations() { + if (this.workspaceManagerConfigurations == null) { + this.workspaceManagerConfigurations + = new WorkspaceManagerConfigurationsImpl(clientObject.getWorkspaceManagerConfigurations(), this); + } + return workspaceManagerConfigurations; + } + + /** + * Gets the resource collection API of WorkspaceManagerGroups. It manages WorkspaceManagerGroup. + * + * @return Resource collection API of WorkspaceManagerGroups. + */ + public WorkspaceManagerGroups workspaceManagerGroups() { + if (this.workspaceManagerGroups == null) { + this.workspaceManagerGroups + = new WorkspaceManagerGroupsImpl(clientObject.getWorkspaceManagerGroups(), this); + } + return workspaceManagerGroups; + } + + /** + * Gets the resource collection API of WorkspaceManagerMembers. It manages WorkspaceManagerMember. + * + * @return Resource collection API of WorkspaceManagerMembers. + */ + public WorkspaceManagerMembers workspaceManagerMembers() { + if (this.workspaceManagerMembers == null) { + this.workspaceManagerMembers + = new WorkspaceManagerMembersImpl(clientObject.getWorkspaceManagerMembers(), this); + } + return workspaceManagerMembers; + } + + /** + * Gets the resource collection API of AlertRuleOperations. + * + * @return Resource collection API of AlertRuleOperations. + */ + public AlertRuleOperations alertRuleOperations() { + if (this.alertRuleOperations == null) { + this.alertRuleOperations = new AlertRuleOperationsImpl(clientObject.getAlertRuleOperations(), this); + } + return alertRuleOperations; + } + + /** + * Gets the resource collection API of Actions. It manages ActionResponse. + * + * @return Resource collection API of Actions. + */ + public Actions actions() { + if (this.actions == null) { + this.actions = new ActionsImpl(clientObject.getActions(), this); + } + return actions; + } + + /** + * Gets the resource collection API of BookmarkOperations. + * + * @return Resource collection API of BookmarkOperations. + */ + public BookmarkOperations bookmarkOperations() { + if (this.bookmarkOperations == null) { + this.bookmarkOperations = new BookmarkOperationsImpl(clientObject.getBookmarkOperations(), this); + } + return bookmarkOperations; + } + + /** + * Gets the resource collection API of ContentPackages. + * + * @return Resource collection API of ContentPackages. + */ + public ContentPackages contentPackages() { + if (this.contentPackages == null) { + this.contentPackages = new ContentPackagesImpl(clientObject.getContentPackages(), this); + } + return contentPackages; + } + + /** + * Gets the resource collection API of ContentPackageOperations. It manages PackageModel. + * + * @return Resource collection API of ContentPackageOperations. + */ + public ContentPackageOperations contentPackageOperations() { + if (this.contentPackageOperations == null) { + this.contentPackageOperations + = new ContentPackageOperationsImpl(clientObject.getContentPackageOperations(), this); + } + return contentPackageOperations; + } + + /** + * Gets the resource collection API of ProductPackages. + * + * @return Resource collection API of ProductPackages. + */ + public ProductPackages productPackages() { + if (this.productPackages == null) { + this.productPackages = new ProductPackagesImpl(clientObject.getProductPackages(), this); + } + return productPackages; + } + + /** + * Gets the resource collection API of ProductPackagesOperations. + * + * @return Resource collection API of ProductPackagesOperations. + */ + public ProductPackagesOperations productPackagesOperations() { + if (this.productPackagesOperations == null) { + this.productPackagesOperations + = new ProductPackagesOperationsImpl(clientObject.getProductPackagesOperations(), this); + } + return productPackagesOperations; + } + + /** + * Gets the resource collection API of ProductTemplates. + * + * @return Resource collection API of ProductTemplates. + */ + public ProductTemplates productTemplates() { + if (this.productTemplates == null) { + this.productTemplates = new ProductTemplatesImpl(clientObject.getProductTemplates(), this); + } + return productTemplates; + } + + /** + * Gets the resource collection API of ProductTemplatesOperations. + * + * @return Resource collection API of ProductTemplatesOperations. + */ + public ProductTemplatesOperations productTemplatesOperations() { + if (this.productTemplatesOperations == null) { + this.productTemplatesOperations + = new ProductTemplatesOperationsImpl(clientObject.getProductTemplatesOperations(), this); + } + return productTemplatesOperations; + } + + /** + * Gets the resource collection API of ContentTemplates. It manages TemplateModel. + * + * @return Resource collection API of ContentTemplates. + */ + public ContentTemplates contentTemplates() { + if (this.contentTemplates == null) { + this.contentTemplates = new ContentTemplatesImpl(clientObject.getContentTemplates(), this); + } + return contentTemplates; + } + + /** + * Gets the resource collection API of ContentTemplatesOperations. + * + * @return Resource collection API of ContentTemplatesOperations. + */ + public ContentTemplatesOperations contentTemplatesOperations() { + if (this.contentTemplatesOperations == null) { + this.contentTemplatesOperations + = new ContentTemplatesOperationsImpl(clientObject.getContentTemplatesOperations(), this); + } + return contentTemplatesOperations; + } + + /** + * Gets the resource collection API of IncidentRelations. + * + * @return Resource collection API of IncidentRelations. + */ + public IncidentRelations incidentRelations() { + if (this.incidentRelations == null) { + this.incidentRelations = new IncidentRelationsImpl(clientObject.getIncidentRelations(), this); + } + return incidentRelations; + } + + /** + * Gets the resource collection API of EntitiesRelations. + * + * @return Resource collection API of EntitiesRelations. + */ + public EntitiesRelations entitiesRelations() { + if (this.entitiesRelations == null) { + this.entitiesRelations = new EntitiesRelationsImpl(clientObject.getEntitiesRelations(), this); + } + return entitiesRelations; + } + + /** + * Gets the resource collection API of Metadatas. It manages MetadataModel. + * + * @return Resource collection API of Metadatas. + */ + public Metadatas metadatas() { + if (this.metadatas == null) { + this.metadatas = new MetadatasImpl(clientObject.getMetadatas(), this); + } + return metadatas; + } + /** * Gets the resource collection API of ThreatIntelligenceIndicators. * @@ -475,6 +1096,32 @@ public ThreatIntelligenceIndicatorsOperations threatIntelligenceIndicatorsOperat return threatIntelligenceIndicatorsOperations; } + /** + * Gets the resource collection API of DataConnectorsCheckRequirementsOperations. + * + * @return Resource collection API of DataConnectorsCheckRequirementsOperations. + */ + public DataConnectorsCheckRequirementsOperations dataConnectorsCheckRequirementsOperations() { + if (this.dataConnectorsCheckRequirementsOperations == null) { + this.dataConnectorsCheckRequirementsOperations = new DataConnectorsCheckRequirementsOperationsImpl( + clientObject.getDataConnectorsCheckRequirementsOperations(), this); + } + return dataConnectorsCheckRequirementsOperations; + } + + /** + * Gets the resource collection API of SourceControlOperations. + * + * @return Resource collection API of SourceControlOperations. + */ + public SourceControlOperations sourceControlOperations() { + if (this.sourceControlOperations == null) { + this.sourceControlOperations + = new SourceControlOperationsImpl(clientObject.getSourceControlOperations(), this); + } + return sourceControlOperations; + } + /** * Gets the resource collection API of ThreatIntelligenceIndicatorMetrics. * @@ -489,48 +1136,110 @@ public ThreatIntelligenceIndicatorMetrics threatIntelligenceIndicatorMetrics() { } /** - * Gets the resource collection API of Watchlists. It manages Watchlist. + * Gets the resource collection API of ThreatIntelligences. * - * @return Resource collection API of Watchlists. + * @return Resource collection API of ThreatIntelligences. */ - public Watchlists watchlists() { - if (this.watchlists == null) { - this.watchlists = new WatchlistsImpl(clientObject.getWatchlists(), this); + public ThreatIntelligences threatIntelligences() { + if (this.threatIntelligences == null) { + this.threatIntelligences = new ThreatIntelligencesImpl(clientObject.getThreatIntelligences(), this); } - return watchlists; + return threatIntelligences; } /** - * Gets the resource collection API of WatchlistItems. It manages WatchlistItem. + * Gets the resource collection API of EntitiesGetTimelines. * - * @return Resource collection API of WatchlistItems. + * @return Resource collection API of EntitiesGetTimelines. */ - public WatchlistItems watchlistItems() { - if (this.watchlistItems == null) { - this.watchlistItems = new WatchlistItemsImpl(clientObject.getWatchlistItems(), this); + public EntitiesGetTimelines entitiesGetTimelines() { + if (this.entitiesGetTimelines == null) { + this.entitiesGetTimelines = new EntitiesGetTimelinesImpl(clientObject.getEntitiesGetTimelines(), this); } - return watchlistItems; + return entitiesGetTimelines; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of Gets. * - * @return Resource collection API of Operations. + * @return Resource collection API of Gets. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public Gets gets() { + if (this.gets == null) { + this.gets = new GetsImpl(clientObject.getGets(), this); } - return operations; + return gets; + } + + /** + * Gets the resource collection API of Updates. + * + * @return Resource collection API of Updates. + */ + public Updates updates() { + if (this.updates == null) { + this.updates = new UpdatesImpl(clientObject.getUpdates(), this); + } + return updates; + } + + /** + * Gets the resource collection API of GetRecommendations. + * + * @return Resource collection API of GetRecommendations. + */ + public GetRecommendations getRecommendations() { + if (this.getRecommendations == null) { + this.getRecommendations = new GetRecommendationsImpl(clientObject.getGetRecommendations(), this); + } + return getRecommendations; + } + + /** + * Gets the resource collection API of Reevaluates. + * + * @return Resource collection API of Reevaluates. + */ + public Reevaluates reevaluates() { + if (this.reevaluates == null) { + this.reevaluates = new ReevaluatesImpl(clientObject.getReevaluates(), this); + } + return reevaluates; + } + + /** + * Gets the resource collection API of GetTriggeredAnalyticsRuleRuns. + * + * @return Resource collection API of GetTriggeredAnalyticsRuleRuns. + */ + public GetTriggeredAnalyticsRuleRuns getTriggeredAnalyticsRuleRuns() { + if (this.getTriggeredAnalyticsRuleRuns == null) { + this.getTriggeredAnalyticsRuleRuns + = new GetTriggeredAnalyticsRuleRunsImpl(clientObject.getGetTriggeredAnalyticsRuleRuns(), this); + } + return getTriggeredAnalyticsRuleRuns; + } + + /** + * Gets the resource collection API of WorkspaceManagerAssignmentJobs. + * + * @return Resource collection API of WorkspaceManagerAssignmentJobs. + */ + public WorkspaceManagerAssignmentJobs workspaceManagerAssignmentJobs() { + if (this.workspaceManagerAssignmentJobs == null) { + this.workspaceManagerAssignmentJobs + = new WorkspaceManagerAssignmentJobsImpl(clientObject.getWorkspaceManagerAssignmentJobs(), this); + } + return workspaceManagerAssignmentJobs; } /** - * Gets wrapped service client SecurityInsights providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets wrapped service client SecurityInsightsManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. * - * @return Wrapped service client SecurityInsights. + * @return Wrapped service client SecurityInsightsManagementClient. */ - public SecurityInsights serviceClient() { + public SecurityInsightsManagementClient 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 index 8fb1871e672b..9d88487e7060 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -16,41 +16,11 @@ * 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param context The context to associate with this operation. @@ -67,7 +37,7 @@ Response getWithResponse(String resourceGroupName, String w * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -82,7 +52,7 @@ Response getWithResponse(String resourceGroupName, String w * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. @@ -100,7 +70,7 @@ Response createOrUpdateWithResponse(String resourceGroupNam * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. @@ -117,7 +87,7 @@ ActionResponseInner createOrUpdate(String resourceGroupName, String workspaceNam * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param context The context to associate with this operation. @@ -134,7 +104,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -143,4 +113,34 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); + + /** + * 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId, + Context context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleOperationsClient.java new file mode 100644 index 000000000000..750d96f109b4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleOperationsClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger; + +/** + * An instance of this class provides access to all the operations defined in AlertRuleOperationsClient. + */ +public interface AlertRuleOperationsClient { + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginTriggerRuleRun(String resourceGroupName, String workspaceName, + String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter); + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginTriggerRuleRun(String resourceGroupName, String workspaceName, + String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context); + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter); + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, 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 index c4af7cd0e699..d495f9a3773a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -16,59 +16,59 @@ */ public interface AlertRuleTemplatesClient { /** - * Gets all alert rule templates. + * 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 workspaceName The name of the monitor 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 all alert rule templates as paginated response with {@link PagedIterable}. + * @return the alert rule template along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String alertRuleTemplateId, Context context); /** - * Gets all alert rule templates. + * 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 context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 all alert rule templates as paginated response with {@link PagedIterable}. + * @return the alert rule template. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. - * @param context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 the alert rule template along with {@link Response}. + * @return all alert rule templates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String workspaceName, - String alertRuleTemplateId, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. + * @param workspaceName The name of the monitor 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 the alert rule template. + * @return all alert rule templates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, 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 index 20360c45cccd..2b3482a5fbfe 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -15,38 +15,11 @@ * 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -62,7 +35,7 @@ Response getWithResponse(String resourceGroupName, String worksp * 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 workspaceName The name of the monitor 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. @@ -76,7 +49,7 @@ Response getWithResponse(String resourceGroupName, String worksp * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @param context The context to associate with this operation. @@ -93,7 +66,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, St * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,7 +82,7 @@ AlertRuleInner createOrUpdate(String resourceGroupName, String workspaceName, St * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +97,7 @@ AlertRuleInner createOrUpdate(String resourceGroupName, String workspaceName, St * 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 workspaceName The name of the monitor 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. @@ -132,4 +105,31 @@ AlertRuleInner createOrUpdate(String resourceGroupName, String workspaceName, St */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String ruleId); + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, 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 index ee8b428d8849..5c8b53512c3d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -19,7 +19,7 @@ public interface AutomationRulesClient { * 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 workspaceName The name of the monitor workspace. * @param automationRuleId Automation rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -35,7 +35,7 @@ Response getWithResponse(String resourceGroupName, String w * 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 workspaceName The name of the monitor 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. @@ -50,13 +50,14 @@ Response getWithResponse(String resourceGroupName, String w * * @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 automationRuleId The automation rule ID. * @param automationRuleToUpsert 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 the response body along with {@link Response}. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, @@ -67,11 +68,11 @@ Response createOrUpdateWithResponse(String resourceGroupNam * * @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 automationRuleId The 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 response. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) AutomationRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String automationRuleId); @@ -80,13 +81,13 @@ Response createOrUpdateWithResponse(String resourceGroupNam * 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 workspaceName The name of the monitor 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 any object along with {@link Response}. + * @return anything along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, @@ -96,12 +97,12 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * 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 workspaceName The name of the monitor 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 any object. + * @return anything. */ @ServiceMethod(returns = ReturnType.SINGLE) Object delete(String resourceGroupName, String workspaceName, String automationRuleId); @@ -110,7 +111,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * 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 workspaceName The name of the monitor 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. @@ -123,7 +124,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * 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 workspaceName The name of the monitor 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. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BillingStatisticsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BillingStatisticsClient.java new file mode 100644 index 000000000000..7e0ff2453c38 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BillingStatisticsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BillingStatisticInner; + +/** + * An instance of this class provides access to all the operations defined in BillingStatisticsClient. + */ +public interface BillingStatisticsClient { + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @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 billing statistic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String billingStatisticName, Context context); + + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 billing statistic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BillingStatisticInner get(String resourceGroupName, String workspaceName, String billingStatisticName); + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, 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..146f44296bbf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkOperationsClient.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response expandWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkExpandParameters parameters, Context context); + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BookmarkExpandResponseInner expand(String resourceGroupName, String workspaceName, String bookmarkId, + BookmarkExpandParameters parameters); +} 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..7c27b4e9796c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkRelationsClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, 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); + + /** + * 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 Resource create parameters. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName, RelationInner relation, 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId, 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/BookmarksClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarksClient.java index b572356bc95b..1b3ee7f5002f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -15,38 +15,11 @@ * 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -62,7 +35,7 @@ Response getWithResponse(String resourceGroupName, String workspa * Gets a bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -76,7 +49,7 @@ Response getWithResponse(String resourceGroupName, String workspa * 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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. * @param context The context to associate with this operation. @@ -93,7 +66,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * 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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,7 +82,7 @@ BookmarkInner createOrUpdate(String resourceGroupName, String workspaceName, Str * Delete the bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,7 +98,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * Delete the bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -133,4 +106,31 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String bookmarkId); + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackageOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackageOperationsClient.java new file mode 100644 index 000000000000..513397e6edae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackageOperationsClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PackageModelInner; + +/** + * An instance of this class provides access to all the operations defined in ContentPackageOperationsClient. + */ +public interface ContentPackageOperationsClient { + /** + * Install a package to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package Id. + * @param packageInstallationProperties Package installation 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 represents a Package in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response installWithResponse(String resourceGroupName, String workspaceName, String packageId, + PackageModelInner packageInstallationProperties, Context context); + + /** + * Install a package to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package Id. + * @param packageInstallationProperties Package installation 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 represents a Package in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageModelInner install(String resourceGroupName, String workspaceName, String packageId, + PackageModelInner packageInstallationProperties); + + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response uninstallWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context); + + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 uninstall(String resourceGroupName, String workspaceName, String packageId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackagesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackagesClient.java new file mode 100644 index 000000000000..f7b240588dfa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackagesClient.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PackageModelInner; + +/** + * An instance of this class provides access to all the operations defined in ContentPackagesClient. + */ +public interface ContentPackagesClient { + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context); + + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PackageModelInner get(String resourceGroupName, String workspaceName, String packageId); + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + String search, Boolean count, Integer top, Integer skip, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesClient.java new file mode 100644 index 000000000000..2ceff03c1aff --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesClient.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TemplateModelInner; + +/** + * An instance of this class provides access to all the operations defined in ContentTemplatesClient. + */ +public interface ContentTemplatesClient { + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context); + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TemplateModelInner get(String resourceGroupName, String workspaceName, String templateId); + + /** + * Install a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId template Id. + * @param templateInstallationProperties Template installation 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 template resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response installWithResponse(String resourceGroupName, String workspaceName, String templateId, + TemplateModelInner templateInstallationProperties, Context context); + + /** + * Install a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId template Id. + * @param templateInstallationProperties Template installation 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 template resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TemplateModelInner install(String resourceGroupName, String workspaceName, String templateId, + TemplateModelInner templateInstallationProperties); + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context); + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String templateId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesOperationsClient.java new file mode 100644 index 000000000000..54756f4a5715 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesOperationsClient.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TemplateModelInner; + +/** + * An instance of this class provides access to all the operations defined in ContentTemplatesOperationsClient. + */ +public interface ContentTemplatesOperationsClient { + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param expand Expands the object with optional fiends that are not included by default. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String expand, String search, Boolean count, Integer top, Integer skip, String skipToken, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorDefinitionsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorDefinitionsClient.java new file mode 100644 index 000000000000..ce1629eb1dac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorDefinitionsClient.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.DataConnectorDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in DataConnectorDefinitionsClient. + */ +public interface DataConnectorDefinitionsClient { + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context); + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectorDefinitionInner get(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName); + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput, Context context); + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataConnectorDefinitionInner createOrUpdate(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput); + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context); + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 dataConnectorDefinitionName); + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, 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..1538c7cd1d62 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsCheckRequirementsOperationsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response postWithResponse(String resourceGroupName, String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, 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 com.azure.core.management.exception.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); +} 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 index 241dad74d594..11125906b9de 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -10,43 +10,17 @@ 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -62,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String wo * 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 workspaceName The name of the monitor 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. @@ -76,7 +50,7 @@ Response getWithResponse(String resourceGroupName, String wo * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. * @param context The context to associate with this operation. @@ -93,7 +67,7 @@ Response createOrUpdateWithResponse(String resourceGroupName * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -109,7 +83,7 @@ DataConnectorInner createOrUpdate(String resourceGroupName, String workspaceName * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,7 +99,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * 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 workspaceName The name of the monitor 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. @@ -133,4 +107,92 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String dataConnectorId); + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, 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 monitor workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The content of the action 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 the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response connectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody, 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 monitor workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void connect(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody); + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response disconnectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + 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 monitor 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); } 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..48f8d9c83369 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesClient.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.EntityQueryItemInner; +import com.azure.resourcemanager.securityinsights.models.Entity; +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.EntityManualTriggerRequestBody; + +/** + * An instance of this class provides access to all the operations defined in EntitiesClient. + */ +public interface EntitiesClient { + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, 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) + Entity get(String resourceGroupName, String workspaceName, String entityId); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier entity ID. + * @param requestBody Describes the request body for triggering a playbook on an 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, String entityIdentifier, + EntityManualTriggerRequestBody requestBody, Context context); + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void runPlaybook(String resourceGroupName, String workspaceName, String entityIdentifier); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response expandWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityExpandParameters parameters, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable queries(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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInsightsWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityGetInsightsParameters parameters, 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); +} 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..07c48d2a0503 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesGetTimelinesClient.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityTimelineParameters parameters, 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 com.azure.core.management.exception.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); +} 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..605ddb060a54 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesRelationsClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..1b164d4dc18a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueriesClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.EntityQueryTemplateKind; + +/** + * An instance of this class provides access to all the operations defined in EntityQueriesClient. + */ +public interface EntityQueriesClient { + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, CustomEntityQuery entityQuery, 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); + + /** + * 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, EntityQueryTemplateKind kind, + 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..a2040c981e86 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueryTemplatesClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.EntityQueryTemplateKind; + +/** + * An instance of this class provides access to all the operations defined in EntityQueryTemplatesClient. + */ +public interface EntityQueryTemplatesClient { + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryTemplateId, 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 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind, 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..5577ed0d2bc9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityRelationsClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRelationWithResponse(String resourceGroupName, String workspaceName, String entityId, + String relationName, 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 com.azure.core.management.exception.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); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/FileImportsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/FileImportsClient.java new file mode 100644 index 000000000000..02bfffdaee5e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/FileImportsClient.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner; + +/** + * An instance of this class provides access to all the operations defined in FileImportsClient. + */ +public interface FileImportsClient { + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String fileImportId, + Context context); + + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileImportInner get(String resourceGroupName, String workspaceName, String fileImportId); + + /** + * Creates the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID. + * @param fileImport The file import. + * @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 file import in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String workspaceName, String fileImportId, + FileImportInner fileImport, Context context); + + /** + * Creates the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID. + * @param fileImport The file import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 file import in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileImportInner create(String resourceGroupName, String workspaceName, String fileImportId, + FileImportInner fileImport); + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 {@link SyncPoller} for polling of represents a file import in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String fileImportId); + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 {@link SyncPoller} for polling of represents a file import in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String fileImportId, + Context context); + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 fileImportId); + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String fileImportId, Context context); + + /** + * Gets all file imports. + * + * @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 file imports as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all file imports. + * + * @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 file imports as paginated response with {@link PagedIterable}. + */ + @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/GetRecommendationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetRecommendationsClient.java new file mode 100644 index 000000000000..103ae7569de4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetRecommendationsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.RecommendationInner; + +/** + * An instance of this class provides access to all the operations defined in GetRecommendationsClient. + */ +public interface GetRecommendationsClient { + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetTriggeredAnalyticsRuleRunsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetTriggeredAnalyticsRuleRunsClient.java new file mode 100644 index 000000000000..8ae4dbd478eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetTriggeredAnalyticsRuleRunsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TriggeredAnalyticsRuleRunInner; + +/** + * An instance of this class provides access to all the operations defined in GetTriggeredAnalyticsRuleRunsClient. + */ +public interface GetTriggeredAnalyticsRuleRunsClient { + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetsClient.java new file mode 100644 index 000000000000..b4031ff4e4d1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.RecommendationInner; + +/** + * An instance of this class provides access to all the operations defined in GetsClient. + */ +public interface GetsClient { + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response singleRecommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, Context context); + + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecommendationInner singleRecommendation(String resourceGroupName, String workspaceName, String recommendationId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntCommentsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntCommentsClient.java new file mode 100644 index 000000000000..7f08b9489e30 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntCommentsClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntCommentInner; + +/** + * An instance of this class provides access to all the operations defined in HuntCommentsClient. + */ +public interface HuntCommentsClient { + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context); + + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HuntCommentInner get(String resourceGroupName, String workspaceName, String huntId, String huntCommentId); + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment id (GUID). + * @param huntComment The hunt 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 a Hunt Comment in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, HuntCommentInner huntComment, Context context); + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment id (GUID). + * @param huntComment The hunt 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 a Hunt Comment in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HuntCommentInner createOrUpdate(String resourceGroupName, String workspaceName, String huntId, String huntCommentId, + HuntCommentInner huntComment); + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context); + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 huntId, String huntCommentId); + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt comments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String huntId); + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt comments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String huntId, 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/HuntRelationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntRelationsClient.java new file mode 100644 index 000000000000..a20daac730d0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntRelationsClient.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntRelationInner; + +/** + * An instance of this class provides access to all the operations defined in HuntRelationsClient. + */ +public interface HuntRelationsClient { + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context); + + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HuntRelationInner get(String resourceGroupName, String workspaceName, String huntId, String huntRelationId); + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation id (GUID). + * @param huntRelation The hunt relation. + * @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 Hunt Relation in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String huntId, String huntRelationId, HuntRelationInner huntRelation, Context context); + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation id (GUID). + * @param huntRelation The hunt relation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Hunt Relation in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HuntRelationInner createOrUpdate(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, HuntRelationInner huntRelation); + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context); + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 huntId, String huntRelationId); + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt relations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String huntId); + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt relations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String huntId, 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/HuntsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntsClient.java new file mode 100644 index 000000000000..2ff0cfff01ce --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntsClient.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntInner; + +/** + * An instance of this class provides access to all the operations defined in HuntsClient. + */ +public interface HuntsClient { + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, Context context); + + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HuntInner get(String resourceGroupName, String workspaceName, String huntId); + + /** + * Create or update a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param hunt The hunt. + * @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 Hunt in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String huntId, + HuntInner hunt, Context context); + + /** + * Create or update a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param hunt The hunt. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Hunt in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HuntInner createOrUpdate(String resourceGroupName, String workspaceName, String huntId, HuntInner hunt); + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, Context context); + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 huntId); + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedIterable}. + */ + @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/IncidentCommentsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentCommentsClient.java index 107b4c042966..f811a76ca02e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -16,69 +16,33 @@ */ public interface IncidentCommentsClient { /** - * Gets all comments for a given 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 all comments for a given incident as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); - - /** - * Gets all comments for a given 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 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 comments for a given incident as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, - String filter, String orderby, Integer top, String skipToken, Context context); - - /** - * Gets a comment for a given incident. + * 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 workspaceName The name of the monitor 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 a comment for a given incident along with {@link Response}. + * @return an incident comment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); /** - * Gets a comment for a given incident. + * 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 workspaceName The name of the monitor 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 a comment for a given incident. + * @return an incident comment. */ @ServiceMethod(returns = ReturnType.SINGLE) IncidentCommentInner get(String resourceGroupName, String workspaceName, String incidentId, @@ -88,7 +52,7 @@ IncidentCommentInner get(String resourceGroupName, String workspaceName, String * Creates or updates a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @param incidentComment The incident comment. @@ -106,7 +70,7 @@ Response createOrUpdateWithResponse(String resourceGroupNa * Creates or updates a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @param incidentComment The incident comment. @@ -123,7 +87,7 @@ IncidentCommentInner createOrUpdate(String resourceGroupName, String workspaceNa * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @param context The context to associate with this operation. @@ -140,7 +104,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param incidentCommentId Incident comment ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -149,4 +113,40 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + + /** + * Gets all comments for a given incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 comments for a given incident as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all comments for a given incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 comments for a given incident as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + 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/IncidentRelationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentRelationsClient.java index a739b64b2d6e..7e6c96340147 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -15,47 +15,11 @@ * An instance of this class provides access to all the operations defined in IncidentRelationsClient. */ public interface IncidentRelationsClient { - /** - * Gets all relations for a given 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 all relations for a given incident as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); - - /** - * Gets all relations for a given 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 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 for a given incident as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, String filter, - String orderby, Integer top, String skipToken, Context context); - /** * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @param context The context to associate with this operation. @@ -72,7 +36,7 @@ Response getWithResponse(String resourceGroupName, String workspa * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -84,10 +48,10 @@ Response getWithResponse(String resourceGroupName, String workspa RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName); /** - * Creates or updates a relation for a given incident. + * 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 workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @param relation The relation model. @@ -102,10 +66,10 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str String incidentId, String relationName, RelationInner relation, Context context); /** - * Creates or updates a relation for a given incident. + * 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 workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @param relation The relation model. @@ -122,7 +86,7 @@ RelationInner createOrUpdate(String resourceGroupName, String workspaceName, Str * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @param context The context to associate with this operation. @@ -139,7 +103,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,4 +112,40 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); + + /** + * Gets all relations for a given incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 relations for a given incident as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all relations for a given incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 relations for a given incident as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, 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/IncidentTasksClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentTasksClient.java new file mode 100644 index 000000000000..b75f561518fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentTasksClient.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.IncidentTaskInner; + +/** + * An instance of this class provides access to all the operations defined in IncidentTasksClient. + */ +public interface IncidentTasksClient { + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context); + + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentTaskInner get(String resourceGroupName, String workspaceName, String incidentId, String incidentTaskId); + + /** + * Creates or updates the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task ID. + * @param incidentTask The incident task. + * @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 incident task properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId, IncidentTaskInner incidentTask, Context context); + + /** + * Creates or updates the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task ID. + * @param incidentTask The incident task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 incident task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncidentTaskInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, IncidentTaskInner incidentTask); + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context); + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 incidentTaskId); + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + 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 index 169fe6e21f31..208d1644af2c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -13,50 +13,17 @@ 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.models.ManualTriggerRequestBody; /** * 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, - Integer top, String skipToken, Context context); - /** * Gets a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,7 +39,7 @@ Response getWithResponse(String resourceGroupName, String workspa * Gets a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -86,7 +53,7 @@ Response getWithResponse(String resourceGroupName, String workspa * Creates or updates an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param incident The incident. * @param context The context to associate with this operation. @@ -103,7 +70,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * Creates or updates an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param incident The incident. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -119,7 +86,7 @@ IncidentInner createOrUpdate(String resourceGroupName, String workspaceName, Str * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -135,7 +102,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -145,10 +112,75 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName void delete(String resourceGroupName, String workspaceName, String incidentId); /** - * Gets all alerts for an incident. + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, Context context); + + /** + * Triggers playbook on a specific incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. + * @param incidentIdentifier The incident identifier. + * @param requestBody Describes the request body for triggering a playbook on an 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 anything along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, String incidentIdentifier, + ManualTriggerRequestBody requestBody, Context context); + + /** + * Triggers playbook on a specific incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param incidentIdentifier The incident identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return anything. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier); + + /** + * Gets all alerts for an incident. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -164,7 +196,7 @@ Response listAlertsWithResponse(String resourceGroupName * Gets all alerts for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -178,7 +210,7 @@ Response listAlertsWithResponse(String resourceGroupName * Gets all bookmarks for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -194,7 +226,7 @@ Response listBookmarksWithResponse(String resourceGro * Gets all bookmarks for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -208,7 +240,7 @@ Response listBookmarksWithResponse(String resourceGro * Gets all entities for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -224,7 +256,7 @@ Response listEntitiesWithResponse(String resource * Gets all entities for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. 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..f3dbeff9a5d3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/MetadatasClient.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 { + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context); + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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); + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String workspaceName, String metadataName, + MetadataModelInner metadata, Context context); + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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); + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String workspaceName, String metadataName, + MetadataPatch metadataPatch, 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 monitor 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); + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(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 monitor 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); + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, Integer skip, 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..d250428e4e2c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/OfficeConsentsClient.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String consentId, + 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); + + /** + * 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, 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 index fb17e6ed66dd..eea4cd4a94c8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesClient.java new file mode 100644 index 000000000000..44feaa61bbdd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductPackageModelInner; + +/** + * An instance of this class provides access to all the operations defined in ProductPackagesClient. + */ +public interface ProductPackagesClient { + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context); + + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductPackageModelInner get(String resourceGroupName, String workspaceName, String packageId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesOperationsClient.java new file mode 100644 index 000000000000..26055fad3724 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesOperationsClient.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductPackageModelInner; + +/** + * An instance of this class provides access to all the operations defined in ProductPackagesOperationsClient. + */ +public interface ProductPackagesOperationsClient { + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 search Searches for a substring in the response. 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, String search, 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..83b4656c37c0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductSettingsClient.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SettingsInner; + +/** + * An instance of this class provides access to all the operations defined in ProductSettingsClient. + */ +public interface ProductSettingsClient { + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String settingsName, + 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String workspaceName, String settingsName, + SettingsInner settings, 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); + + /** + * 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesClient.java new file mode 100644 index 000000000000..be03920adeb5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductTemplateModelInner; + +/** + * An instance of this class provides access to all the operations defined in ProductTemplatesClient. + */ +public interface ProductTemplatesClient { + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String templateId, Context context); + + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProductTemplateModelInner get(String resourceGroupName, String workspaceName, String templateId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesOperationsClient.java new file mode 100644 index 000000000000..2b219f1c4c60 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesOperationsClient.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductTemplateModelInner; + +/** + * An instance of this class provides access to all the operations defined in ProductTemplatesOperationsClient. + */ +public interface ProductTemplatesOperationsClient { + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 templates in the catalog as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 templates in the catalog as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ReevaluatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ReevaluatesClient.java new file mode 100644 index 000000000000..14a9e8884061 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ReevaluatesClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ReevaluateResponseInner; + +/** + * An instance of this class provides access to all the operations defined in ReevaluatesClient. + */ +public interface ReevaluatesClient { + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, Context context); + + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReevaluateResponseInner recommendation(String resourceGroupName, String workspaceName, String recommendationId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ResourceProvidersClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ResourceProvidersClient.java new file mode 100644 index 000000000000..25d80115a42e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ResourceProvidersClient.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; + +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ +public interface ResourceProvidersClient { + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listGeodataByIpWithResponse(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody, Context context); + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 listGeodataByIp(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody); + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWhoisByDomainWithResponse(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody, Context context); + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 listWhoisByDomain(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody); +} 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 deleted file mode 100644 index 0e30a1ad43f3..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsights.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (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 DataConnectorsClient object to access its operations. - * - * @return the DataConnectorsClient object. - */ - DataConnectorsClient getDataConnectors(); - - /** - * 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 SentinelOnboardingStatesClient object to access its operations. - * - * @return the SentinelOnboardingStatesClient object. - */ - SentinelOnboardingStatesClient getSentinelOnboardingStates(); - - /** - * Gets the SecurityMLAnalyticsSettingsClient object to access its operations. - * - * @return the SecurityMLAnalyticsSettingsClient object. - */ - SecurityMLAnalyticsSettingsClient getSecurityMLAnalyticsSettings(); - - /** - * 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 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 OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); -} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsightsManagementClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsightsManagementClient.java new file mode 100644 index 000000000000..aa063dca37f6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsightsManagementClient.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for SecurityInsightsManagementClient class. + */ +public interface SecurityInsightsManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * 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 ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the AlertRulesClient object to access its operations. + * + * @return the AlertRulesClient object. + */ + AlertRulesClient getAlertRules(); + + /** + * 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 IncidentsClient object to access its operations. + * + * @return the IncidentsClient object. + */ + IncidentsClient getIncidents(); + + /** + * Gets the BookmarksClient object to access its operations. + * + * @return the BookmarksClient object. + */ + BookmarksClient getBookmarks(); + + /** + * Gets the DataConnectorDefinitionsClient object to access its operations. + * + * @return the DataConnectorDefinitionsClient object. + */ + DataConnectorDefinitionsClient getDataConnectorDefinitions(); + + /** + * Gets the DataConnectorsClient object to access its operations. + * + * @return the DataConnectorsClient object. + */ + DataConnectorsClient getDataConnectors(); + + /** + * Gets the IncidentCommentsClient object to access its operations. + * + * @return the IncidentCommentsClient object. + */ + IncidentCommentsClient getIncidentComments(); + + /** + * Gets the BookmarkRelationsClient object to access its operations. + * + * @return the BookmarkRelationsClient object. + */ + BookmarkRelationsClient getBookmarkRelations(); + + /** + * Gets the EntityRelationsClient object to access its operations. + * + * @return the EntityRelationsClient object. + */ + EntityRelationsClient getEntityRelations(); + + /** + * Gets the IncidentTasksClient object to access its operations. + * + * @return the IncidentTasksClient object. + */ + IncidentTasksClient getIncidentTasks(); + + /** + * Gets the SentinelOnboardingStatesClient object to access its operations. + * + * @return the SentinelOnboardingStatesClient object. + */ + SentinelOnboardingStatesClient getSentinelOnboardingStates(); + + /** + * Gets the SecurityMLAnalyticsSettingsClient object to access its operations. + * + * @return the SecurityMLAnalyticsSettingsClient object. + */ + SecurityMLAnalyticsSettingsClient getSecurityMLAnalyticsSettings(); + + /** + * Gets the SourceControlsClient object to access its operations. + * + * @return the SourceControlsClient object. + */ + SourceControlsClient getSourceControls(); + + /** + * 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 BillingStatisticsClient object to access its operations. + * + * @return the BillingStatisticsClient object. + */ + BillingStatisticsClient getBillingStatistics(); + + /** + * Gets the EntitiesClient object to access its operations. + * + * @return the EntitiesClient object. + */ + EntitiesClient getEntities(); + + /** + * Gets the EntityQueriesClient object to access its operations. + * + * @return the EntityQueriesClient object. + */ + EntityQueriesClient getEntityQueries(); + + /** + * Gets the EntityQueryTemplatesClient object to access its operations. + * + * @return the EntityQueryTemplatesClient object. + */ + EntityQueryTemplatesClient getEntityQueryTemplates(); + + /** + * Gets the FileImportsClient object to access its operations. + * + * @return the FileImportsClient object. + */ + FileImportsClient getFileImports(); + + /** + * Gets the HuntsClient object to access its operations. + * + * @return the HuntsClient object. + */ + HuntsClient getHunts(); + + /** + * Gets the HuntCommentsClient object to access its operations. + * + * @return the HuntCommentsClient object. + */ + HuntCommentsClient getHuntComments(); + + /** + * Gets the HuntRelationsClient object to access its operations. + * + * @return the HuntRelationsClient object. + */ + HuntRelationsClient getHuntRelations(); + + /** + * Gets the OfficeConsentsClient object to access its operations. + * + * @return the OfficeConsentsClient object. + */ + OfficeConsentsClient getOfficeConsents(); + + /** + * Gets the ProductSettingsClient object to access its operations. + * + * @return the ProductSettingsClient object. + */ + ProductSettingsClient getProductSettings(); + + /** + * Gets the TriggeredAnalyticsRuleRunOperationsClient object to access its operations. + * + * @return the TriggeredAnalyticsRuleRunOperationsClient object. + */ + TriggeredAnalyticsRuleRunOperationsClient getTriggeredAnalyticsRuleRunOperations(); + + /** + * Gets the WorkspaceManagerAssignmentsClient object to access its operations. + * + * @return the WorkspaceManagerAssignmentsClient object. + */ + WorkspaceManagerAssignmentsClient getWorkspaceManagerAssignments(); + + /** + * Gets the WorkspaceManagerConfigurationsClient object to access its operations. + * + * @return the WorkspaceManagerConfigurationsClient object. + */ + WorkspaceManagerConfigurationsClient getWorkspaceManagerConfigurations(); + + /** + * Gets the WorkspaceManagerGroupsClient object to access its operations. + * + * @return the WorkspaceManagerGroupsClient object. + */ + WorkspaceManagerGroupsClient getWorkspaceManagerGroups(); + + /** + * Gets the WorkspaceManagerMembersClient object to access its operations. + * + * @return the WorkspaceManagerMembersClient object. + */ + WorkspaceManagerMembersClient getWorkspaceManagerMembers(); + + /** + * Gets the AlertRuleOperationsClient object to access its operations. + * + * @return the AlertRuleOperationsClient object. + */ + AlertRuleOperationsClient getAlertRuleOperations(); + + /** + * Gets the ActionsClient object to access its operations. + * + * @return the ActionsClient object. + */ + ActionsClient getActions(); + + /** + * Gets the BookmarkOperationsClient object to access its operations. + * + * @return the BookmarkOperationsClient object. + */ + BookmarkOperationsClient getBookmarkOperations(); + + /** + * Gets the ContentPackagesClient object to access its operations. + * + * @return the ContentPackagesClient object. + */ + ContentPackagesClient getContentPackages(); + + /** + * Gets the ContentPackageOperationsClient object to access its operations. + * + * @return the ContentPackageOperationsClient object. + */ + ContentPackageOperationsClient getContentPackageOperations(); + + /** + * Gets the ProductPackagesClient object to access its operations. + * + * @return the ProductPackagesClient object. + */ + ProductPackagesClient getProductPackages(); + + /** + * Gets the ProductPackagesOperationsClient object to access its operations. + * + * @return the ProductPackagesOperationsClient object. + */ + ProductPackagesOperationsClient getProductPackagesOperations(); + + /** + * Gets the ProductTemplatesClient object to access its operations. + * + * @return the ProductTemplatesClient object. + */ + ProductTemplatesClient getProductTemplates(); + + /** + * Gets the ProductTemplatesOperationsClient object to access its operations. + * + * @return the ProductTemplatesOperationsClient object. + */ + ProductTemplatesOperationsClient getProductTemplatesOperations(); + + /** + * Gets the ContentTemplatesClient object to access its operations. + * + * @return the ContentTemplatesClient object. + */ + ContentTemplatesClient getContentTemplates(); + + /** + * Gets the ContentTemplatesOperationsClient object to access its operations. + * + * @return the ContentTemplatesOperationsClient object. + */ + ContentTemplatesOperationsClient getContentTemplatesOperations(); + + /** + * Gets the IncidentRelationsClient object to access its operations. + * + * @return the IncidentRelationsClient object. + */ + IncidentRelationsClient getIncidentRelations(); + + /** + * Gets the EntitiesRelationsClient object to access its operations. + * + * @return the EntitiesRelationsClient object. + */ + EntitiesRelationsClient getEntitiesRelations(); + + /** + * Gets the MetadatasClient object to access its operations. + * + * @return the MetadatasClient object. + */ + MetadatasClient getMetadatas(); + + /** + * 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 DataConnectorsCheckRequirementsOperationsClient object to access its operations. + * + * @return the DataConnectorsCheckRequirementsOperationsClient object. + */ + DataConnectorsCheckRequirementsOperationsClient getDataConnectorsCheckRequirementsOperations(); + + /** + * Gets the SourceControlOperationsClient object to access its operations. + * + * @return the SourceControlOperationsClient object. + */ + SourceControlOperationsClient getSourceControlOperations(); + + /** + * Gets the ThreatIntelligenceIndicatorMetricsClient object to access its operations. + * + * @return the ThreatIntelligenceIndicatorMetricsClient object. + */ + ThreatIntelligenceIndicatorMetricsClient getThreatIntelligenceIndicatorMetrics(); + + /** + * Gets the ThreatIntelligencesClient object to access its operations. + * + * @return the ThreatIntelligencesClient object. + */ + ThreatIntelligencesClient getThreatIntelligences(); + + /** + * Gets the EntitiesGetTimelinesClient object to access its operations. + * + * @return the EntitiesGetTimelinesClient object. + */ + EntitiesGetTimelinesClient getEntitiesGetTimelines(); + + /** + * Gets the GetsClient object to access its operations. + * + * @return the GetsClient object. + */ + GetsClient getGets(); + + /** + * Gets the UpdatesClient object to access its operations. + * + * @return the UpdatesClient object. + */ + UpdatesClient getUpdates(); + + /** + * Gets the GetRecommendationsClient object to access its operations. + * + * @return the GetRecommendationsClient object. + */ + GetRecommendationsClient getGetRecommendations(); + + /** + * Gets the ReevaluatesClient object to access its operations. + * + * @return the ReevaluatesClient object. + */ + ReevaluatesClient getReevaluates(); + + /** + * Gets the GetTriggeredAnalyticsRuleRunsClient object to access its operations. + * + * @return the GetTriggeredAnalyticsRuleRunsClient object. + */ + GetTriggeredAnalyticsRuleRunsClient getGetTriggeredAnalyticsRuleRuns(); + + /** + * Gets the WorkspaceManagerAssignmentJobsClient object to access its operations. + * + * @return the WorkspaceManagerAssignmentJobsClient object. + */ + WorkspaceManagerAssignmentJobsClient getWorkspaceManagerAssignmentJobs(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityMLAnalyticsSettingsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityMLAnalyticsSettingsClient.java index 37b2930cb76f..97db9546225a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityMLAnalyticsSettingsClient.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityMLAnalyticsSettingsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -15,39 +15,11 @@ * An instance of this class provides access to all the operations defined in SecurityMLAnalyticsSettingsClient. */ public interface SecurityMLAnalyticsSettingsClient { - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName); - - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, - Context context); - /** * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,7 +35,7 @@ Response getWithResponse(String resourceGroupNa * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -77,7 +49,7 @@ Response getWithResponse(String resourceGroupNa * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @param context The context to associate with this operation. @@ -94,7 +66,7 @@ Response createOrUpdateWithResponse(String reso * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -110,7 +82,7 @@ SecurityMLAnalyticsSettingInner createOrUpdate(String resourceGroupName, String * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -126,7 +98,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,4 +106,32 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String settingsResourceName); + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, + Context context); } 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 index 5bed6ffdb489..b9f9af259e6b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -19,7 +19,7 @@ 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 workspaceName The name of the monitor 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. @@ -35,7 +35,7 @@ Response getWithResponse(String resourceGroupName, * 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 workspaceName The name of the monitor 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. @@ -83,7 +83,7 @@ SentinelOnboardingStateInner create(String resourceGroupName, String workspaceNa * 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 workspaceName The name of the monitor 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. @@ -99,7 +99,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * 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 workspaceName The name of the monitor 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. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlOperationsClient.java new file mode 100644 index 000000000000..252c03837b64 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlOperationsClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.RepositoryAccessProperties; + +/** + * An instance of this class provides access to all the operations defined in SourceControlOperationsClient. + */ +public interface SourceControlOperationsClient { + /** + * 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 repositoryAccess The content of the action 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 a list of repositories metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess); + + /** + * 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 repositoryAccess The content of the action 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 a list of repositories metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess, 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..bf790f3be297 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsClient.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; +import com.azure.resourcemanager.securityinsights.fluent.models.WarningInner; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; + +/** + * An instance of this class provides access to all the operations defined in SourceControlsClient. + */ +public interface SourceControlsClient { + /** + * 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 monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String sourceControlId, + 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 monitor 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); + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, SourceControlInner sourceControl, 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 monitor 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); + + /** + * 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, 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 monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @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 warning response structure along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess, 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 monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return warning response structure. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WarningInner delete(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess); +} 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 index 37b1ef902430..85ae1a2d583d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -18,7 +18,7 @@ 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. + * @param workspaceName The name of the monitor 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. @@ -34,7 +34,7 @@ Response listWithResponse(String resourceGro * 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 workspaceName The name of the monitor 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. 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 index a49a1116b11b..2292ebab2f32 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -18,42 +18,11 @@ * 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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createIndicatorWithResponse(String resourceGroupName, - String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, 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 com.azure.core.management.exception.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, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties); - /** * 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 workspaceName The name of the monitor 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. @@ -69,7 +38,7 @@ Response getWithResponse(String resourceGrou * 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 workspaceName The name of the monitor 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. @@ -83,7 +52,7 @@ Response getWithResponse(String resourceGrou * 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 workspaceName The name of the monitor 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. @@ -100,7 +69,7 @@ Response createWithResponse(String resourceG * 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 workspaceName The name of the monitor 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. @@ -116,7 +85,7 @@ ThreatIntelligenceInformationInner create(String resourceGroupName, String works * 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 workspaceName The name of the monitor 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. @@ -131,7 +100,7 @@ ThreatIntelligenceInformationInner create(String resourceGroupName, String works * 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 workspaceName The name of the monitor 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. @@ -140,42 +109,11 @@ ThreatIntelligenceInformationInner create(String resourceGroupName, String works @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, String name); - /** - * 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 as paginated response with {@link PagedIterable}. - */ - @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 as paginated response with {@link PagedIterable}. - */ - @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 workspaceName The name of the monitor 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. @@ -192,7 +130,7 @@ Response appendTagsWithResponse(String resourceGroupName, String workspace * 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 workspaceName The name of the monitor 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. @@ -207,7 +145,7 @@ void appendTags(String resourceGroupName, String workspaceName, String name, * 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 workspaceName The name of the monitor 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. @@ -224,7 +162,7 @@ Response replaceTagsWithResponse(String reso * 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 workspaceName The name of the monitor 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. @@ -235,4 +173,66 @@ Response replaceTagsWithResponse(String reso @ServiceMethod(returns = ReturnType.SINGLE) ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags); + + /** + * 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 monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 threat intelligence information object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createIndicatorWithResponse(String resourceGroupName, + String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, 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 monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 threat intelligence information object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThreatIntelligenceInformationInner createIndicator(String resourceGroupName, String workspaceName, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties); + + /** + * 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 monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. + */ + @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 monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable queryIndicators(String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, 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 index 5876e602f43b..9b8347bc79a5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -19,7 +19,7 @@ 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. + * @param workspaceName The name of the monitor 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. @@ -32,7 +32,7 @@ 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. + * @param workspaceName The name of the monitor workspace. * @param filter Filters the results, based on a Boolean condition. 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 diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligencesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligencesClient.java new file mode 100644 index 000000000000..7c136e58d610 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligencesClient.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TIObjectInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; +import com.azure.resourcemanager.securityinsights.models.CountQuery; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.TiType; + +/** + * An instance of this class provides access to all the operations defined in ThreatIntelligencesClient. + */ +public interface ThreatIntelligencesClient { + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 the count of all TI objects for the workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response countWithResponse(String resourceGroupName, String workspaceName, + TiType tiType, CountQuery query, Context context); + + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 the count of all TI objects for the workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThreatIntelligenceCountInner count(String resourceGroupName, String workspaceName, TiType tiType); + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 all TI objects for the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType); + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 TI objects for the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType, Query query, + Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/TriggeredAnalyticsRuleRunOperationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/TriggeredAnalyticsRuleRunOperationsClient.java new file mode 100644 index 000000000000..99e84f04ef69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/TriggeredAnalyticsRuleRunOperationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TriggeredAnalyticsRuleRunInner; + +/** + * An instance of this class provides access to all the operations defined in TriggeredAnalyticsRuleRunOperationsClient. + */ +public interface TriggeredAnalyticsRuleRunOperationsClient { + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String ruleRunId, Context context); + + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TriggeredAnalyticsRuleRunInner get(String resourceGroupName, String workspaceName, String ruleRunId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/UpdatesClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/UpdatesClient.java new file mode 100644 index 000000000000..8e8efc07a9c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/UpdatesClient.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.RecommendationInner; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; + +/** + * An instance of this class provides access to all the operations defined in UpdatesClient. + */ +public interface UpdatesClient { + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, RecommendationPatch recommendationPatch, Context context); + + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecommendationInner recommendation(String resourceGroupName, String workspaceName, String recommendationId, + RecommendationPatch recommendationPatch); +} 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 index 5bc1e1c84f1c..14b41755f61c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -16,76 +16,78 @@ */ public interface WatchlistItemsClient { /** - * Get all watchlist Items. + * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. + * @param watchlistItemId The 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 all watchlist Items as paginated response with {@link PagedIterable}. + * @return a watchlist item along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context); /** - * Get all watchlist Items. + * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @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. + * @param watchlistItemId The 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 all watchlist Items as paginated response with {@link PagedIterable}. + * @return a watchlist item. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, - String skipToken, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + WatchlistItemInner get(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId); /** - * Get a watchlist item. + * Create or update a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 a watchlist item along with {@link Response}. + * @return represents a Watchlist Item in Azure Security Insights along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - String watchlistItemId, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId, WatchlistItemInner watchlistItem, Context context); /** - * Get a watchlist item. + * Create or update a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 a watchlist item. + * @return represents a Watchlist Item in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistItemInner get(String resourceGroupName, String workspaceName, String watchlistAlias, - String watchlistItemId); + WatchlistItemInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, WatchlistItemInner watchlistItem); /** * 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The watchlist item id (GUID). * @param context The context to associate with this operation. @@ -102,7 +104,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The watchlist item id (GUID). * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,37 +115,35 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); /** - * Create or update a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The 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 along with {@link Response}. + * @return all watchlist Items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, - String watchlistAlias, String watchlistItemId, WatchlistItemInner watchlistItem, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias); /** - * Create or update a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The watchlist item id (GUID). - * @param watchlistItem The watchlist item. + * @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 represents a Watchlist Item in Azure Security Insights. + * @return all watchlist Items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistItemInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, - String watchlistItemId, WatchlistItemInner watchlistItem); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, + String skipToken, 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 index 297446f54e25..dd30cf642ca5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent; @@ -8,7 +8,9 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; /** @@ -16,87 +18,141 @@ */ public interface WatchlistsClient { /** - * Get all watchlists, without watchlist items. + * Get 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 workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 watchlists, without watchlist items as paginated response with {@link PagedIterable}. + * @return a watchlist, without its watchlist items along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + Context context); /** - * Get all watchlists, without watchlist items. + * Get 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 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. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 watchlists, without watchlist items as paginated response with {@link PagedIterable}. + * @return a watchlist, without its watchlist items. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias); /** - * Get a watchlist, without its watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 the {@link SyncPoller} for polling of represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WatchlistInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String watchlistAlias, WatchlistInner watchlist); + + /** + * Create or update 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 monitor workspace. + * @param watchlistAlias The 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 a watchlist, without its watchlist items along with {@link Response}. + * @return the {@link SyncPoller} for polling of represents a Watchlist in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WatchlistInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String watchlistAlias, WatchlistInner watchlist, Context context); + + /** + * Create or update 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 monitor workspace. + * @param watchlistAlias The 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) - Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - Context context); + WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + WatchlistInner watchlist); /** - * Get a watchlist, without its watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 a watchlist, without its watchlist items. + * @return represents a Watchlist in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias); + WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + WatchlistInner watchlist, Context context); + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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. @@ -106,37 +162,47 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName void delete(String resourceGroupName, String workspaceName, String watchlistAlias); /** - * Create or update 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. + * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, - String watchlistAlias, WatchlistInner watchlist, Context context); + void delete(String resourceGroupName, String workspaceName, String watchlistAlias, Context context); /** - * Create or update 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. + * Get 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 watchlistAlias The watchlist alias. - * @param watchlist The watchlist. + * @param workspaceName The name of the monitor 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 represents a Watchlist in Azure Security Insights. + * @return all watchlists, without watchlist items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, - WatchlistInner watchlist); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @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 watchlists, without watchlist items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, + Context context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentJobsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentJobsClient.java new file mode 100644 index 000000000000..f99087c2117e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentJobsClient.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.JobInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerAssignmentJobsClient. + */ +public interface WorkspaceManagerAssignmentJobsClient { + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 assignment job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context); + + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 assignment job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner create(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName); + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName, Context context); + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner get(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, String jobName); + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName, Context context); + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 workspaceManagerAssignmentName, String jobName); + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 jobs for the specified workspace manager assignment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName); + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 jobs for the specified workspace manager assignment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, + String orderby, Integer top, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentsClient.java new file mode 100644 index 000000000000..e29ea71d458f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentsClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerAssignmentInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerAssignmentsClient. + */ +public interface WorkspaceManagerAssignmentsClient { + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 workspace manager assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context); + + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerAssignmentInner get(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName); + + /** + * Creates or updates a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param workspaceManagerAssignment The workspace manager assignment. + * @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 workspace manager assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, WorkspaceManagerAssignmentInner workspaceManagerAssignment, + Context context); + + /** + * Creates or updates a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param workspaceManagerAssignment The workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerAssignmentInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, WorkspaceManagerAssignmentInner workspaceManagerAssignment); + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context); + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerAssignmentName); + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerConfigurationsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerConfigurationsClient.java new file mode 100644 index 000000000000..d161c0be3426 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerConfigurationsClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerConfigurationsClient. + */ +public interface WorkspaceManagerConfigurationsClient { + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @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 workspace manager configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context); + + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerConfigurationInner get(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName); + + /** + * Creates or updates a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @param workspaceManagerConfiguration The workspace manager configuration. + * @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 workspace manager configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String workspaceManagerConfigurationName, + WorkspaceManagerConfigurationInner workspaceManagerConfiguration, Context context); + + /** + * Creates or updates a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @param workspaceManagerConfiguration The workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerConfigurationInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, WorkspaceManagerConfigurationInner workspaceManagerConfiguration); + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context); + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerConfigurationName); + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerGroupsClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerGroupsClient.java new file mode 100644 index 000000000000..6c3b514d0193 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerGroupsClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerGroupInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerGroupsClient. + */ +public interface WorkspaceManagerGroupsClient { + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @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 workspace manager group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, Context context); + + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerGroupInner get(String resourceGroupName, String workspaceName, String workspaceManagerGroupName); + + /** + * Creates or updates a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @param workspaceManagerGroup The workspace manager group object. + * @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 workspace manager group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, WorkspaceManagerGroupInner workspaceManagerGroup, Context context); + + /** + * Creates or updates a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @param workspaceManagerGroup The workspace manager group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerGroupInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, WorkspaceManagerGroupInner workspaceManagerGroup); + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String workspaceManagerGroupName, + Context context); + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerGroupName); + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerMembersClient.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerMembersClient.java new file mode 100644 index 000000000000..946bfc05f51a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerMembersClient.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerMemberInner; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerMembersClient. + */ +public interface WorkspaceManagerMembersClient { + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @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 workspace manager member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, Context context); + + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerMemberInner get(String resourceGroupName, String workspaceName, String workspaceManagerMemberName); + + /** + * Creates or updates a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @param workspaceManagerMember The workspace manager member object. + * @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 workspace manager member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, WorkspaceManagerMemberInner workspaceManagerMember, Context context); + + /** + * Creates or updates a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @param workspaceManagerMember The workspace manager member object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceManagerMemberInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, WorkspaceManagerMemberInner workspaceManagerMember); + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String workspaceName, String workspaceManagerMemberName, + Context context); + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerMemberName); + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, 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..0923a57e6982 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AADCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * AADIP (Azure Active Directory Identity Protection) requirements check properties. + */ +@Fluent +public final class AADCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of AADCheckRequirementsProperties class. + */ + public AADCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public AADCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AADCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AADCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AADCheckRequirementsProperties. + */ + public static AADCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AADCheckRequirementsProperties deserializedAADCheckRequirementsProperties + = new AADCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedAADCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAADCheckRequirementsProperties; + }); + } +} 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 similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AadDataConnectorProperties.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AADDataConnectorProperties.java index 584b4b41623e..5e5813c05db8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -13,10 +13,10 @@ import java.io.IOException; /** - * AAD (Azure Active Directory) data connector properties. + * AADIP (Azure Active Directory Identity Protection) data connector properties. */ @Fluent -public final class AadDataConnectorProperties implements JsonSerializable { +public final class AADDataConnectorProperties implements JsonSerializable { /* * The tenant id to connect to, and get the data from. */ @@ -28,9 +28,9 @@ public final class AadDataConnectorProperties implements JsonSerializable { - AadDataConnectorProperties deserializedAadDataConnectorProperties = new AadDataConnectorProperties(); + AADDataConnectorProperties deserializedAADDataConnectorProperties = new AADDataConnectorProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("tenantId".equals(fieldName)) { - deserializedAadDataConnectorProperties.tenantId = reader.getString(); + deserializedAADDataConnectorProperties.tenantId = reader.getString(); } else if ("dataTypes".equals(fieldName)) { - deserializedAadDataConnectorProperties.dataTypes = AlertsDataTypeOfDataConnector.fromJson(reader); + deserializedAADDataConnectorProperties.dataTypes = AlertsDataTypeOfDataConnector.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedAadDataConnectorProperties; + return deserializedAADDataConnectorProperties; }); } } 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..2562fad9fb43 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AATPCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * AATP (Azure Advanced Threat Protection) requirements check properties. + */ +@Fluent +public final class AATPCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of AATPCheckRequirementsProperties class. + */ + public AATPCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public AATPCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AATPCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AATPCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AATPCheckRequirementsProperties. + */ + public static AATPCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AATPCheckRequirementsProperties deserializedAATPCheckRequirementsProperties + = new AATPCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedAATPCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAATPCheckRequirementsProperties; + }); + } +} 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 similarity index 68% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AatpDataConnectorProperties.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AATPDataConnectorProperties.java index 63b8c8f525c6..50481e968328 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -16,7 +16,7 @@ * AATP (Azure Advanced Threat Protection) data connector properties. */ @Fluent -public final class AatpDataConnectorProperties implements JsonSerializable { +public final class AATPDataConnectorProperties implements JsonSerializable { /* * The tenant id to connect to, and get the data from. */ @@ -28,9 +28,9 @@ public final class AatpDataConnectorProperties implements JsonSerializable { - AatpDataConnectorProperties deserializedAatpDataConnectorProperties = new AatpDataConnectorProperties(); + AATPDataConnectorProperties deserializedAATPDataConnectorProperties = new AATPDataConnectorProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("tenantId".equals(fieldName)) { - deserializedAatpDataConnectorProperties.tenantId = reader.getString(); + deserializedAATPDataConnectorProperties.tenantId = reader.getString(); } else if ("dataTypes".equals(fieldName)) { - deserializedAatpDataConnectorProperties.dataTypes = AlertsDataTypeOfDataConnector.fromJson(reader); + deserializedAATPDataConnectorProperties.dataTypes = AlertsDataTypeOfDataConnector.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedAatpDataConnectorProperties; + return deserializedAATPDataConnectorProperties; }); } } 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..98d35d426e87 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ASCCheckRequirementsProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ASC (Azure Security Center) requirements check properties. + */ +@Fluent +public final class ASCCheckRequirementsProperties implements JsonSerializable { + /* + * The subscription id to connect to, and get the data from. + */ + private String subscriptionId; + + /** + * Creates an instance of ASCCheckRequirementsProperties class. + */ + public ASCCheckRequirementsProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ASCCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ASCCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ASCCheckRequirementsProperties. + */ + public static ASCCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ASCCheckRequirementsProperties deserializedASCCheckRequirementsProperties + = new ASCCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptionId".equals(fieldName)) { + deserializedASCCheckRequirementsProperties.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedASCCheckRequirementsProperties; + }); + } +} 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 similarity index 68% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AscDataConnectorProperties.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ASCDataConnectorProperties.java index d322e6ee6b8f..f3d9773c4c09 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -16,16 +16,16 @@ * ASC (Azure Security Center) data connector properties. */ @Fluent -public final class AscDataConnectorProperties extends DataConnectorWithAlertsProperties { +public final class ASCDataConnectorProperties extends DataConnectorWithAlertsProperties { /* * The subscription id to connect to, and get the data from. */ private String subscriptionId; /** - * Creates an instance of AscDataConnectorProperties class. + * Creates an instance of ASCDataConnectorProperties class. */ - public AscDataConnectorProperties() { + public ASCDataConnectorProperties() { } /** @@ -41,9 +41,9 @@ public String 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. + * @return the ASCDataConnectorProperties object itself. */ - public AscDataConnectorProperties withSubscriptionId(String subscriptionId) { + public ASCDataConnectorProperties withSubscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } @@ -52,23 +52,11 @@ public AscDataConnectorProperties withSubscriptionId(String subscriptionId) { * {@inheritDoc} */ @Override - public AscDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + 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() { - if (dataTypes() != null) { - dataTypes().validate(); - } - } - /** * {@inheritDoc} */ @@ -81,31 +69,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AscDataConnectorProperties from the JsonReader. + * Reads an instance of ASCDataConnectorProperties from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AscDataConnectorProperties if the JsonReader was pointing to an instance of it, or null if + * @return An instance of ASCDataConnectorProperties if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the AscDataConnectorProperties. + * @throws IOException If an error occurs while reading the ASCDataConnectorProperties. */ - public static AscDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + public static ASCDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - AscDataConnectorProperties deserializedAscDataConnectorProperties = new AscDataConnectorProperties(); + ASCDataConnectorProperties deserializedASCDataConnectorProperties = new ASCDataConnectorProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("dataTypes".equals(fieldName)) { - deserializedAscDataConnectorProperties + deserializedASCDataConnectorProperties .withDataTypes(AlertsDataTypeOfDataConnector.fromJson(reader)); } else if ("subscriptionId".equals(fieldName)) { - deserializedAscDataConnectorProperties.subscriptionId = reader.getString(); + deserializedASCDataConnectorProperties.subscriptionId = reader.getString(); } else { reader.skipChildren(); } } - return deserializedAscDataConnectorProperties; + return deserializedASCDataConnectorProperties; }); } } 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 index 7d86bba45d1b..f9cf3c3c2e76 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -11,7 +11,6 @@ import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Account entity property bag. @@ -49,7 +48,7 @@ public final class AccountEntityProperties extends EntityCommonProperties { private Boolean isDomainJoined; /* - * The NetBIOS domain name as it appears in the alert format - domain/username. Examples: NT AUTHORITY. + * The NetBIOS domain name as it appears in the alert format domain/username. Examples: NT AUTHORITY. */ private String ntDomain; @@ -57,7 +56,7 @@ public final class AccountEntityProperties extends EntityCommonProperties { * The objectGUID attribute is a single-value attribute that is the unique identifier for the object, assigned by * active directory. */ - private UUID objectGuid; + private String objectGuid; /* * The Azure Active Directory Passport User ID. @@ -93,7 +92,7 @@ public final class AccountEntityProperties extends EntityCommonProperties { /** * Creates an instance of AccountEntityProperties class. */ - public AccountEntityProperties() { + private AccountEntityProperties() { } /** @@ -153,7 +152,7 @@ public Boolean isDomainJoined() { } /** - * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format - domain/username. Examples: + * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format domain/username. Examples: * NT AUTHORITY. * * @return the ntDomain value. @@ -168,7 +167,7 @@ public String ntDomain() { * * @return the objectGuid value. */ - public UUID objectGuid() { + public String objectGuid() { return this.objectGuid; } @@ -231,15 +230,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -284,8 +274,7 @@ public static AccountEntityProperties fromJson(JsonReader jsonReader) throws IOE } else if ("ntDomain".equals(fieldName)) { deserializedAccountEntityProperties.ntDomain = reader.getString(); } else if ("objectGuid".equals(fieldName)) { - deserializedAccountEntityProperties.objectGuid - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedAccountEntityProperties.objectGuid = reader.getString(); } else if ("puid".equals(fieldName)) { deserializedAccountEntityProperties.puid = reader.getString(); } else if ("sid".equals(fieldName)) { 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 index 47f044dd7bd4..63e475404ad8 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -57,27 +56,6 @@ public ActionRequestProperties withLogicAppResourceId(String logicAppResourceId) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (triggerUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property triggerUri in model ActionRequestProperties")); - } - if (logicAppResourceId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property logicAppResourceId in model ActionRequestProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ActionRequestProperties.class); - /** * {@inheritDoc} */ 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 index f9831cffcab2..6953a9d066af 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -15,17 +15,17 @@ /** * Action for alert rule. */ -@Fluent +@Immutable public final class ActionResponseInner extends ProxyResource { /* - * Etag of the action. + * Action properties for get request */ - private String etag; + private ActionResponseProperties innerProperties; /* - * Action properties for get request + * Etag of the action. */ - private ActionResponseProperties innerProperties; + private String etag; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,36 +50,25 @@ public final class ActionResponseInner extends ProxyResource { /** * Creates an instance of ActionResponseInner class. */ - public ActionResponseInner() { + private ActionResponseInner() { } /** - * Get the etag property: Etag of the action. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Etag of the action. + * Get the innerProperties property: Action properties for get request. * - * @param etag the etag value to set. - * @return the ActionResponseInner object itself. + * @return the innerProperties value. */ - public ActionResponseInner withEtag(String etag) { - this.etag = etag; - return this; + private ActionResponseProperties innerProperties() { + return this.innerProperties; } /** - * Get the innerProperties property: Action properties for get request. + * Get the etag property: Etag of the action. * - * @return the innerProperties value. + * @return the etag value. */ - private ActionResponseProperties innerProperties() { - return this.innerProperties; + public String etag() { + return this.etag; } /** @@ -130,20 +119,6 @@ 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}. @@ -154,40 +129,14 @@ 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. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", this.etag); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -213,10 +162,10 @@ public static ActionResponseInner fromJson(JsonReader jsonReader) throws IOExcep deserializedActionResponseInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedActionResponseInner.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedActionResponseInner.etag = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedActionResponseInner.innerProperties = ActionResponseProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedActionResponseInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedActionResponseInner.systemData = SystemData.fromJson(reader); } else { 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 index 34aea42e118d..294e5aae53b2 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -15,7 +14,7 @@ /** * Action property bag. */ -@Fluent +@Immutable public final class ActionResponseProperties extends ActionPropertiesBase { /* * The name of the logic app's workflow. @@ -25,7 +24,7 @@ public final class ActionResponseProperties extends ActionPropertiesBase { /** * Creates an instance of ActionResponseProperties class. */ - public ActionResponseProperties() { + private ActionResponseProperties() { } /** @@ -37,42 +36,6 @@ 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() { - if (logicAppResourceId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property logicAppResourceId in model ActionResponseProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ActionResponseProperties.class); - /** * {@inheritDoc} */ 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..ef3282c3559d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueriesProperties.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Describes activity entity query properties. + */ +@Fluent +public final class ActivityEntityQueriesProperties implements JsonSerializable { + /* + * The entity query title + */ + private String title; + + /* + * The entity query content to display in timeline + */ + private String content; + + /* + * The entity query description + */ + private String description; + + /* + * The Activity query definitions + */ + private ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions; + + /* + * The type of the query's source entity + */ + private EntityType inputEntityType; + + /* + * List of the fields of the source entity that are required to run the query + */ + private List> requiredInputFieldsSets; + + /* + * The query applied only to entities matching to all filters + */ + private Map> entitiesFilter; + + /* + * The template id this activity was created from + */ + private String templateName; + + /* + * Determines whether this activity is enabled or disabled. + */ + private Boolean enabled; + + /* + * The time the activity was created + */ + private OffsetDateTime createdTimeUtc; + + /* + * The last time the activity was updated + */ + private OffsetDateTime lastModifiedTimeUtc; + + /** + * Creates an instance of ActivityEntityQueriesProperties class. + */ + public ActivityEntityQueriesProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("queryDefinitions", this.queryDefinitions); + jsonWriter.writeStringField("inputEntityType", + this.inputEntityType == null ? null : this.inputEntityType.toString()); + jsonWriter.writeArrayField("requiredInputFieldsSets", this.requiredInputFieldsSets, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + jsonWriter.writeMapField("entitiesFilter", this.entitiesFilter, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + jsonWriter.writeStringField("templateName", this.templateName); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityEntityQueriesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityEntityQueriesProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActivityEntityQueriesProperties. + */ + public static ActivityEntityQueriesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivityEntityQueriesProperties deserializedActivityEntityQueriesProperties + = new ActivityEntityQueriesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.title = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.content = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.description = reader.getString(); + } else if ("queryDefinitions".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.queryDefinitions + = ActivityEntityQueriesPropertiesQueryDefinitions.fromJson(reader); + } else if ("inputEntityType".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.inputEntityType + = EntityType.fromString(reader.getString()); + } else if ("requiredInputFieldsSets".equals(fieldName)) { + List> requiredInputFieldsSets + = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedActivityEntityQueriesProperties.requiredInputFieldsSets = requiredInputFieldsSets; + } else if ("entitiesFilter".equals(fieldName)) { + Map> entitiesFilter + = reader.readMap(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedActivityEntityQueriesProperties.entitiesFilter = entitiesFilter; + } else if ("templateName".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.templateName = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("createdTimeUtc".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.createdTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedTimeUtc".equals(fieldName)) { + deserializedActivityEntityQueriesProperties.lastModifiedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedActivityEntityQueriesProperties; + }); + } +} 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..e7f8a5fc4743 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueryTemplateProperties.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplatePropertiesQueryDefinitions; +import com.azure.resourcemanager.securityinsights.models.DataTypeDefinitions; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Describes activity entity query properties. + */ +@Immutable +public final class ActivityEntityQueryTemplateProperties + implements JsonSerializable { + /* + * The entity query title + */ + private String title; + + /* + * The entity query content to display in timeline + */ + private String content; + + /* + * The entity query description + */ + private String description; + + /* + * The Activity query definitions + */ + private ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions; + + /* + * List of required data types for the given entity query template + */ + private List dataTypes; + + /* + * The type of the query's source entity + */ + private EntityType inputEntityType; + + /* + * List of the fields of the source entity that are required to run the query + */ + private List> requiredInputFieldsSets; + + /* + * The query applied only to entities matching to all filters + */ + private Map> entitiesFilter; + + /** + * Creates an instance of ActivityEntityQueryTemplateProperties class. + */ + private ActivityEntityQueryTemplateProperties() { + } + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the content property: The entity query content to display in timeline. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() { + return this.queryDefinitions; + } + + /** + * 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; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.inputEntityType; + } + + /** + * 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; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + public Map> entitiesFilter() { + return this.entitiesFilter; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("queryDefinitions", this.queryDefinitions); + jsonWriter.writeArrayField("dataTypes", this.dataTypes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("inputEntityType", + this.inputEntityType == null ? null : this.inputEntityType.toString()); + jsonWriter.writeArrayField("requiredInputFieldsSets", this.requiredInputFieldsSets, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + jsonWriter.writeMapField("entitiesFilter", this.entitiesFilter, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityEntityQueryTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityEntityQueryTemplateProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActivityEntityQueryTemplateProperties. + */ + public static ActivityEntityQueryTemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivityEntityQueryTemplateProperties deserializedActivityEntityQueryTemplateProperties + = new ActivityEntityQueryTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedActivityEntityQueryTemplateProperties.title = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedActivityEntityQueryTemplateProperties.content = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedActivityEntityQueryTemplateProperties.description = reader.getString(); + } else if ("queryDefinitions".equals(fieldName)) { + deserializedActivityEntityQueryTemplateProperties.queryDefinitions + = ActivityEntityQueryTemplatePropertiesQueryDefinitions.fromJson(reader); + } else if ("dataTypes".equals(fieldName)) { + List dataTypes + = reader.readArray(reader1 -> DataTypeDefinitions.fromJson(reader1)); + deserializedActivityEntityQueryTemplateProperties.dataTypes = dataTypes; + } else if ("inputEntityType".equals(fieldName)) { + deserializedActivityEntityQueryTemplateProperties.inputEntityType + = EntityType.fromString(reader.getString()); + } else if ("requiredInputFieldsSets".equals(fieldName)) { + List> requiredInputFieldsSets + = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedActivityEntityQueryTemplateProperties.requiredInputFieldsSets = requiredInputFieldsSets; + } else if ("entitiesFilter".equals(fieldName)) { + Map> entitiesFilter + = reader.readMap(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedActivityEntityQueryTemplateProperties.entitiesFilter = entitiesFilter; + } else { + reader.skipChildren(); + } + } + + return deserializedActivityEntityQueryTemplateProperties; + }); + } +} 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 index 82b21a9babd1..98057786ad66 100644 --- 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 @@ -1,31 +1,41 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.securityinsights.models.AlertRuleKind; 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.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.NrtAlertRule; import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRule; import java.io.IOException; /** * Alert rule. */ @Fluent -public class AlertRuleInner extends ResourceWithEtag { +public class AlertRuleInner extends ProxyResource { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.fromString("AlertRule"); + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -53,7 +63,9 @@ public AlertRuleInner() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -61,16 +73,46 @@ public AlertRuleKind kind() { return this.kind; } + /** + * 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 AlertRuleInner object itself. + */ + public AlertRuleInner 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. */ - @Override public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the AlertRuleInner object itself. + */ + AlertRuleInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -101,32 +143,14 @@ public String id() { return this.id; } - /** - * {@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() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -155,12 +179,18 @@ public static AlertRuleInner fromJson(JsonReader jsonReader) throws IOException } } // Use the discriminator value to determine which subtype should be deserialized. - if ("Fusion".equals(discriminatorValue)) { + if ("MLBehaviorAnalytics".equals(discriminatorValue)) { + return MLBehaviorAnalyticsAlertRule.fromJson(readerToUse.reset()); + } else if ("Fusion".equals(discriminatorValue)) { return FusionAlertRule.fromJson(readerToUse.reset()); + } else if ("ThreatIntelligence".equals(discriminatorValue)) { + return ThreatIntelligenceAlertRule.fromJson(readerToUse.reset()); } else if ("MicrosoftSecurityIncidentCreation".equals(discriminatorValue)) { return MicrosoftSecurityIncidentCreationAlertRule.fromJson(readerToUse.reset()); } else if ("Scheduled".equals(discriminatorValue)) { return ScheduledAlertRule.fromJson(readerToUse.reset()); + } else if ("NRT".equals(discriminatorValue)) { + return NrtAlertRule.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -181,12 +211,12 @@ static AlertRuleInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws I deserializedAlertRuleInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedAlertRuleInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedAlertRuleInner.kind = AlertRuleKind.fromString(reader.getString()); } else if ("etag".equals(fieldName)) { - deserializedAlertRuleInner.withEtag(reader.getString()); + deserializedAlertRuleInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedAlertRuleInner.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedAlertRuleInner.kind = AlertRuleKind.fromString(reader.getString()); } else { reader.skipChildren(); } 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 index c91682bf8b56..92184250496e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -12,8 +12,11 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.securityinsights.models.AlertRuleKind; 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 java.io.IOException; /** @@ -22,7 +25,9 @@ @Immutable public class AlertRuleTemplateInner extends ProxyResource { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.fromString("AlertRuleTemplate"); @@ -49,11 +54,13 @@ public class AlertRuleTemplateInner extends ProxyResource { /** * Creates an instance of AlertRuleTemplateInner class. */ - public AlertRuleTemplateInner() { + protected AlertRuleTemplateInner() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -111,14 +118,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -154,12 +153,18 @@ public static AlertRuleTemplateInner fromJson(JsonReader jsonReader) throws IOEx } } // Use the discriminator value to determine which subtype should be deserialized. - if ("Fusion".equals(discriminatorValue)) { + if ("MLBehaviorAnalytics".equals(discriminatorValue)) { + return MLBehaviorAnalyticsAlertRuleTemplate.fromJson(readerToUse.reset()); + } else if ("Fusion".equals(discriminatorValue)) { return FusionAlertRuleTemplate.fromJson(readerToUse.reset()); + } else if ("ThreatIntelligence".equals(discriminatorValue)) { + return ThreatIntelligenceAlertRuleTemplate.fromJson(readerToUse.reset()); } else if ("MicrosoftSecurityIncidentCreation".equals(discriminatorValue)) { return MicrosoftSecurityIncidentCreationAlertRuleTemplate.fromJson(readerToUse.reset()); } else if ("Scheduled".equals(discriminatorValue)) { return ScheduledAlertRuleTemplate.fromJson(readerToUse.reset()); + } else if ("NRT".equals(discriminatorValue)) { + return NrtAlertRuleTemplate.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnalyticsRuleRunTriggerProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnalyticsRuleRunTriggerProperties.java new file mode 100644 index 000000000000..45e63a42f6c2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnalyticsRuleRunTriggerProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The Analytics Rule Run Trigger properties. + */ +@Fluent +public final class AnalyticsRuleRunTriggerProperties implements JsonSerializable { + /* + * The executionTimeUtc property. + */ + private OffsetDateTime executionTimeUtc; + + /** + * Creates an instance of AnalyticsRuleRunTriggerProperties class. + */ + public AnalyticsRuleRunTriggerProperties() { + } + + /** + * Get the executionTimeUtc property: The executionTimeUtc property. + * + * @return the executionTimeUtc value. + */ + public OffsetDateTime executionTimeUtc() { + return this.executionTimeUtc; + } + + /** + * Set the executionTimeUtc property: The executionTimeUtc property. + * + * @param executionTimeUtc the executionTimeUtc value to set. + * @return the AnalyticsRuleRunTriggerProperties object itself. + */ + public AnalyticsRuleRunTriggerProperties withExecutionTimeUtc(OffsetDateTime executionTimeUtc) { + this.executionTimeUtc = executionTimeUtc; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("executionTimeUtc", + this.executionTimeUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.executionTimeUtc)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyticsRuleRunTriggerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyticsRuleRunTriggerProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AnalyticsRuleRunTriggerProperties. + */ + public static AnalyticsRuleRunTriggerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyticsRuleRunTriggerProperties deserializedAnalyticsRuleRunTriggerProperties + = new AnalyticsRuleRunTriggerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionTimeUtc".equals(fieldName)) { + deserializedAnalyticsRuleRunTriggerProperties.executionTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyticsRuleRunTriggerProperties; + }); + } +} 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..47773090d039 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomaliesSettingsProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Anomalies property bag. + */ +@Immutable +public final class AnomaliesSettingsProperties implements JsonSerializable { + /* + * Determines whether the setting is enable or disabled. + */ + private Boolean isEnabled; + + /** + * Creates an instance of AnomaliesSettingsProperties class. + */ + public AnomaliesSettingsProperties() { + } + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomaliesSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomaliesSettingsProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AnomaliesSettingsProperties. + */ + public static AnomaliesSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnomaliesSettingsProperties deserializedAnomaliesSettingsProperties = new AnomaliesSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isEnabled".equals(fieldName)) { + deserializedAnomaliesSettingsProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAnomaliesSettingsProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomalySecurityMLAnalyticsSettingsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomalySecurityMLAnalyticsSettingsProperties.java index 937c7df279f9..35217ad4d657 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomalySecurityMLAnalyticsSettingsProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomalySecurityMLAnalyticsSettingsProperties.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,8 +17,6 @@ import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; -import java.util.UUID; /** * AnomalySecurityMLAnalytics settings base property bag. @@ -96,7 +93,7 @@ public final class AnomalySecurityMLAnalyticsSettingsProperties /* * The anomaly settings definition Id */ - private UUID settingsDefinitionId; + private String settingsDefinitionId; /** * Creates an instance of AnomalySecurityMLAnalyticsSettingsProperties class. @@ -365,7 +362,7 @@ public AnomalySecurityMLAnalyticsSettingsProperties withAnomalySettingsVersion(I * * @return the settingsDefinitionId value. */ - public UUID settingsDefinitionId() { + public String settingsDefinitionId() { return this.settingsDefinitionId; } @@ -375,44 +372,11 @@ public UUID settingsDefinitionId() { * @param settingsDefinitionId the settingsDefinitionId value to set. * @return the AnomalySecurityMLAnalyticsSettingsProperties object itself. */ - public AnomalySecurityMLAnalyticsSettingsProperties withSettingsDefinitionId(UUID settingsDefinitionId) { + public AnomalySecurityMLAnalyticsSettingsProperties withSettingsDefinitionId(String settingsDefinitionId) { this.settingsDefinitionId = settingsDefinitionId; return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model AnomalySecurityMLAnalyticsSettingsProperties")); - } - if (requiredDataConnectors() != null) { - requiredDataConnectors().forEach(e -> e.validate()); - } - if (anomalyVersion() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property anomalyVersion in model AnomalySecurityMLAnalyticsSettingsProperties")); - } - if (frequency() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property frequency in model AnomalySecurityMLAnalyticsSettingsProperties")); - } - if (settingsStatus() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property settingsStatus in model AnomalySecurityMLAnalyticsSettingsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AnomalySecurityMLAnalyticsSettingsProperties.class); - /** * {@inheritDoc} */ @@ -432,9 +396,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("tactics", this.tactics, (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); - jsonWriter.writeUntypedField("customizableObservations", this.customizableObservations); + if (this.customizableObservations != null) { + jsonWriter.writeUntypedField("customizableObservations", this.customizableObservations); + } jsonWriter.writeNumberField("anomalySettingsVersion", this.anomalySettingsVersion); - jsonWriter.writeStringField("settingsDefinitionId", Objects.toString(this.settingsDefinitionId, null)); + jsonWriter.writeStringField("settingsDefinitionId", this.settingsDefinitionId); return jsonWriter.writeEndObject(); } @@ -493,8 +459,7 @@ public static AnomalySecurityMLAnalyticsSettingsProperties fromJson(JsonReader j deserializedAnomalySecurityMLAnalyticsSettingsProperties.anomalySettingsVersion = reader.getNullable(JsonReader::getInt); } else if ("settingsDefinitionId".equals(fieldName)) { - deserializedAnomalySecurityMLAnalyticsSettingsProperties.settingsDefinitionId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedAnomalySecurityMLAnalyticsSettingsProperties.settingsDefinitionId = reader.getString(); } else { reader.skipChildren(); } 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..2b5ead766b46 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ApiPollingParameters.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingConfigProperties; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; +import java.io.IOException; + +/** + * Represents Codeless API Polling data connector. + */ +@Fluent +public final class ApiPollingParameters implements JsonSerializable { + /* + * Config to describe the instructions blade + */ + private CodelessUiConnectorConfigProperties connectorUiConfig; + + /* + * Config to describe the polling instructions + */ + private CodelessConnectorPollingConfigProperties pollingConfig; + + /** + * Creates an instance of ApiPollingParameters class. + */ + public ApiPollingParameters() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connectorUiConfig", this.connectorUiConfig); + jsonWriter.writeJsonField("pollingConfig", this.pollingConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiPollingParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiPollingParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiPollingParameters. + */ + public static ApiPollingParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiPollingParameters deserializedApiPollingParameters = new ApiPollingParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectorUiConfig".equals(fieldName)) { + deserializedApiPollingParameters.connectorUiConfig + = CodelessUiConnectorConfigProperties.fromJson(reader); + } else if ("pollingConfig".equals(fieldName)) { + deserializedApiPollingParameters.pollingConfig + = CodelessConnectorPollingConfigProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiPollingParameters; + }); + } +} 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 index 319d26048192..1dacc290dc1d 100644 --- 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 @@ -1,33 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; 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 java.io.IOException; import java.time.OffsetDateTime; import java.util.List; /** - * The AutomationRule model. + * Concrete proxy resource types can be created by aliasing this type using a specific property type. */ @Fluent -public final class AutomationRuleInner extends ResourceWithEtag { +public final class AutomationRuleInner extends ProxyResource { /* * Automation rule properties */ private AutomationRuleProperties innerProperties = new AutomationRuleProperties(); + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -63,12 +67,31 @@ private AutomationRuleProperties innerProperties() { return this.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 AutomationRuleInner object itself. + */ + public AutomationRuleInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -103,15 +126,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public AutomationRuleInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the displayName property: The display name of the automation rule. * @@ -240,32 +254,14 @@ public ClientInfo createdBy() { return this.innerProperties() == null ? null : this.innerProperties().createdBy(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model AutomationRuleInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutomationRuleInner.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -291,12 +287,12 @@ public static AutomationRuleInner fromJson(JsonReader jsonReader) throws IOExcep deserializedAutomationRuleInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedAutomationRuleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAutomationRuleInner.innerProperties = AutomationRuleProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { - deserializedAutomationRuleInner.withEtag(reader.getString()); + deserializedAutomationRuleInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedAutomationRuleInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedAutomationRuleInner.innerProperties = AutomationRuleProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index 2a765d4fef10..89d8ce735486 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -185,41 +184,6 @@ public ClientInfo createdBy() { return this.createdBy; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model AutomationRuleProperties")); - } - if (triggeringLogic() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property triggeringLogic in model AutomationRuleProperties")); - } else { - triggeringLogic().validate(); - } - if (actions() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property actions in model AutomationRuleProperties")); - } else { - actions().forEach(e -> e.validate()); - } - if (lastModifiedBy() != null) { - lastModifiedBy().validate(); - } - if (createdBy() != null) { - createdBy().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutomationRuleProperties.class); - /** * {@inheritDoc} */ 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 index 272f287264ab..af8c9e92b4c7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -76,25 +76,14 @@ public AwsCloudTrailDataConnectorProperties withDataTypes(AwsCloudTrailDataConne return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataTypes() != null) { - dataTypes().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("awsRoleArn", this.awsRoleArn); jsonWriter.writeJsonField("dataTypes", this.dataTypes); + jsonWriter.writeStringField("awsRoleArn", this.awsRoleArn); return jsonWriter.writeEndObject(); } @@ -104,6 +93,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AwsCloudTrailDataConnectorProperties if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the AwsCloudTrailDataConnectorProperties. */ public static AwsCloudTrailDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { @@ -114,11 +104,11 @@ public static AwsCloudTrailDataConnectorProperties fromJson(JsonReader jsonReade String fieldName = reader.getFieldName(); reader.nextToken(); - if ("awsRoleArn".equals(fieldName)) { - deserializedAwsCloudTrailDataConnectorProperties.awsRoleArn = reader.getString(); - } else if ("dataTypes".equals(fieldName)) { + if ("dataTypes".equals(fieldName)) { deserializedAwsCloudTrailDataConnectorProperties.dataTypes = AwsCloudTrailDataConnectorDataTypes.fromJson(reader); + } else if ("awsRoleArn".equals(fieldName)) { + deserializedAwsCloudTrailDataConnectorProperties.awsRoleArn = reader.getString(); } else { reader.skipChildren(); } 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..bbb25f8cdfdb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypes; +import java.io.IOException; +import java.util.List; + +/** + * Amazon Web Services S3 data connector properties. + */ +@Fluent +public final class AwsS3DataConnectorProperties implements JsonSerializable { + /* + * The logs destination table name in LogAnalytics. + */ + private String destinationTable; + + /* + * The AWS sqs urls for the connector. + */ + private List sqsUrls; + + /* + * The Aws Role Arn that is used to access the Aws account. + */ + private String roleArn; + + /* + * The available data types for the connector. + */ + private AwsS3DataConnectorDataTypes dataTypes; + + /** + * Creates an instance of AwsS3DataConnectorProperties class. + */ + public AwsS3DataConnectorProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destinationTable", this.destinationTable); + jsonWriter.writeArrayField("sqsUrls", this.sqsUrls, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("roleArn", this.roleArn); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3DataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3DataConnectorProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AwsS3DataConnectorProperties. + */ + public static AwsS3DataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3DataConnectorProperties deserializedAwsS3DataConnectorProperties = new AwsS3DataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationTable".equals(fieldName)) { + deserializedAwsS3DataConnectorProperties.destinationTable = reader.getString(); + } else if ("sqsUrls".equals(fieldName)) { + List sqsUrls = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsS3DataConnectorProperties.sqsUrls = sqsUrls; + } else if ("roleArn".equals(fieldName)) { + deserializedAwsS3DataConnectorProperties.roleArn = reader.getString(); + } else if ("dataTypes".equals(fieldName)) { + deserializedAwsS3DataConnectorProperties.dataTypes = AwsS3DataConnectorDataTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3DataConnectorProperties; + }); + } +} 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 index 9e4acbd6737d..4142a22bec4e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -41,7 +41,7 @@ public final class AzureResourceEntityProperties extends EntityCommonProperties /** * Creates an instance of AzureResourceEntityProperties class. */ - public AzureResourceEntityProperties() { + private AzureResourceEntityProperties() { } /** @@ -84,15 +84,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BillingStatisticInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BillingStatisticInner.java new file mode 100644 index 000000000000..a875f9f25324 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BillingStatisticInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.BillingStatisticKind; +import com.azure.resourcemanager.securityinsights.models.SapSolutionUsageStatistic; +import java.io.IOException; + +/** + * Billing statistic. + */ +@Immutable +public class BillingStatisticInner extends ProxyResource { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private BillingStatisticKind kind = BillingStatisticKind.fromString("BillingStatistic"); + + /* + * Resource Etag. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BillingStatisticInner class. + */ + protected BillingStatisticInner() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + public BillingStatisticKind kind() { + return this.kind; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Resource Etag. + * + * @param etag the etag value to set. + * @return the BillingStatisticInner object itself. + */ + BillingStatisticInner 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the BillingStatisticInner object itself. + */ + BillingStatisticInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingStatisticInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingStatisticInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BillingStatisticInner. + */ + public static BillingStatisticInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("SapSolutionUsage".equals(discriminatorValue)) { + return SapSolutionUsageStatistic.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static BillingStatisticInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingStatisticInner deserializedBillingStatisticInner = new BillingStatisticInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBillingStatisticInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBillingStatisticInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBillingStatisticInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedBillingStatisticInner.kind = BillingStatisticKind.fromString(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedBillingStatisticInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedBillingStatisticInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingStatisticInner; + }); + } +} 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..3052787f8e2f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponseValue; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; +import java.io.IOException; + +/** + * The entity expansion result operation response. + */ +@Immutable +public final class BookmarkExpandResponseInner implements JsonSerializable { + /* + * The metadata from the expansion operation results. + */ + private ExpansionResultsMetadata metaData; + + /* + * The expansion result values. + */ + private BookmarkExpandResponseValue value; + + /** + * Creates an instance of BookmarkExpandResponseInner class. + */ + private BookmarkExpandResponseInner() { + } + + /** + * Get the metaData property: The metadata from the expansion operation results. + * + * @return the metaData value. + */ + public ExpansionResultsMetadata metaData() { + return this.metaData; + } + + /** + * Get the value property: The expansion result values. + * + * @return the value value. + */ + public BookmarkExpandResponseValue value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metaData", this.metaData); + jsonWriter.writeJsonField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BookmarkExpandResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BookmarkExpandResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BookmarkExpandResponseInner. + */ + public static BookmarkExpandResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BookmarkExpandResponseInner deserializedBookmarkExpandResponseInner = new BookmarkExpandResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metaData".equals(fieldName)) { + deserializedBookmarkExpandResponseInner.metaData = ExpansionResultsMetadata.fromJson(reader); + } else if ("value".equals(fieldName)) { + deserializedBookmarkExpandResponseInner.value = BookmarkExpandResponseValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBookmarkExpandResponseInner; + }); + } +} 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 index 5d156d50c82d..8d4ad0df5b64 100644 --- 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 @@ -1,16 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; import com.azure.resourcemanager.securityinsights.models.IncidentInfo; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,12 +22,17 @@ * Represents a bookmark in Azure Security Insights. */ @Fluent -public final class BookmarkInner extends ResourceWithEtag { +public final class BookmarkInner extends ProxyResource { /* * Bookmark properties */ private BookmarkProperties innerProperties; + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -61,12 +68,31 @@ private BookmarkProperties innerProperties() { return this.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 BookmarkInner object itself. + */ + public BookmarkInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -101,15 +127,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public BookmarkInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the created property: The time the bookmark was created. * @@ -410,15 +427,72 @@ public BookmarkInner withIncidentInfo(IncidentInfo incidentInfo) { } /** - * Validates the instance. + * Get the entityMappings property: Describes the entity mappings of the bookmark. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the entityMappings value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public List entityMappings() { + return this.innerProperties() == null ? null : this.innerProperties().entityMappings(); + } + + /** + * Set the entityMappings property: Describes the entity mappings of the bookmark. + * + * @param entityMappings the entityMappings value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withEntityMappings(List entityMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); } + this.innerProperties().withEntityMappings(entityMappings); + return this; + } + + /** + * Get the tactics property: A list of relevant mitre attacks. + * + * @return the tactics value. + */ + public List tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Set the tactics property: A list of relevant mitre attacks. + * + * @param tactics the tactics value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the techniques property: A list of relevant mitre techniques. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * Set the techniques property: A list of relevant mitre techniques. + * + * @param techniques the techniques value to set. + * @return the BookmarkInner object itself. + */ + public BookmarkInner withTechniques(List techniques) { + if (this.innerProperties() == null) { + this.innerProperties = new BookmarkProperties(); + } + this.innerProperties().withTechniques(techniques); + return this; } /** @@ -427,8 +501,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -454,12 +528,12 @@ public static BookmarkInner fromJson(JsonReader jsonReader) throws IOException { deserializedBookmarkInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedBookmarkInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBookmarkInner.innerProperties = BookmarkProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { - deserializedBookmarkInner.withEtag(reader.getString()); + deserializedBookmarkInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedBookmarkInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedBookmarkInner.innerProperties = BookmarkProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index 971c9bc589fd..1c390d8e942e 100644 --- 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 @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.io.IOException; @@ -88,6 +89,21 @@ public final class BookmarkProperties implements JsonSerializable entityMappings; + + /* + * A list of relevant mitre attacks + */ + private List tactics; + + /* + * A list of relevant mitre techniques + */ + private List techniques; + /** * Creates an instance of BookmarkProperties class. */ @@ -355,31 +371,64 @@ public BookmarkProperties withIncidentInfo(IncidentInfo incidentInfo) { } /** - * Validates the instance. + * Get the entityMappings property: Describes the entity mappings of the bookmark. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.entityMappings; + } + + /** + * Set the entityMappings property: Describes the entity mappings of the bookmark. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param entityMappings the entityMappings value to set. + * @return the BookmarkProperties object itself. */ - public void validate() { - if (createdBy() != null) { - createdBy().validate(); - } - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property displayName in model BookmarkProperties")); - } - if (query() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property query in model BookmarkProperties")); - } - if (updatedBy() != null) { - updatedBy().validate(); - } - if (incidentInfo() != null) { - incidentInfo().validate(); - } + public BookmarkProperties withEntityMappings(List entityMappings) { + this.entityMappings = entityMappings; + return this; } - private static final ClientLogger LOGGER = new ClientLogger(BookmarkProperties.class); + /** + * Get the tactics property: A list of relevant mitre attacks. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Set the tactics property: A list of relevant mitre attacks. + * + * @param tactics the tactics value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the techniques property: A list of relevant mitre techniques. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Set the techniques property: A list of relevant mitre techniques. + * + * @param techniques the techniques value to set. + * @return the BookmarkProperties object itself. + */ + public BookmarkProperties withTechniques(List techniques) { + this.techniques = techniques; + return this; + } /** * {@inheritDoc} @@ -405,6 +454,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("queryEndTime", this.queryEndTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queryEndTime)); jsonWriter.writeJsonField("incidentInfo", this.incidentInfo); + jsonWriter.writeArrayField("entityMappings", this.entityMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tactics", this.tactics, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -456,6 +510,17 @@ public static BookmarkProperties fromJson(JsonReader jsonReader) throws IOExcept .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("incidentInfo".equals(fieldName)) { deserializedBookmarkProperties.incidentInfo = IncidentInfo.fromJson(reader); + } else if ("entityMappings".equals(fieldName)) { + List entityMappings + = reader.readArray(reader1 -> BookmarkEntityMappings.fromJson(reader1)); + deserializedBookmarkProperties.entityMappings = entityMappings; + } else if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedBookmarkProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedBookmarkProperties.techniques = techniques; } else { reader.skipChildren(); } 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 index 7b7c6d9f799c..a92020f00c4a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -47,7 +47,7 @@ public final class CloudApplicationEntityProperties extends EntityCommonProperti /** * Creates an instance of CloudApplicationEntityProperties class. */ - public CloudApplicationEntityProperties() { + private CloudApplicationEntityProperties() { } /** @@ -100,15 +100,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ 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..5686af825356 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CodelessParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties; +import java.io.IOException; + +/** + * Represents Codeless UI data connector. + */ +@Fluent +public final class CodelessParameters implements JsonSerializable { + /* + * Config to describe the instructions blade + */ + private CodelessUiConnectorConfigProperties connectorUiConfig; + + /** + * Creates an instance of CodelessParameters class. + */ + public CodelessParameters() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connectorUiConfig", this.connectorUiConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CodelessParameters. + */ + public static CodelessParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessParameters deserializedCodelessParameters = new CodelessParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectorUiConfig".equals(fieldName)) { + deserializedCodelessParameters.connectorUiConfig + = CodelessUiConnectorConfigProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessParameters; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CustomizableConnectorDefinitionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CustomizableConnectorDefinitionProperties.java new file mode 100644 index 000000000000..ad50b193f645 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CustomizableConnectorDefinitionProperties.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectionsConfig; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The UiConfig for 'Customizable' connector definition kind. + */ +@Fluent +public final class CustomizableConnectorDefinitionProperties + implements JsonSerializable { + /* + * Gets or sets the connector definition created date in UTC format. + */ + private OffsetDateTime createdTimeUtc; + + /* + * Gets or sets the connector definition last modified date in UTC format. + */ + private OffsetDateTime lastModifiedUtc; + + /* + * The UiConfig for 'Customizable' connector definition kind. + */ + private CustomizableConnectorUiConfig connectorUiConfig; + + /* + * The UiConfig for 'Customizable' connector definition kind. + */ + private CustomizableConnectionsConfig connectionsConfig; + + /** + * Creates an instance of CustomizableConnectorDefinitionProperties class. + */ + public CustomizableConnectorDefinitionProperties() { + } + + /** + * Get the createdTimeUtc property: Gets or sets the connector definition created date in UTC format. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; + } + + /** + * Set the createdTimeUtc property: Gets or sets the connector definition created date in UTC format. + * + * @param createdTimeUtc the createdTimeUtc value to set. + * @return the CustomizableConnectorDefinitionProperties object itself. + */ + public CustomizableConnectorDefinitionProperties withCreatedTimeUtc(OffsetDateTime createdTimeUtc) { + this.createdTimeUtc = createdTimeUtc; + return this; + } + + /** + * Get the lastModifiedUtc property: Gets or sets the connector definition last modified date in UTC format. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.lastModifiedUtc; + } + + /** + * Set the lastModifiedUtc property: Gets or sets the connector definition last modified date in UTC format. + * + * @param lastModifiedUtc the lastModifiedUtc value to set. + * @return the CustomizableConnectorDefinitionProperties object itself. + */ + public CustomizableConnectorDefinitionProperties withLastModifiedUtc(OffsetDateTime lastModifiedUtc) { + this.lastModifiedUtc = lastModifiedUtc; + return this; + } + + /** + * Get the connectorUiConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @return the connectorUiConfig value. + */ + public CustomizableConnectorUiConfig connectorUiConfig() { + return this.connectorUiConfig; + } + + /** + * Set the connectorUiConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @param connectorUiConfig the connectorUiConfig value to set. + * @return the CustomizableConnectorDefinitionProperties object itself. + */ + public CustomizableConnectorDefinitionProperties + withConnectorUiConfig(CustomizableConnectorUiConfig connectorUiConfig) { + this.connectorUiConfig = connectorUiConfig; + return this; + } + + /** + * Get the connectionsConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @return the connectionsConfig value. + */ + public CustomizableConnectionsConfig connectionsConfig() { + return this.connectionsConfig; + } + + /** + * Set the connectionsConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @param connectionsConfig the connectionsConfig value to set. + * @return the CustomizableConnectorDefinitionProperties object itself. + */ + public CustomizableConnectorDefinitionProperties + withConnectionsConfig(CustomizableConnectionsConfig connectionsConfig) { + this.connectionsConfig = connectionsConfig; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connectorUiConfig", this.connectorUiConfig); + jsonWriter.writeStringField("createdTimeUtc", + this.createdTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTimeUtc)); + jsonWriter.writeStringField("lastModifiedUtc", + this.lastModifiedUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedUtc)); + jsonWriter.writeJsonField("connectionsConfig", this.connectionsConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizableConnectorDefinitionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizableConnectorDefinitionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomizableConnectorDefinitionProperties. + */ + public static CustomizableConnectorDefinitionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizableConnectorDefinitionProperties deserializedCustomizableConnectorDefinitionProperties + = new CustomizableConnectorDefinitionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectorUiConfig".equals(fieldName)) { + deserializedCustomizableConnectorDefinitionProperties.connectorUiConfig + = CustomizableConnectorUiConfig.fromJson(reader); + } else if ("createdTimeUtc".equals(fieldName)) { + deserializedCustomizableConnectorDefinitionProperties.createdTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedUtc".equals(fieldName)) { + deserializedCustomizableConnectorDefinitionProperties.lastModifiedUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("connectionsConfig".equals(fieldName)) { + deserializedCustomizableConnectorDefinitionProperties.connectionsConfig + = CustomizableConnectionsConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizableConnectorDefinitionProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorDefinitionInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorDefinitionInner.java new file mode 100644 index 000000000000..eb8126daf96c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorDefinitionInner.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitionKind; +import java.io.IOException; + +/** + * An Azure resource, which encapsulate the entire info requires to display a data connector page in Azure portal, + * and the info required to define data connections. + */ +@Fluent +public class DataConnectorDefinitionInner extends ProxyResource { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorDefinitionKind kind = DataConnectorDefinitionKind.fromString("DataConnectorDefinition"); + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DataConnectorDefinitionInner class. + */ + public DataConnectorDefinitionInner() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + public DataConnectorDefinitionKind kind() { + return this.kind; + } + + /** + * 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 DataConnectorDefinitionInner object itself. + */ + public DataConnectorDefinitionInner 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the DataConnectorDefinitionInner object itself. + */ + DataConnectorDefinitionInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorDefinitionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataConnectorDefinitionInner. + */ + public static DataConnectorDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Customizable".equals(discriminatorValue)) { + return CustomizableConnectorDefinition.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataConnectorDefinitionInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorDefinitionInner deserializedDataConnectorDefinitionInner = new DataConnectorDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataConnectorDefinitionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataConnectorDefinitionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataConnectorDefinitionInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedDataConnectorDefinitionInner.kind + = DataConnectorDefinitionKind.fromString(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedDataConnectorDefinitionInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedDataConnectorDefinitionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorDefinitionInner; + }); + } +} 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 index 8fdbe82ec45f..5d76a56aac40 100644 --- 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; @@ -13,24 +14,47 @@ 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.DataConnectorKind; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnector; +import com.azure.resourcemanager.securityinsights.models.GCPDataConnector; +import com.azure.resourcemanager.securityinsights.models.IoTDataConnector; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnector; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnector; import com.azure.resourcemanager.securityinsights.models.McasDataConnector; import com.azure.resourcemanager.securityinsights.models.MdatpDataConnector; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector; +import com.azure.resourcemanager.securityinsights.models.OfficeATPDataConnector; import com.azure.resourcemanager.securityinsights.models.OfficeDataConnector; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; +import com.azure.resourcemanager.securityinsights.models.OfficeIRMDataConnector; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIDataConnector; +import com.azure.resourcemanager.securityinsights.models.PremiumMicrosoftDefenderForThreatIntelligence; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditDataConnector; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerDataConnector; import com.azure.resourcemanager.securityinsights.models.TIDataConnector; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector; import java.io.IOException; /** * Data connector. */ @Fluent -public class DataConnectorInner extends ResourceWithEtag { +public class DataConnectorInner extends ProxyResource { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.fromString("DataConnector"); + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -58,7 +82,9 @@ public DataConnectorInner() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -66,16 +92,46 @@ public DataConnectorKind kind() { return this.kind; } + /** + * 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 DataConnectorInner object itself. + */ + public DataConnectorInner 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. */ - @Override public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the DataConnectorInner object itself. + */ + DataConnectorInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -106,32 +162,14 @@ public String id() { return this.id; } - /** - * {@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() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -162,20 +200,54 @@ public static DataConnectorInner fromJson(JsonReader jsonReader) throws IOExcept // Use the discriminator value to determine which subtype should be deserialized. if ("AzureActiveDirectory".equals(discriminatorValue)) { return AadDataConnector.fromJson(readerToUse.reset()); + } else if ("MicrosoftThreatIntelligence".equals(discriminatorValue)) { + return MSTIDataConnector.fromJson(readerToUse.reset()); + } else if ("PremiumMicrosoftDefenderForThreatIntelligence".equals(discriminatorValue)) { + return PremiumMicrosoftDefenderForThreatIntelligence.fromJson(readerToUse.reset()); + } else if ("MicrosoftThreatProtection".equals(discriminatorValue)) { + return MTPDataConnector.fromJson(readerToUse.reset()); } else if ("AzureAdvancedThreatProtection".equals(discriminatorValue)) { return AatpDataConnector.fromJson(readerToUse.reset()); } else if ("AzureSecurityCenter".equals(discriminatorValue)) { return AscDataConnector.fromJson(readerToUse.reset()); } else if ("AmazonWebServicesCloudTrail".equals(discriminatorValue)) { return AwsCloudTrailDataConnector.fromJson(readerToUse.reset()); + } else if ("AmazonWebServicesS3".equals(discriminatorValue)) { + return AwsS3DataConnector.fromJson(readerToUse.reset()); + } else if ("RestApiPoller".equals(discriminatorValue)) { + return RestApiPollerDataConnector.fromJson(readerToUse.reset()); + } else if ("GCP".equals(discriminatorValue)) { + return GCPDataConnector.fromJson(readerToUse.reset()); } else if ("MicrosoftCloudAppSecurity".equals(discriminatorValue)) { return McasDataConnector.fromJson(readerToUse.reset()); + } else if ("Dynamics365".equals(discriminatorValue)) { + return Dynamics365DataConnector.fromJson(readerToUse.reset()); + } else if ("OfficeATP".equals(discriminatorValue)) { + return OfficeATPDataConnector.fromJson(readerToUse.reset()); + } else if ("MicrosoftPurviewInformationProtection".equals(discriminatorValue)) { + return MicrosoftPurviewInformationProtectionDataConnector.fromJson(readerToUse.reset()); + } else if ("Office365Project".equals(discriminatorValue)) { + return Office365ProjectDataConnector.fromJson(readerToUse.reset()); + } else if ("OfficePowerBI".equals(discriminatorValue)) { + return OfficePowerBIDataConnector.fromJson(readerToUse.reset()); + } else if ("PurviewAudit".equals(discriminatorValue)) { + return PurviewAuditDataConnector.fromJson(readerToUse.reset()); + } else if ("OfficeIRM".equals(discriminatorValue)) { + return OfficeIRMDataConnector.fromJson(readerToUse.reset()); } else if ("MicrosoftDefenderAdvancedThreatProtection".equals(discriminatorValue)) { return MdatpDataConnector.fromJson(readerToUse.reset()); - } else if ("ThreatIntelligence".equals(discriminatorValue)) { - return TIDataConnector.fromJson(readerToUse.reset()); } else if ("Office365".equals(discriminatorValue)) { return OfficeDataConnector.fromJson(readerToUse.reset()); + } else if ("ThreatIntelligence".equals(discriminatorValue)) { + return TIDataConnector.fromJson(readerToUse.reset()); + } else if ("ThreatIntelligenceTaxii".equals(discriminatorValue)) { + return TiTaxiiDataConnector.fromJson(readerToUse.reset()); + } else if ("IOT".equals(discriminatorValue)) { + return IoTDataConnector.fromJson(readerToUse.reset()); + } else if ("GenericUI".equals(discriminatorValue)) { + return CodelessUiDataConnector.fromJson(readerToUse.reset()); + } else if ("APIPolling".equals(discriminatorValue)) { + return CodelessApiPollingDataConnector.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -196,12 +268,12 @@ static DataConnectorInner fromJsonKnownDiscriminator(JsonReader jsonReader) thro deserializedDataConnectorInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDataConnectorInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedDataConnectorInner.kind = DataConnectorKind.fromString(reader.getString()); } else if ("etag".equals(fieldName)) { - deserializedDataConnectorInner.withEtag(reader.getString()); + deserializedDataConnectorInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedDataConnectorInner.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedDataConnectorInner.kind = DataConnectorKind.fromString(reader.getString()); } else { reader.skipChildren(); } 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..e4a910a2d2e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorRequirementsStateInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorAuthorizationState; +import com.azure.resourcemanager.securityinsights.models.DataConnectorLicenseState; +import java.io.IOException; + +/** + * Data connector requirements status. + */ +@Immutable +public final class DataConnectorRequirementsStateInner + implements JsonSerializable { + /* + * Authorization state for this connector + */ + private DataConnectorAuthorizationState authorizationState; + + /* + * License state for this connector + */ + private DataConnectorLicenseState licenseState; + + /** + * Creates an instance of DataConnectorRequirementsStateInner class. + */ + private DataConnectorRequirementsStateInner() { + } + + /** + * Get the authorizationState property: Authorization state for this connector. + * + * @return the authorizationState value. + */ + public DataConnectorAuthorizationState authorizationState() { + return this.authorizationState; + } + + /** + * Get the licenseState property: License state for this connector. + * + * @return the licenseState value. + */ + public DataConnectorLicenseState licenseState() { + return this.licenseState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authorizationState", + this.authorizationState == null ? null : this.authorizationState.toString()); + jsonWriter.writeStringField("licenseState", this.licenseState == null ? null : this.licenseState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorRequirementsStateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorRequirementsStateInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataConnectorRequirementsStateInner. + */ + public static DataConnectorRequirementsStateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorRequirementsStateInner deserializedDataConnectorRequirementsStateInner + = new DataConnectorRequirementsStateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authorizationState".equals(fieldName)) { + deserializedDataConnectorRequirementsStateInner.authorizationState + = DataConnectorAuthorizationState.fromString(reader.getString()); + } else if ("licenseState".equals(fieldName)) { + deserializedDataConnectorRequirementsStateInner.licenseState + = DataConnectorLicenseState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorRequirementsStateInner; + }); + } +} 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 index 80176090a32b..1119bc111ef9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -52,7 +52,7 @@ public final class DnsEntityProperties extends EntityCommonProperties { /** * Creates an instance of DnsEntityProperties class. */ - public DnsEntityProperties() { + private DnsEntityProperties() { } /** @@ -113,15 +113,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ 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..af5e282b5663 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365CheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * Dynamics365 requirements check properties. + */ +@Fluent +public final class Dynamics365CheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of Dynamics365CheckRequirementsProperties class. + */ + public Dynamics365CheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public Dynamics365CheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dynamics365CheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dynamics365CheckRequirementsProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Dynamics365CheckRequirementsProperties. + */ + public static Dynamics365CheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dynamics365CheckRequirementsProperties deserializedDynamics365CheckRequirementsProperties + = new Dynamics365CheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedDynamics365CheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamics365CheckRequirementsProperties; + }); + } +} 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..0d8f442fcba1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365DataConnectorProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; +import java.io.IOException; + +/** + * Dynamics365 data connector properties. + */ +@Fluent +public final class Dynamics365DataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + private Dynamics365DataConnectorDataTypes dataTypes; + + /** + * Creates an instance of Dynamics365DataConnectorProperties class. + */ + public Dynamics365DataConnectorProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dynamics365DataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dynamics365DataConnectorProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Dynamics365DataConnectorProperties. + */ + public static Dynamics365DataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dynamics365DataConnectorProperties deserializedDynamics365DataConnectorProperties + = new Dynamics365DataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedDynamics365DataConnectorProperties.withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedDynamics365DataConnectorProperties.dataTypes + = Dynamics365DataConnectorDataTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamics365DataConnectorProperties; + }); + } +} 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..00a8a64bec93 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisDetails; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Whois information for a given domain and associated metadata. + */ +@Immutable +public final class EnrichmentDomainWhoisInner implements JsonSerializable { + /* + * The domain for this whois record + */ + private String domain; + + /* + * The hostname of this registrar's whois server + */ + private String server; + + /* + * The timestamp at which this record was created + */ + private OffsetDateTime created; + + /* + * The timestamp at which this record was last updated + */ + private OffsetDateTime updated; + + /* + * The timestamp at which this record will expire + */ + private OffsetDateTime expires; + + /* + * The whois record for a given domain + */ + private EnrichmentDomainWhoisDetails parsedWhois; + + /** + * Creates an instance of EnrichmentDomainWhoisInner class. + */ + private EnrichmentDomainWhoisInner() { + } + + /** + * Get the domain property: The domain for this whois record. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Get the server property: The hostname of this registrar's whois server. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Get the created property: The timestamp at which this record was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the updated property: The timestamp at which this record was last updated. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + return this.updated; + } + + /** + * Get the expires property: The timestamp at which this record will expire. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + return this.expires; + } + + /** + * Get the parsedWhois property: The whois record for a given domain. + * + * @return the parsedWhois value. + */ + public EnrichmentDomainWhoisDetails parsedWhois() { + return this.parsedWhois; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domain", this.domain); + jsonWriter.writeStringField("server", this.server); + jsonWriter.writeStringField("created", + this.created == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.created)); + jsonWriter.writeStringField("updated", + this.updated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updated)); + jsonWriter.writeStringField("expires", + this.expires == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expires)); + jsonWriter.writeJsonField("parsedWhois", this.parsedWhois); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentDomainWhoisInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentDomainWhoisInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentDomainWhoisInner. + */ + public static EnrichmentDomainWhoisInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentDomainWhoisInner deserializedEnrichmentDomainWhoisInner = new EnrichmentDomainWhoisInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domain".equals(fieldName)) { + deserializedEnrichmentDomainWhoisInner.domain = reader.getString(); + } else if ("server".equals(fieldName)) { + deserializedEnrichmentDomainWhoisInner.server = reader.getString(); + } else if ("created".equals(fieldName)) { + deserializedEnrichmentDomainWhoisInner.created = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updated".equals(fieldName)) { + deserializedEnrichmentDomainWhoisInner.updated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expires".equals(fieldName)) { + deserializedEnrichmentDomainWhoisInner.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("parsedWhois".equals(fieldName)) { + deserializedEnrichmentDomainWhoisInner.parsedWhois = EnrichmentDomainWhoisDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentDomainWhoisInner; + }); + } +} 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..c0912a1bcefd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Geodata information for a given IP address. + */ +@Immutable +public final class EnrichmentIpGeodataInner implements JsonSerializable { + /* + * The autonomous system number associated with this IP address + */ + private String asn; + + /* + * The name of the carrier for this IP address + */ + private String carrier; + + /* + * The city this IP address is located in + */ + private String city; + + /* + * A numeric rating of confidence that the value in the 'city' field is correct, on a scale of 0-100 + */ + private Integer cityConfidenceFactor; + + /* + * The continent this IP address is located on + */ + private String continent; + + /* + * The county this IP address is located in + */ + private String country; + + /* + * A numeric rating of confidence that the value in the 'country' field is correct on a scale of 0-100 + */ + private Integer countryConfidenceFactor; + + /* + * The dotted-decimal or colon-separated string representation of the IP address + */ + private String ipAddr; + + /* + * A description of the connection type of this IP address + */ + private String ipRoutingType; + + /* + * The latitude of this IP address + */ + private String latitude; + + /* + * The longitude of this IP address + */ + private String longitude; + + /* + * The name of the organization for this IP address + */ + private String organization; + + /* + * The type of the organization for this IP address + */ + private String organizationType; + + /* + * The geographic region this IP address is located in + */ + private String region; + + /* + * The state this IP address is located in + */ + private String state; + + /* + * A numeric rating of confidence that the value in the 'state' field is correct on a scale of 0-100 + */ + private Integer stateConfidenceFactor; + + /* + * The abbreviated name for the state this IP address is located in + */ + private String stateCode; + + /** + * Creates an instance of EnrichmentIpGeodataInner class. + */ + private EnrichmentIpGeodataInner() { + } + + /** + * Get the asn property: The autonomous system number associated with this IP address. + * + * @return the asn value. + */ + public String asn() { + return this.asn; + } + + /** + * Get the carrier property: The name of the carrier for this IP address. + * + * @return the carrier value. + */ + public String carrier() { + return this.carrier; + } + + /** + * Get the city property: The city this IP address is located in. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Get the cityConfidenceFactor property: A numeric rating of confidence that the value in the 'city' field is + * correct, on a scale of 0-100. + * + * @return the cityConfidenceFactor value. + */ + public Integer cityConfidenceFactor() { + return this.cityConfidenceFactor; + } + + /** + * Get the continent property: The continent this IP address is located on. + * + * @return the continent value. + */ + public String continent() { + return this.continent; + } + + /** + * Get the country property: The county this IP address is located in. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Get the countryConfidenceFactor property: A numeric rating of confidence that the value in the 'country' field is + * correct on a scale of 0-100. + * + * @return the countryConfidenceFactor value. + */ + public Integer countryConfidenceFactor() { + return this.countryConfidenceFactor; + } + + /** + * 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; + } + + /** + * Get the ipRoutingType property: A description of the connection type of this IP address. + * + * @return the ipRoutingType value. + */ + public String ipRoutingType() { + return this.ipRoutingType; + } + + /** + * Get the latitude property: The latitude of this IP address. + * + * @return the latitude value. + */ + public String latitude() { + return this.latitude; + } + + /** + * Get the longitude property: The longitude of this IP address. + * + * @return the longitude value. + */ + public String longitude() { + return this.longitude; + } + + /** + * Get the organization property: The name of the organization for this IP address. + * + * @return the organization value. + */ + public String organization() { + return this.organization; + } + + /** + * Get the organizationType property: The type of the organization for this IP address. + * + * @return the organizationType value. + */ + public String organizationType() { + return this.organizationType; + } + + /** + * Get the region property: The geographic region this IP address is located in. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the state property: The state this IP address is located in. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the stateConfidenceFactor property: A numeric rating of confidence that the value in the 'state' field is + * correct on a scale of 0-100. + * + * @return the stateConfidenceFactor value. + */ + public Integer stateConfidenceFactor() { + return this.stateConfidenceFactor; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("asn", this.asn); + jsonWriter.writeStringField("carrier", this.carrier); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeNumberField("cityConfidenceFactor", this.cityConfidenceFactor); + jsonWriter.writeStringField("continent", this.continent); + jsonWriter.writeStringField("country", this.country); + jsonWriter.writeNumberField("countryConfidenceFactor", this.countryConfidenceFactor); + jsonWriter.writeStringField("ipAddr", this.ipAddr); + jsonWriter.writeStringField("ipRoutingType", this.ipRoutingType); + jsonWriter.writeStringField("latitude", this.latitude); + jsonWriter.writeStringField("longitude", this.longitude); + jsonWriter.writeStringField("organization", this.organization); + jsonWriter.writeStringField("organizationType", this.organizationType); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeNumberField("stateConfidenceFactor", this.stateConfidenceFactor); + jsonWriter.writeStringField("stateCode", this.stateCode); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentIpGeodataInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentIpGeodataInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentIpGeodataInner. + */ + public static EnrichmentIpGeodataInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentIpGeodataInner deserializedEnrichmentIpGeodataInner = new EnrichmentIpGeodataInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("asn".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.asn = reader.getString(); + } else if ("carrier".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.carrier = reader.getString(); + } else if ("city".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.city = reader.getString(); + } else if ("cityConfidenceFactor".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.cityConfidenceFactor = reader.getNullable(JsonReader::getInt); + } else if ("continent".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.continent = reader.getString(); + } else if ("country".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.country = reader.getString(); + } else if ("countryConfidenceFactor".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.countryConfidenceFactor + = reader.getNullable(JsonReader::getInt); + } else if ("ipAddr".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.ipAddr = reader.getString(); + } else if ("ipRoutingType".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.ipRoutingType = reader.getString(); + } else if ("latitude".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.latitude = reader.getString(); + } else if ("longitude".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.longitude = reader.getString(); + } else if ("organization".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.organization = reader.getString(); + } else if ("organizationType".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.organizationType = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.region = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.state = reader.getString(); + } else if ("stateConfidenceFactor".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.stateConfidenceFactor = reader.getNullable(JsonReader::getInt); + } else if ("stateCode".equals(fieldName)) { + deserializedEnrichmentIpGeodataInner.stateCode = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentIpGeodataInner; + }); + } +} 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..dadf8dee163b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EntityProviders; +import java.io.IOException; +import java.util.List; + +/** + * EntityAnalytics property bag. + */ +@Fluent +public final class EntityAnalyticsProperties implements JsonSerializable { + /* + * The relevant entity providers that are synced + */ + private List entityProviders; + + /** + * Creates an instance of EntityAnalyticsProperties class. + */ + public EntityAnalyticsProperties() { + } + + /** + * Get the entityProviders property: The relevant entity providers that are synced. + * + * @return the entityProviders value. + */ + public List entityProviders() { + return this.entityProviders; + } + + /** + * Set the entityProviders property: The relevant entity providers that are synced. + * + * @param entityProviders the entityProviders value to set. + * @return the EntityAnalyticsProperties object itself. + */ + public EntityAnalyticsProperties withEntityProviders(List entityProviders) { + this.entityProviders = entityProviders; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entityProviders", this.entityProviders, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityAnalyticsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityAnalyticsProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityAnalyticsProperties. + */ + public static EntityAnalyticsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityAnalyticsProperties deserializedEntityAnalyticsProperties = new EntityAnalyticsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entityProviders".equals(fieldName)) { + List entityProviders + = reader.readArray(reader1 -> EntityProviders.fromString(reader1.getString())); + deserializedEntityAnalyticsProperties.entityProviders = entityProviders; + } else { + reader.skipChildren(); + } + } + + return deserializedEntityAnalyticsProperties; + }); + } +} 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..edba550a410b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EntityExpandResponseValue; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; +import java.io.IOException; + +/** + * The entity expansion result operation response. + */ +@Immutable +public final class EntityExpandResponseInner implements JsonSerializable { + /* + * The metadata from the expansion operation results. + */ + private ExpansionResultsMetadata metaData; + + /* + * The expansion result values. + */ + private EntityExpandResponseValue value; + + /** + * Creates an instance of EntityExpandResponseInner class. + */ + private EntityExpandResponseInner() { + } + + /** + * Get the metaData property: The metadata from the expansion operation results. + * + * @return the metaData value. + */ + public ExpansionResultsMetadata metaData() { + return this.metaData; + } + + /** + * Get the value property: The expansion result values. + * + * @return the value value. + */ + public EntityExpandResponseValue value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metaData", this.metaData); + jsonWriter.writeJsonField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityExpandResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityExpandResponseInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityExpandResponseInner. + */ + public static EntityExpandResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityExpandResponseInner deserializedEntityExpandResponseInner = new EntityExpandResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metaData".equals(fieldName)) { + deserializedEntityExpandResponseInner.metaData = ExpansionResultsMetadata.fromJson(reader); + } else if ("value".equals(fieldName)) { + deserializedEntityExpandResponseInner.value = EntityExpandResponseValue.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityExpandResponseInner; + }); + } +} 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..9071aa3164f7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EntityInsightItem; +import com.azure.resourcemanager.securityinsights.models.GetInsightsResultsMetadata; +import java.io.IOException; +import java.util.List; + +/** + * The Get Insights result operation response. + */ +@Immutable +public final class EntityGetInsightsResponseInner implements JsonSerializable { + /* + * The metadata from the get insights operation results. + */ + private GetInsightsResultsMetadata metaData; + + /* + * The insights result values. + */ + private List value; + + /** + * Creates an instance of EntityGetInsightsResponseInner class. + */ + private EntityGetInsightsResponseInner() { + } + + /** + * Get the metaData property: The metadata from the get insights operation results. + * + * @return the metaData value. + */ + public GetInsightsResultsMetadata metaData() { + return this.metaData; + } + + /** + * Get the value property: The insights result values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metaData", this.metaData); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityGetInsightsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityGetInsightsResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityGetInsightsResponseInner. + */ + public static EntityGetInsightsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityGetInsightsResponseInner deserializedEntityGetInsightsResponseInner + = new EntityGetInsightsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metaData".equals(fieldName)) { + deserializedEntityGetInsightsResponseInner.metaData = GetInsightsResultsMetadata.fromJson(reader); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EntityInsightItem.fromJson(reader1)); + deserializedEntityGetInsightsResponseInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedEntityGetInsightsResponseInner; + }); + } +} 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..b80c7b13b072 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueryKind; +import com.azure.resourcemanager.securityinsights.models.ExpansionEntityQuery; +import java.io.IOException; + +/** + * Specific entity query. + */ +@Immutable +public class EntityQueryInner extends ProxyResource { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private EntityQueryKind kind = EntityQueryKind.fromString("EntityQuery"); + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EntityQueryInner class. + */ + protected EntityQueryInner() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + public EntityQueryKind kind() { + return this.kind; + } + + /** + * 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 EntityQueryInner object itself. + */ + EntityQueryInner 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the EntityQueryInner object itself. + */ + EntityQueryInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityQueryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityQueryInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityQueryInner. + */ + public static EntityQueryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Expansion".equals(discriminatorValue)) { + return ExpansionEntityQuery.fromJson(readerToUse.reset()); + } else if ("Activity".equals(discriminatorValue)) { + return ActivityEntityQuery.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static EntityQueryInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityQueryInner deserializedEntityQueryInner = new EntityQueryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEntityQueryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEntityQueryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEntityQueryInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedEntityQueryInner.kind = EntityQueryKind.fromString(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedEntityQueryInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedEntityQueryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityQueryInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryItemInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryItemInner.java new file mode 100644 index 000000000000..dbb174467afe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryItemInner.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EntityQueryKind; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItem; +import java.io.IOException; + +/** + * An abstract Query item for entity. + */ +@Immutable +public class EntityQueryItemInner implements JsonSerializable { + /* + * The kind of the entity query + */ + private EntityQueryKind kind = EntityQueryKind.fromString("EntityQueryItem"); + + /* + * Query Template ARM ID + */ + private String id; + + /* + * Query Template ARM Name + */ + private String name; + + /* + * ARM Type + */ + private String type; + + /** + * Creates an instance of EntityQueryItemInner class. + */ + protected EntityQueryItemInner() { + } + + /** + * Get the kind property: The kind of the entity query. + * + * @return the kind value. + */ + public EntityQueryKind kind() { + return this.kind; + } + + /** + * Get the id property: Query Template ARM ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Query Template ARM ID. + * + * @param id the id value to set. + * @return the EntityQueryItemInner object itself. + */ + EntityQueryItemInner withId(String id) { + this.id = id; + return this; + } + + /** + * 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 EntityQueryItemInner object itself. + */ + EntityQueryItemInner 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 EntityQueryItemInner object itself. + */ + EntityQueryItemInner withType(String type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityQueryItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityQueryItemInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityQueryItemInner. + */ + public static EntityQueryItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Insight".equals(discriminatorValue)) { + return InsightQueryItem.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static EntityQueryItemInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityQueryItemInner deserializedEntityQueryItemInner = new EntityQueryItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedEntityQueryItemInner.kind = EntityQueryKind.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + deserializedEntityQueryItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEntityQueryItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEntityQueryItemInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityQueryItemInner; + }); + } +} 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..d8e1b58b1a45 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryTemplateInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplate; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; +import java.io.IOException; + +/** + * Specific entity query template. + */ +@Immutable +public class EntityQueryTemplateInner extends ProxyResource { + /* + * The kind of the entity query template. + */ + private EntityQueryTemplateKind kind = EntityQueryTemplateKind.fromString("EntityQueryTemplate"); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EntityQueryTemplateInner class. + */ + protected EntityQueryTemplateInner() { + } + + /** + * Get the kind property: The kind of the entity query template. + * + * @return the kind value. + */ + public EntityQueryTemplateKind kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the EntityQueryTemplateInner object itself. + */ + EntityQueryTemplateInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityQueryTemplateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityQueryTemplateInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityQueryTemplateInner. + */ + public static EntityQueryTemplateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Activity".equals(discriminatorValue)) { + return ActivityEntityQueryTemplate.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static EntityQueryTemplateInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityQueryTemplateInner deserializedEntityQueryTemplateInner = new EntityQueryTemplateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEntityQueryTemplateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEntityQueryTemplateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEntityQueryTemplateInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedEntityQueryTemplateInner.kind = EntityQueryTemplateKind.fromString(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedEntityQueryTemplateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityQueryTemplateInner; + }); + } +} 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..2015b8123648 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineItem; +import com.azure.resourcemanager.securityinsights.models.TimelineResultsMetadata; +import java.io.IOException; +import java.util.List; + +/** + * The entity timeline result operation response. + */ +@Immutable +public final class EntityTimelineResponseInner implements JsonSerializable { + /* + * The metadata from the timeline operation results. + */ + private TimelineResultsMetadata metaData; + + /* + * The timeline result values. + */ + private List value; + + /** + * Creates an instance of EntityTimelineResponseInner class. + */ + private EntityTimelineResponseInner() { + } + + /** + * Get the metaData property: The metadata from the timeline operation results. + * + * @return the metaData value. + */ + public TimelineResultsMetadata metaData() { + return this.metaData; + } + + /** + * Get the value property: The timeline result values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("metaData", this.metaData); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityTimelineResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityTimelineResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityTimelineResponseInner. + */ + public static EntityTimelineResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityTimelineResponseInner deserializedEntityTimelineResponseInner = new EntityTimelineResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metaData".equals(fieldName)) { + deserializedEntityTimelineResponseInner.metaData = TimelineResultsMetadata.fromJson(reader); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EntityTimelineItem.fromJson(reader1)); + deserializedEntityTimelineResponseInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedEntityTimelineResponseInner; + }); + } +} 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..95c3050438a5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import java.io.IOException; +import java.util.List; + +/** + * Describes expansion entity query properties. + */ +@Immutable +public final class ExpansionEntityQueriesProperties implements JsonSerializable { + /* + * List of the data sources that are required to run the query + */ + private List dataSources; + + /* + * The query display name + */ + private String displayName; + + /* + * The type of the query's source entity + */ + private EntityType inputEntityType; + + /* + * List of the fields of the source entity that are required to run the query + */ + private List inputFields; + + /* + * List of the desired output types to be constructed from the result + */ + private List outputEntityTypes; + + /* + * The template query string to be parsed and formatted + */ + private String queryTemplate; + + /** + * Creates an instance of ExpansionEntityQueriesProperties class. + */ + private ExpansionEntityQueriesProperties() { + } + + /** + * 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; + } + + /** + * Get the displayName property: The query display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the inputEntityType property: The type of the query's source entity. + * + * @return the inputEntityType value. + */ + public EntityType inputEntityType() { + return this.inputEntityType; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Get the queryTemplate property: The template query string to be parsed and formatted. + * + * @return the queryTemplate value. + */ + public String queryTemplate() { + return this.queryTemplate; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataSources", this.dataSources, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("inputEntityType", + this.inputEntityType == null ? null : this.inputEntityType.toString()); + jsonWriter.writeArrayField("inputFields", this.inputFields, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("outputEntityTypes", this.outputEntityTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("queryTemplate", this.queryTemplate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpansionEntityQueriesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpansionEntityQueriesProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpansionEntityQueriesProperties. + */ + public static ExpansionEntityQueriesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpansionEntityQueriesProperties deserializedExpansionEntityQueriesProperties + = new ExpansionEntityQueriesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataSources".equals(fieldName)) { + List dataSources = reader.readArray(reader1 -> reader1.getString()); + deserializedExpansionEntityQueriesProperties.dataSources = dataSources; + } else if ("displayName".equals(fieldName)) { + deserializedExpansionEntityQueriesProperties.displayName = reader.getString(); + } else if ("inputEntityType".equals(fieldName)) { + deserializedExpansionEntityQueriesProperties.inputEntityType + = EntityType.fromString(reader.getString()); + } else if ("inputFields".equals(fieldName)) { + List inputFields = reader.readArray(reader1 -> reader1.getString()); + deserializedExpansionEntityQueriesProperties.inputFields = inputFields; + } else if ("outputEntityTypes".equals(fieldName)) { + List outputEntityTypes + = reader.readArray(reader1 -> EntityType.fromString(reader1.getString())); + deserializedExpansionEntityQueriesProperties.outputEntityTypes = outputEntityTypes; + } else if ("queryTemplate".equals(fieldName)) { + deserializedExpansionEntityQueriesProperties.queryTemplate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpansionEntityQueriesProperties; + }); + } +} 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..e31444a6a85e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * EyesOn property bag. + */ +@Immutable +public final class EyesOnSettingsProperties implements JsonSerializable { + /* + * Determines whether the setting is enable or disabled. + */ + private Boolean isEnabled; + + /** + * Creates an instance of EyesOnSettingsProperties class. + */ + public EyesOnSettingsProperties() { + } + + /** + * Get the isEnabled property: Determines whether the setting is enable or disabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EyesOnSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EyesOnSettingsProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EyesOnSettingsProperties. + */ + public static EyesOnSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EyesOnSettingsProperties deserializedEyesOnSettingsProperties = new EyesOnSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isEnabled".equals(fieldName)) { + deserializedEyesOnSettingsProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedEyesOnSettingsProperties; + }); + } +} 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 index 92c4110ff056..8f7e49024512 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -52,7 +52,7 @@ public final class FileEntityProperties extends EntityCommonProperties { /** * Creates an instance of FileEntityProperties class. */ - public FileEntityProperties() { + private FileEntityProperties() { } /** @@ -113,15 +113,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ 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 index 0d5e2d05a749..d1e932d7482e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -42,7 +42,7 @@ public final class FileHashEntityProperties extends EntityCommonProperties { /** * Creates an instance of FileHashEntityProperties class. */ - public FileHashEntityProperties() { + private FileHashEntityProperties() { } /** @@ -85,15 +85,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportInner.java new file mode 100644 index 000000000000..20e4d68ac653 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportInner.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileImportState; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import com.azure.resourcemanager.securityinsights.models.ValidationError; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Represents a file import in Azure Security Insights. + */ +@Fluent +public final class FileImportInner extends ProxyResource { + /* + * File import properties + */ + private FileImportProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of FileImportInner class. + */ + public FileImportInner() { + } + + /** + * Get the innerProperties property: File import properties. + * + * @return the innerProperties value. + */ + private FileImportProperties 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the ingestionMode property: Describes how to ingest the records in the file. + * + * @return the ingestionMode value. + */ + public IngestionMode ingestionMode() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionMode(); + } + + /** + * Set the ingestionMode property: Describes how to ingest the records in the file. + * + * @param ingestionMode the ingestionMode value to set. + * @return the FileImportInner object itself. + */ + public FileImportInner withIngestionMode(IngestionMode ingestionMode) { + if (this.innerProperties() == null) { + this.innerProperties = new FileImportProperties(); + } + this.innerProperties().withIngestionMode(ingestionMode); + return this; + } + + /** + * Get the contentType property: The content type of this file. + * + * @return the contentType value. + */ + public FileImportContentType contentType() { + return this.innerProperties() == null ? null : this.innerProperties().contentType(); + } + + /** + * Set the contentType property: The content type of this file. + * + * @param contentType the contentType value to set. + * @return the FileImportInner object itself. + */ + public FileImportInner withContentType(FileImportContentType contentType) { + if (this.innerProperties() == null) { + this.innerProperties = new FileImportProperties(); + } + this.innerProperties().withContentType(contentType); + return this; + } + + /** + * Get the createdTimeUTC property: The time the file was imported. + * + * @return the createdTimeUTC value. + */ + public OffsetDateTime createdTimeUTC() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUTC(); + } + + /** + * Get the errorFile property: Represents the error file (if the import was ingested with errors or failed the + * validation). + * + * @return the errorFile value. + */ + public FileMetadata errorFile() { + return this.innerProperties() == null ? null : this.innerProperties().errorFile(); + } + + /** + * Get the errorsPreview property: An ordered list of some of the errors that were encountered during validation. + * + * @return the errorsPreview value. + */ + public List errorsPreview() { + return this.innerProperties() == null ? null : this.innerProperties().errorsPreview(); + } + + /** + * Get the importFile property: Represents the imported file. + * + * @return the importFile value. + */ + public FileMetadata importFile() { + return this.innerProperties() == null ? null : this.innerProperties().importFile(); + } + + /** + * Set the importFile property: Represents the imported file. + * + * @param importFile the importFile value to set. + * @return the FileImportInner object itself. + */ + public FileImportInner withImportFile(FileMetadata importFile) { + if (this.innerProperties() == null) { + this.innerProperties = new FileImportProperties(); + } + this.innerProperties().withImportFile(importFile); + return this; + } + + /** + * Get the ingestedRecordCount property: The number of records that have been successfully ingested. + * + * @return the ingestedRecordCount value. + */ + public Integer ingestedRecordCount() { + return this.innerProperties() == null ? null : this.innerProperties().ingestedRecordCount(); + } + + /** + * Get the source property: The source for the data in the file. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: The source for the data in the file. + * + * @param source the source value to set. + * @return the FileImportInner object itself. + */ + public FileImportInner withSource(String source) { + if (this.innerProperties() == null) { + this.innerProperties = new FileImportProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the state property: The state of the file import. + * + * @return the state value. + */ + public FileImportState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the totalRecordCount property: The number of records in the file. + * + * @return the totalRecordCount value. + */ + public Integer totalRecordCount() { + return this.innerProperties() == null ? null : this.innerProperties().totalRecordCount(); + } + + /** + * Get the validRecordCount property: The number of records that have passed validation. + * + * @return the validRecordCount value. + */ + public Integer validRecordCount() { + return this.innerProperties() == null ? null : this.innerProperties().validRecordCount(); + } + + /** + * Get the filesValidUntilTimeUTC property: The time the files associated with this import are deleted from the + * storage account. + * + * @return the filesValidUntilTimeUTC value. + */ + public OffsetDateTime filesValidUntilTimeUTC() { + return this.innerProperties() == null ? null : this.innerProperties().filesValidUntilTimeUTC(); + } + + /** + * Get the importValidUntilTimeUTC property: The time the file import record is soft deleted from the database and + * history. + * + * @return the importValidUntilTimeUTC value. + */ + public OffsetDateTime importValidUntilTimeUTC() { + return this.innerProperties() == null ? null : this.innerProperties().importValidUntilTimeUTC(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileImportInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileImportInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileImportInner. + */ + public static FileImportInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileImportInner deserializedFileImportInner = new FileImportInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileImportInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileImportInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileImportInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileImportInner.innerProperties = FileImportProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFileImportInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileImportInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportProperties.java new file mode 100644 index 000000000000..45054db96153 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportProperties.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileImportState; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import com.azure.resourcemanager.securityinsights.models.ValidationError; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Describes the FileImport's properties. + */ +@Fluent +public final class FileImportProperties implements JsonSerializable { + /* + * Describes how to ingest the records in the file. + */ + private IngestionMode ingestionMode; + + /* + * The content type of this file. + */ + private FileImportContentType contentType; + + /* + * The time the file was imported. + */ + private OffsetDateTime createdTimeUTC; + + /* + * Represents the error file (if the import was ingested with errors or failed the validation). + */ + private FileMetadata errorFile; + + /* + * An ordered list of some of the errors that were encountered during validation. + */ + private List errorsPreview; + + /* + * Represents the imported file. + */ + private FileMetadata importFile; + + /* + * The number of records that have been successfully ingested. + */ + private Integer ingestedRecordCount; + + /* + * The source for the data in the file. + */ + private String source; + + /* + * The state of the file import. + */ + private FileImportState state; + + /* + * The number of records in the file. + */ + private Integer totalRecordCount; + + /* + * The number of records that have passed validation. + */ + private Integer validRecordCount; + + /* + * The time the files associated with this import are deleted from the storage account. + */ + private OffsetDateTime filesValidUntilTimeUTC; + + /* + * The time the file import record is soft deleted from the database and history. + */ + private OffsetDateTime importValidUntilTimeUTC; + + /** + * Creates an instance of FileImportProperties class. + */ + public FileImportProperties() { + } + + /** + * Get the ingestionMode property: Describes how to ingest the records in the file. + * + * @return the ingestionMode value. + */ + public IngestionMode ingestionMode() { + return this.ingestionMode; + } + + /** + * Set the ingestionMode property: Describes how to ingest the records in the file. + * + * @param ingestionMode the ingestionMode value to set. + * @return the FileImportProperties object itself. + */ + public FileImportProperties withIngestionMode(IngestionMode ingestionMode) { + this.ingestionMode = ingestionMode; + return this; + } + + /** + * Get the contentType property: The content type of this file. + * + * @return the contentType value. + */ + public FileImportContentType contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content type of this file. + * + * @param contentType the contentType value to set. + * @return the FileImportProperties object itself. + */ + public FileImportProperties withContentType(FileImportContentType contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the createdTimeUTC property: The time the file was imported. + * + * @return the createdTimeUTC value. + */ + public OffsetDateTime createdTimeUTC() { + return this.createdTimeUTC; + } + + /** + * Get the errorFile property: Represents the error file (if the import was ingested with errors or failed the + * validation). + * + * @return the errorFile value. + */ + public FileMetadata errorFile() { + return this.errorFile; + } + + /** + * Get the errorsPreview property: An ordered list of some of the errors that were encountered during validation. + * + * @return the errorsPreview value. + */ + public List errorsPreview() { + return this.errorsPreview; + } + + /** + * Get the importFile property: Represents the imported file. + * + * @return the importFile value. + */ + public FileMetadata importFile() { + return this.importFile; + } + + /** + * Set the importFile property: Represents the imported file. + * + * @param importFile the importFile value to set. + * @return the FileImportProperties object itself. + */ + public FileImportProperties withImportFile(FileMetadata importFile) { + this.importFile = importFile; + return this; + } + + /** + * Get the ingestedRecordCount property: The number of records that have been successfully ingested. + * + * @return the ingestedRecordCount value. + */ + public Integer ingestedRecordCount() { + return this.ingestedRecordCount; + } + + /** + * Get the source property: The source for the data in the file. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: The source for the data in the file. + * + * @param source the source value to set. + * @return the FileImportProperties object itself. + */ + public FileImportProperties withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the state property: The state of the file import. + * + * @return the state value. + */ + public FileImportState state() { + return this.state; + } + + /** + * Get the totalRecordCount property: The number of records in the file. + * + * @return the totalRecordCount value. + */ + public Integer totalRecordCount() { + return this.totalRecordCount; + } + + /** + * Get the validRecordCount property: The number of records that have passed validation. + * + * @return the validRecordCount value. + */ + public Integer validRecordCount() { + return this.validRecordCount; + } + + /** + * Get the filesValidUntilTimeUTC property: The time the files associated with this import are deleted from the + * storage account. + * + * @return the filesValidUntilTimeUTC value. + */ + public OffsetDateTime filesValidUntilTimeUTC() { + return this.filesValidUntilTimeUTC; + } + + /** + * Get the importValidUntilTimeUTC property: The time the file import record is soft deleted from the database and + * history. + * + * @return the importValidUntilTimeUTC value. + */ + public OffsetDateTime importValidUntilTimeUTC() { + return this.importValidUntilTimeUTC; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ingestionMode", this.ingestionMode == null ? null : this.ingestionMode.toString()); + jsonWriter.writeStringField("contentType", this.contentType == null ? null : this.contentType.toString()); + jsonWriter.writeJsonField("importFile", this.importFile); + jsonWriter.writeStringField("source", this.source); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileImportProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileImportProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileImportProperties. + */ + public static FileImportProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileImportProperties deserializedFileImportProperties = new FileImportProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ingestionMode".equals(fieldName)) { + deserializedFileImportProperties.ingestionMode = IngestionMode.fromString(reader.getString()); + } else if ("contentType".equals(fieldName)) { + deserializedFileImportProperties.contentType = FileImportContentType.fromString(reader.getString()); + } else if ("importFile".equals(fieldName)) { + deserializedFileImportProperties.importFile = FileMetadata.fromJson(reader); + } else if ("source".equals(fieldName)) { + deserializedFileImportProperties.source = reader.getString(); + } else if ("createdTimeUTC".equals(fieldName)) { + deserializedFileImportProperties.createdTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("errorFile".equals(fieldName)) { + deserializedFileImportProperties.errorFile = FileMetadata.fromJson(reader); + } else if ("errorsPreview".equals(fieldName)) { + List errorsPreview + = reader.readArray(reader1 -> ValidationError.fromJson(reader1)); + deserializedFileImportProperties.errorsPreview = errorsPreview; + } else if ("ingestedRecordCount".equals(fieldName)) { + deserializedFileImportProperties.ingestedRecordCount = reader.getNullable(JsonReader::getInt); + } else if ("state".equals(fieldName)) { + deserializedFileImportProperties.state = FileImportState.fromString(reader.getString()); + } else if ("totalRecordCount".equals(fieldName)) { + deserializedFileImportProperties.totalRecordCount = reader.getNullable(JsonReader::getInt); + } else if ("validRecordCount".equals(fieldName)) { + deserializedFileImportProperties.validRecordCount = reader.getNullable(JsonReader::getInt); + } else if ("filesValidUntilTimeUTC".equals(fieldName)) { + deserializedFileImportProperties.filesValidUntilTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("importValidUntilTimeUTC".equals(fieldName)) { + deserializedFileImportProperties.importValidUntilTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedFileImportProperties; + }); + } +} 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 index 8ffd126ba8c8..c5de5d21b248 100644 --- 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 @@ -1,18 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.FusionScenarioExclusionPattern; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSettings; import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -42,6 +43,16 @@ public final class FusionAlertRuleProperties implements JsonSerializable sourceSettings; + + /* + * Configuration to exclude scenarios in fusion detection. + */ + private List scenarioExclusionPatterns; + /* * The last time that this alert has been modified. */ @@ -62,6 +73,11 @@ public final class FusionAlertRuleProperties implements JsonSerializable techniques; + /* + * The sub-techniques of the alert rule + */ + private List subTechniques; + /** * Creates an instance of FusionAlertRuleProperties class. */ @@ -126,6 +142,47 @@ public FusionAlertRuleProperties withEnabled(boolean enabled) { return this; } + /** + * Get the sourceSettings property: Configuration for all supported source signals in fusion detection. + * + * @return the sourceSettings value. + */ + public List sourceSettings() { + return this.sourceSettings; + } + + /** + * Set the sourceSettings property: Configuration for all supported source signals in fusion detection. + * + * @param sourceSettings the sourceSettings value to set. + * @return the FusionAlertRuleProperties object itself. + */ + public FusionAlertRuleProperties withSourceSettings(List sourceSettings) { + this.sourceSettings = sourceSettings; + return this; + } + + /** + * Get the scenarioExclusionPatterns property: Configuration to exclude scenarios in fusion detection. + * + * @return the scenarioExclusionPatterns value. + */ + public List scenarioExclusionPatterns() { + return this.scenarioExclusionPatterns; + } + + /** + * Set the scenarioExclusionPatterns property: Configuration to exclude scenarios in fusion detection. + * + * @param scenarioExclusionPatterns the scenarioExclusionPatterns value to set. + * @return the FusionAlertRuleProperties object itself. + */ + public FusionAlertRuleProperties + withScenarioExclusionPatterns(List scenarioExclusionPatterns) { + this.scenarioExclusionPatterns = scenarioExclusionPatterns; + return this; + } + /** * Get the lastModifiedUtc property: The last time that this alert has been modified. * @@ -163,20 +220,14 @@ public List techniques() { } /** - * Validates the instance. + * Get the subTechniques property: The sub-techniques of the alert rule. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the subTechniques value. */ - public void validate() { - if (alertRuleTemplateName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property alertRuleTemplateName in model FusionAlertRuleProperties")); - } + public List subTechniques() { + return this.subTechniques; } - private static final ClientLogger LOGGER = new ClientLogger(FusionAlertRuleProperties.class); - /** * {@inheritDoc} */ @@ -185,6 +236,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("alertRuleTemplateName", this.alertRuleTemplateName); jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeArrayField("sourceSettings", this.sourceSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scenarioExclusionPatterns", this.scenarioExclusionPatterns, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -212,6 +267,14 @@ public static FusionAlertRuleProperties fromJson(JsonReader jsonReader) throws I deserializedFusionAlertRuleProperties.description = reader.getString(); } else if ("displayName".equals(fieldName)) { deserializedFusionAlertRuleProperties.displayName = reader.getString(); + } else if ("sourceSettings".equals(fieldName)) { + List sourceSettings + = reader.readArray(reader1 -> FusionSourceSettings.fromJson(reader1)); + deserializedFusionAlertRuleProperties.sourceSettings = sourceSettings; + } else if ("scenarioExclusionPatterns".equals(fieldName)) { + List scenarioExclusionPatterns + = reader.readArray(reader1 -> FusionScenarioExclusionPattern.fromJson(reader1)); + deserializedFusionAlertRuleProperties.scenarioExclusionPatterns = scenarioExclusionPatterns; } else if ("lastModifiedUtc".equals(fieldName)) { deserializedFusionAlertRuleProperties.lastModifiedUtc = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); @@ -224,6 +287,9 @@ public static FusionAlertRuleProperties fromJson(JsonReader jsonReader) throws I } else if ("techniques".equals(fieldName)) { List techniques = reader.readArray(reader1 -> reader1.getString()); deserializedFusionAlertRuleProperties.techniques = techniques; + } else if ("subTechniques".equals(fieldName)) { + List subTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedFusionAlertRuleProperties.subTechniques = subTechniques; } else { reader.skipChildren(); } 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 index eb4f04d27f2b..6c4e2ab9c4c8 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -13,18 +13,19 @@ import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.FusionTemplateSourceSetting; import com.azure.resourcemanager.securityinsights.models.TemplateStatus; import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; /** - * Represents Fusion alert rule template properties. + * Fusion alert rule template properties. */ -@Fluent +@Immutable public final class FusionAlertRuleTemplateProperties implements JsonSerializable { /* - * the number of alert rules that were created by this template + * The number of alert rules that were created by this template */ private Integer alertRulesCreatedByTemplateCount; @@ -69,18 +70,28 @@ public final class FusionAlertRuleTemplateProperties implements JsonSerializable private List tactics; /* - * The techniques of the alert rule template + * The techniques of the alert rule */ private List techniques; + /* + * The sub-techniques of the alert rule + */ + private List subTechniques; + + /* + * All supported source signal configurations consumed in fusion detection. + */ + private List sourceSettings; + /** * Creates an instance of FusionAlertRuleTemplateProperties class. */ - public FusionAlertRuleTemplateProperties() { + private FusionAlertRuleTemplateProperties() { } /** - * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. * * @return the alertRulesCreatedByTemplateCount value. */ @@ -88,18 +99,6 @@ 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 FusionAlertRuleTemplateProperties object itself. - */ - public FusionAlertRuleTemplateProperties - withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { - this.alertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - return this; - } - /** * Get the createdDateUtc property: The time that this alert rule template has been added. * @@ -127,17 +126,6 @@ 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 FusionAlertRuleTemplateProperties object itself. - */ - public FusionAlertRuleTemplateProperties withDescription(String description) { - this.description = description; - return this; - } - /** * Get the displayName property: The display name for alert rule template. * @@ -147,17 +135,6 @@ 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 FusionAlertRuleTemplateProperties object itself. - */ - public FusionAlertRuleTemplateProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - /** * Get the requiredDataConnectors property: The required data connectors for this template. * @@ -167,18 +144,6 @@ public List requiredDataConnectors() { return this.requiredDataConnectors; } - /** - * Set the requiredDataConnectors property: The required data connectors for this template. - * - * @param requiredDataConnectors the requiredDataConnectors value to set. - * @return the FusionAlertRuleTemplateProperties object itself. - */ - public FusionAlertRuleTemplateProperties - withRequiredDataConnectors(List requiredDataConnectors) { - this.requiredDataConnectors = requiredDataConnectors; - return this; - } - /** * Get the status property: The alert rule template status. * @@ -188,17 +153,6 @@ public TemplateStatus status() { return this.status; } - /** - * Set the status property: The alert rule template status. - * - * @param status the status value to set. - * @return the FusionAlertRuleTemplateProperties object itself. - */ - public FusionAlertRuleTemplateProperties withStatus(TemplateStatus status) { - this.status = status; - return this; - } - /** * Get the severity property: The severity for alerts created by this alert rule. * @@ -208,17 +162,6 @@ 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. * @@ -229,18 +172,7 @@ public List 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; - } - - /** - * Get the techniques property: The techniques of the alert rule template. + * Get the techniques property: The techniques of the alert rule. * * @return the techniques value. */ @@ -249,25 +181,21 @@ public List techniques() { } /** - * Set the techniques property: The techniques of the alert rule template. + * Get the subTechniques property: The sub-techniques of the alert rule. * - * @param techniques the techniques value to set. - * @return the FusionAlertRuleTemplateProperties object itself. + * @return the subTechniques value. */ - public FusionAlertRuleTemplateProperties withTechniques(List techniques) { - this.techniques = techniques; - return this; + public List subTechniques() { + return this.subTechniques; } /** - * Validates the instance. + * Get the sourceSettings property: All supported source signal configurations consumed in fusion detection. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the sourceSettings value. */ - public void validate() { - if (requiredDataConnectors() != null) { - requiredDataConnectors().forEach(e -> e.validate()); - } + public List sourceSettings() { + return this.sourceSettings; } /** @@ -286,6 +214,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("tactics", this.tactics, (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subTechniques", this.subTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sourceSettings", this.sourceSettings, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -335,6 +267,13 @@ public static FusionAlertRuleTemplateProperties fromJson(JsonReader jsonReader) } else if ("techniques".equals(fieldName)) { List techniques = reader.readArray(reader1 -> reader1.getString()); deserializedFusionAlertRuleTemplateProperties.techniques = techniques; + } else if ("subTechniques".equals(fieldName)) { + List subTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedFusionAlertRuleTemplateProperties.subTechniques = subTechniques; + } else if ("sourceSettings".equals(fieldName)) { + List sourceSettings + = reader.readArray(reader1 -> FusionTemplateSourceSetting.fromJson(reader1)); + deserializedFusionAlertRuleTemplateProperties.sourceSettings = sourceSettings; } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GCPDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GCPDataConnectorProperties.java new file mode 100644 index 000000000000..d273f716c2a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GCPDataConnectorProperties.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.GCPAuthProperties; +import com.azure.resourcemanager.securityinsights.models.GCPRequestProperties; +import java.io.IOException; + +/** + * Google Cloud Platform data connector properties. + */ +@Fluent +public final class GCPDataConnectorProperties implements JsonSerializable { + /* + * The name of the connector definition that represents the UI config. + */ + private String connectorDefinitionName; + + /* + * The auth section of the connector. + */ + private GCPAuthProperties auth; + + /* + * The request section of the connector. + */ + private GCPRequestProperties request; + + /* + * The configuration of the destination of the data. + */ + private DCRConfiguration dcrConfig; + + /** + * Creates an instance of GCPDataConnectorProperties class. + */ + public GCPDataConnectorProperties() { + } + + /** + * Get the connectorDefinitionName property: The name of the connector definition that represents the UI config. + * + * @return the connectorDefinitionName value. + */ + public String connectorDefinitionName() { + return this.connectorDefinitionName; + } + + /** + * Set the connectorDefinitionName property: The name of the connector definition that represents the UI config. + * + * @param connectorDefinitionName the connectorDefinitionName value to set. + * @return the GCPDataConnectorProperties object itself. + */ + public GCPDataConnectorProperties withConnectorDefinitionName(String connectorDefinitionName) { + this.connectorDefinitionName = connectorDefinitionName; + return this; + } + + /** + * Get the auth property: The auth section of the connector. + * + * @return the auth value. + */ + public GCPAuthProperties auth() { + return this.auth; + } + + /** + * Set the auth property: The auth section of the connector. + * + * @param auth the auth value to set. + * @return the GCPDataConnectorProperties object itself. + */ + public GCPDataConnectorProperties withAuth(GCPAuthProperties auth) { + this.auth = auth; + return this; + } + + /** + * Get the request property: The request section of the connector. + * + * @return the request value. + */ + public GCPRequestProperties request() { + return this.request; + } + + /** + * Set the request property: The request section of the connector. + * + * @param request the request value to set. + * @return the GCPDataConnectorProperties object itself. + */ + public GCPDataConnectorProperties withRequest(GCPRequestProperties request) { + this.request = request; + return this; + } + + /** + * Get the dcrConfig property: The configuration of the destination of the data. + * + * @return the dcrConfig value. + */ + public DCRConfiguration dcrConfig() { + return this.dcrConfig; + } + + /** + * Set the dcrConfig property: The configuration of the destination of the data. + * + * @param dcrConfig the dcrConfig value to set. + * @return the GCPDataConnectorProperties object itself. + */ + public GCPDataConnectorProperties withDcrConfig(DCRConfiguration dcrConfig) { + this.dcrConfig = dcrConfig; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectorDefinitionName", this.connectorDefinitionName); + jsonWriter.writeJsonField("auth", this.auth); + jsonWriter.writeJsonField("request", this.request); + jsonWriter.writeJsonField("dcrConfig", this.dcrConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GCPDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GCPDataConnectorProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GCPDataConnectorProperties. + */ + public static GCPDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GCPDataConnectorProperties deserializedGCPDataConnectorProperties = new GCPDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectorDefinitionName".equals(fieldName)) { + deserializedGCPDataConnectorProperties.connectorDefinitionName = reader.getString(); + } else if ("auth".equals(fieldName)) { + deserializedGCPDataConnectorProperties.auth = GCPAuthProperties.fromJson(reader); + } else if ("request".equals(fieldName)) { + deserializedGCPDataConnectorProperties.request = GCPRequestProperties.fromJson(reader); + } else if ("dcrConfig".equals(fieldName)) { + deserializedGCPDataConnectorProperties.dcrConfig = DCRConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGCPDataConnectorProperties; + }); + } +} 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 index a10368ed3754..8b122f7b5861 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -16,7 +16,7 @@ /** * Host entity property bag. */ -@Fluent +@Immutable public final class HostEntityProperties extends EntityCommonProperties { /* * The azure resource id of the VM. @@ -78,7 +78,7 @@ public final class HostEntityProperties extends EntityCommonProperties { /** * Creates an instance of HostEntityProperties class. */ - public HostEntityProperties() { + private HostEntityProperties() { } /** @@ -154,17 +154,6 @@ 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. @@ -197,15 +186,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentInner.java new file mode 100644 index 000000000000..8e01d0128dab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a Hunt Comment in Azure Security Insights. + */ +@Fluent +public final class HuntCommentInner extends ProxyResource { + /* + * Hunt Comment properties + */ + private HuntCommentProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HuntCommentInner class. + */ + public HuntCommentInner() { + } + + /** + * Get the innerProperties property: Hunt Comment properties. + * + * @return the innerProperties value. + */ + private HuntCommentProperties innerProperties() { + return this.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 HuntCommentInner object itself. + */ + public HuntCommentInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the message property: The message for the comment. + * + * @return the message value. + */ + public String message() { + return this.innerProperties() == null ? null : this.innerProperties().message(); + } + + /** + * Set the message property: The message for the comment. + * + * @param message the message value to set. + * @return the HuntCommentInner object itself. + */ + public HuntCommentInner withMessage(String message) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntCommentProperties(); + } + this.innerProperties().withMessage(message); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntCommentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntCommentInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntCommentInner. + */ + public static HuntCommentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntCommentInner deserializedHuntCommentInner = new HuntCommentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHuntCommentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHuntCommentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHuntCommentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHuntCommentInner.innerProperties = HuntCommentProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedHuntCommentInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedHuntCommentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntCommentInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentProperties.java new file mode 100644 index 000000000000..225e566dc833 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a hunt comment properties. + */ +@Fluent +public final class HuntCommentProperties implements JsonSerializable { + /* + * The message for the comment + */ + private String message; + + /** + * Creates an instance of HuntCommentProperties class. + */ + public HuntCommentProperties() { + } + + /** + * Get the message property: The message for the comment. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message for the comment. + * + * @param message the message value to set. + * @return the HuntCommentProperties object itself. + */ + public HuntCommentProperties withMessage(String message) { + this.message = message; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntCommentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntCommentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntCommentProperties. + */ + public static HuntCommentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntCommentProperties deserializedHuntCommentProperties = new HuntCommentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedHuntCommentProperties.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntCommentProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntInner.java new file mode 100644 index 000000000000..8566c5e9afc1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntInner.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.io.IOException; +import java.util.List; + +/** + * Represents a Hunt in Azure Security Insights. + */ +@Fluent +public final class HuntInner extends ProxyResource { + /* + * Hunt properties + */ + private HuntProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HuntInner class. + */ + public HuntInner() { + } + + /** + * Get the innerProperties property: Hunt properties. + * + * @return the innerProperties value. + */ + private HuntProperties innerProperties() { + return this.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 HuntInner object itself. + */ + public HuntInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the displayName property: The display name of the hunt. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the hunt. + * + * @param displayName the displayName value to set. + * @return the HuntInner object itself. + */ + public HuntInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: The description of the hunt. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the hunt. + * + * @param description the description value to set. + * @return the HuntInner object itself. + */ + public HuntInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the status property: The status of the hunt. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the hunt. + * + * @param status the status value to set. + * @return the HuntInner object itself. + */ + public HuntInner withStatus(Status status) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the hypothesisStatus property: The hypothesis status of the hunt. + * + * @return the hypothesisStatus value. + */ + public HypothesisStatus hypothesisStatus() { + return this.innerProperties() == null ? null : this.innerProperties().hypothesisStatus(); + } + + /** + * Set the hypothesisStatus property: The hypothesis status of the hunt. + * + * @param hypothesisStatus the hypothesisStatus value to set. + * @return the HuntInner object itself. + */ + public HuntInner withHypothesisStatus(HypothesisStatus hypothesisStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withHypothesisStatus(hypothesisStatus); + return this; + } + + /** + * Get the attackTactics property: A list of mitre attack tactics the hunt is associated with. + * + * @return the attackTactics value. + */ + public List attackTactics() { + return this.innerProperties() == null ? null : this.innerProperties().attackTactics(); + } + + /** + * Set the attackTactics property: A list of mitre attack tactics the hunt is associated with. + * + * @param attackTactics the attackTactics value to set. + * @return the HuntInner object itself. + */ + public HuntInner withAttackTactics(List attackTactics) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withAttackTactics(attackTactics); + return this; + } + + /** + * Get the attackTechniques property: A list of a mitre attack techniques the hunt is associated with. + * + * @return the attackTechniques value. + */ + public List attackTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().attackTechniques(); + } + + /** + * Set the attackTechniques property: A list of a mitre attack techniques the hunt is associated with. + * + * @param attackTechniques the attackTechniques value to set. + * @return the HuntInner object itself. + */ + public HuntInner withAttackTechniques(List attackTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withAttackTechniques(attackTechniques); + return this; + } + + /** + * Get the labels property: List of labels relevant to this hunt. + * + * @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 hunt. + * + * @param labels the labels value to set. + * @return the HuntInner object itself. + */ + public HuntInner withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * Get the owner property: Describes a user that the hunt is assigned to. + * + * @return the owner value. + */ + public HuntOwner owner() { + return this.innerProperties() == null ? null : this.innerProperties().owner(); + } + + /** + * Set the owner property: Describes a user that the hunt is assigned to. + * + * @param owner the owner value to set. + * @return the HuntInner object itself. + */ + public HuntInner withOwner(HuntOwner owner) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntProperties(); + } + this.innerProperties().withOwner(owner); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntInner. + */ + public static HuntInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntInner deserializedHuntInner = new HuntInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHuntInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHuntInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHuntInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHuntInner.innerProperties = HuntProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedHuntInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedHuntInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntProperties.java new file mode 100644 index 000000000000..360b52399094 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntProperties.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.io.IOException; +import java.util.List; + +/** + * Describes hunt properties. + */ +@Fluent +public final class HuntProperties implements JsonSerializable { + /* + * The display name of the hunt + */ + private String displayName; + + /* + * The description of the hunt + */ + private String description; + + /* + * The status of the hunt. + */ + private Status status; + + /* + * The hypothesis status of the hunt. + */ + private HypothesisStatus hypothesisStatus; + + /* + * A list of mitre attack tactics the hunt is associated with + */ + private List attackTactics; + + /* + * A list of a mitre attack techniques the hunt is associated with + */ + private List attackTechniques; + + /* + * List of labels relevant to this hunt + */ + private List labels; + + /* + * Describes a user that the hunt is assigned to + */ + private HuntOwner owner; + + /** + * Creates an instance of HuntProperties class. + */ + public HuntProperties() { + } + + /** + * Get the displayName property: The display name of the hunt. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the hunt. + * + * @param displayName the displayName value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description of the hunt. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the hunt. + * + * @param description the description value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: The status of the hunt. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the hunt. + * + * @param status the status value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the hypothesisStatus property: The hypothesis status of the hunt. + * + * @return the hypothesisStatus value. + */ + public HypothesisStatus hypothesisStatus() { + return this.hypothesisStatus; + } + + /** + * Set the hypothesisStatus property: The hypothesis status of the hunt. + * + * @param hypothesisStatus the hypothesisStatus value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withHypothesisStatus(HypothesisStatus hypothesisStatus) { + this.hypothesisStatus = hypothesisStatus; + return this; + } + + /** + * Get the attackTactics property: A list of mitre attack tactics the hunt is associated with. + * + * @return the attackTactics value. + */ + public List attackTactics() { + return this.attackTactics; + } + + /** + * Set the attackTactics property: A list of mitre attack tactics the hunt is associated with. + * + * @param attackTactics the attackTactics value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withAttackTactics(List attackTactics) { + this.attackTactics = attackTactics; + return this; + } + + /** + * Get the attackTechniques property: A list of a mitre attack techniques the hunt is associated with. + * + * @return the attackTechniques value. + */ + public List attackTechniques() { + return this.attackTechniques; + } + + /** + * Set the attackTechniques property: A list of a mitre attack techniques the hunt is associated with. + * + * @param attackTechniques the attackTechniques value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withAttackTechniques(List attackTechniques) { + this.attackTechniques = attackTechniques; + return this; + } + + /** + * Get the labels property: List of labels relevant to this hunt. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels relevant to this hunt. + * + * @param labels the labels value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the owner property: Describes a user that the hunt is assigned to. + * + * @return the owner value. + */ + public HuntOwner owner() { + return this.owner; + } + + /** + * Set the owner property: Describes a user that the hunt is assigned to. + * + * @param owner the owner value to set. + * @return the HuntProperties object itself. + */ + public HuntProperties withOwner(HuntOwner owner) { + this.owner = owner; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("hypothesisStatus", + this.hypothesisStatus == null ? null : this.hypothesisStatus.toString()); + jsonWriter.writeArrayField("attackTactics", this.attackTactics, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("attackTechniques", this.attackTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("owner", this.owner); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntProperties. + */ + public static HuntProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntProperties deserializedHuntProperties = new HuntProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedHuntProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedHuntProperties.description = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedHuntProperties.status = Status.fromString(reader.getString()); + } else if ("hypothesisStatus".equals(fieldName)) { + deserializedHuntProperties.hypothesisStatus = HypothesisStatus.fromString(reader.getString()); + } else if ("attackTactics".equals(fieldName)) { + List attackTactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedHuntProperties.attackTactics = attackTactics; + } else if ("attackTechniques".equals(fieldName)) { + List attackTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedHuntProperties.attackTechniques = attackTechniques; + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> reader1.getString()); + deserializedHuntProperties.labels = labels; + } else if ("owner".equals(fieldName)) { + deserializedHuntProperties.owner = HuntOwner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationInner.java new file mode 100644 index 000000000000..d21dd389467d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationInner.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a Hunt Relation in Azure Security Insights. + */ +@Fluent +public final class HuntRelationInner extends ProxyResource { + /* + * Hunt Relation properties + */ + private HuntRelationProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of HuntRelationInner class. + */ + public HuntRelationInner() { + } + + /** + * Get the innerProperties property: Hunt Relation properties. + * + * @return the innerProperties value. + */ + private HuntRelationProperties 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the relatedResourceId property: The 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 id of the related resource. + * + * @param relatedResourceId the relatedResourceId value to set. + * @return the HuntRelationInner object itself. + */ + public HuntRelationInner withRelatedResourceId(String relatedResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntRelationProperties(); + } + 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 relationType property: The type of the hunt relation. + * + * @return the relationType value. + */ + public String relationType() { + return this.innerProperties() == null ? null : this.innerProperties().relationType(); + } + + /** + * Get the relatedResourceKind property: The resource that the relation is related to. + * + * @return the relatedResourceKind value. + */ + public String relatedResourceKind() { + return this.innerProperties() == null ? null : this.innerProperties().relatedResourceKind(); + } + + /** + * Get the labels property: List of labels relevant to this hunt. + * + * @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 hunt. + * + * @param labels the labels value to set. + * @return the HuntRelationInner object itself. + */ + public HuntRelationInner withLabels(List labels) { + if (this.innerProperties() == null) { + this.innerProperties = new HuntRelationProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntRelationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntRelationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntRelationInner. + */ + public static HuntRelationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntRelationInner deserializedHuntRelationInner = new HuntRelationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHuntRelationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedHuntRelationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHuntRelationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHuntRelationInner.innerProperties = HuntRelationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedHuntRelationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntRelationInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationProperties.java new file mode 100644 index 000000000000..60c05aa5ddc5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationProperties.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes hunt relation properties. + */ +@Fluent +public final class HuntRelationProperties implements JsonSerializable { + /* + * The id of the related resource + */ + private String relatedResourceId; + + /* + * The name of the related resource + */ + private String relatedResourceName; + + /* + * The type of the hunt relation + */ + private String relationType; + + /* + * The resource that the relation is related to + */ + private String relatedResourceKind; + + /* + * List of labels relevant to this hunt + */ + private List labels; + + /** + * Creates an instance of HuntRelationProperties class. + */ + public HuntRelationProperties() { + } + + /** + * Get the relatedResourceId property: The id of the related resource. + * + * @return the relatedResourceId value. + */ + public String relatedResourceId() { + return this.relatedResourceId; + } + + /** + * Set the relatedResourceId property: The id of the related resource. + * + * @param relatedResourceId the relatedResourceId value to set. + * @return the HuntRelationProperties object itself. + */ + public HuntRelationProperties 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 relationType property: The type of the hunt relation. + * + * @return the relationType value. + */ + public String relationType() { + return this.relationType; + } + + /** + * Get the relatedResourceKind property: The resource that the relation is related to. + * + * @return the relatedResourceKind value. + */ + public String relatedResourceKind() { + return this.relatedResourceKind; + } + + /** + * Get the labels property: List of labels relevant to this hunt. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels property: List of labels relevant to this hunt. + * + * @param labels the labels value to set. + * @return the HuntRelationProperties object itself. + */ + public HuntRelationProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("relatedResourceId", this.relatedResourceId); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntRelationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntRelationProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntRelationProperties. + */ + public static HuntRelationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntRelationProperties deserializedHuntRelationProperties = new HuntRelationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("relatedResourceId".equals(fieldName)) { + deserializedHuntRelationProperties.relatedResourceId = reader.getString(); + } else if ("relatedResourceName".equals(fieldName)) { + deserializedHuntRelationProperties.relatedResourceName = reader.getString(); + } else if ("relationType".equals(fieldName)) { + deserializedHuntRelationProperties.relationType = reader.getString(); + } else if ("relatedResourceKind".equals(fieldName)) { + deserializedHuntRelationProperties.relatedResourceKind = reader.getString(); + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> reader1.getString()); + deserializedHuntRelationProperties.labels = labels; + } else { + reader.skipChildren(); + } + } + + return deserializedHuntRelationProperties; + }); + } +} 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 index fe99392e869d..d6382fab5b1d 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -22,7 +21,7 @@ /** * Describes bookmark properties. */ -@Fluent +@Immutable public final class HuntingBookmarkProperties extends EntityCommonProperties { /* * The time the bookmark was created @@ -93,7 +92,7 @@ public final class HuntingBookmarkProperties extends EntityCommonProperties { /** * Creates an instance of HuntingBookmarkProperties class. */ - public HuntingBookmarkProperties() { + private HuntingBookmarkProperties() { } /** @@ -105,17 +104,6 @@ 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. * @@ -125,17 +113,6 @@ 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. * @@ -145,17 +122,6 @@ 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. * @@ -165,17 +131,6 @@ 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. * @@ -185,17 +140,6 @@ 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. * @@ -205,17 +149,6 @@ 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. * @@ -225,17 +158,6 @@ 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. * @@ -245,17 +167,6 @@ 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. * @@ -265,17 +176,6 @@ 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. * @@ -285,17 +185,6 @@ 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. * @@ -305,17 +194,6 @@ 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; - } - /** * 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. @@ -338,36 +216,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (createdBy() != null) { - createdBy().validate(); - } - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model HuntingBookmarkProperties")); - } - if (query() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property query in model HuntingBookmarkProperties")); - } - if (updatedBy() != null) { - updatedBy().validate(); - } - if (incidentInfo() != null) { - incidentInfo().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(HuntingBookmarkProperties.class); - /** * {@inheritDoc} */ 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 index 1d934e9f0da0..eed1c9d4bfff 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * List of incident alerts. */ -@Fluent +@Immutable public final class IncidentAlertListInner implements JsonSerializable { /* * Array of incident alerts. @@ -27,7 +26,7 @@ public final class IncidentAlertListInner implements JsonSerializable 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.atError() - .log(new IllegalArgumentException("Missing required property value in model IncidentAlertListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IncidentAlertListInner.class); - /** * {@inheritDoc} */ 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 index 79d8834156d1..b3ba50ecfe91 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * List of incident bookmarks. */ -@Fluent +@Immutable public final class IncidentBookmarkListInner implements JsonSerializable { /* * Array of incident bookmarks. @@ -27,7 +26,7 @@ public final class IncidentBookmarkListInner implements JsonSerializable 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.atError() - .log( - new IllegalArgumentException("Missing required property value in model IncidentBookmarkListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IncidentBookmarkListInner.class); - /** * {@inheritDoc} */ 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 index 173e56cbf8da..6fdc2798a3d8 100644 --- 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 @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.securityinsights.models.ClientInfo; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import java.io.IOException; import java.time.OffsetDateTime; @@ -18,12 +18,17 @@ * Represents an incident comment. */ @Fluent -public final class IncidentCommentInner extends ResourceWithEtag { +public final class IncidentCommentInner extends ProxyResource { /* * Incident comment properties */ private IncidentCommentProperties innerProperties; + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -59,12 +64,31 @@ private IncidentCommentProperties innerProperties() { return this.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 IncidentCommentInner object itself. + */ + public IncidentCommentInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -99,33 +123,6 @@ public String id() { return this.id; } - /** - * {@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. * @@ -150,24 +147,30 @@ public IncidentCommentInner withMessage(String message) { } /** - * Get the author property: Describes the client that created the comment. + * Get the createdTimeUtc property: The time the comment was created. * - * @return the author value. + * @return the createdTimeUtc value. */ - public ClientInfo author() { - return this.innerProperties() == null ? null : this.innerProperties().author(); + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); } /** - * Validates the instance. + * Get the lastModifiedTimeUtc property: The time the comment was updated. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the lastModifiedTimeUtc value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * 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(); } /** @@ -176,8 +179,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -203,12 +206,12 @@ public static IncidentCommentInner fromJson(JsonReader jsonReader) throws IOExce deserializedIncidentCommentInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedIncidentCommentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIncidentCommentInner.innerProperties = IncidentCommentProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { - deserializedIncidentCommentInner.withEtag(reader.getString()); + deserializedIncidentCommentInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedIncidentCommentInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedIncidentCommentInner.innerProperties = IncidentCommentProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index b9da1b6b8e22..e6bab6ae8742 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -20,6 +19,11 @@ */ @Fluent public final class IncidentCommentProperties implements JsonSerializable { + /* + * The comment message + */ + private String message; + /* * The time the comment was created */ @@ -30,11 +34,6 @@ public final class IncidentCommentProperties implements JsonSerializable { /* * Array of the incident related entities. @@ -32,7 +32,7 @@ public final class IncidentEntitiesResponseInner implements JsonSerializable 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. * @@ -64,31 +53,6 @@ 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()); - } - } - /** * {@inheritDoc} */ 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 index 5f7ee3ad33d4..15b3dbff4241 100644 --- 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 @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; @@ -16,7 +17,7 @@ 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.azure.resourcemanager.securityinsights.models.TeamInformation; import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -25,12 +26,17 @@ * Represents an incident in Azure Security Insights. */ @Fluent -public final class IncidentInner extends ResourceWithEtag { +public final class IncidentInner extends ProxyResource { /* * Incident properties */ private IncidentProperties innerProperties; + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -66,12 +72,31 @@ private IncidentProperties innerProperties() { return this.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 IncidentInner object itself. + */ + public IncidentInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -107,163 +132,187 @@ public String id() { } /** - * {@inheritDoc} + * Get the title property: The title of the incident. + * + * @return the title value. */ - @Override - public IncidentInner withEtag(String etag) { - super.withEtag(etag); - return this; + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); } /** - * Get the additionalData property: Additional data on the incident. + * Set the title property: The title of the incident. * - * @return the additionalData value. + * @param title the title value to set. + * @return the IncidentInner object itself. */ - public IncidentAdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); + public IncidentInner withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentProperties(); + } + this.innerProperties().withTitle(title); + return this; } /** - * Get the classification property: The reason the incident was closed. + * Get the description property: The description of the incident. * - * @return the classification value. + * @return the description value. */ - public IncidentClassification classification() { - return this.innerProperties() == null ? null : this.innerProperties().classification(); + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** - * Set the classification property: The reason the incident was closed. + * Set the description property: The description of the incident. * - * @param classification the classification value to set. + * @param description the description value to set. * @return the IncidentInner object itself. */ - public IncidentInner withClassification(IncidentClassification classification) { + public IncidentInner withDescription(String description) { if (this.innerProperties() == null) { this.innerProperties = new IncidentProperties(); } - this.innerProperties().withClassification(classification); + this.innerProperties().withDescription(description); return this; } /** - * Get the classificationComment property: Describes the reason the incident was closed. + * Get the severity property: The severity of the incident. * - * @return the classificationComment value. + * @return the severity value. */ - public String classificationComment() { - return this.innerProperties() == null ? null : this.innerProperties().classificationComment(); + public IncidentSeverity severity() { + return this.innerProperties() == null ? null : this.innerProperties().severity(); } /** - * Set the classificationComment property: Describes the reason the incident was closed. + * Set the severity property: The severity of the incident. * - * @param classificationComment the classificationComment value to set. + * @param severity the severity value to set. * @return the IncidentInner object itself. */ - public IncidentInner withClassificationComment(String classificationComment) { + public IncidentInner withSeverity(IncidentSeverity severity) { if (this.innerProperties() == null) { this.innerProperties = new IncidentProperties(); } - this.innerProperties().withClassificationComment(classificationComment); + this.innerProperties().withSeverity(severity); return this; } /** - * Get the classificationReason property: The classification reason the incident was closed with. + * Get the status property: The status of the incident. * - * @return the classificationReason value. + * @return the status value. */ - public IncidentClassificationReason classificationReason() { - return this.innerProperties() == null ? null : this.innerProperties().classificationReason(); + public IncidentStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** - * Set the classificationReason property: The classification reason the incident was closed with. + * Set the status property: The status of the incident. * - * @param classificationReason the classificationReason value to set. + * @param status the status value to set. * @return the IncidentInner object itself. */ - public IncidentInner withClassificationReason(IncidentClassificationReason classificationReason) { + public IncidentInner withStatus(IncidentStatus status) { if (this.innerProperties() == null) { this.innerProperties = new IncidentProperties(); } - this.innerProperties().withClassificationReason(classificationReason); + this.innerProperties().withStatus(status); return this; } /** - * Get the createdTimeUtc property: The time the incident was created. + * Get the classification property: The reason the incident was closed. * - * @return the createdTimeUtc value. + * @return the classification value. */ - public OffsetDateTime createdTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); + public IncidentClassification classification() { + return this.innerProperties() == null ? null : this.innerProperties().classification(); } /** - * Get the description property: The description of the incident. + * Set the classification property: The reason the incident was closed. * - * @return the description value. + * @param classification the classification value to set. + * @return the IncidentInner object itself. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public IncidentInner withClassification(IncidentClassification classification) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentProperties(); + } + this.innerProperties().withClassification(classification); + return this; } /** - * Set the description property: The description of the incident. + * Get the classificationReason property: The classification reason the incident was closed with. * - * @param description the description value to set. + * @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 withDescription(String description) { + public IncidentInner withClassificationReason(IncidentClassificationReason classificationReason) { if (this.innerProperties() == null) { this.innerProperties = new IncidentProperties(); } - this.innerProperties().withDescription(description); + this.innerProperties().withClassificationReason(classificationReason); return this; } /** - * Get the firstActivityTimeUtc property: The time of the first activity in the incident. + * Get the classificationComment property: Describes the reason the incident was closed. * - * @return the firstActivityTimeUtc value. + * @return the classificationComment value. */ - public OffsetDateTime firstActivityTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().firstActivityTimeUtc(); + public String classificationComment() { + return this.innerProperties() == null ? null : this.innerProperties().classificationComment(); } /** - * Set the firstActivityTimeUtc property: The time of the first activity in the incident. + * Set the classificationComment property: Describes the reason the incident was closed. * - * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. + * @param classificationComment the classificationComment value to set. * @return the IncidentInner object itself. */ - public IncidentInner withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + public IncidentInner withClassificationComment(String classificationComment) { if (this.innerProperties() == null) { this.innerProperties = new IncidentProperties(); } - this.innerProperties().withFirstActivityTimeUtc(firstActivityTimeUtc); + this.innerProperties().withClassificationComment(classificationComment); return this; } /** - * Get the incidentUrl property: The deep-link url to the incident in Azure portal. + * Get the owner property: Describes a user that the incident is assigned to. * - * @return the incidentUrl value. + * @return the owner value. */ - public String incidentUrl() { - return this.innerProperties() == null ? null : this.innerProperties().incidentUrl(); + public IncidentOwnerInfo owner() { + return this.innerProperties() == null ? null : this.innerProperties().owner(); } /** - * Get the incidentNumber property: A sequential number. + * Set the owner property: Describes a user that the incident is assigned to. * - * @return the incidentNumber value. + * @param owner the owner value to set. + * @return the IncidentInner object itself. */ - public Integer incidentNumber() { - return this.innerProperties() == null ? null : this.innerProperties().incidentNumber(); + public IncidentInner withOwner(IncidentOwnerInfo owner) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentProperties(); + } + this.innerProperties().withOwner(owner); + return this; } /** @@ -289,6 +338,29 @@ public IncidentInner withLabels(List labels) { 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 IncidentProperties(); + } + this.innerProperties().withFirstActivityTimeUtc(firstActivityTimeUtc); + return this; + } + /** * Get the lastActivityTimeUtc property: The time of the last activity in the incident. * @@ -322,126 +394,99 @@ public OffsetDateTime lastModifiedTimeUtc() { } /** - * Get the owner property: Describes a user that the incident is assigned to. + * Get the createdTimeUtc property: The time the incident was created. * - * @return the owner value. + * @return the createdTimeUtc value. */ - public IncidentOwnerInfo owner() { - return this.innerProperties() == null ? null : this.innerProperties().owner(); + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); } /** - * Set the owner property: Describes a user that the incident is assigned to. + * Get the incidentNumber property: A sequential number. * - * @param owner the owner value to set. - * @return the IncidentInner object itself. + * @return the incidentNumber value. */ - public IncidentInner withOwner(IncidentOwnerInfo owner) { - if (this.innerProperties() == null) { - this.innerProperties = new IncidentProperties(); - } - this.innerProperties().withOwner(owner); - return this; + public Integer incidentNumber() { + return this.innerProperties() == null ? null : this.innerProperties().incidentNumber(); } /** - * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * Get the additionalData property: Additional data on the incident. * - * @return the relatedAnalyticRuleIds value. + * @return the additionalData value. */ - public List relatedAnalyticRuleIds() { - return this.innerProperties() == null ? null : this.innerProperties().relatedAnalyticRuleIds(); + public IncidentAdditionalData additionalData() { + return this.innerProperties() == null ? null : this.innerProperties().additionalData(); } /** - * Get the severity property: The severity of the incident. + * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. * - * @return the severity value. + * @return the relatedAnalyticRuleIds value. */ - public IncidentSeverity severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); + public List relatedAnalyticRuleIds() { + return this.innerProperties() == null ? null : this.innerProperties().relatedAnalyticRuleIds(); } /** - * Set the severity property: The severity of the incident. + * Get the incidentUrl property: The deep-link url to the incident in Azure portal. * - * @param severity the severity value to set. - * @return the IncidentInner object itself. + * @return the incidentUrl value. */ - public IncidentInner withSeverity(IncidentSeverity severity) { - if (this.innerProperties() == null) { - this.innerProperties = new IncidentProperties(); - } - this.innerProperties().withSeverity(severity); - return this; + public String incidentUrl() { + return this.innerProperties() == null ? null : this.innerProperties().incidentUrl(); } /** - * Get the status property: The status of the incident. + * Get the providerName property: The name of the source provider that generated the incident. * - * @return the status value. + * @return the providerName value. */ - public IncidentStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); + public String providerName() { + return this.innerProperties() == null ? null : this.innerProperties().providerName(); } /** - * Set the status property: The status of the incident. + * Get the providerIncidentId property: The incident ID assigned by the incident provider. * - * @param status the status value to set. - * @return the IncidentInner object itself. + * @return the providerIncidentId value. */ - public IncidentInner withStatus(IncidentStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new IncidentProperties(); - } - this.innerProperties().withStatus(status); - return this; + public String providerIncidentId() { + return this.innerProperties() == null ? null : this.innerProperties().providerIncidentId(); } /** - * Get the title property: The title of the incident. + * Get the teamInformation property: Describes a team for the incident. * - * @return the title value. + * @return the teamInformation value. */ - public String title() { - return this.innerProperties() == null ? null : this.innerProperties().title(); + public TeamInformation teamInformation() { + return this.innerProperties() == null ? null : this.innerProperties().teamInformation(); } /** - * Set the title property: The title of the incident. + * Set the teamInformation property: Describes a team for the incident. * - * @param title the title value to set. + * @param teamInformation the teamInformation value to set. * @return the IncidentInner object itself. */ - public IncidentInner withTitle(String title) { + public IncidentInner withTeamInformation(TeamInformation teamInformation) { if (this.innerProperties() == null) { this.innerProperties = new IncidentProperties(); } - this.innerProperties().withTitle(title); + this.innerProperties().withTeamInformation(teamInformation); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -467,12 +512,12 @@ public static IncidentInner fromJson(JsonReader jsonReader) throws IOException { deserializedIncidentInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedIncidentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIncidentInner.innerProperties = IncidentProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { - deserializedIncidentInner.withEtag(reader.getString()); + deserializedIncidentInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedIncidentInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedIncidentInner.innerProperties = IncidentProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentProperties.java index 5345982b0317..490bc62ac6e3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentProperties.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,6 +17,7 @@ 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 java.io.IOException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; @@ -29,54 +29,54 @@ @Fluent public final class IncidentProperties implements JsonSerializable { /* - * Additional data on the incident + * The title of the incident */ - private IncidentAdditionalData additionalData; + private String title; /* - * The reason the incident was closed + * The description of the incident */ - private IncidentClassification classification; + private String description; /* - * Describes the reason the incident was closed + * The severity of the incident */ - private String classificationComment; + private IncidentSeverity severity; /* - * The classification reason the incident was closed with + * The status of the incident */ - private IncidentClassificationReason classificationReason; + private IncidentStatus status; /* - * The time the incident was created + * The reason the incident was closed */ - private OffsetDateTime createdTimeUtc; + private IncidentClassification classification; /* - * The description of the incident + * The classification reason the incident was closed with */ - private String description; + private IncidentClassificationReason classificationReason; /* - * The time of the first activity in the incident + * Describes the reason the incident was closed */ - private OffsetDateTime firstActivityTimeUtc; + private String classificationComment; /* - * The deep-link url to the incident in Azure portal + * Describes a user that the incident is assigned to */ - private String incidentUrl; + private IncidentOwnerInfo owner; /* - * A sequential number + * List of labels relevant to this incident */ - private Integer incidentNumber; + private List labels; /* - * List of labels relevant to this incident + * The time of the first activity in the incident */ - private List labels; + private OffsetDateTime firstActivityTimeUtc; /* * The time of the last activity in the incident @@ -89,9 +89,19 @@ public final class IncidentProperties implements JsonSerializable relatedAnalyticRuleIds; /* - * The severity of the incident + * The deep-link url to the incident in Azure portal */ - private IncidentSeverity severity; + private String incidentUrl; /* - * The status of the incident + * The name of the source provider that generated the incident */ - private IncidentStatus status; + private String providerName; /* - * The title of the incident + * The incident ID assigned by the incident provider */ - private String title; + private String providerIncidentId; + + /* + * Describes a team for the incident + */ + private TeamInformation teamInformation; /** * Creates an instance of IncidentProperties class. @@ -120,139 +135,163 @@ public IncidentProperties() { } /** - * Get the additionalData property: Additional data on the incident. + * Get the title property: The title of the incident. * - * @return the additionalData value. + * @return the title value. */ - public IncidentAdditionalData additionalData() { - return this.additionalData; + public String title() { + return this.title; } /** - * Get the classification property: The reason the incident was closed. + * Set the title property: The title of the incident. * - * @return the classification value. + * @param title the title value to set. + * @return the IncidentProperties object itself. */ - public IncidentClassification classification() { - return this.classification; + public IncidentProperties withTitle(String title) { + this.title = title; + return this; } /** - * Set the classification property: The reason the incident was closed. + * Get the description property: The description of the incident. * - * @param classification the classification value to set. + * @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 IncidentProperties object itself. */ - public IncidentProperties withClassification(IncidentClassification classification) { - this.classification = classification; + public IncidentProperties withDescription(String description) { + this.description = description; return this; } /** - * Get the classificationComment property: Describes the reason the incident was closed. + * Get the severity property: The severity of the incident. * - * @return the classificationComment value. + * @return the severity value. */ - public String classificationComment() { - return this.classificationComment; + public IncidentSeverity severity() { + return this.severity; } /** - * Set the classificationComment property: Describes the reason the incident was closed. + * Set the severity property: The severity of the incident. * - * @param classificationComment the classificationComment value to set. + * @param severity the severity value to set. * @return the IncidentProperties object itself. */ - public IncidentProperties withClassificationComment(String classificationComment) { - this.classificationComment = classificationComment; + public IncidentProperties withSeverity(IncidentSeverity severity) { + this.severity = severity; return this; } /** - * Get the classificationReason property: The classification reason the incident was closed with. + * Get the status property: The status of the incident. * - * @return the classificationReason value. + * @return the status value. */ - public IncidentClassificationReason classificationReason() { - return this.classificationReason; + public IncidentStatus status() { + return this.status; } /** - * Set the classificationReason property: The classification reason the incident was closed with. + * Set the status property: The status of the incident. * - * @param classificationReason the classificationReason value to set. + * @param status the status value to set. * @return the IncidentProperties object itself. */ - public IncidentProperties withClassificationReason(IncidentClassificationReason classificationReason) { - this.classificationReason = classificationReason; + public IncidentProperties withStatus(IncidentStatus status) { + this.status = status; return this; } /** - * Get the createdTimeUtc property: The time the incident was created. + * Get the classification property: The reason the incident was closed. * - * @return the createdTimeUtc value. + * @return the classification value. */ - public OffsetDateTime createdTimeUtc() { - return this.createdTimeUtc; + public IncidentClassification classification() { + return this.classification; } /** - * Get the description property: The description of the incident. + * Set the classification property: The reason the incident was closed. * - * @return the description value. + * @param classification the classification value to set. + * @return the IncidentProperties object itself. */ - public String description() { - return this.description; + public IncidentProperties withClassification(IncidentClassification classification) { + this.classification = classification; + return this; } /** - * Set the description property: The description of the incident. + * Get the classificationReason property: The classification reason the incident was closed with. * - * @param description the description value to set. + * @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 IncidentProperties object itself. */ - public IncidentProperties withDescription(String description) { - this.description = description; + public IncidentProperties withClassificationReason(IncidentClassificationReason classificationReason) { + this.classificationReason = classificationReason; return this; } /** - * Get the firstActivityTimeUtc property: The time of the first activity in the incident. + * Get the classificationComment property: Describes the reason the incident was closed. * - * @return the firstActivityTimeUtc value. + * @return the classificationComment value. */ - public OffsetDateTime firstActivityTimeUtc() { - return this.firstActivityTimeUtc; + public String classificationComment() { + return this.classificationComment; } /** - * Set the firstActivityTimeUtc property: The time of the first activity in the incident. + * Set the classificationComment property: Describes the reason the incident was closed. * - * @param firstActivityTimeUtc the firstActivityTimeUtc value to set. + * @param classificationComment the classificationComment value to set. * @return the IncidentProperties object itself. */ - public IncidentProperties withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { - this.firstActivityTimeUtc = firstActivityTimeUtc; + public IncidentProperties withClassificationComment(String classificationComment) { + this.classificationComment = classificationComment; return this; } /** - * Get the incidentUrl property: The deep-link url to the incident in Azure portal. + * Get the owner property: Describes a user that the incident is assigned to. * - * @return the incidentUrl value. + * @return the owner value. */ - public String incidentUrl() { - return this.incidentUrl; + public IncidentOwnerInfo owner() { + return this.owner; } /** - * Get the incidentNumber property: A sequential number. + * Set the owner property: Describes a user that the incident is assigned to. * - * @return the incidentNumber value. + * @param owner the owner value to set. + * @return the IncidentProperties object itself. */ - public Integer incidentNumber() { - return this.incidentNumber; + public IncidentProperties withOwner(IncidentOwnerInfo owner) { + this.owner = owner; + return this; } /** @@ -275,6 +314,26 @@ public IncidentProperties withLabels(List labels) { 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 IncidentProperties object itself. + */ + public IncidentProperties withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + this.firstActivityTimeUtc = firstActivityTimeUtc; + return this; + } + /** * Get the lastActivityTimeUtc property: The time of the last activity in the incident. * @@ -305,150 +364,114 @@ public OffsetDateTime lastModifiedTimeUtc() { } /** - * Get the owner property: Describes a user that the incident is assigned to. + * Get the createdTimeUtc property: The time the incident was created. * - * @return the owner value. + * @return the createdTimeUtc value. */ - public IncidentOwnerInfo owner() { - return this.owner; + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; } /** - * Set the owner property: Describes a user that the incident is assigned to. + * Get the incidentNumber property: A sequential number. * - * @param owner the owner value to set. - * @return the IncidentProperties object itself. + * @return the incidentNumber value. */ - public IncidentProperties withOwner(IncidentOwnerInfo owner) { - this.owner = owner; - return this; + public Integer incidentNumber() { + return this.incidentNumber; } /** - * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. + * Get the additionalData property: Additional data on the incident. * - * @return the relatedAnalyticRuleIds value. + * @return the additionalData value. */ - public List relatedAnalyticRuleIds() { - return this.relatedAnalyticRuleIds; + public IncidentAdditionalData additionalData() { + return this.additionalData; } /** - * Get the severity property: The severity of the incident. + * Get the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. * - * @return the severity value. + * @return the relatedAnalyticRuleIds value. */ - public IncidentSeverity severity() { - return this.severity; + public List relatedAnalyticRuleIds() { + return this.relatedAnalyticRuleIds; } /** - * Set the severity property: The severity of the incident. + * Get the incidentUrl property: The deep-link url to the incident in Azure portal. * - * @param severity the severity value to set. - * @return the IncidentProperties object itself. + * @return the incidentUrl value. */ - public IncidentProperties withSeverity(IncidentSeverity severity) { - this.severity = severity; - return this; + public String incidentUrl() { + return this.incidentUrl; } /** - * Get the status property: The status of the incident. + * Get the providerName property: The name of the source provider that generated the incident. * - * @return the status value. + * @return the providerName value. */ - public IncidentStatus status() { - return this.status; + public String providerName() { + return this.providerName; } /** - * Set the status property: The status of the incident. + * Get the providerIncidentId property: The incident ID assigned by the incident provider. * - * @param status the status value to set. - * @return the IncidentProperties object itself. + * @return the providerIncidentId value. */ - public IncidentProperties withStatus(IncidentStatus status) { - this.status = status; - return this; + public String providerIncidentId() { + return this.providerIncidentId; } /** - * Get the title property: The title of the incident. + * Get the teamInformation property: Describes a team for the incident. * - * @return the title value. + * @return the teamInformation value. */ - public String title() { - return this.title; + public TeamInformation teamInformation() { + return this.teamInformation; } /** - * Set the title property: The title of the incident. + * Set the teamInformation property: Describes a team for the incident. * - * @param title the title value to set. + * @param teamInformation the teamInformation value to set. * @return the IncidentProperties object itself. */ - public IncidentProperties withTitle(String title) { - this.title = title; + public IncidentProperties withTeamInformation(TeamInformation teamInformation) { + this.teamInformation = teamInformation; 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.atError() - .log(new IllegalArgumentException("Missing required property severity in model IncidentProperties")); - } - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property status in model IncidentProperties")); - } - if (title() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property title in model IncidentProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IncidentProperties.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); jsonWriter.writeStringField("classification", this.classification == null ? null : this.classification.toString()); - jsonWriter.writeStringField("classificationComment", this.classificationComment); jsonWriter.writeStringField("classificationReason", this.classificationReason == null ? null : this.classificationReason.toString()); - jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("classificationComment", this.classificationComment); + jsonWriter.writeJsonField("owner", this.owner); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("firstActivityTimeUtc", this.firstActivityTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstActivityTimeUtc)); - jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("lastActivityTimeUtc", this.lastActivityTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActivityTimeUtc)); - jsonWriter.writeJsonField("owner", this.owner); + jsonWriter.writeJsonField("teamInformation", this.teamInformation); return jsonWriter.writeEndObject(); } @@ -468,48 +491,54 @@ public static IncidentProperties fromJson(JsonReader jsonReader) throws IOExcept String fieldName = reader.getFieldName(); reader.nextToken(); - if ("severity".equals(fieldName)) { + if ("title".equals(fieldName)) { + deserializedIncidentProperties.title = reader.getString(); + } else if ("severity".equals(fieldName)) { deserializedIncidentProperties.severity = IncidentSeverity.fromString(reader.getString()); } else if ("status".equals(fieldName)) { deserializedIncidentProperties.status = IncidentStatus.fromString(reader.getString()); - } else if ("title".equals(fieldName)) { - deserializedIncidentProperties.title = reader.getString(); - } else if ("additionalData".equals(fieldName)) { - deserializedIncidentProperties.additionalData = IncidentAdditionalData.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedIncidentProperties.description = reader.getString(); } else if ("classification".equals(fieldName)) { deserializedIncidentProperties.classification = IncidentClassification.fromString(reader.getString()); - } else if ("classificationComment".equals(fieldName)) { - deserializedIncidentProperties.classificationComment = reader.getString(); } else if ("classificationReason".equals(fieldName)) { deserializedIncidentProperties.classificationReason = IncidentClassificationReason.fromString(reader.getString()); - } else if ("createdTimeUtc".equals(fieldName)) { - deserializedIncidentProperties.createdTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("description".equals(fieldName)) { - deserializedIncidentProperties.description = reader.getString(); - } else if ("firstActivityTimeUtc".equals(fieldName)) { - deserializedIncidentProperties.firstActivityTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("incidentUrl".equals(fieldName)) { - deserializedIncidentProperties.incidentUrl = reader.getString(); - } else if ("incidentNumber".equals(fieldName)) { - deserializedIncidentProperties.incidentNumber = reader.getNullable(JsonReader::getInt); + } else if ("classificationComment".equals(fieldName)) { + deserializedIncidentProperties.classificationComment = reader.getString(); + } else if ("owner".equals(fieldName)) { + deserializedIncidentProperties.owner = IncidentOwnerInfo.fromJson(reader); } else if ("labels".equals(fieldName)) { List labels = reader.readArray(reader1 -> IncidentLabel.fromJson(reader1)); deserializedIncidentProperties.labels = labels; + } else if ("firstActivityTimeUtc".equals(fieldName)) { + deserializedIncidentProperties.firstActivityTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("lastActivityTimeUtc".equals(fieldName)) { deserializedIncidentProperties.lastActivityTimeUtc = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("lastModifiedTimeUtc".equals(fieldName)) { deserializedIncidentProperties.lastModifiedTimeUtc = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("owner".equals(fieldName)) { - deserializedIncidentProperties.owner = IncidentOwnerInfo.fromJson(reader); + } else if ("createdTimeUtc".equals(fieldName)) { + deserializedIncidentProperties.createdTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("incidentNumber".equals(fieldName)) { + deserializedIncidentProperties.incidentNumber = reader.getNullable(JsonReader::getInt); + } else if ("additionalData".equals(fieldName)) { + deserializedIncidentProperties.additionalData = IncidentAdditionalData.fromJson(reader); } else if ("relatedAnalyticRuleIds".equals(fieldName)) { List relatedAnalyticRuleIds = reader.readArray(reader1 -> reader1.getString()); deserializedIncidentProperties.relatedAnalyticRuleIds = relatedAnalyticRuleIds; + } else if ("incidentUrl".equals(fieldName)) { + deserializedIncidentProperties.incidentUrl = reader.getString(); + } else if ("providerName".equals(fieldName)) { + deserializedIncidentProperties.providerName = reader.getString(); + } else if ("providerIncidentId".equals(fieldName)) { + deserializedIncidentProperties.providerIncidentId = reader.getString(); + } else if ("teamInformation".equals(fieldName)) { + deserializedIncidentProperties.teamInformation = TeamInformation.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskInner.java new file mode 100644 index 000000000000..1058e0347f44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskInner.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Describes incident task properties. + */ +@Fluent +public final class IncidentTaskInner extends ProxyResource { + /* + * Describes the properties of an incident task + */ + private IncidentTaskProperties innerProperties = new IncidentTaskProperties(); + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IncidentTaskInner class. + */ + public IncidentTaskInner() { + } + + /** + * Get the innerProperties property: Describes the properties of an incident task. + * + * @return the innerProperties value. + */ + private IncidentTaskProperties innerProperties() { + return this.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 IncidentTaskInner object itself. + */ + public IncidentTaskInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the title property: The title of the task. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Set the title property: The title of the task. + * + * @param title the title value to set. + * @return the IncidentTaskInner object itself. + */ + public IncidentTaskInner withTitle(String title) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentTaskProperties(); + } + this.innerProperties().withTitle(title); + return this; + } + + /** + * Get the description property: The description of the task. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the task. + * + * @param description the description value to set. + * @return the IncidentTaskInner object itself. + */ + public IncidentTaskInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentTaskProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the status property: The status of the task. + * + * @return the status value. + */ + public IncidentTaskStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the task. + * + * @param status the status value to set. + * @return the IncidentTaskInner object itself. + */ + public IncidentTaskInner withStatus(IncidentTaskStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentTaskProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the createdTimeUtc property: The time the task 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 task was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Get the createdBy property: Information on the client (user or application) that made some action. + * + * @return the createdBy value. + */ + public ClientInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Set the createdBy property: Information on the client (user or application) that made some action. + * + * @param createdBy the createdBy value to set. + * @return the IncidentTaskInner object itself. + */ + public IncidentTaskInner withCreatedBy(ClientInfo createdBy) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentTaskProperties(); + } + this.innerProperties().withCreatedBy(createdBy); + return this; + } + + /** + * Get the lastModifiedBy property: Information on the client (user or application) that made some action. + * + * @return the lastModifiedBy value. + */ + public ClientInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Set the lastModifiedBy property: Information on the client (user or application) that made some action. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the IncidentTaskInner object itself. + */ + public IncidentTaskInner withLastModifiedBy(ClientInfo lastModifiedBy) { + if (this.innerProperties() == null) { + this.innerProperties = new IncidentTaskProperties(); + } + this.innerProperties().withLastModifiedBy(lastModifiedBy); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncidentTaskInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncidentTaskInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IncidentTaskInner. + */ + public static IncidentTaskInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncidentTaskInner deserializedIncidentTaskInner = new IncidentTaskInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIncidentTaskInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIncidentTaskInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIncidentTaskInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIncidentTaskInner.innerProperties = IncidentTaskProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedIncidentTaskInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedIncidentTaskInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIncidentTaskInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskProperties.java new file mode 100644 index 000000000000..b11227023b80 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskProperties.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Describes the properties of an incident task. + */ +@Fluent +public final class IncidentTaskProperties implements JsonSerializable { + /* + * The title of the task + */ + private String title; + + /* + * The description of the task + */ + private String description; + + /* + * The status of the task + */ + private IncidentTaskStatus status; + + /* + * The time the task was created + */ + private OffsetDateTime createdTimeUtc; + + /* + * The last time the task was updated + */ + private OffsetDateTime lastModifiedTimeUtc; + + /* + * Information on the client (user or application) that made some action + */ + private ClientInfo createdBy; + + /* + * Information on the client (user or application) that made some action + */ + private ClientInfo lastModifiedBy; + + /** + * Creates an instance of IncidentTaskProperties class. + */ + public IncidentTaskProperties() { + } + + /** + * Get the title property: The title of the task. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The title of the task. + * + * @param title the title value to set. + * @return the IncidentTaskProperties object itself. + */ + public IncidentTaskProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: The description of the task. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the task. + * + * @param description the description value to set. + * @return the IncidentTaskProperties object itself. + */ + public IncidentTaskProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: The status of the task. + * + * @return the status value. + */ + public IncidentTaskStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the task. + * + * @param status the status value to set. + * @return the IncidentTaskProperties object itself. + */ + public IncidentTaskProperties withStatus(IncidentTaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the createdTimeUtc property: The time the task was created. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.createdTimeUtc; + } + + /** + * Get the lastModifiedTimeUtc property: The last time the task was updated. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Get the createdBy property: Information on the client (user or application) that made some action. + * + * @return the createdBy value. + */ + public ClientInfo createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: Information on the client (user or application) that made some action. + * + * @param createdBy the createdBy value to set. + * @return the IncidentTaskProperties object itself. + */ + public IncidentTaskProperties withCreatedBy(ClientInfo createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the lastModifiedBy property: Information on the client (user or application) that made some action. + * + * @return the lastModifiedBy value. + */ + public ClientInfo lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the lastModifiedBy property: Information on the client (user or application) that made some action. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the IncidentTaskProperties object itself. + */ + public IncidentTaskProperties withLastModifiedBy(ClientInfo lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("createdBy", this.createdBy); + jsonWriter.writeJsonField("lastModifiedBy", this.lastModifiedBy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncidentTaskProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncidentTaskProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IncidentTaskProperties. + */ + public static IncidentTaskProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncidentTaskProperties deserializedIncidentTaskProperties = new IncidentTaskProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedIncidentTaskProperties.title = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedIncidentTaskProperties.status = IncidentTaskStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedIncidentTaskProperties.description = reader.getString(); + } else if ("createdTimeUtc".equals(fieldName)) { + deserializedIncidentTaskProperties.createdTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedTimeUtc".equals(fieldName)) { + deserializedIncidentTaskProperties.lastModifiedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedIncidentTaskProperties.createdBy = ClientInfo.fromJson(reader); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedIncidentTaskProperties.lastModifiedBy = ClientInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIncidentTaskProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTCheckRequirementsProperties.java new file mode 100644 index 000000000000..86c16daaac11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTCheckRequirementsProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IoT requirements check properties. + */ +@Fluent +public final class IoTCheckRequirementsProperties implements JsonSerializable { + /* + * The subscription id to connect to, and get the data from. + */ + private String subscriptionId; + + /** + * Creates an instance of IoTCheckRequirementsProperties class. + */ + public IoTCheckRequirementsProperties() { + } + + /** + * 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 IoTCheckRequirementsProperties object itself. + */ + public IoTCheckRequirementsProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IoTCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IoTCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IoTCheckRequirementsProperties. + */ + public static IoTCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IoTCheckRequirementsProperties deserializedIoTCheckRequirementsProperties + = new IoTCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptionId".equals(fieldName)) { + deserializedIoTCheckRequirementsProperties.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIoTCheckRequirementsProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDataConnectorProperties.java new file mode 100644 index 000000000000..8cf7a441e2cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDataConnectorProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorWithAlertsProperties; +import java.io.IOException; + +/** + * IoT data connector properties. + */ +@Fluent +public final class IoTDataConnectorProperties extends DataConnectorWithAlertsProperties { + /* + * The subscription id to connect to, and get the data from. + */ + private String subscriptionId; + + /** + * Creates an instance of IoTDataConnectorProperties class. + */ + public IoTDataConnectorProperties() { + } + + /** + * 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 IoTDataConnectorProperties object itself. + */ + public IoTDataConnectorProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IoTDataConnectorProperties withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + super.withDataTypes(dataTypes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataTypes", dataTypes()); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IoTDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IoTDataConnectorProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IoTDataConnectorProperties. + */ + public static IoTDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IoTDataConnectorProperties deserializedIoTDataConnectorProperties = new IoTDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataTypes".equals(fieldName)) { + deserializedIoTDataConnectorProperties + .withDataTypes(AlertsDataTypeOfDataConnector.fromJson(reader)); + } else if ("subscriptionId".equals(fieldName)) { + deserializedIoTDataConnectorProperties.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIoTDataConnectorProperties; + }); + } +} 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 index 7f4b66868f1b..3abe6a470671 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -8,12 +8,12 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DeviceImportance; import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligence; import java.io.IOException; import java.util.List; import java.util.Map; -import java.util.UUID; /** * IoTDevice entity property bag. @@ -38,7 +38,7 @@ public final class IoTDeviceEntityProperties extends EntityCommonProperties { /* * The ID of the security agent running on the device */ - private UUID iotSecurityAgentId; + private String iotSecurityAgentId; /* * The type of the device @@ -105,6 +105,61 @@ public final class IoTDeviceEntityProperties extends EntityCommonProperties { */ private List protocols; + /* + * A list of owners of the IoTDevice entity. + */ + private List owners; + + /* + * A list of Nic entity ids of the IoTDevice entity. + */ + private List nicEntityIds; + + /* + * The site of the device + */ + private String site; + + /* + * The zone location of the device within a site + */ + private String zone; + + /* + * The sensor the device is monitored by + */ + private String sensor; + + /* + * The subType of the device ('PLC', 'HMI', 'EWS', etc.) + */ + private String deviceSubType; + + /* + * Device importance, determines if the device classified as 'crown jewel' + */ + private DeviceImportance importance; + + /* + * The Purdue Layer of the device + */ + private String purdueLayer; + + /* + * Determines whether the device classified as authorized device + */ + private Boolean isAuthorized; + + /* + * Determines whether the device classified as programming device + */ + private Boolean isProgramming; + + /* + * Is the device classified as a scanner device + */ + private Boolean isScanner; + /* * 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. @@ -119,7 +174,7 @@ public final class IoTDeviceEntityProperties extends EntityCommonProperties { /** * Creates an instance of IoTDeviceEntityProperties class. */ - public IoTDeviceEntityProperties() { + private IoTDeviceEntityProperties() { } /** @@ -154,7 +209,7 @@ public String source() { * * @return the iotSecurityAgentId value. */ - public UUID iotSecurityAgentId() { + public String iotSecurityAgentId() { return this.iotSecurityAgentId; } @@ -275,6 +330,105 @@ public List protocols() { return this.protocols; } + /** + * Get the owners property: A list of owners of the IoTDevice entity. + * + * @return the owners value. + */ + public List owners() { + return this.owners; + } + + /** + * Get the nicEntityIds property: A list of Nic entity ids of the IoTDevice entity. + * + * @return the nicEntityIds value. + */ + public List nicEntityIds() { + return this.nicEntityIds; + } + + /** + * Get the site property: The site of the device. + * + * @return the site value. + */ + public String site() { + return this.site; + } + + /** + * Get the zone property: The zone location of the device within a site. + * + * @return the zone value. + */ + public String zone() { + return this.zone; + } + + /** + * Get the sensor property: The sensor the device is monitored by. + * + * @return the sensor value. + */ + public String sensor() { + return this.sensor; + } + + /** + * Get the deviceSubType property: The subType of the device ('PLC', 'HMI', 'EWS', etc.). + * + * @return the deviceSubType value. + */ + public String deviceSubType() { + return this.deviceSubType; + } + + /** + * Get the importance property: Device importance, determines if the device classified as 'crown jewel'. + * + * @return the importance value. + */ + public DeviceImportance importance() { + return this.importance; + } + + /** + * Get the purdueLayer property: The Purdue Layer of the device. + * + * @return the purdueLayer value. + */ + public String purdueLayer() { + return this.purdueLayer; + } + + /** + * Get the isAuthorized property: Determines whether the device classified as authorized device. + * + * @return the isAuthorized value. + */ + public Boolean isAuthorized() { + return this.isAuthorized; + } + + /** + * Get the isProgramming property: Determines whether the device classified as programming device. + * + * @return the isProgramming value. + */ + public Boolean isProgramming() { + return this.isProgramming; + } + + /** + * Get the isScanner property: Is the device classified as a scanner device. + * + * @return the isScanner value. + */ + public Boolean isScanner() { + return this.isScanner; + } + /** * 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. @@ -297,24 +451,13 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (threatIntelligence() != null) { - threatIntelligence().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("importance", this.importance == null ? null : this.importance.toString()); return jsonWriter.writeEndObject(); } @@ -345,8 +488,7 @@ public static IoTDeviceEntityProperties fromJson(JsonReader jsonReader) throws I } else if ("source".equals(fieldName)) { deserializedIoTDeviceEntityProperties.source = reader.getString(); } else if ("iotSecurityAgentId".equals(fieldName)) { - deserializedIoTDeviceEntityProperties.iotSecurityAgentId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedIoTDeviceEntityProperties.iotSecurityAgentId = reader.getString(); } else if ("deviceType".equals(fieldName)) { deserializedIoTDeviceEntityProperties.deviceType = reader.getString(); } else if ("vendor".equals(fieldName)) { @@ -376,6 +518,30 @@ public static IoTDeviceEntityProperties fromJson(JsonReader jsonReader) throws I } else if ("protocols".equals(fieldName)) { List protocols = reader.readArray(reader1 -> reader1.getString()); deserializedIoTDeviceEntityProperties.protocols = protocols; + } else if ("owners".equals(fieldName)) { + List owners = reader.readArray(reader1 -> reader1.getString()); + deserializedIoTDeviceEntityProperties.owners = owners; + } else if ("nicEntityIds".equals(fieldName)) { + List nicEntityIds = reader.readArray(reader1 -> reader1.getString()); + deserializedIoTDeviceEntityProperties.nicEntityIds = nicEntityIds; + } else if ("site".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.site = reader.getString(); + } else if ("zone".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.zone = reader.getString(); + } else if ("sensor".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.sensor = reader.getString(); + } else if ("deviceSubType".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.deviceSubType = reader.getString(); + } else if ("importance".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.importance = DeviceImportance.fromString(reader.getString()); + } else if ("purdueLayer".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.purdueLayer = reader.getString(); + } else if ("isAuthorized".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.isAuthorized = reader.getNullable(JsonReader::getBoolean); + } else if ("isProgramming".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.isProgramming = reader.getNullable(JsonReader::getBoolean); + } else if ("isScanner".equals(fieldName)) { + deserializedIoTDeviceEntityProperties.isScanner = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } 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 index c5bc53567990..4a2dcc1feb44 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -49,7 +49,7 @@ public final class IpEntityProperties extends EntityCommonProperties { /** * Creates an instance of IpEntityProperties class. */ - public IpEntityProperties() { + private IpEntityProperties() { } /** @@ -101,21 +101,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (location() != null) { - location().validate(); - } - if (threatIntelligence() != null) { - threatIntelligence().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobInner.java new file mode 100644 index 000000000000..be12aae608ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobInner.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.JobItem; +import com.azure.resourcemanager.securityinsights.models.JobProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The assignment job. + */ +@Immutable +public final class JobInner extends ProxyResource { + /* + * The job object + */ + private JobProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of JobInner class. + */ + private JobInner() { + } + + /** + * Get the innerProperties property: The job object. + * + * @return the innerProperties value. + */ + private JobProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the endTime property: The time the job completed. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.innerProperties() == null ? null : this.innerProperties().endTime(); + } + + /** + * Get the items property: List of items published by the job. + * + * @return the items value. + */ + public List items() { + return this.innerProperties() == null ? null : this.innerProperties().items(); + } + + /** + * Get the provisioningState property: State of the job. + * + * @return the provisioningState value. + */ + public JobProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the startTime property: The time the job started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.innerProperties() == null ? null : this.innerProperties().startTime(); + } + + /** + * Get the errorMessage property: Message to describe error, if an error exists. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JobInner. + */ + public static JobInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobInner deserializedJobInner = new JobInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedJobInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedJobInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedJobInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedJobInner.innerProperties = JobProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedJobInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedJobInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedJobInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobProperties.java new file mode 100644 index 000000000000..ac0262d1a452 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.JobItem; +import com.azure.resourcemanager.securityinsights.models.JobProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The job properties. + */ +@Immutable +public final class JobProperties implements JsonSerializable { + /* + * The time the job completed + */ + private OffsetDateTime endTime; + + /* + * List of items published by the job + */ + private List items; + + /* + * State of the job + */ + private JobProvisioningState provisioningState; + + /* + * The time the job started + */ + private OffsetDateTime startTime; + + /* + * Message to describe error, if an error exists + */ + private String errorMessage; + + /** + * Creates an instance of JobProperties class. + */ + private JobProperties() { + } + + /** + * Get the endTime property: The time the job completed. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the items property: List of items published by the job. + * + * @return the items value. + */ + public List items() { + return this.items; + } + + /** + * Get the provisioningState property: State of the job. + * + * @return the provisioningState value. + */ + public JobProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the startTime property: The time the job started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the errorMessage property: Message to describe error, if an error exists. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the JobProperties. + */ + public static JobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobProperties deserializedJobProperties = new JobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endTime".equals(fieldName)) { + deserializedJobProperties.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("items".equals(fieldName)) { + List items = reader.readArray(reader1 -> JobItem.fromJson(reader1)); + deserializedJobProperties.items = items; + } else if ("provisioningState".equals(fieldName)) { + deserializedJobProperties.provisioningState = JobProvisioningState.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedJobProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("errorMessage".equals(fieldName)) { + deserializedJobProperties.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobProperties; + }); + } +} 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..8ed38d642856 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MCASCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * MCAS (Microsoft Cloud App Security) requirements check properties. + */ +@Fluent +public final class MCASCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of MCASCheckRequirementsProperties class. + */ + public MCASCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public MCASCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MCASCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MCASCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MCASCheckRequirementsProperties. + */ + public static MCASCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MCASCheckRequirementsProperties deserializedMCASCheckRequirementsProperties + = new MCASCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMCASCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMCASCheckRequirementsProperties; + }); + } +} 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..3153fcb52417 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MCASDataConnectorProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.McasDataConnectorDataTypes; +import java.io.IOException; + +/** + * MCAS (Microsoft Cloud App Security) data connector properties. + */ +@Fluent +public final class MCASDataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + private McasDataConnectorDataTypes dataTypes; + + /** + * Creates an instance of MCASDataConnectorProperties class. + */ + public MCASDataConnectorProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MCASDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MCASDataConnectorProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MCASDataConnectorProperties. + */ + public static MCASDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MCASDataConnectorProperties deserializedMCASDataConnectorProperties = new MCASDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMCASDataConnectorProperties.withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedMCASDataConnectorProperties.dataTypes = McasDataConnectorDataTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMCASDataConnectorProperties; + }); + } +} 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..e13034a4cb6e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MDATPCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. + */ +@Fluent +public final class MDATPCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of MDATPCheckRequirementsProperties class. + */ + public MDATPCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public MDATPCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MDATPCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MDATPCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MDATPCheckRequirementsProperties. + */ + public static MDATPCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MDATPCheckRequirementsProperties deserializedMDATPCheckRequirementsProperties + = new MDATPCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMDATPCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMDATPCheckRequirementsProperties; + }); + } +} 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 similarity index 68% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MdatpDataConnectorProperties.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MDATPDataConnectorProperties.java index 96c17372eca8..6de4fc544708 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -16,7 +16,7 @@ * MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. */ @Fluent -public final class MdatpDataConnectorProperties implements JsonSerializable { +public final class MDATPDataConnectorProperties implements JsonSerializable { /* * The tenant id to connect to, and get the data from. */ @@ -28,9 +28,9 @@ public final class MdatpDataConnectorProperties implements JsonSerializable { - MdatpDataConnectorProperties deserializedMdatpDataConnectorProperties = new MdatpDataConnectorProperties(); + MDATPDataConnectorProperties deserializedMDATPDataConnectorProperties = new MDATPDataConnectorProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("tenantId".equals(fieldName)) { - deserializedMdatpDataConnectorProperties.tenantId = reader.getString(); + deserializedMDATPDataConnectorProperties.tenantId = reader.getString(); } else if ("dataTypes".equals(fieldName)) { - deserializedMdatpDataConnectorProperties.dataTypes = AlertsDataTypeOfDataConnector.fromJson(reader); + deserializedMDATPDataConnectorProperties.dataTypes = AlertsDataTypeOfDataConnector.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedMdatpDataConnectorProperties; + return deserializedMDATPDataConnectorProperties; }); } } 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..e33e7e0409db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * MLBehaviorAnalytics alert rule base property bag. + */ +@Fluent +public final class MLBehaviorAnalyticsAlertRuleProperties + implements JsonSerializable { + /* + * The Name of the alert rule template used to create this rule. + */ + private String alertRuleTemplateName; + + /* + * The description of the alert rule. + */ + private String description; + + /* + * The display name for alerts created by this alert rule. + */ + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + private boolean enabled; + + /* + * The last time that this alert rule has been modified. + */ + private OffsetDateTime lastModifiedUtc; + + /* + * The severity for alerts created by this alert rule. + */ + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + private List tactics; + + /* + * The techniques of the alert rule + */ + private List techniques; + + /* + * The sub-techniques of the alert rule + */ + private List subTechniques; + + /** + * Creates an instance of MLBehaviorAnalyticsAlertRuleProperties class. + */ + public MLBehaviorAnalyticsAlertRuleProperties() { + } + + /** + * 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; + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.subTechniques; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("alertRuleTemplateName", this.alertRuleTemplateName); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLBehaviorAnalyticsAlertRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLBehaviorAnalyticsAlertRuleProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MLBehaviorAnalyticsAlertRuleProperties. + */ + public static MLBehaviorAnalyticsAlertRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLBehaviorAnalyticsAlertRuleProperties deserializedMLBehaviorAnalyticsAlertRuleProperties + = new MLBehaviorAnalyticsAlertRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertRuleTemplateName".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleProperties.alertRuleTemplateName = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleProperties.enabled = reader.getBoolean(); + } else if ("description".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleProperties.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleProperties.displayName = reader.getString(); + } else if ("lastModifiedUtc".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleProperties.lastModifiedUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("severity".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleProperties.severity + = AlertSeverity.fromString(reader.getString()); + } else if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedMLBehaviorAnalyticsAlertRuleProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedMLBehaviorAnalyticsAlertRuleProperties.techniques = techniques; + } else if ("subTechniques".equals(fieldName)) { + List subTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedMLBehaviorAnalyticsAlertRuleProperties.subTechniques = subTechniques; + } else { + reader.skipChildren(); + } + } + + return deserializedMLBehaviorAnalyticsAlertRuleProperties; + }); + } +} 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..79572780ff36 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateWithMitreProperties; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * MLBehaviorAnalytics alert rule template properties. + */ +@Immutable +public final class MLBehaviorAnalyticsAlertRuleTemplateProperties extends AlertRuleTemplateWithMitreProperties { + /* + * The severity for alerts created by this alert rule. + */ + private AlertSeverity severity; + + /* + * The techniques of the alert rule + */ + private List techniques; + + /* + * The tactics of the alert rule + */ + private List tactics; + + /* + * The alert rule template status. + */ + private TemplateStatus status; + + /* + * The required data sources for this template + */ + private List requiredDataConnectors; + + /* + * The display name for alert rule template. + */ + private String displayName; + + /* + * The description of the alert rule template. + */ + private String description; + + /* + * The time that this alert rule template has been added. + */ + private OffsetDateTime createdDateUtc; + + /* + * The last time that this alert rule template has been updated. + */ + private OffsetDateTime lastUpdatedDateUtc; + + /* + * The number of alert rules that were created by this template + */ + private Integer alertRulesCreatedByTemplateCount; + + /** + * Creates an instance of MLBehaviorAnalyticsAlertRuleTemplateProperties class. + */ + private MLBehaviorAnalyticsAlertRuleTemplateProperties() { + } + + /** + * 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 techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + @Override + public List techniques() { + return this.techniques; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + @Override + public List tactics() { + return this.tactics; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + @Override + public TemplateStatus status() { + return this.status; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + @Override + public List requiredDataConnectors() { + return this.requiredDataConnectors; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + @Override + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + @Override + public String description() { + return this.description; + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + @Override + public OffsetDateTime createdDateUtc() { + return this.createdDateUtc; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + @Override + public OffsetDateTime lastUpdatedDateUtc() { + return this.lastUpdatedDateUtc; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + @Override + public Integer alertRulesCreatedByTemplateCount() { + return this.alertRulesCreatedByTemplateCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("alertRulesCreatedByTemplateCount", alertRulesCreatedByTemplateCount()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeArrayField("requiredDataConnectors", requiredDataConnectors(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeArrayField("tactics", tactics(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("techniques", techniques(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLBehaviorAnalyticsAlertRuleTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLBehaviorAnalyticsAlertRuleTemplateProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MLBehaviorAnalyticsAlertRuleTemplateProperties. + */ + public static MLBehaviorAnalyticsAlertRuleTemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLBehaviorAnalyticsAlertRuleTemplateProperties deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties + = new MLBehaviorAnalyticsAlertRuleTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertRulesCreatedByTemplateCount".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.alertRulesCreatedByTemplateCount + = reader.getNullable(JsonReader::getInt); + } else if ("lastUpdatedDateUTC".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.lastUpdatedDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateUTC".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.createdDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.displayName = reader.getString(); + } else if ("requiredDataConnectors".equals(fieldName)) { + List requiredDataConnectors + = reader.readArray(reader1 -> AlertRuleTemplateDataSource.fromJson(reader1)); + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.requiredDataConnectors + = requiredDataConnectors; + } else if ("status".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.status + = TemplateStatus.fromString(reader.getString()); + } else if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.techniques = techniques; + } else if ("severity".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties.severity + = AlertSeverity.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMLBehaviorAnalyticsAlertRuleTemplateProperties; + }); + } +} 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..95e9b627e906 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MSTICheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * Microsoft Threat Intelligence requirements check properties. + */ +@Fluent +public final class MSTICheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of MSTICheckRequirementsProperties class. + */ + public MSTICheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public MSTICheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MSTICheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MSTICheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MSTICheckRequirementsProperties. + */ + public static MSTICheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MSTICheckRequirementsProperties deserializedMSTICheckRequirementsProperties + = new MSTICheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMSTICheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMSTICheckRequirementsProperties; + }); + } +} 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..d46494f633f7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MSTIDataConnectorProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnectorDataTypes; +import java.io.IOException; + +/** + * Microsoft Threat Intelligence data connector properties. + */ +@Fluent +public final class MSTIDataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + private MSTIDataConnectorDataTypes dataTypes; + + /** + * Creates an instance of MSTIDataConnectorProperties class. + */ + public MSTIDataConnectorProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MSTIDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MSTIDataConnectorProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MSTIDataConnectorProperties. + */ + public static MSTIDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MSTIDataConnectorProperties deserializedMSTIDataConnectorProperties = new MSTIDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMSTIDataConnectorProperties.withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedMSTIDataConnectorProperties.dataTypes = MSTIDataConnectorDataTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMSTIDataConnectorProperties; + }); + } +} 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..d5f4d45f2d40 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MTPCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * MTP (Microsoft Threat Protection) requirements check properties. + */ +@Fluent +public final class MTPCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of MTPCheckRequirementsProperties class. + */ + public MTPCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public MTPCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MTPCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MTPCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MTPCheckRequirementsProperties. + */ + public static MTPCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MTPCheckRequirementsProperties deserializedMTPCheckRequirementsProperties + = new MTPCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMTPCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMTPCheckRequirementsProperties; + }); + } +} 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..65fd6713a551 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MTPDataConnectorProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders; +import java.io.IOException; + +/** + * MTP (Microsoft Threat Protection) data connector properties. + */ +@Fluent +public final class MTPDataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + private MTPDataConnectorDataTypes dataTypes; + + /* + * The available filtered providers for the connector. + */ + private MtpFilteredProviders filteredProviders; + + /** + * Creates an instance of MTPDataConnectorProperties class. + */ + public MTPDataConnectorProperties() { + } + + /** + * 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; + } + + /** + * Get the filteredProviders property: The available filtered providers for the connector. + * + * @return the filteredProviders value. + */ + public MtpFilteredProviders filteredProviders() { + return this.filteredProviders; + } + + /** + * Set the filteredProviders property: The available filtered providers for the connector. + * + * @param filteredProviders the filteredProviders value to set. + * @return the MTPDataConnectorProperties object itself. + */ + public MTPDataConnectorProperties withFilteredProviders(MtpFilteredProviders filteredProviders) { + this.filteredProviders = filteredProviders; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MTPDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + jsonWriter.writeJsonField("filteredProviders", this.filteredProviders); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MTPDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MTPDataConnectorProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MTPDataConnectorProperties. + */ + public static MTPDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MTPDataConnectorProperties deserializedMTPDataConnectorProperties = new MTPDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMTPDataConnectorProperties.withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedMTPDataConnectorProperties.dataTypes = MTPDataConnectorDataTypes.fromJson(reader); + } else if ("filteredProviders".equals(fieldName)) { + deserializedMTPDataConnectorProperties.filteredProviders = MtpFilteredProviders.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMTPDataConnectorProperties; + }); + } +} 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 index 007493180e94..58e52d0ab2bc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -109,7 +109,7 @@ public final class MailClusterEntityProperties extends EntityCommonProperties { /** * Creates an instance of MailClusterEntityProperties class. */ - public MailClusterEntityProperties() { + private MailClusterEntityProperties() { } /** @@ -269,15 +269,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ 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 index cfc628223a54..9c9c1d5899c2 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -17,12 +17,11 @@ import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import java.util.UUID; /** * Mail message entity property bag. */ -@Fluent +@Immutable public final class MailMessageEntityProperties extends EntityCommonProperties { /* * The File entity ids of this mail message's attachments @@ -88,7 +87,7 @@ public final class MailMessageEntityProperties extends EntityCommonProperties { /* * The network message id of this mail message */ - private UUID networkMessageId; + private String networkMessageId; /* * The internet message id of this mail message @@ -164,7 +163,7 @@ public final class MailMessageEntityProperties extends EntityCommonProperties { /** * Creates an instance of MailMessageEntityProperties class. */ - public MailMessageEntityProperties() { + private MailMessageEntityProperties() { } /** @@ -281,7 +280,7 @@ public OffsetDateTime receiveDate() { * * @return the networkMessageId value. */ - public UUID networkMessageId() { + public String networkMessageId() { return this.networkMessageId; } @@ -330,17 +329,6 @@ 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. * @@ -350,17 +338,6 @@ 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. * @@ -370,17 +347,6 @@ 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. * @@ -390,17 +356,6 @@ 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. * @@ -410,17 +365,6 @@ 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. * @@ -430,17 +374,6 @@ 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. * @@ -450,17 +383,6 @@ 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. * @@ -470,17 +392,6 @@ 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; - } - /** * 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. @@ -503,15 +414,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -581,8 +483,7 @@ public static MailMessageEntityProperties fromJson(JsonReader jsonReader) throws deserializedMailMessageEntityProperties.receiveDate = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("networkMessageId".equals(fieldName)) { - deserializedMailMessageEntityProperties.networkMessageId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedMailMessageEntityProperties.networkMessageId = reader.getString(); } else if ("internetMessageId".equals(fieldName)) { deserializedMailMessageEntityProperties.internetMessageId = reader.getString(); } else if ("subject".equals(fieldName)) { 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 index c864777b63d0..0c40aede1b14 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -11,7 +11,6 @@ import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Mailbox entity property bag. @@ -37,7 +36,7 @@ public final class MailboxEntityProperties extends EntityCommonProperties { * The AzureAD identifier of mailbox. Similar to AadUserId in account entity but this property is specific to * mailbox object on office side */ - private UUID externalDirectoryObjectId; + private String externalDirectoryObjectId; /* * The graph item display name which is a short humanly readable description of the graph item instance. This @@ -53,7 +52,7 @@ public final class MailboxEntityProperties extends EntityCommonProperties { /** * Creates an instance of MailboxEntityProperties class. */ - public MailboxEntityProperties() { + private MailboxEntityProperties() { } /** @@ -89,7 +88,7 @@ public String upn() { * * @return the externalDirectoryObjectId value. */ - public UUID externalDirectoryObjectId() { + public String externalDirectoryObjectId() { return this.externalDirectoryObjectId; } @@ -115,15 +114,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -160,8 +150,7 @@ public static MailboxEntityProperties fromJson(JsonReader jsonReader) throws IOE } else if ("upn".equals(fieldName)) { deserializedMailboxEntityProperties.upn = reader.getString(); } else if ("externalDirectoryObjectId".equals(fieldName)) { - deserializedMailboxEntityProperties.externalDirectoryObjectId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedMailboxEntityProperties.externalDirectoryObjectId = reader.getString(); } else { reader.skipChildren(); } 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 index c92abb495d77..d26a1d218c45 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -52,7 +52,7 @@ public final class MalwareEntityProperties extends EntityCommonProperties { /** * Creates an instance of MalwareEntityProperties class. */ - public MalwareEntityProperties() { + private MalwareEntityProperties() { } /** @@ -113,15 +113,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ 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..cff55629eb1d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataModelInner.java @@ -0,0 +1,637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.time.LocalDate; +import java.util.List; + +/** + * Metadata resource definition. + */ +@Fluent +public final class MetadataModelInner extends ProxyResource { + /* + * Metadata properties + */ + private MetadataProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MetadataModelInner class. + */ + public MetadataModelInner() { + } + + /** + * Get the innerProperties property: Metadata properties. + * + * @return the innerProperties value. + */ + private MetadataProperties innerProperties() { + return this.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 MetadataModelInner object itself. + */ + public MetadataModelInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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 String 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(String 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 of 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 of 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 of 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 of 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; + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.innerProperties() == null ? null : this.innerProperties().customVersion(); + } + + /** + * Set the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion the customVersion value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withCustomVersion(String customVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withCustomVersion(customVersion); + return this; + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentSchemaVersion(); + } + + /** + * Set the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withContentSchemaVersion(String contentSchemaVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @return the icon value. + */ + public String icon() { + return this.innerProperties() == null ? null : this.innerProperties().icon(); + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @param icon the icon value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withIcon(String icon) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withIcon(icon); + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTactics(); + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withThreatAnalysisTactics(List threatAnalysisTactics) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTechniques(); + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withThreatAnalysisTechniques(List threatAnalysisTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.innerProperties() == null ? null : this.innerProperties().previewImages(); + } + + /** + * Set the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @param previewImages the previewImages value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withPreviewImages(List previewImages) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withPreviewImages(previewImages); + return this; + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.innerProperties() == null ? null : this.innerProperties().previewImagesDark(); + } + + /** + * Set the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @param previewImagesDark the previewImagesDark value to set. + * @return the MetadataModelInner object itself. + */ + public MetadataModelInner withPreviewImagesDark(List previewImagesDark) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataProperties(); + } + this.innerProperties().withPreviewImagesDark(previewImagesDark); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataModelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataModelInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetadataModelInner. + */ + public static MetadataModelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataModelInner deserializedMetadataModelInner = new MetadataModelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMetadataModelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMetadataModelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMetadataModelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMetadataModelInner.innerProperties = MetadataProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedMetadataModelInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedMetadataModelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataModelInner; + }); + } +} 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..f3f8b3db77a8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataProperties.java @@ -0,0 +1,637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Metadata property bag. + */ +@Fluent +public final class MetadataProperties implements JsonSerializable { + /* + * 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. Can be optionally set for user created content to + * define dependencies. If an active content item is made from a template, both will have the same 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) + */ + 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 + */ + private String version; + + /* + * The kind of content the metadata is for. + */ + private String kind; + + /* + * Source of the content. This is where/how it was created. + */ + private MetadataSource source; + + /* + * The creator of the content item. + */ + private MetadataAuthor author; + + /* + * Support information for the metadata - type, name, contact information + */ + 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. + */ + private MetadataDependencies dependencies; + + /* + * Categories for the solution content item + */ + private MetadataCategories categories; + + /* + * Providers for the solution content item + */ + private List providers; + + /* + * first publish date of solution content item + */ + private LocalDate firstPublishDate; + + /* + * last publish date of solution content item + */ + private LocalDate lastPublishDate; + + /* + * The custom version of the content. A optional free text + */ + private String customVersion; + + /* + * Schema version of the content. Can be used to distinguish between different flow based on the schema version + */ + private String contentSchemaVersion; + + /* + * the icon identifier. this id can later be fetched from the solution template + */ + private String icon; + + /* + * the tactics the resource covers + */ + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + private List threatAnalysisTechniques; + + /* + * preview image file names. These will be taken from the solution artifacts + */ + private List previewImages; + + /* + * preview image file names. These will be taken from the solution artifacts. used for dark theme support + */ + private List previewImagesDark; + + /** + * Creates an instance of MetadataProperties class. + */ + public MetadataProperties() { + } + + /** + * 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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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 String 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(String 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 of solution content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Set the firstPublishDate property: first publish date of 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 of solution content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Set the lastPublishDate property: last publish date of 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; + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.customVersion; + } + + /** + * Set the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion the customVersion value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withCustomVersion(String customVersion) { + this.customVersion = customVersion; + return this; + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.contentSchemaVersion; + } + + /** + * Set the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withContentSchemaVersion(String contentSchemaVersion) { + this.contentSchemaVersion = contentSchemaVersion; + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @param icon the icon value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withIcon(String icon) { + this.icon = icon; + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.threatAnalysisTactics; + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withThreatAnalysisTactics(List threatAnalysisTactics) { + this.threatAnalysisTactics = threatAnalysisTactics; + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.threatAnalysisTechniques; + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withThreatAnalysisTechniques(List threatAnalysisTechniques) { + this.threatAnalysisTechniques = threatAnalysisTechniques; + return this; + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.previewImages; + } + + /** + * Set the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @param previewImages the previewImages value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withPreviewImages(List previewImages) { + this.previewImages = previewImages; + return this; + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.previewImagesDark; + } + + /** + * Set the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @param previewImagesDark the previewImagesDark value to set. + * @return the MetadataProperties object itself. + */ + public MetadataProperties withPreviewImagesDark(List previewImagesDark) { + this.previewImagesDark = previewImagesDark; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("parentId", this.parentId); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeStringField("contentId", this.contentId); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("author", this.author); + jsonWriter.writeJsonField("support", this.support); + jsonWriter.writeJsonField("dependencies", this.dependencies); + jsonWriter.writeJsonField("categories", this.categories); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstPublishDate", Objects.toString(this.firstPublishDate, null)); + jsonWriter.writeStringField("lastPublishDate", Objects.toString(this.lastPublishDate, null)); + jsonWriter.writeStringField("customVersion", this.customVersion); + jsonWriter.writeStringField("contentSchemaVersion", this.contentSchemaVersion); + jsonWriter.writeStringField("icon", this.icon); + jsonWriter.writeArrayField("threatAnalysisTactics", this.threatAnalysisTactics, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threatAnalysisTechniques", this.threatAnalysisTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImages", this.previewImages, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImagesDark", this.previewImagesDark, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetadataProperties. + */ + public static MetadataProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataProperties deserializedMetadataProperties = new MetadataProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parentId".equals(fieldName)) { + deserializedMetadataProperties.parentId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedMetadataProperties.kind = reader.getString(); + } else if ("contentId".equals(fieldName)) { + deserializedMetadataProperties.contentId = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedMetadataProperties.version = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedMetadataProperties.source = MetadataSource.fromJson(reader); + } else if ("author".equals(fieldName)) { + deserializedMetadataProperties.author = MetadataAuthor.fromJson(reader); + } else if ("support".equals(fieldName)) { + deserializedMetadataProperties.support = MetadataSupport.fromJson(reader); + } else if ("dependencies".equals(fieldName)) { + deserializedMetadataProperties.dependencies = MetadataDependencies.fromJson(reader); + } else if ("categories".equals(fieldName)) { + deserializedMetadataProperties.categories = MetadataCategories.fromJson(reader); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataProperties.providers = providers; + } else if ("firstPublishDate".equals(fieldName)) { + deserializedMetadataProperties.firstPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("lastPublishDate".equals(fieldName)) { + deserializedMetadataProperties.lastPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("customVersion".equals(fieldName)) { + deserializedMetadataProperties.customVersion = reader.getString(); + } else if ("contentSchemaVersion".equals(fieldName)) { + deserializedMetadataProperties.contentSchemaVersion = reader.getString(); + } else if ("icon".equals(fieldName)) { + deserializedMetadataProperties.icon = reader.getString(); + } else if ("threatAnalysisTactics".equals(fieldName)) { + List threatAnalysisTactics = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataProperties.threatAnalysisTactics = threatAnalysisTactics; + } else if ("threatAnalysisTechniques".equals(fieldName)) { + List threatAnalysisTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataProperties.threatAnalysisTechniques = threatAnalysisTechniques; + } else if ("previewImages".equals(fieldName)) { + List previewImages = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataProperties.previewImages = previewImages; + } else if ("previewImagesDark".equals(fieldName)) { + List previewImagesDark = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataProperties.previewImagesDark = previewImagesDark; + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataProperties; + }); + } +} 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..d36894670e8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Metadata property bag for patch requests. This is the same as the MetadataProperties, but with nothing required. + */ +@Fluent +public final class MetadataPropertiesPatch implements JsonSerializable { + /* + * 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. Can be optionally set for user created content to + * define dependencies. If an active content item is made from a template, both will have the same 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) + */ + 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 + */ + private String version; + + /* + * The kind of content the metadata is for. + */ + private String kind; + + /* + * Source of the content. This is where/how it was created. + */ + private MetadataSource source; + + /* + * The creator of the content item. + */ + private MetadataAuthor author; + + /* + * Support information for the metadata - type, name, contact information + */ + 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. + */ + private MetadataDependencies dependencies; + + /* + * Categories for the solution content item + */ + private MetadataCategories categories; + + /* + * Providers for the solution content item + */ + private List providers; + + /* + * first publish date of solution content item + */ + private LocalDate firstPublishDate; + + /* + * last publish date of solution content item + */ + private LocalDate lastPublishDate; + + /* + * The custom version of the content. A optional free text + */ + private String customVersion; + + /* + * Schema version of the content. Can be used to distinguish between different flow based on the schema version + */ + private String contentSchemaVersion; + + /* + * the icon identifier. this id can later be fetched from the solution template + */ + private String icon; + + /* + * the tactics the resource covers + */ + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + private List threatAnalysisTechniques; + + /* + * preview image file names. These will be taken from the solution artifacts + */ + private List previewImages; + + /* + * preview image file names. These will be taken from the solution artifacts. used for dark theme support + */ + private List previewImagesDark; + + /** + * Creates an instance of MetadataPropertiesPatch class. + */ + public MetadataPropertiesPatch() { + } + + /** + * 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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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 String 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(String 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 of solution content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Set the firstPublishDate property: first publish date of 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 of solution content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Set the lastPublishDate property: last publish date of 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; + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.customVersion; + } + + /** + * Set the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion the customVersion value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withCustomVersion(String customVersion) { + this.customVersion = customVersion; + return this; + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.contentSchemaVersion; + } + + /** + * Set the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withContentSchemaVersion(String contentSchemaVersion) { + this.contentSchemaVersion = contentSchemaVersion; + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @param icon the icon value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withIcon(String icon) { + this.icon = icon; + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.threatAnalysisTactics; + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withThreatAnalysisTactics(List threatAnalysisTactics) { + this.threatAnalysisTactics = threatAnalysisTactics; + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.threatAnalysisTechniques; + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withThreatAnalysisTechniques(List threatAnalysisTechniques) { + this.threatAnalysisTechniques = threatAnalysisTechniques; + return this; + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.previewImages; + } + + /** + * Set the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @param previewImages the previewImages value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withPreviewImages(List previewImages) { + this.previewImages = previewImages; + return this; + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.previewImagesDark; + } + + /** + * Set the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @param previewImagesDark the previewImagesDark value to set. + * @return the MetadataPropertiesPatch object itself. + */ + public MetadataPropertiesPatch withPreviewImagesDark(List previewImagesDark) { + this.previewImagesDark = previewImagesDark; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentId", this.contentId); + jsonWriter.writeStringField("parentId", this.parentId); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("author", this.author); + jsonWriter.writeJsonField("support", this.support); + jsonWriter.writeJsonField("dependencies", this.dependencies); + jsonWriter.writeJsonField("categories", this.categories); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstPublishDate", Objects.toString(this.firstPublishDate, null)); + jsonWriter.writeStringField("lastPublishDate", Objects.toString(this.lastPublishDate, null)); + jsonWriter.writeStringField("customVersion", this.customVersion); + jsonWriter.writeStringField("contentSchemaVersion", this.contentSchemaVersion); + jsonWriter.writeStringField("icon", this.icon); + jsonWriter.writeArrayField("threatAnalysisTactics", this.threatAnalysisTactics, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threatAnalysisTechniques", this.threatAnalysisTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImages", this.previewImages, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImagesDark", this.previewImagesDark, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataPropertiesPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataPropertiesPatch if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetadataPropertiesPatch. + */ + public static MetadataPropertiesPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataPropertiesPatch deserializedMetadataPropertiesPatch = new MetadataPropertiesPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentId".equals(fieldName)) { + deserializedMetadataPropertiesPatch.contentId = reader.getString(); + } else if ("parentId".equals(fieldName)) { + deserializedMetadataPropertiesPatch.parentId = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedMetadataPropertiesPatch.version = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedMetadataPropertiesPatch.kind = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedMetadataPropertiesPatch.source = MetadataSource.fromJson(reader); + } else if ("author".equals(fieldName)) { + deserializedMetadataPropertiesPatch.author = MetadataAuthor.fromJson(reader); + } else if ("support".equals(fieldName)) { + deserializedMetadataPropertiesPatch.support = MetadataSupport.fromJson(reader); + } else if ("dependencies".equals(fieldName)) { + deserializedMetadataPropertiesPatch.dependencies = MetadataDependencies.fromJson(reader); + } else if ("categories".equals(fieldName)) { + deserializedMetadataPropertiesPatch.categories = MetadataCategories.fromJson(reader); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataPropertiesPatch.providers = providers; + } else if ("firstPublishDate".equals(fieldName)) { + deserializedMetadataPropertiesPatch.firstPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("lastPublishDate".equals(fieldName)) { + deserializedMetadataPropertiesPatch.lastPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("customVersion".equals(fieldName)) { + deserializedMetadataPropertiesPatch.customVersion = reader.getString(); + } else if ("contentSchemaVersion".equals(fieldName)) { + deserializedMetadataPropertiesPatch.contentSchemaVersion = reader.getString(); + } else if ("icon".equals(fieldName)) { + deserializedMetadataPropertiesPatch.icon = reader.getString(); + } else if ("threatAnalysisTactics".equals(fieldName)) { + List threatAnalysisTactics = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataPropertiesPatch.threatAnalysisTactics = threatAnalysisTactics; + } else if ("threatAnalysisTechniques".equals(fieldName)) { + List threatAnalysisTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataPropertiesPatch.threatAnalysisTechniques = threatAnalysisTechniques; + } else if ("previewImages".equals(fieldName)) { + List previewImages = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataPropertiesPatch.previewImages = previewImages; + } else if ("previewImagesDark".equals(fieldName)) { + List previewImagesDark = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataPropertiesPatch.previewImagesDark = previewImagesDark; + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataPropertiesPatch; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionCheckRequirementsProperties.java new file mode 100644 index 000000000000..18a7051cf512 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionCheckRequirementsProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * MicrosoftPurviewInformationProtection requirements check properties. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of MicrosoftPurviewInformationProtectionCheckRequirementsProperties class. + */ + public MicrosoftPurviewInformationProtectionCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public MicrosoftPurviewInformationProtectionCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftPurviewInformationProtectionCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftPurviewInformationProtectionCheckRequirementsProperties if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * MicrosoftPurviewInformationProtectionCheckRequirementsProperties. + */ + public static MicrosoftPurviewInformationProtectionCheckRequirementsProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftPurviewInformationProtectionCheckRequirementsProperties deserializedMicrosoftPurviewInformationProtectionCheckRequirementsProperties + = new MicrosoftPurviewInformationProtectionCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionCheckRequirementsProperties + .withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMicrosoftPurviewInformationProtectionCheckRequirementsProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionDataConnectorProperties.java new file mode 100644 index 000000000000..5a81750899de --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionDataConnectorProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import java.io.IOException; + +/** + * Microsoft Purview Information Protection data connector properties. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionDataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + private MicrosoftPurviewInformationProtectionConnectorDataTypes dataTypes; + + /** + * Creates an instance of MicrosoftPurviewInformationProtectionDataConnectorProperties class. + */ + public MicrosoftPurviewInformationProtectionDataConnectorProperties() { + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public MicrosoftPurviewInformationProtectionConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the MicrosoftPurviewInformationProtectionDataConnectorProperties object itself. + */ + public MicrosoftPurviewInformationProtectionDataConnectorProperties + withDataTypes(MicrosoftPurviewInformationProtectionConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MicrosoftPurviewInformationProtectionDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftPurviewInformationProtectionDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftPurviewInformationProtectionDataConnectorProperties if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * MicrosoftPurviewInformationProtectionDataConnectorProperties. + */ + public static MicrosoftPurviewInformationProtectionDataConnectorProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftPurviewInformationProtectionDataConnectorProperties deserializedMicrosoftPurviewInformationProtectionDataConnectorProperties + = new MicrosoftPurviewInformationProtectionDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnectorProperties + .withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnectorProperties.dataTypes + = MicrosoftPurviewInformationProtectionConnectorDataTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMicrosoftPurviewInformationProtectionDataConnectorProperties; + }); + } +} 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 index e2e4d589ed16..5d62d7f63128 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -184,28 +183,6 @@ public OffsetDateTime lastModifiedUtc() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model MicrosoftSecurityIncidentCreationAlertRuleProperties")); - } - if (productFilter() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property productFilter in model MicrosoftSecurityIncidentCreationAlertRuleProperties")); - } - } - - private static final ClientLogger LOGGER - = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleProperties.class); - /** * {@inheritDoc} */ 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 index 3c26c7967755..ea7487478072 100644 --- 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 @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; 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; @@ -22,168 +21,104 @@ /** * MicrosoftSecurityIncidentCreation rule template properties. */ -@Fluent +@Immutable public final class MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - implements JsonSerializable { + extends AlertRuleTemplatePropertiesBase { /* - * the number of alert rules that were created by this template + * the alerts' displayNames on which the cases will be generated */ - private Integer alertRulesCreatedByTemplateCount; + private List displayNamesFilter; /* - * The time that this alert rule template has been added. + * the alerts' displayNames on which the cases will not be generated */ - private OffsetDateTime createdDateUtc; + private List displayNamesExcludeFilter; /* - * The time that this alert rule template was last updated. + * The alerts' productName on which the cases will be generated */ - private OffsetDateTime lastUpdatedDateUtc; + private MicrosoftSecurityProductName productFilter; /* - * The description of the alert rule template. + * the alerts' severities on which the cases will be generated */ - private String description; + private List severitiesFilter; /* - * The display name for alert rule template. + * The alert rule template status. */ - private String displayName; + private TemplateStatus status; /* - * The required data connectors for this template + * The required data sources for this template */ private List requiredDataConnectors; /* - * The alert rule template status. + * The display name for alert rule template. */ - private TemplateStatus status; + private String displayName; /* - * the alerts' displayNames on which the cases will be generated + * The description of the alert rule template. */ - private List displayNamesFilter; + private String description; /* - * the alerts' displayNames on which the cases will not be generated + * The time that this alert rule template has been added. */ - private List displayNamesExcludeFilter; + private OffsetDateTime createdDateUtc; /* - * The alerts' productName on which the cases will be generated + * The last time that this alert rule template has been updated. */ - private MicrosoftSecurityProductName productFilter; + private OffsetDateTime lastUpdatedDateUtc; /* - * the alerts' severities on which the cases will be generated + * The number of alert rules that were created by this template */ - private List severitiesFilter; + private Integer alertRulesCreatedByTemplateCount; /** * Creates an instance of MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties class. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties() { - } - - /** - * 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 MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. - */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { - this.alertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - return this; + private MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties() { } /** - * 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 lastUpdatedDateUtc property: The time that this alert rule template was last updated. - * - * @return the lastUpdatedDateUtc value. - */ - public OffsetDateTime lastUpdatedDateUtc() { - return this.lastUpdatedDateUtc; - } - - /** - * 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 MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. - */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the displayName property: The display name for alert rule template. + * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. * - * @return the displayName value. + * @return the displayNamesFilter value. */ - public String displayName() { - return this.displayName; + public List displayNamesFilter() { + return this.displayNamesFilter; } /** - * Set the displayName property: The display name for alert rule template. + * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. * - * @param displayName the displayName value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + * @return the displayNamesExcludeFilter value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; + public List displayNamesExcludeFilter() { + return this.displayNamesExcludeFilter; } /** - * Get the requiredDataConnectors property: The required data connectors for this template. + * Get the productFilter property: The alerts' productName on which the cases will be generated. * - * @return the requiredDataConnectors value. + * @return the productFilter value. */ - public List requiredDataConnectors() { - return this.requiredDataConnectors; + public MicrosoftSecurityProductName productFilter() { + return this.productFilter; } /** - * Set the requiredDataConnectors property: The required data connectors for this template. + * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. * - * @param requiredDataConnectors the requiredDataConnectors value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + * @return the severitiesFilter value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - withRequiredDataConnectors(List requiredDataConnectors) { - this.requiredDataConnectors = requiredDataConnectors; - return this; + public List severitiesFilter() { + return this.severitiesFilter; } /** @@ -191,141 +126,88 @@ public List requiredDataConnectors() { * * @return the status value. */ + @Override public TemplateStatus status() { return this.status; } /** - * Set the status property: The alert rule template status. + * Get the requiredDataConnectors property: The required data sources for this template. * - * @param status the status value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. - */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties withStatus(TemplateStatus status) { - this.status = status; - return this; - } - - /** - * 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. + * @return the requiredDataConnectors value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - withDisplayNamesExcludeFilter(List displayNamesExcludeFilter) { - this.displayNamesExcludeFilter = displayNamesExcludeFilter; - return this; + @Override + public List requiredDataConnectors() { + return this.requiredDataConnectors; } /** - * Get the productFilter property: The alerts' productName on which the cases will be generated. + * Get the displayName property: The display name for alert rule template. * - * @return the productFilter value. + * @return the displayName value. */ - public MicrosoftSecurityProductName productFilter() { - return this.productFilter; + @Override + public String displayName() { + return this.displayName; } /** - * Set the productFilter property: The alerts' productName on which the cases will be generated. + * Get the description property: The description of the alert rule template. * - * @param productFilter the productFilter value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + * @return the description value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - withProductFilter(MicrosoftSecurityProductName productFilter) { - this.productFilter = productFilter; - return this; + @Override + public String description() { + return this.description; } /** - * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. + * Get the createdDateUtc property: The time that this alert rule template has been added. * - * @return the severitiesFilter value. + * @return the createdDateUtc value. */ - public List severitiesFilter() { - return this.severitiesFilter; + @Override + public OffsetDateTime createdDateUtc() { + return this.createdDateUtc; } /** - * Set the severitiesFilter property: the alerts' severities on which the cases will be generated. + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. * - * @param severitiesFilter the severitiesFilter value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties object itself. + * @return the lastUpdatedDateUtc value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - withSeveritiesFilter(List severitiesFilter) { - this.severitiesFilter = severitiesFilter; - return this; + @Override + public OffsetDateTime lastUpdatedDateUtc() { + return this.lastUpdatedDateUtc; } /** - * Validates the instance. + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the alertRulesCreatedByTemplateCount value. */ - public void validate() { - if (requiredDataConnectors() != null) { - requiredDataConnectors().forEach(e -> e.validate()); - } - if (productFilter() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property productFilter in model MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties")); - } + @Override + public Integer alertRulesCreatedByTemplateCount() { + return this.alertRulesCreatedByTemplateCount; } - private static final ClientLogger LOGGER - = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("productFilter", this.productFilter == null ? null : this.productFilter.toString()); - jsonWriter.writeNumberField("alertRulesCreatedByTemplateCount", this.alertRulesCreatedByTemplateCount); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeArrayField("requiredDataConnectors", this.requiredDataConnectors, + jsonWriter.writeNumberField("alertRulesCreatedByTemplateCount", alertRulesCreatedByTemplateCount()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeArrayField("requiredDataConnectors", requiredDataConnectors(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); jsonWriter.writeArrayField("displayNamesFilter", this.displayNamesFilter, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("displayNamesExcludeFilter", this.displayNamesExcludeFilter, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("productFilter", this.productFilter == null ? null : this.productFilter.toString()); jsonWriter.writeArrayField("severitiesFilter", this.severitiesFilter, (writer, element) -> writer.writeString(element == null ? null : element.toString())); return jsonWriter.writeEndObject(); @@ -337,7 +219,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties if the JsonReader was * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the * MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties. */ @@ -350,18 +231,15 @@ public static MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties fromJ String fieldName = reader.getFieldName(); reader.nextToken(); - if ("productFilter".equals(fieldName)) { - deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.productFilter - = MicrosoftSecurityProductName.fromString(reader.getString()); - } else if ("alertRulesCreatedByTemplateCount".equals(fieldName)) { + if ("alertRulesCreatedByTemplateCount".equals(fieldName)) { deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.alertRulesCreatedByTemplateCount = reader.getNullable(JsonReader::getInt); - } else if ("createdDateUTC".equals(fieldName)) { - deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.createdDateUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("lastUpdatedDateUTC".equals(fieldName)) { deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.lastUpdatedDateUtc = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateUTC".equals(fieldName)) { + deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.createdDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("description".equals(fieldName)) { deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.description = reader.getString(); @@ -384,6 +262,9 @@ public static MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties fromJ List displayNamesExcludeFilter = reader.readArray(reader1 -> reader1.getString()); deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.displayNamesExcludeFilter = displayNamesExcludeFilter; + } else if ("productFilter".equals(fieldName)) { + deserializedMicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.productFilter + = MicrosoftSecurityProductName.fromString(reader.getString()); } else if ("severitiesFilter".equals(fieldName)) { List severitiesFilter = reader.readArray(reader1 -> AlertSeverity.fromString(reader1.getString())); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NicEntityProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NicEntityProperties.java new file mode 100644 index 000000000000..ea7b5c7ce2e3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NicEntityProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Nic entity property bag. + */ +@Immutable +public final class NicEntityProperties extends EntityCommonProperties { + /* + * The MAC address of this network interface + */ + private String macAddress; + + /* + * The IP entity id of this network interface + */ + private String ipAddressEntityId; + + /* + * A list of VLANs of the network interface entity. + */ + private List vlans; + + /* + * 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. + */ + private String friendlyName; + + /* + * A bag of custom fields that should be part of the entity and will be presented to the user. + */ + private Map additionalData; + + /** + * Creates an instance of NicEntityProperties class. + */ + private NicEntityProperties() { + } + + /** + * Get the macAddress property: The MAC address of this network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the ipAddressEntityId property: The IP entity id of this network interface. + * + * @return the ipAddressEntityId value. + */ + public String ipAddressEntityId() { + return this.ipAddressEntityId; + } + + /** + * Get the vlans property: A list of VLANs of the network interface entity. + * + * @return the vlans value. + */ + public List vlans() { + return this.vlans; + } + + /** + * 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. + */ + @Override + public String friendlyName() { + return this.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. + */ + @Override + public Map additionalData() { + return this.additionalData; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NicEntityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NicEntityProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NicEntityProperties. + */ + public static NicEntityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NicEntityProperties deserializedNicEntityProperties = new NicEntityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalData".equals(fieldName)) { + Map additionalData = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedNicEntityProperties.additionalData = additionalData; + } else if ("friendlyName".equals(fieldName)) { + deserializedNicEntityProperties.friendlyName = reader.getString(); + } else if ("macAddress".equals(fieldName)) { + deserializedNicEntityProperties.macAddress = reader.getString(); + } else if ("ipAddressEntityId".equals(fieldName)) { + deserializedNicEntityProperties.ipAddressEntityId = reader.getString(); + } else if ("vlans".equals(fieldName)) { + List vlans = reader.readArray(reader1 -> reader1.getString()); + deserializedNicEntityProperties.vlans = vlans; + } else { + reader.skipChildren(); + } + } + + return deserializedNicEntityProperties; + }); + } +} 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..bff2d3cd7a39 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleProperties.java @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.SentinelEntityMapping; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Nrt alert rule base property bag. + */ +@Fluent +public final class NrtAlertRuleProperties implements JsonSerializable { + /* + * The Name of the alert rule template used to create this rule. + */ + 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> + */ + private String templateVersion; + + /* + * The description of the alert rule. + */ + private String description; + + /* + * The query that creates alerts for this rule. + */ + private String query; + + /* + * The tactics of the alert rule + */ + private List tactics; + + /* + * The techniques of the alert rule + */ + private List techniques; + + /* + * The sub-techniques of the alert rule + */ + private List subTechniques; + + /* + * The display name for alerts created by this alert rule. + */ + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + private boolean enabled; + + /* + * The last time that this alert rule has been modified. + */ + private OffsetDateTime lastModifiedUtc; + + /* + * The suppression (in ISO 8601 duration format) to wait since last time this alert rule been triggered. + */ + private Duration suppressionDuration; + + /* + * Determines whether the suppression for this alert rule is enabled or disabled. + */ + private boolean suppressionEnabled; + + /* + * The severity for alerts created by this alert rule. + */ + private AlertSeverity severity; + + /* + * The settings of the incidents that created from alerts triggered by this analytics rule + */ + private IncidentConfiguration incidentConfiguration; + + /* + * Dictionary of string key-value pairs of columns to be attached to the alert + */ + private Map customDetails; + + /* + * Array of the entity mappings of the alert rule + */ + private List entityMappings; + + /* + * The alert details override settings + */ + private AlertDetailsOverride alertDetailsOverride; + + /* + * The event grouping settings. + */ + private EventGroupingSettings eventGroupingSettings; + + /* + * Array of the sentinel entity mappings of the alert rule + */ + private List sentinelEntitiesMappings; + + /** + * Creates an instance of NrtAlertRuleProperties class. + */ + public NrtAlertRuleProperties() { + } + + /** + * 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withQuery(String query) { + this.query = query; + 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Set the techniques property: The techniques of the alert rule. + * + * @param techniques the techniques value to set. + * @return the NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withTechniques(List techniques) { + this.techniques = techniques; + return this; + } + + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.subTechniques; + } + + /** + * Set the subTechniques property: The sub-techniques of the alert rule. + * + * @param subTechniques the subTechniques value to set. + * @return the NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withSubTechniques(List subTechniques) { + this.subTechniques = subTechniques; + 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withSeverity(AlertSeverity severity) { + this.severity = severity; + 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + this.alertDetailsOverride = alertDetailsOverride; + 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 NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { + this.eventGroupingSettings = eventGroupingSettings; + return this; + } + + /** + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @return the sentinelEntitiesMappings value. + */ + public List sentinelEntitiesMappings() { + return this.sentinelEntitiesMappings; + } + + /** + * Set the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @param sentinelEntitiesMappings the sentinelEntitiesMappings value to set. + * @return the NrtAlertRuleProperties object itself. + */ + public NrtAlertRuleProperties withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + this.sentinelEntitiesMappings = sentinelEntitiesMappings; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("suppressionDuration", + CoreUtils.durationToStringWithDays(this.suppressionDuration)); + jsonWriter.writeBooleanField("suppressionEnabled", this.suppressionEnabled); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeStringField("alertRuleTemplateName", this.alertRuleTemplateName); + jsonWriter.writeStringField("templateVersion", this.templateVersion); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("tactics", this.tactics, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subTechniques", this.subTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("incidentConfiguration", this.incidentConfiguration); + jsonWriter.writeMapField("customDetails", this.customDetails, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("entityMappings", this.entityMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("alertDetailsOverride", this.alertDetailsOverride); + jsonWriter.writeJsonField("eventGroupingSettings", this.eventGroupingSettings); + jsonWriter.writeArrayField("sentinelEntitiesMappings", this.sentinelEntitiesMappings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NrtAlertRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NrtAlertRuleProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NrtAlertRuleProperties. + */ + public static NrtAlertRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NrtAlertRuleProperties deserializedNrtAlertRuleProperties = new NrtAlertRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("query".equals(fieldName)) { + deserializedNrtAlertRuleProperties.query = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedNrtAlertRuleProperties.displayName = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedNrtAlertRuleProperties.enabled = reader.getBoolean(); + } else if ("suppressionDuration".equals(fieldName)) { + deserializedNrtAlertRuleProperties.suppressionDuration + = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); + } else if ("suppressionEnabled".equals(fieldName)) { + deserializedNrtAlertRuleProperties.suppressionEnabled = reader.getBoolean(); + } else if ("severity".equals(fieldName)) { + deserializedNrtAlertRuleProperties.severity = AlertSeverity.fromString(reader.getString()); + } else if ("alertRuleTemplateName".equals(fieldName)) { + deserializedNrtAlertRuleProperties.alertRuleTemplateName = reader.getString(); + } else if ("templateVersion".equals(fieldName)) { + deserializedNrtAlertRuleProperties.templateVersion = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedNrtAlertRuleProperties.description = reader.getString(); + } else if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedNrtAlertRuleProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedNrtAlertRuleProperties.techniques = techniques; + } else if ("subTechniques".equals(fieldName)) { + List subTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedNrtAlertRuleProperties.subTechniques = subTechniques; + } else if ("lastModifiedUtc".equals(fieldName)) { + deserializedNrtAlertRuleProperties.lastModifiedUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("incidentConfiguration".equals(fieldName)) { + deserializedNrtAlertRuleProperties.incidentConfiguration = IncidentConfiguration.fromJson(reader); + } else if ("customDetails".equals(fieldName)) { + Map customDetails = reader.readMap(reader1 -> reader1.getString()); + deserializedNrtAlertRuleProperties.customDetails = customDetails; + } else if ("entityMappings".equals(fieldName)) { + List entityMappings = reader.readArray(reader1 -> EntityMapping.fromJson(reader1)); + deserializedNrtAlertRuleProperties.entityMappings = entityMappings; + } else if ("alertDetailsOverride".equals(fieldName)) { + deserializedNrtAlertRuleProperties.alertDetailsOverride = AlertDetailsOverride.fromJson(reader); + } else if ("eventGroupingSettings".equals(fieldName)) { + deserializedNrtAlertRuleProperties.eventGroupingSettings = EventGroupingSettings.fromJson(reader); + } else if ("sentinelEntitiesMappings".equals(fieldName)) { + List sentinelEntitiesMappings + = reader.readArray(reader1 -> SentinelEntityMapping.fromJson(reader1)); + deserializedNrtAlertRuleProperties.sentinelEntitiesMappings = sentinelEntitiesMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedNrtAlertRuleProperties; + }); + } +} 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..33bfad3c7fb6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleTemplateProperties.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +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.SentinelEntityMapping; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * NRT alert rule template properties. + */ +@Immutable +public final class NrtAlertRuleTemplateProperties implements JsonSerializable { + /* + * The tactics of the alert rule + */ + private List tactics; + + /* + * The techniques of the alert rule + */ + private List techniques; + + /* + * The number of alert rules that were created by this template + */ + private Integer alertRulesCreatedByTemplateCount; + + /* + * The last time that this alert rule template has been updated. + */ + private OffsetDateTime lastUpdatedDateUtc; + + /* + * The time that this alert rule template has been added. + */ + private OffsetDateTime createdDateUtc; + + /* + * The description of the alert rule template. + */ + private String description; + + /* + * The display name for alert rule template. + */ + private String displayName; + + /* + * The required data sources for this template + */ + private List requiredDataConnectors; + + /* + * The alert rule template status. + */ + private TemplateStatus status; + + /* + * The query that creates alerts for this rule. + */ + private String query; + + /* + * The severity for alerts created by this alert rule. + */ + private AlertSeverity severity; + + /* + * The version of this template - in format , where all are numbers. For example <1.0.2>. + */ + private String version; + + /* + * Dictionary of string key-value pairs of columns to be attached to the alert + */ + private Map customDetails; + + /* + * Array of the entity mappings of the alert rule + */ + private List entityMappings; + + /* + * The alert details override settings + */ + private AlertDetailsOverride alertDetailsOverride; + + /* + * The event grouping settings. + */ + private EventGroupingSettings eventGroupingSettings; + + /* + * Array of the sentinel entity mappings of the alert rule + */ + private List sentinelEntitiesMappings; + + /** + * Creates an instance of NrtAlertRuleTemplateProperties class. + */ + private NrtAlertRuleTemplateProperties() { + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + public List tactics() { + return this.tactics; + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + public List requiredDataConnectors() { + return this.requiredDataConnectors; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.status; + } + + /** + * Get the query property: The query that creates alerts for this rule. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * 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 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; + } + + /** + * 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; + } + + /** + * Get the entityMappings property: Array of the entity mappings of the alert rule. + * + * @return the entityMappings value. + */ + public List entityMappings() { + return this.entityMappings; + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.alertDetailsOverride; + } + + /** + * Get the eventGroupingSettings property: The event grouping settings. + * + * @return the eventGroupingSettings value. + */ + public EventGroupingSettings eventGroupingSettings() { + return this.eventGroupingSettings; + } + + /** + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @return the sentinelEntitiesMappings value. + */ + public List sentinelEntitiesMappings() { + return this.sentinelEntitiesMappings; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tactics", this.tactics, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("alertRulesCreatedByTemplateCount", this.alertRulesCreatedByTemplateCount); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("requiredDataConnectors", this.requiredDataConnectors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeMapField("customDetails", this.customDetails, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("entityMappings", this.entityMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("alertDetailsOverride", this.alertDetailsOverride); + jsonWriter.writeJsonField("eventGroupingSettings", this.eventGroupingSettings); + jsonWriter.writeArrayField("sentinelEntitiesMappings", this.sentinelEntitiesMappings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NrtAlertRuleTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NrtAlertRuleTemplateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NrtAlertRuleTemplateProperties. + */ + public static NrtAlertRuleTemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NrtAlertRuleTemplateProperties deserializedNrtAlertRuleTemplateProperties + = new NrtAlertRuleTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedNrtAlertRuleTemplateProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedNrtAlertRuleTemplateProperties.techniques = techniques; + } else if ("alertRulesCreatedByTemplateCount".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.alertRulesCreatedByTemplateCount + = reader.getNullable(JsonReader::getInt); + } else if ("lastUpdatedDateUTC".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.lastUpdatedDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateUTC".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.createdDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.displayName = reader.getString(); + } else if ("requiredDataConnectors".equals(fieldName)) { + List requiredDataConnectors + = reader.readArray(reader1 -> AlertRuleTemplateDataSource.fromJson(reader1)); + deserializedNrtAlertRuleTemplateProperties.requiredDataConnectors = requiredDataConnectors; + } else if ("status".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.status = TemplateStatus.fromString(reader.getString()); + } else if ("query".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.query = reader.getString(); + } else if ("severity".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.severity = AlertSeverity.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.version = reader.getString(); + } else if ("customDetails".equals(fieldName)) { + Map customDetails = reader.readMap(reader1 -> reader1.getString()); + deserializedNrtAlertRuleTemplateProperties.customDetails = customDetails; + } else if ("entityMappings".equals(fieldName)) { + List entityMappings = reader.readArray(reader1 -> EntityMapping.fromJson(reader1)); + deserializedNrtAlertRuleTemplateProperties.entityMappings = entityMappings; + } else if ("alertDetailsOverride".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.alertDetailsOverride + = AlertDetailsOverride.fromJson(reader); + } else if ("eventGroupingSettings".equals(fieldName)) { + deserializedNrtAlertRuleTemplateProperties.eventGroupingSettings + = EventGroupingSettings.fromJson(reader); + } else if ("sentinelEntitiesMappings".equals(fieldName)) { + List sentinelEntitiesMappings + = reader.readArray(reader1 -> SentinelEntityMapping.fromJson(reader1)); + deserializedNrtAlertRuleTemplateProperties.sentinelEntitiesMappings = sentinelEntitiesMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedNrtAlertRuleTemplateProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectCheckRequirementsProperties.java new file mode 100644 index 000000000000..a72a4d683bf2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * Office365 Project requirements check properties. + */ +@Fluent +public final class Office365ProjectCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of Office365ProjectCheckRequirementsProperties class. + */ + public Office365ProjectCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public Office365ProjectCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Office365ProjectCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Office365ProjectCheckRequirementsProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Office365ProjectCheckRequirementsProperties. + */ + public static Office365ProjectCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Office365ProjectCheckRequirementsProperties deserializedOffice365ProjectCheckRequirementsProperties + = new Office365ProjectCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOffice365ProjectCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOffice365ProjectCheckRequirementsProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectDataConnectorProperties.java new file mode 100644 index 000000000000..6908fa685878 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectDataConnectorProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; +import java.io.IOException; + +/** + * Office Microsoft Project data connector properties. + */ +@Fluent +public final class Office365ProjectDataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + private Office365ProjectConnectorDataTypes dataTypes; + + /** + * Creates an instance of Office365ProjectDataConnectorProperties class. + */ + public Office365ProjectDataConnectorProperties() { + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public Office365ProjectConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the Office365ProjectDataConnectorProperties object itself. + */ + public Office365ProjectDataConnectorProperties withDataTypes(Office365ProjectConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Office365ProjectDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Office365ProjectDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Office365ProjectDataConnectorProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Office365ProjectDataConnectorProperties. + */ + public static Office365ProjectDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Office365ProjectDataConnectorProperties deserializedOffice365ProjectDataConnectorProperties + = new Office365ProjectDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOffice365ProjectDataConnectorProperties.withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedOffice365ProjectDataConnectorProperties.dataTypes + = Office365ProjectConnectorDataTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOffice365ProjectDataConnectorProperties; + }); + } +} 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..68102a0c87d7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeATPCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. + */ +@Fluent +public final class OfficeATPCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of OfficeATPCheckRequirementsProperties class. + */ + public OfficeATPCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public OfficeATPCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeATPCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeATPCheckRequirementsProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficeATPCheckRequirementsProperties. + */ + public static OfficeATPCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeATPCheckRequirementsProperties deserializedOfficeATPCheckRequirementsProperties + = new OfficeATPCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOfficeATPCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeATPCheckRequirementsProperties; + }); + } +} 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..2b0e9be472bb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeATPDataConnectorProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import java.io.IOException; + +/** + * OfficeATP (Office 365 Advanced Threat Protection) data connector properties. + */ +@Fluent +public final class OfficeATPDataConnectorProperties implements JsonSerializable { + /* + * The tenant id to connect to, and get the data from. + */ + private String tenantId; + + /* + * The available data types for the connector. + */ + private AlertsDataTypeOfDataConnector dataTypes; + + /** + * Creates an instance of OfficeATPDataConnectorProperties class. + */ + public OfficeATPDataConnectorProperties() { + } + + /** + * 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 OfficeATPDataConnectorProperties object itself. + */ + public OfficeATPDataConnectorProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * 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 JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeATPDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeATPDataConnectorProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficeATPDataConnectorProperties. + */ + public static OfficeATPDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeATPDataConnectorProperties deserializedOfficeATPDataConnectorProperties + = new OfficeATPDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOfficeATPDataConnectorProperties.tenantId = reader.getString(); + } else if ("dataTypes".equals(fieldName)) { + deserializedOfficeATPDataConnectorProperties.dataTypes + = AlertsDataTypeOfDataConnector.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeATPDataConnectorProperties; + }); + } +} 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..364f264d509e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentInner.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Consent for Office365 tenant that already made. + */ +@Immutable +public final class OfficeConsentInner extends ProxyResource { + /* + * Office consent properties + */ + private OfficeConsentProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OfficeConsentInner class. + */ + private OfficeConsentInner() { + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeConsentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeConsentInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficeConsentInner. + */ + public static OfficeConsentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeConsentInner deserializedOfficeConsentInner = new OfficeConsentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOfficeConsentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOfficeConsentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOfficeConsentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOfficeConsentInner.innerProperties = OfficeConsentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOfficeConsentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeConsentInner; + }); + } +} 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..d677f3e1784b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Consent property bag. + */ +@Immutable +public final class OfficeConsentProperties implements JsonSerializable { + /* + * The tenantId of the Office365 with the consent. + */ + private String tenantId; + + /* + * Help to easily cascade among the data layers. + */ + private String consentId; + + /** + * Creates an instance of OfficeConsentProperties class. + */ + private OfficeConsentProperties() { + } + + /** + * Get the tenantId property: The tenantId of the Office365 with the consent. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the consentId property: Help to easily cascade among the data layers. + * + * @return the consentId value. + */ + public String consentId() { + return this.consentId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("consentId", this.consentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeConsentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeConsentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the OfficeConsentProperties. + */ + public static OfficeConsentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeConsentProperties deserializedOfficeConsentProperties = new OfficeConsentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOfficeConsentProperties.tenantId = reader.getString(); + } else if ("consentId".equals(fieldName)) { + deserializedOfficeConsentProperties.consentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeConsentProperties; + }); + } +} 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 index 17cd25dd494b..00fcddcd7921 100644 --- 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypes; import java.io.IOException; @@ -16,12 +16,7 @@ * Office data connector properties. */ @Fluent -public final class OfficeDataConnectorProperties implements JsonSerializable { - /* - * The tenant id to connect to, and get the data from. - */ - private String tenantId; - +public final class OfficeDataConnectorProperties extends DataConnectorTenantId { /* * The available data types for the connector. */ @@ -33,26 +28,6 @@ public final class OfficeDataConnectorProperties implements JsonSerializable { + OfficeIRMCheckRequirementsProperties deserializedOfficeIRMCheckRequirementsProperties + = new OfficeIRMCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOfficeIRMCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeIRMCheckRequirementsProperties; + }); + } +} 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/OfficeIRMDataConnectorProperties.java similarity index 56% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/McasDataConnectorProperties.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIRMDataConnectorProperties.java index 1a31247f621e..06c9bf995dfc 100644 --- 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/OfficeIRMDataConnectorProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -9,14 +9,14 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.models.McasDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; import java.io.IOException; /** - * MCAS (Microsoft Cloud App Security) data connector properties. + * OfficeIRM (Microsoft Insider Risk Management) data connector properties. */ @Fluent -public final class McasDataConnectorProperties implements JsonSerializable { +public final class OfficeIRMDataConnectorProperties implements JsonSerializable { /* * The tenant id to connect to, and get the data from. */ @@ -25,12 +25,12 @@ public final class McasDataConnectorProperties implements JsonSerializable { - McasDataConnectorProperties deserializedMcasDataConnectorProperties = new McasDataConnectorProperties(); + OfficeIRMDataConnectorProperties deserializedOfficeIRMDataConnectorProperties + = new OfficeIRMDataConnectorProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("tenantId".equals(fieldName)) { - deserializedMcasDataConnectorProperties.tenantId = reader.getString(); + deserializedOfficeIRMDataConnectorProperties.tenantId = reader.getString(); } else if ("dataTypes".equals(fieldName)) { - deserializedMcasDataConnectorProperties.dataTypes = McasDataConnectorDataTypes.fromJson(reader); + deserializedOfficeIRMDataConnectorProperties.dataTypes + = AlertsDataTypeOfDataConnector.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedMcasDataConnectorProperties; + return deserializedOfficeIRMDataConnectorProperties; }); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBICheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBICheckRequirementsProperties.java new file mode 100644 index 000000000000..51b305b2a676 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBICheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * Office PowerBI requirements check properties. + */ +@Fluent +public final class OfficePowerBICheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of OfficePowerBICheckRequirementsProperties class. + */ + public OfficePowerBICheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public OfficePowerBICheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficePowerBICheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficePowerBICheckRequirementsProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficePowerBICheckRequirementsProperties. + */ + public static OfficePowerBICheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficePowerBICheckRequirementsProperties deserializedOfficePowerBICheckRequirementsProperties + = new OfficePowerBICheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOfficePowerBICheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficePowerBICheckRequirementsProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBIDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBIDataConnectorProperties.java new file mode 100644 index 000000000000..50e1476a3bed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBIDataConnectorProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypes; +import java.io.IOException; + +/** + * Office Microsoft PowerBI data connector properties. + */ +@Fluent +public final class OfficePowerBIDataConnectorProperties extends DataConnectorTenantId { + /* + * The available data types for the connector. + */ + private OfficePowerBIConnectorDataTypes dataTypes; + + /** + * Creates an instance of OfficePowerBIDataConnectorProperties class. + */ + public OfficePowerBIDataConnectorProperties() { + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public OfficePowerBIConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the OfficePowerBIDataConnectorProperties object itself. + */ + public OfficePowerBIDataConnectorProperties withDataTypes(OfficePowerBIConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OfficePowerBIDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficePowerBIDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficePowerBIDataConnectorProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficePowerBIDataConnectorProperties. + */ + public static OfficePowerBIDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficePowerBIDataConnectorProperties deserializedOfficePowerBIDataConnectorProperties + = new OfficePowerBIDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOfficePowerBIDataConnectorProperties.withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedOfficePowerBIDataConnectorProperties.dataTypes + = OfficePowerBIConnectorDataTypes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficePowerBIDataConnectorProperties; + }); + } +} 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 index 5e25311c4f83..8596da7ea859 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Operation provided by provider. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* * Properties of the operation @@ -40,7 +40,7 @@ public final class OperationInner implements JsonSerializable { /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -52,17 +52,6 @@ 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. * @@ -72,17 +61,6 @@ 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. * @@ -92,17 +70,6 @@ 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. * @@ -112,28 +79,6 @@ 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(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageModelInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageModelInner.java new file mode 100644 index 000000000000..9afe3a8dc6a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageModelInner.java @@ -0,0 +1,713 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; + +/** + * Represents a Package in Azure Security Insights. + */ +@Fluent +public final class PackageModelInner extends ProxyResource { + /* + * package properties + */ + private PackageProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PackageModelInner class. + */ + public PackageModelInner() { + } + + /** + * Get the innerProperties property: package properties. + * + * @return the innerProperties value. + */ + private PackageProperties innerProperties() { + return this.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 PackageModelInner object itself. + */ + public PackageModelInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the contentId property: The content id of the package. + * + * @return the contentId value. + */ + public String contentId() { + return this.innerProperties() == null ? null : this.innerProperties().contentId(); + } + + /** + * Set the contentId property: The content id of the package. + * + * @param contentId the contentId value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withContentId(String contentId) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withContentId(contentId); + return this; + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.innerProperties() == null ? null : this.innerProperties().contentProductId(); + } + + /** + * Set the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @param contentProductId the contentProductId value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withContentProductId(String contentProductId) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withContentProductId(contentProductId); + return this; + } + + /** + * Get the contentKind property: The package kind. + * + * @return the contentKind value. + */ + public PackageKind contentKind() { + return this.innerProperties() == null ? null : this.innerProperties().contentKind(); + } + + /** + * Set the contentKind property: The package kind. + * + * @param contentKind the contentKind value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withContentKind(PackageKind contentKind) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withContentKind(contentKind); + return this; + } + + /** + * Get the contentSchemaVersion property: The version of the content schema. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentSchemaVersion(); + } + + /** + * Set the contentSchemaVersion property: The version of the content schema. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withContentSchemaVersion(String contentSchemaVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * Get the isNew property: Flag indicates if this is a newly published package. + * + * @return the isNew value. + */ + public Flag isNew() { + return this.innerProperties() == null ? null : this.innerProperties().isNew(); + } + + /** + * Set the isNew property: Flag indicates if this is a newly published package. + * + * @param isNew the isNew value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withIsNew(Flag isNew) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withIsNew(isNew); + return this; + } + + /** + * Get the isPreview property: Flag indicates if this package is in preview. + * + * @return the isPreview value. + */ + public Flag isPreview() { + return this.innerProperties() == null ? null : this.innerProperties().isPreview(); + } + + /** + * Set the isPreview property: Flag indicates if this package is in preview. + * + * @param isPreview the isPreview value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withIsPreview(Flag isPreview) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withIsPreview(isPreview); + return this; + } + + /** + * Get the isFeatured property: Flag indicates if this package is among the featured list. + * + * @return the isFeatured value. + */ + public Flag isFeatured() { + return this.innerProperties() == null ? null : this.innerProperties().isFeatured(); + } + + /** + * Set the isFeatured property: Flag indicates if this package is among the featured list. + * + * @param isFeatured the isFeatured value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withIsFeatured(Flag isFeatured) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withIsFeatured(isFeatured); + return this; + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.innerProperties() == null ? null : this.innerProperties().isDeprecated(); + } + + /** + * Set the isDeprecated property: Flag indicates if this template is deprecated. + * + * @param isDeprecated the isDeprecated value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withIsDeprecated(Flag isDeprecated) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withIsDeprecated(isDeprecated); + return this; + } + + /** + * Get the version property: the latest version number of the package. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: the latest version number of the package. + * + * @param version the version value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the displayName property: The display name of the package. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the package. + * + * @param displayName the displayName value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: The description of the package. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the package. + * + * @param description the description value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the publisherDisplayName property: The publisher display name of the package. + * + * @return the publisherDisplayName value. + */ + public String publisherDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().publisherDisplayName(); + } + + /** + * Set the publisherDisplayName property: The publisher display name of the package. + * + * @param publisherDisplayName the publisherDisplayName value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withPublisherDisplayName(String publisherDisplayName) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withPublisherDisplayName(publisherDisplayName); + return this; + } + + /** + * Get the source property: The source of the package. + * + * @return the source value. + */ + public MetadataSource source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: The source of the package. + * + * @param source the source value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withSource(MetadataSource source) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the author property: The author of the package. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Set the author property: The author of the package. + * + * @param author the author value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withAuthor(MetadataAuthor author) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withAuthor(author); + return this; + } + + /** + * Get the support property: The support tier of the package. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.innerProperties() == null ? null : this.innerProperties().support(); + } + + /** + * Set the support property: The support tier of the package. + * + * @param support the support value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withSupport(MetadataSupport support) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withSupport(support); + return this; + } + + /** + * Get the dependencies property: The support tier of the package. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.innerProperties() == null ? null : this.innerProperties().dependencies(); + } + + /** + * Set the dependencies property: The support tier of the package. + * + * @param dependencies the dependencies value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withDependencies(MetadataDependencies dependencies) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withDependencies(dependencies); + return this; + } + + /** + * Get the providers property: Providers for the package item. + * + * @return the providers value. + */ + public List providers() { + return this.innerProperties() == null ? null : this.innerProperties().providers(); + } + + /** + * Set the providers property: Providers for the package item. + * + * @param providers the providers value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withProviders(List providers) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withProviders(providers); + return this; + } + + /** + * Get the firstPublishDate property: first publish date package item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().firstPublishDate(); + } + + /** + * Set the firstPublishDate property: first publish date package item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withFirstPublishDate(LocalDate firstPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the package 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 package item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withLastPublishDate(LocalDate lastPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withLastPublishDate(lastPublishDate); + return this; + } + + /** + * Get the categories property: The categories of the package. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.innerProperties() == null ? null : this.innerProperties().categories(); + } + + /** + * Set the categories property: The categories of the package. + * + * @param categories the categories value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withCategories(MetadataCategories categories) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withCategories(categories); + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTactics(); + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withThreatAnalysisTactics(List threatAnalysisTactics) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTechniques(); + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withThreatAnalysisTechniques(List threatAnalysisTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.innerProperties() == null ? null : this.innerProperties().icon(); + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon value to set. + * @return the PackageModelInner object itself. + */ + public PackageModelInner withIcon(String icon) { + if (this.innerProperties() == null) { + this.innerProperties = new PackageProperties(); + } + this.innerProperties().withIcon(icon); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PackageModelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PackageModelInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PackageModelInner. + */ + public static PackageModelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PackageModelInner deserializedPackageModelInner = new PackageModelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPackageModelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPackageModelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPackageModelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPackageModelInner.innerProperties = PackageProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedPackageModelInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedPackageModelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPackageModelInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageProperties.java new file mode 100644 index 000000000000..c8a984eb4764 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageProperties.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageBaseProperties; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Describes package properties. + */ +@Fluent +public final class PackageProperties extends PackageBaseProperties { + /** + * Creates an instance of PackageProperties class. + */ + public PackageProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withContentId(String contentId) { + super.withContentId(contentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withContentProductId(String contentProductId) { + super.withContentProductId(contentProductId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withContentKind(PackageKind contentKind) { + super.withContentKind(contentKind); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withContentSchemaVersion(String contentSchemaVersion) { + super.withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withIsNew(Flag isNew) { + super.withIsNew(isNew); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withIsPreview(Flag isPreview) { + super.withIsPreview(isPreview); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withIsFeatured(Flag isFeatured) { + super.withIsFeatured(isFeatured); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withIsDeprecated(Flag isDeprecated) { + super.withIsDeprecated(isDeprecated); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withPublisherDisplayName(String publisherDisplayName) { + super.withPublisherDisplayName(publisherDisplayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withSource(MetadataSource source) { + super.withSource(source); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withAuthor(MetadataAuthor author) { + super.withAuthor(author); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withSupport(MetadataSupport support) { + super.withSupport(support); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withDependencies(MetadataDependencies dependencies) { + super.withDependencies(dependencies); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withProviders(List providers) { + super.withProviders(providers); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withFirstPublishDate(LocalDate firstPublishDate) { + super.withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withLastPublishDate(LocalDate lastPublishDate) { + super.withLastPublishDate(lastPublishDate); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withCategories(MetadataCategories categories) { + super.withCategories(categories); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withThreatAnalysisTactics(List threatAnalysisTactics) { + super.withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withThreatAnalysisTechniques(List threatAnalysisTechniques) { + super.withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PackageProperties withIcon(String icon) { + super.withIcon(icon); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentId", contentId()); + jsonWriter.writeStringField("contentProductId", contentProductId()); + jsonWriter.writeStringField("contentKind", contentKind() == null ? null : contentKind().toString()); + jsonWriter.writeStringField("contentSchemaVersion", contentSchemaVersion()); + jsonWriter.writeStringField("isNew", isNew() == null ? null : isNew().toString()); + jsonWriter.writeStringField("isPreview", isPreview() == null ? null : isPreview().toString()); + jsonWriter.writeStringField("isFeatured", isFeatured() == null ? null : isFeatured().toString()); + jsonWriter.writeStringField("isDeprecated", isDeprecated() == null ? null : isDeprecated().toString()); + jsonWriter.writeStringField("version", version()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("publisherDisplayName", publisherDisplayName()); + jsonWriter.writeJsonField("source", source()); + jsonWriter.writeJsonField("author", author()); + jsonWriter.writeJsonField("support", support()); + jsonWriter.writeJsonField("dependencies", dependencies()); + jsonWriter.writeArrayField("providers", providers(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstPublishDate", Objects.toString(firstPublishDate(), null)); + jsonWriter.writeStringField("lastPublishDate", Objects.toString(lastPublishDate(), null)); + jsonWriter.writeJsonField("categories", categories()); + jsonWriter.writeArrayField("threatAnalysisTactics", threatAnalysisTactics(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threatAnalysisTechniques", threatAnalysisTechniques(), + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("icon", icon()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PackageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PackageProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PackageProperties. + */ + public static PackageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PackageProperties deserializedPackageProperties = new PackageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentId".equals(fieldName)) { + deserializedPackageProperties.withContentId(reader.getString()); + } else if ("contentProductId".equals(fieldName)) { + deserializedPackageProperties.withContentProductId(reader.getString()); + } else if ("contentKind".equals(fieldName)) { + deserializedPackageProperties.withContentKind(PackageKind.fromString(reader.getString())); + } else if ("contentSchemaVersion".equals(fieldName)) { + deserializedPackageProperties.withContentSchemaVersion(reader.getString()); + } else if ("isNew".equals(fieldName)) { + deserializedPackageProperties.withIsNew(Flag.fromString(reader.getString())); + } else if ("isPreview".equals(fieldName)) { + deserializedPackageProperties.withIsPreview(Flag.fromString(reader.getString())); + } else if ("isFeatured".equals(fieldName)) { + deserializedPackageProperties.withIsFeatured(Flag.fromString(reader.getString())); + } else if ("isDeprecated".equals(fieldName)) { + deserializedPackageProperties.withIsDeprecated(Flag.fromString(reader.getString())); + } else if ("version".equals(fieldName)) { + deserializedPackageProperties.withVersion(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedPackageProperties.withDisplayName(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPackageProperties.withDescription(reader.getString()); + } else if ("publisherDisplayName".equals(fieldName)) { + deserializedPackageProperties.withPublisherDisplayName(reader.getString()); + } else if ("source".equals(fieldName)) { + deserializedPackageProperties.withSource(MetadataSource.fromJson(reader)); + } else if ("author".equals(fieldName)) { + deserializedPackageProperties.withAuthor(MetadataAuthor.fromJson(reader)); + } else if ("support".equals(fieldName)) { + deserializedPackageProperties.withSupport(MetadataSupport.fromJson(reader)); + } else if ("dependencies".equals(fieldName)) { + deserializedPackageProperties.withDependencies(MetadataDependencies.fromJson(reader)); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedPackageProperties.withProviders(providers); + } else if ("firstPublishDate".equals(fieldName)) { + deserializedPackageProperties.withFirstPublishDate( + reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString()))); + } else if ("lastPublishDate".equals(fieldName)) { + deserializedPackageProperties.withLastPublishDate( + reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString()))); + } else if ("categories".equals(fieldName)) { + deserializedPackageProperties.withCategories(MetadataCategories.fromJson(reader)); + } else if ("threatAnalysisTactics".equals(fieldName)) { + List threatAnalysisTactics = reader.readArray(reader1 -> reader1.getString()); + deserializedPackageProperties.withThreatAnalysisTactics(threatAnalysisTactics); + } else if ("threatAnalysisTechniques".equals(fieldName)) { + List threatAnalysisTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedPackageProperties.withThreatAnalysisTechniques(threatAnalysisTechniques); + } else if ("icon".equals(fieldName)) { + deserializedPackageProperties.withIcon(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPackageProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PremiumMdtiDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PremiumMdtiDataConnectorProperties.java new file mode 100644 index 000000000000..2194f357dff2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PremiumMdtiDataConnectorProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypes; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Microsoft Defender for Threat Intelligence Premium data connector properties. + */ +@Fluent +public final class PremiumMdtiDataConnectorProperties extends DataConnectorTenantId { + /* + * The lookback period for the feed to be imported. The date-time to begin importing the feed from, for example: + * 2024-01-01T00:00:00.000Z. + */ + private OffsetDateTime lookbackPeriod; + + /* + * The flag to indicate whether the tenant has the premium SKU required to access this connector. + */ + private Boolean requiredSKUsPresent; + + /* + * The available data types for the connector. + */ + private PremiumMdtiDataConnectorDataTypes dataTypes; + + /** + * Creates an instance of PremiumMdtiDataConnectorProperties class. + */ + public PremiumMdtiDataConnectorProperties() { + } + + /** + * Get the lookbackPeriod property: The lookback period for the feed to be imported. The date-time to begin + * importing the feed from, for example: 2024-01-01T00:00:00.000Z. + * + * @return the lookbackPeriod value. + */ + public OffsetDateTime lookbackPeriod() { + return this.lookbackPeriod; + } + + /** + * Set the lookbackPeriod property: The lookback period for the feed to be imported. The date-time to begin + * importing the feed from, for example: 2024-01-01T00:00:00.000Z. + * + * @param lookbackPeriod the lookbackPeriod value to set. + * @return the PremiumMdtiDataConnectorProperties object itself. + */ + public PremiumMdtiDataConnectorProperties withLookbackPeriod(OffsetDateTime lookbackPeriod) { + this.lookbackPeriod = lookbackPeriod; + return this; + } + + /** + * Get the requiredSKUsPresent property: The flag to indicate whether the tenant has the premium SKU required to + * access this connector. + * + * @return the requiredSKUsPresent value. + */ + public Boolean requiredSKUsPresent() { + return this.requiredSKUsPresent; + } + + /** + * Set the requiredSKUsPresent property: The flag to indicate whether the tenant has the premium SKU required to + * access this connector. + * + * @param requiredSKUsPresent the requiredSKUsPresent value to set. + * @return the PremiumMdtiDataConnectorProperties object itself. + */ + public PremiumMdtiDataConnectorProperties withRequiredSKUsPresent(Boolean requiredSKUsPresent) { + this.requiredSKUsPresent = requiredSKUsPresent; + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public PremiumMdtiDataConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the PremiumMdtiDataConnectorProperties object itself. + */ + public PremiumMdtiDataConnectorProperties withDataTypes(PremiumMdtiDataConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PremiumMdtiDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeStringField("lookbackPeriod", + this.lookbackPeriod == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lookbackPeriod)); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + jsonWriter.writeBooleanField("requiredSKUsPresent", this.requiredSKUsPresent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PremiumMdtiDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PremiumMdtiDataConnectorProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PremiumMdtiDataConnectorProperties. + */ + public static PremiumMdtiDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PremiumMdtiDataConnectorProperties deserializedPremiumMdtiDataConnectorProperties + = new PremiumMdtiDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedPremiumMdtiDataConnectorProperties.withTenantId(reader.getString()); + } else if ("lookbackPeriod".equals(fieldName)) { + deserializedPremiumMdtiDataConnectorProperties.lookbackPeriod = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dataTypes".equals(fieldName)) { + deserializedPremiumMdtiDataConnectorProperties.dataTypes + = PremiumMdtiDataConnectorDataTypes.fromJson(reader); + } else if ("requiredSKUsPresent".equals(fieldName)) { + deserializedPremiumMdtiDataConnectorProperties.requiredSKUsPresent + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPremiumMdtiDataConnectorProperties; + }); + } +} 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 index cf2df9c45318..0cbfd9df1e0d 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,7 +18,7 @@ /** * Process entity property bag. */ -@Fluent +@Immutable public final class ProcessEntityProperties extends EntityCommonProperties { /* * The account entity id running the processes. @@ -79,7 +79,7 @@ public final class ProcessEntityProperties extends EntityCommonProperties { /** * Creates an instance of ProcessEntityProperties class. */ - public ProcessEntityProperties() { + private ProcessEntityProperties() { } /** @@ -118,17 +118,6 @@ 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. * @@ -196,15 +185,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageModelInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageModelInner.java new file mode 100644 index 000000000000..c70734af05f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageModelInner.java @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; + +/** + * Represents a Package in Azure Security Insights. + */ +@Immutable +public final class ProductPackageModelInner extends ProxyResource { + /* + * package properties + */ + private ProductPackageProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProductPackageModelInner class. + */ + private ProductPackageModelInner() { + } + + /** + * Get the innerProperties property: package properties. + * + * @return the innerProperties value. + */ + private ProductPackageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the contentId property: The content id of the package. + * + * @return the contentId value. + */ + public String contentId() { + return this.innerProperties() == null ? null : this.innerProperties().contentId(); + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.innerProperties() == null ? null : this.innerProperties().contentProductId(); + } + + /** + * Get the contentKind property: The package kind. + * + * @return the contentKind value. + */ + public PackageKind contentKind() { + return this.innerProperties() == null ? null : this.innerProperties().contentKind(); + } + + /** + * Get the contentSchemaVersion property: The version of the content schema. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentSchemaVersion(); + } + + /** + * Get the isNew property: Flag indicates if this is a newly published package. + * + * @return the isNew value. + */ + public Flag isNew() { + return this.innerProperties() == null ? null : this.innerProperties().isNew(); + } + + /** + * Get the isPreview property: Flag indicates if this package is in preview. + * + * @return the isPreview value. + */ + public Flag isPreview() { + return this.innerProperties() == null ? null : this.innerProperties().isPreview(); + } + + /** + * Get the isFeatured property: Flag indicates if this package is among the featured list. + * + * @return the isFeatured value. + */ + public Flag isFeatured() { + return this.innerProperties() == null ? null : this.innerProperties().isFeatured(); + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.innerProperties() == null ? null : this.innerProperties().isDeprecated(); + } + + /** + * Get the version property: the latest version number of the package. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the displayName property: The display name of the package. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the description property: The description of the package. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the publisherDisplayName property: The publisher display name of the package. + * + * @return the publisherDisplayName value. + */ + public String publisherDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().publisherDisplayName(); + } + + /** + * Get the source property: The source of the package. + * + * @return the source value. + */ + public MetadataSource source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the author property: The author of the package. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.innerProperties() == null ? null : this.innerProperties().author(); + } + + /** + * Get the support property: The support tier of the package. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.innerProperties() == null ? null : this.innerProperties().support(); + } + + /** + * Get the dependencies property: The support tier of the package. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.innerProperties() == null ? null : this.innerProperties().dependencies(); + } + + /** + * Get the providers property: Providers for the package item. + * + * @return the providers value. + */ + public List providers() { + return this.innerProperties() == null ? null : this.innerProperties().providers(); + } + + /** + * Get the firstPublishDate property: first publish date package item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().firstPublishDate(); + } + + /** + * Get the lastPublishDate property: last publish date for the package item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().lastPublishDate(); + } + + /** + * Get the categories property: The categories of the package. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.innerProperties() == null ? null : this.innerProperties().categories(); + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTactics(); + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTechniques(); + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.innerProperties() == null ? null : this.innerProperties().icon(); + } + + /** + * Get the installedVersion property: The version of the installed package, null or absent means not installed. + * + * @return the installedVersion value. + */ + public String installedVersion() { + return this.innerProperties() == null ? null : this.innerProperties().installedVersion(); + } + + /** + * Get the metadataResourceId property: The metadata resource id. + * + * @return the metadataResourceId value. + */ + public String metadataResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().metadataResourceId(); + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.innerProperties() == null ? null : this.innerProperties().packagedContent(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductPackageModelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductPackageModelInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProductPackageModelInner. + */ + public static ProductPackageModelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductPackageModelInner deserializedProductPackageModelInner = new ProductPackageModelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProductPackageModelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProductPackageModelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProductPackageModelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProductPackageModelInner.innerProperties = ProductPackageProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedProductPackageModelInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedProductPackageModelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProductPackageModelInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageProperties.java new file mode 100644 index 000000000000..7f1733c05d9c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageProperties.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Describes package properties. + */ +@Immutable +public final class ProductPackageProperties implements JsonSerializable { + /* + * The content id of the package + */ + private String contentId; + + /* + * Unique ID for the content. It should be generated based on the contentId, contentKind and the contentVersion of + * the package + */ + private String contentProductId; + + /* + * The package kind + */ + private PackageKind contentKind; + + /* + * The version of the content schema. + */ + private String contentSchemaVersion; + + /* + * Flag indicates if this is a newly published package. + */ + private Flag isNew; + + /* + * Flag indicates if this package is in preview. + */ + private Flag isPreview; + + /* + * Flag indicates if this package is among the featured list. + */ + private Flag isFeatured; + + /* + * Flag indicates if this template is deprecated + */ + private Flag isDeprecated; + + /* + * the latest version number of the package + */ + private String version; + + /* + * The display name of the package + */ + private String displayName; + + /* + * The description of the package + */ + private String description; + + /* + * The publisher display name of the package + */ + private String publisherDisplayName; + + /* + * The source of the package + */ + private MetadataSource source; + + /* + * The author of the package + */ + private MetadataAuthor author; + + /* + * The support tier of the package + */ + private MetadataSupport support; + + /* + * The support tier of the package + */ + private MetadataDependencies dependencies; + + /* + * Providers for the package item + */ + private List providers; + + /* + * first publish date package item + */ + private LocalDate firstPublishDate; + + /* + * last publish date for the package item + */ + private LocalDate lastPublishDate; + + /* + * The categories of the package + */ + private MetadataCategories categories; + + /* + * the tactics the resource covers + */ + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + private List threatAnalysisTechniques; + + /* + * the icon identifier. this id can later be fetched from the content metadata + */ + private String icon; + + /* + * The version of the installed package, null or absent means not installed. + */ + private String installedVersion; + + /* + * The metadata resource id. + */ + private String metadataResourceId; + + /* + * The json of the ARM template to deploy. Expandable. + */ + private Object packagedContent; + + /** + * Creates an instance of ProductPackageProperties class. + */ + private ProductPackageProperties() { + } + + /** + * Get the contentId property: The content id of the package. + * + * @return the contentId value. + */ + public String contentId() { + return this.contentId; + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.contentProductId; + } + + /** + * Get the contentKind property: The package kind. + * + * @return the contentKind value. + */ + public PackageKind contentKind() { + return this.contentKind; + } + + /** + * Get the contentSchemaVersion property: The version of the content schema. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.contentSchemaVersion; + } + + /** + * Get the isNew property: Flag indicates if this is a newly published package. + * + * @return the isNew value. + */ + public Flag isNew() { + return this.isNew; + } + + /** + * Get the isPreview property: Flag indicates if this package is in preview. + * + * @return the isPreview value. + */ + public Flag isPreview() { + return this.isPreview; + } + + /** + * Get the isFeatured property: Flag indicates if this package is among the featured list. + * + * @return the isFeatured value. + */ + public Flag isFeatured() { + return this.isFeatured; + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.isDeprecated; + } + + /** + * Get the version property: the latest version number of the package. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the displayName property: The display name of the package. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the package. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the publisherDisplayName property: The publisher display name of the package. + * + * @return the publisherDisplayName value. + */ + public String publisherDisplayName() { + return this.publisherDisplayName; + } + + /** + * Get the source property: The source of the package. + * + * @return the source value. + */ + public MetadataSource source() { + return this.source; + } + + /** + * Get the author property: The author of the package. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.author; + } + + /** + * Get the support property: The support tier of the package. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.support; + } + + /** + * Get the dependencies property: The support tier of the package. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.dependencies; + } + + /** + * Get the providers property: Providers for the package item. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Get the firstPublishDate property: first publish date package item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Get the lastPublishDate property: last publish date for the package item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Get the categories property: The categories of the package. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.categories; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.threatAnalysisTactics; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.threatAnalysisTechniques; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Get the installedVersion property: The version of the installed package, null or absent means not installed. + * + * @return the installedVersion value. + */ + public String installedVersion() { + return this.installedVersion; + } + + /** + * Get the metadataResourceId property: The metadata resource id. + * + * @return the metadataResourceId value. + */ + public String metadataResourceId() { + return this.metadataResourceId; + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.packagedContent; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentId", this.contentId); + jsonWriter.writeStringField("contentProductId", this.contentProductId); + jsonWriter.writeStringField("contentKind", this.contentKind == null ? null : this.contentKind.toString()); + jsonWriter.writeStringField("contentSchemaVersion", this.contentSchemaVersion); + jsonWriter.writeStringField("isNew", this.isNew == null ? null : this.isNew.toString()); + jsonWriter.writeStringField("isPreview", this.isPreview == null ? null : this.isPreview.toString()); + jsonWriter.writeStringField("isFeatured", this.isFeatured == null ? null : this.isFeatured.toString()); + jsonWriter.writeStringField("isDeprecated", this.isDeprecated == null ? null : this.isDeprecated.toString()); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("publisherDisplayName", this.publisherDisplayName); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("author", this.author); + jsonWriter.writeJsonField("support", this.support); + jsonWriter.writeJsonField("dependencies", this.dependencies); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstPublishDate", Objects.toString(this.firstPublishDate, null)); + jsonWriter.writeStringField("lastPublishDate", Objects.toString(this.lastPublishDate, null)); + jsonWriter.writeJsonField("categories", this.categories); + jsonWriter.writeArrayField("threatAnalysisTactics", this.threatAnalysisTactics, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threatAnalysisTechniques", this.threatAnalysisTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("icon", this.icon); + jsonWriter.writeStringField("installedVersion", this.installedVersion); + jsonWriter.writeStringField("metadataResourceId", this.metadataResourceId); + if (this.packagedContent != null) { + jsonWriter.writeUntypedField("packagedContent", this.packagedContent); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductPackageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductPackageProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProductPackageProperties. + */ + public static ProductPackageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductPackageProperties deserializedProductPackageProperties = new ProductPackageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentId".equals(fieldName)) { + deserializedProductPackageProperties.contentId = reader.getString(); + } else if ("contentProductId".equals(fieldName)) { + deserializedProductPackageProperties.contentProductId = reader.getString(); + } else if ("contentKind".equals(fieldName)) { + deserializedProductPackageProperties.contentKind = PackageKind.fromString(reader.getString()); + } else if ("contentSchemaVersion".equals(fieldName)) { + deserializedProductPackageProperties.contentSchemaVersion = reader.getString(); + } else if ("isNew".equals(fieldName)) { + deserializedProductPackageProperties.isNew = Flag.fromString(reader.getString()); + } else if ("isPreview".equals(fieldName)) { + deserializedProductPackageProperties.isPreview = Flag.fromString(reader.getString()); + } else if ("isFeatured".equals(fieldName)) { + deserializedProductPackageProperties.isFeatured = Flag.fromString(reader.getString()); + } else if ("isDeprecated".equals(fieldName)) { + deserializedProductPackageProperties.isDeprecated = Flag.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedProductPackageProperties.version = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedProductPackageProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedProductPackageProperties.description = reader.getString(); + } else if ("publisherDisplayName".equals(fieldName)) { + deserializedProductPackageProperties.publisherDisplayName = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedProductPackageProperties.source = MetadataSource.fromJson(reader); + } else if ("author".equals(fieldName)) { + deserializedProductPackageProperties.author = MetadataAuthor.fromJson(reader); + } else if ("support".equals(fieldName)) { + deserializedProductPackageProperties.support = MetadataSupport.fromJson(reader); + } else if ("dependencies".equals(fieldName)) { + deserializedProductPackageProperties.dependencies = MetadataDependencies.fromJson(reader); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedProductPackageProperties.providers = providers; + } else if ("firstPublishDate".equals(fieldName)) { + deserializedProductPackageProperties.firstPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("lastPublishDate".equals(fieldName)) { + deserializedProductPackageProperties.lastPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("categories".equals(fieldName)) { + deserializedProductPackageProperties.categories = MetadataCategories.fromJson(reader); + } else if ("threatAnalysisTactics".equals(fieldName)) { + List threatAnalysisTactics = reader.readArray(reader1 -> reader1.getString()); + deserializedProductPackageProperties.threatAnalysisTactics = threatAnalysisTactics; + } else if ("threatAnalysisTechniques".equals(fieldName)) { + List threatAnalysisTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedProductPackageProperties.threatAnalysisTechniques = threatAnalysisTechniques; + } else if ("icon".equals(fieldName)) { + deserializedProductPackageProperties.icon = reader.getString(); + } else if ("installedVersion".equals(fieldName)) { + deserializedProductPackageProperties.installedVersion = reader.getString(); + } else if ("metadataResourceId".equals(fieldName)) { + deserializedProductPackageProperties.metadataResourceId = reader.getString(); + } else if ("packagedContent".equals(fieldName)) { + deserializedProductPackageProperties.packagedContent = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedProductPackageProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateModelInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateModelInner.java new file mode 100644 index 000000000000..e79c4203633c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateModelInner.java @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; + +/** + * Template resource definition. + */ +@Immutable +public final class ProductTemplateModelInner extends ProxyResource { + /* + * template properties + */ + private ProductTemplateProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProductTemplateModelInner class. + */ + private ProductTemplateModelInner() { + } + + /** + * Get the innerProperties property: template properties. + * + * @return the innerProperties value. + */ + private ProductTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.innerProperties() == null ? null : this.innerProperties().contentProductId(); + } + + /** + * Get the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @return the packageVersion value. + */ + public String packageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().packageVersion(); + } + + /** + * 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 metadata 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(); + } + + /** + * Get the displayName property: The display name of the template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the contentKind property: The kind of content the template is for. + * + * @return the contentKind value. + */ + public Kind contentKind() { + return this.innerProperties() == null ? null : this.innerProperties().contentKind(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * Get the support property: Support information for the template - type, name, contact information. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.innerProperties() == null ? null : this.innerProperties().support(); + } + + /** + * 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(); + } + + /** + * Get the categories property: Categories for the item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.innerProperties() == null ? null : this.innerProperties().categories(); + } + + /** + * Get the providers property: Providers for the content item. + * + * @return the providers value. + */ + public List providers() { + return this.innerProperties() == null ? null : this.innerProperties().providers(); + } + + /** + * Get the firstPublishDate property: first publish date content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().firstPublishDate(); + } + + /** + * Get the lastPublishDate property: last publish date for the content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().lastPublishDate(); + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.innerProperties() == null ? null : this.innerProperties().customVersion(); + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentSchemaVersion(); + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.innerProperties() == null ? null : this.innerProperties().icon(); + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTactics(); + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTechniques(); + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.innerProperties() == null ? null : this.innerProperties().previewImages(); + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.innerProperties() == null ? null : this.innerProperties().previewImagesDark(); + } + + /** + * Get the packageId property: the package Id contains this template. + * + * @return the packageId value. + */ + public String packageId() { + return this.innerProperties() == null ? null : this.innerProperties().packageId(); + } + + /** + * Get the packageKind property: the packageKind of the package contains this template. + * + * @return the packageKind value. + */ + public PackageKind packageKind() { + return this.innerProperties() == null ? null : this.innerProperties().packageKind(); + } + + /** + * Get the packageName property: the name of the package contains this template. + * + * @return the packageName value. + */ + public String packageName() { + return this.innerProperties() == null ? null : this.innerProperties().packageName(); + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.innerProperties() == null ? null : this.innerProperties().isDeprecated(); + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.innerProperties() == null ? null : this.innerProperties().packagedContent(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductTemplateModelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductTemplateModelInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProductTemplateModelInner. + */ + public static ProductTemplateModelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductTemplateModelInner deserializedProductTemplateModelInner = new ProductTemplateModelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProductTemplateModelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProductTemplateModelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProductTemplateModelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProductTemplateModelInner.innerProperties = ProductTemplateProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedProductTemplateModelInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedProductTemplateModelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProductTemplateModelInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateProperties.java new file mode 100644 index 000000000000..f657bccd7e2b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateProperties.java @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Template property bag. + */ +@Immutable +public final class ProductTemplateProperties implements JsonSerializable { + /* + * 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 + */ + private String contentId; + + /* + * Unique ID for the content. It should be generated based on the contentId of the package, contentId of the + * template, contentKind of the template and the contentVersion of the template + */ + private String contentProductId; + + /* + * Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM + * metadata best practices. Can also be any string, but then we cannot guarantee any version checks + */ + private String packageVersion; + + /* + * Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM + * metadata best practices. Can also be any string, but then we cannot guarantee any version checks + */ + private String version; + + /* + * The display name of the template + */ + private String displayName; + + /* + * The kind of content the template is for. + */ + private Kind contentKind; + + /* + * Source of the content. This is where/how it was created. + */ + private MetadataSource source; + + /* + * The creator of the content item. + */ + private MetadataAuthor author; + + /* + * Support information for the template - type, name, contact information + */ + 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. + */ + private MetadataDependencies dependencies; + + /* + * Categories for the item + */ + private MetadataCategories categories; + + /* + * Providers for the content item + */ + private List providers; + + /* + * first publish date content item + */ + private LocalDate firstPublishDate; + + /* + * last publish date for the content item + */ + private LocalDate lastPublishDate; + + /* + * The custom version of the content. A optional free text + */ + private String customVersion; + + /* + * Schema version of the content. Can be used to distinguish between different flow based on the schema version + */ + private String contentSchemaVersion; + + /* + * the icon identifier. this id can later be fetched from the content metadata + */ + private String icon; + + /* + * the tactics the resource covers + */ + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + private List threatAnalysisTechniques; + + /* + * preview image file names. These will be taken from the solution artifacts + */ + private List previewImages; + + /* + * preview image file names. These will be taken from the solution artifacts. used for dark theme support + */ + private List previewImagesDark; + + /* + * the package Id contains this template + */ + private String packageId; + + /* + * the packageKind of the package contains this template + */ + private PackageKind packageKind; + + /* + * the name of the package contains this template + */ + private String packageName; + + /* + * Flag indicates if this template is deprecated + */ + private Flag isDeprecated; + + /* + * The json of the ARM template to deploy + */ + private Object packagedContent; + + /** + * Creates an instance of ProductTemplateProperties class. + */ + private ProductTemplateProperties() { + } + + /** + * 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; + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.contentProductId; + } + + /** + * Get the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @return the packageVersion value. + */ + public String packageVersion() { + return this.packageVersion; + } + + /** + * 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 metadata 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; + } + + /** + * Get the displayName property: The display name of the template. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the contentKind property: The kind of content the template is for. + * + * @return the contentKind value. + */ + public Kind contentKind() { + return this.contentKind; + } + + /** + * 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; + } + + /** + * Get the author property: The creator of the content item. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.author; + } + + /** + * Get the support property: Support information for the template - type, name, contact information. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.support; + } + + /** + * 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; + } + + /** + * Get the categories property: Categories for the item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.categories; + } + + /** + * Get the providers property: Providers for the content item. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Get the firstPublishDate property: first publish date content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Get the lastPublishDate property: last publish date for the content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.customVersion; + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.contentSchemaVersion; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.threatAnalysisTactics; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.threatAnalysisTechniques; + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.previewImages; + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.previewImagesDark; + } + + /** + * Get the packageId property: the package Id contains this template. + * + * @return the packageId value. + */ + public String packageId() { + return this.packageId; + } + + /** + * Get the packageKind property: the packageKind of the package contains this template. + * + * @return the packageKind value. + */ + public PackageKind packageKind() { + return this.packageKind; + } + + /** + * Get the packageName property: the name of the package contains this template. + * + * @return the packageName value. + */ + public String packageName() { + return this.packageName; + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.isDeprecated; + } + + /** + * Get the packagedContent property: The json of the ARM template to deploy. + * + * @return the packagedContent value. + */ + public Object packagedContent() { + return this.packagedContent; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentId", this.contentId); + jsonWriter.writeStringField("contentProductId", this.contentProductId); + jsonWriter.writeStringField("packageVersion", this.packageVersion); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("contentKind", this.contentKind == null ? null : this.contentKind.toString()); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("author", this.author); + jsonWriter.writeJsonField("support", this.support); + jsonWriter.writeJsonField("dependencies", this.dependencies); + jsonWriter.writeJsonField("categories", this.categories); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstPublishDate", Objects.toString(this.firstPublishDate, null)); + jsonWriter.writeStringField("lastPublishDate", Objects.toString(this.lastPublishDate, null)); + jsonWriter.writeStringField("customVersion", this.customVersion); + jsonWriter.writeStringField("contentSchemaVersion", this.contentSchemaVersion); + jsonWriter.writeStringField("icon", this.icon); + jsonWriter.writeArrayField("threatAnalysisTactics", this.threatAnalysisTactics, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threatAnalysisTechniques", this.threatAnalysisTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImages", this.previewImages, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImagesDark", this.previewImagesDark, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("packageId", this.packageId); + jsonWriter.writeStringField("packageKind", this.packageKind == null ? null : this.packageKind.toString()); + jsonWriter.writeStringField("packageName", this.packageName); + if (this.packagedContent != null) { + jsonWriter.writeUntypedField("packagedContent", this.packagedContent); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductTemplateProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProductTemplateProperties. + */ + public static ProductTemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductTemplateProperties deserializedProductTemplateProperties = new ProductTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentId".equals(fieldName)) { + deserializedProductTemplateProperties.contentId = reader.getString(); + } else if ("contentProductId".equals(fieldName)) { + deserializedProductTemplateProperties.contentProductId = reader.getString(); + } else if ("packageVersion".equals(fieldName)) { + deserializedProductTemplateProperties.packageVersion = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedProductTemplateProperties.version = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedProductTemplateProperties.displayName = reader.getString(); + } else if ("contentKind".equals(fieldName)) { + deserializedProductTemplateProperties.contentKind = Kind.fromString(reader.getString()); + } else if ("source".equals(fieldName)) { + deserializedProductTemplateProperties.source = MetadataSource.fromJson(reader); + } else if ("author".equals(fieldName)) { + deserializedProductTemplateProperties.author = MetadataAuthor.fromJson(reader); + } else if ("support".equals(fieldName)) { + deserializedProductTemplateProperties.support = MetadataSupport.fromJson(reader); + } else if ("dependencies".equals(fieldName)) { + deserializedProductTemplateProperties.dependencies = MetadataDependencies.fromJson(reader); + } else if ("categories".equals(fieldName)) { + deserializedProductTemplateProperties.categories = MetadataCategories.fromJson(reader); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedProductTemplateProperties.providers = providers; + } else if ("firstPublishDate".equals(fieldName)) { + deserializedProductTemplateProperties.firstPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("lastPublishDate".equals(fieldName)) { + deserializedProductTemplateProperties.lastPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("customVersion".equals(fieldName)) { + deserializedProductTemplateProperties.customVersion = reader.getString(); + } else if ("contentSchemaVersion".equals(fieldName)) { + deserializedProductTemplateProperties.contentSchemaVersion = reader.getString(); + } else if ("icon".equals(fieldName)) { + deserializedProductTemplateProperties.icon = reader.getString(); + } else if ("threatAnalysisTactics".equals(fieldName)) { + List threatAnalysisTactics = reader.readArray(reader1 -> reader1.getString()); + deserializedProductTemplateProperties.threatAnalysisTactics = threatAnalysisTactics; + } else if ("threatAnalysisTechniques".equals(fieldName)) { + List threatAnalysisTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedProductTemplateProperties.threatAnalysisTechniques = threatAnalysisTechniques; + } else if ("previewImages".equals(fieldName)) { + List previewImages = reader.readArray(reader1 -> reader1.getString()); + deserializedProductTemplateProperties.previewImages = previewImages; + } else if ("previewImagesDark".equals(fieldName)) { + List previewImagesDark = reader.readArray(reader1 -> reader1.getString()); + deserializedProductTemplateProperties.previewImagesDark = previewImagesDark; + } else if ("packageId".equals(fieldName)) { + deserializedProductTemplateProperties.packageId = reader.getString(); + } else if ("packageKind".equals(fieldName)) { + deserializedProductTemplateProperties.packageKind = PackageKind.fromString(reader.getString()); + } else if ("packageName".equals(fieldName)) { + deserializedProductTemplateProperties.packageName = reader.getString(); + } else if ("isDeprecated".equals(fieldName)) { + deserializedProductTemplateProperties.isDeprecated = Flag.fromString(reader.getString()); + } else if ("packagedContent".equals(fieldName)) { + deserializedProductTemplateProperties.packagedContent = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedProductTemplateProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditCheckRequirementsProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditCheckRequirementsProperties.java new file mode 100644 index 000000000000..929e72a2caac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * PurviewAudit requirements check properties. + */ +@Fluent +public final class PurviewAuditCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of PurviewAuditCheckRequirementsProperties class. + */ + public PurviewAuditCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public PurviewAuditCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurviewAuditCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurviewAuditCheckRequirementsProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PurviewAuditCheckRequirementsProperties. + */ + public static PurviewAuditCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurviewAuditCheckRequirementsProperties deserializedPurviewAuditCheckRequirementsProperties + = new PurviewAuditCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedPurviewAuditCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPurviewAuditCheckRequirementsProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditDataConnectorProperties.java new file mode 100644 index 000000000000..f489208493c2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditDataConnectorProperties.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypes; +import java.io.IOException; + +/** + * PurviewAudit data connector properties. + */ +@Fluent +public final class PurviewAuditDataConnectorProperties extends DataConnectorTenantId { + /* + * The connector definition name (the dataConnectorDefinition resource id). + */ + private String connectorDefinitionName; + + /* + * The source type indicates which kind of data is relevant for this connector. + */ + private String sourceType; + + /* + * The DCR related properties. + */ + private DCRConfiguration dcrConfig; + + /* + * The available data types for the connector. + */ + private PurviewAuditConnectorDataTypes dataTypes; + + /** + * Creates an instance of PurviewAuditDataConnectorProperties class. + */ + public PurviewAuditDataConnectorProperties() { + } + + /** + * Get the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @return the connectorDefinitionName value. + */ + public String connectorDefinitionName() { + return this.connectorDefinitionName; + } + + /** + * Set the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @param connectorDefinitionName the connectorDefinitionName value to set. + * @return the PurviewAuditDataConnectorProperties object itself. + */ + public PurviewAuditDataConnectorProperties withConnectorDefinitionName(String connectorDefinitionName) { + this.connectorDefinitionName = connectorDefinitionName; + return this; + } + + /** + * Get the sourceType property: The source type indicates which kind of data is relevant for this connector. + * + * @return the sourceType value. + */ + public String sourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: The source type indicates which kind of data is relevant for this connector. + * + * @param sourceType the sourceType value to set. + * @return the PurviewAuditDataConnectorProperties object itself. + */ + public PurviewAuditDataConnectorProperties withSourceType(String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the dcrConfig property: The DCR related properties. + * + * @return the dcrConfig value. + */ + public DCRConfiguration dcrConfig() { + return this.dcrConfig; + } + + /** + * Set the dcrConfig property: The DCR related properties. + * + * @param dcrConfig the dcrConfig value to set. + * @return the PurviewAuditDataConnectorProperties object itself. + */ + public PurviewAuditDataConnectorProperties withDcrConfig(DCRConfiguration dcrConfig) { + this.dcrConfig = dcrConfig; + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public PurviewAuditConnectorDataTypes dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: The available data types for the connector. + * + * @param dataTypes the dataTypes value to set. + * @return the PurviewAuditDataConnectorProperties object itself. + */ + public PurviewAuditDataConnectorProperties withDataTypes(PurviewAuditConnectorDataTypes dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PurviewAuditDataConnectorProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + jsonWriter.writeStringField("connectorDefinitionName", this.connectorDefinitionName); + jsonWriter.writeStringField("sourceType", this.sourceType); + jsonWriter.writeJsonField("dcrConfig", this.dcrConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurviewAuditDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurviewAuditDataConnectorProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PurviewAuditDataConnectorProperties. + */ + public static PurviewAuditDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurviewAuditDataConnectorProperties deserializedPurviewAuditDataConnectorProperties + = new PurviewAuditDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedPurviewAuditDataConnectorProperties.withTenantId(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedPurviewAuditDataConnectorProperties.dataTypes + = PurviewAuditConnectorDataTypes.fromJson(reader); + } else if ("connectorDefinitionName".equals(fieldName)) { + deserializedPurviewAuditDataConnectorProperties.connectorDefinitionName = reader.getString(); + } else if ("sourceType".equals(fieldName)) { + deserializedPurviewAuditDataConnectorProperties.sourceType = reader.getString(); + } else if ("dcrConfig".equals(fieldName)) { + deserializedPurviewAuditDataConnectorProperties.dcrConfig = DCRConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPurviewAuditDataConnectorProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/QueryProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/QueryProperties.java new file mode 100644 index 000000000000..be607705b416 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/QueryProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ConditionProperties; +import java.io.IOException; + +/** + * Describes the query properties. + */ +@Fluent +public final class QueryProperties implements JsonSerializable { + /* + * Represents a condition used to query for TI objects. + */ + private ConditionProperties condition; + + /** + * Creates an instance of QueryProperties class. + */ + public QueryProperties() { + } + + /** + * Get the condition property: Represents a condition used to query for TI objects. + * + * @return the condition value. + */ + public ConditionProperties condition() { + return this.condition; + } + + /** + * Set the condition property: Represents a condition used to query for TI objects. + * + * @param condition the condition value to set. + * @return the QueryProperties object itself. + */ + public QueryProperties withCondition(ConditionProperties condition) { + this.condition = condition; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("condition", this.condition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryProperties. + */ + public static QueryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryProperties deserializedQueryProperties = new QueryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("condition".equals(fieldName)) { + deserializedQueryProperties.condition = ConditionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationInner.java new file mode 100644 index 000000000000..671398173c04 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationInner.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion; +import com.azure.resourcemanager.securityinsights.models.State; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Recommendation object. + */ +@Immutable +public final class RecommendationInner extends ProxyResource { + /* + * Recommendation properties object. + */ + private RecommendationProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RecommendationInner class. + */ + private RecommendationInner() { + } + + /** + * Get the innerProperties property: Recommendation properties object. + * + * @return the innerProperties value. + */ + private RecommendationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the recommendationTypeId property: Id of the recommendation type. + * + * @return the recommendationTypeId value. + */ + public String recommendationTypeId() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationTypeId(); + } + + /** + * Get the state property: State of the recommendation. + * + * @return the state value. + */ + public State state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the title property: Title of the recommendation. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * Get the description property: Description of the recommendation. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the creationTimeUtc property: The time stamp (UTC) when the recommendation was created. + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().creationTimeUtc(); + } + + /** + * Get the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @return the lastEvaluatedTimeUtc value. + */ + public OffsetDateTime lastEvaluatedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastEvaluatedTimeUtc(); + } + + /** + * Get the lastModifiedTimeUtc property: The time stamp (UTC) when the recommendation was last modified. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTimeUtc(); + } + + /** + * Get the suggestions property: List of suggestions to take for this recommendation. + * + * @return the suggestions value. + */ + public List suggestions() { + return this.innerProperties() == null ? null : this.innerProperties().suggestions(); + } + + /** + * Get the resourceId property: Id of the resource this recommendation refers to. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); + } + + /** + * Get the additionalProperties property: Collection of additional properties for the recommendation. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.innerProperties() == null ? null : this.innerProperties().additionalProperties(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecommendationInner. + */ + public static RecommendationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationInner deserializedRecommendationInner = new RecommendationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRecommendationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRecommendationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRecommendationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRecommendationInner.innerProperties = RecommendationProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedRecommendationInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedRecommendationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationProperties.java new file mode 100644 index 000000000000..f6370e7677ba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationProperties.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion; +import com.azure.resourcemanager.securityinsights.models.State; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.Map; + +/** + * Recommendation properties object. + */ +@Immutable +public final class RecommendationProperties implements JsonSerializable { + /* + * Id of the recommendation type. + */ + private String recommendationTypeId; + + /* + * State of the recommendation. + */ + private State state; + + /* + * Title of the recommendation. + */ + private String title; + + /* + * Description of the recommendation. + */ + private String description; + + /* + * The time stamp (UTC) when the recommendation was created. + */ + private OffsetDateTime creationTimeUtc; + + /* + * The time stamp (UTC) when the recommendation was last evaluated. + */ + private OffsetDateTime lastEvaluatedTimeUtc; + + /* + * The time stamp (UTC) when the recommendation was last modified. + */ + private OffsetDateTime lastModifiedTimeUtc; + + /* + * List of suggestions to take for this recommendation. + */ + private List suggestions; + + /* + * Id of the resource this recommendation refers to. + */ + private String resourceId; + + /* + * Collection of additional properties for the recommendation. + */ + private Map additionalProperties; + + /** + * Creates an instance of RecommendationProperties class. + */ + private RecommendationProperties() { + } + + /** + * Get the recommendationTypeId property: Id of the recommendation type. + * + * @return the recommendationTypeId value. + */ + public String recommendationTypeId() { + return this.recommendationTypeId; + } + + /** + * Get the state property: State of the recommendation. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Get the title property: Title of the recommendation. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the description property: Description of the recommendation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the creationTimeUtc property: The time stamp (UTC) when the recommendation was created. + * + * @return the creationTimeUtc value. + */ + public OffsetDateTime creationTimeUtc() { + return this.creationTimeUtc; + } + + /** + * Get the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @return the lastEvaluatedTimeUtc value. + */ + public OffsetDateTime lastEvaluatedTimeUtc() { + return this.lastEvaluatedTimeUtc; + } + + /** + * Get the lastModifiedTimeUtc property: The time stamp (UTC) when the recommendation was last modified. + * + * @return the lastModifiedTimeUtc value. + */ + public OffsetDateTime lastModifiedTimeUtc() { + return this.lastModifiedTimeUtc; + } + + /** + * Get the suggestions property: List of suggestions to take for this recommendation. + * + * @return the suggestions value. + */ + public List suggestions() { + return this.suggestions; + } + + /** + * Get the resourceId property: Id of the resource this recommendation refers to. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the additionalProperties property: Collection of additional properties for the recommendation. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("recommendationTypeId", this.recommendationTypeId); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("creationTimeUtc", + this.creationTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.creationTimeUtc)); + jsonWriter.writeStringField("lastEvaluatedTimeUtc", + this.lastEvaluatedTimeUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastEvaluatedTimeUtc)); + jsonWriter.writeStringField("lastModifiedTimeUtc", + this.lastModifiedTimeUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTimeUtc)); + jsonWriter.writeArrayField("suggestions", this.suggestions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeMapField("additionalProperties", this.additionalProperties, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecommendationProperties. + */ + public static RecommendationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationProperties deserializedRecommendationProperties = new RecommendationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recommendationTypeId".equals(fieldName)) { + deserializedRecommendationProperties.recommendationTypeId = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedRecommendationProperties.state = State.fromString(reader.getString()); + } else if ("title".equals(fieldName)) { + deserializedRecommendationProperties.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedRecommendationProperties.description = reader.getString(); + } else if ("creationTimeUtc".equals(fieldName)) { + deserializedRecommendationProperties.creationTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastEvaluatedTimeUtc".equals(fieldName)) { + deserializedRecommendationProperties.lastEvaluatedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedTimeUtc".equals(fieldName)) { + deserializedRecommendationProperties.lastModifiedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("suggestions".equals(fieldName)) { + List suggestions + = reader.readArray(reader1 -> RecommendedSuggestion.fromJson(reader1)); + deserializedRecommendationProperties.suggestions = suggestions; + } else if ("resourceId".equals(fieldName)) { + deserializedRecommendationProperties.resourceId = reader.getString(); + } else if ("additionalProperties".equals(fieldName)) { + Map additionalProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedRecommendationProperties.additionalProperties = additionalProperties; + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ReevaluateResponseInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ReevaluateResponseInner.java new file mode 100644 index 000000000000..887a84cb5be6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ReevaluateResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Reevaluate response object. + */ +@Immutable +public final class ReevaluateResponseInner implements JsonSerializable { + /* + * The time stamp (UTC) when the recommendation was last evaluated. + */ + private OffsetDateTime lastEvaluatedTimeUtc; + + /** + * Creates an instance of ReevaluateResponseInner class. + */ + private ReevaluateResponseInner() { + } + + /** + * Get the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @return the lastEvaluatedTimeUtc value. + */ + public OffsetDateTime lastEvaluatedTimeUtc() { + return this.lastEvaluatedTimeUtc; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastEvaluatedTimeUtc", + this.lastEvaluatedTimeUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastEvaluatedTimeUtc)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReevaluateResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReevaluateResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReevaluateResponseInner. + */ + public static ReevaluateResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReevaluateResponseInner deserializedReevaluateResponseInner = new ReevaluateResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastEvaluatedTimeUtc".equals(fieldName)) { + deserializedReevaluateResponseInner.lastEvaluatedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedReevaluateResponseInner; + }); + } +} 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 index ed4b0663db00..97b8757d46af 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -42,7 +42,7 @@ public final class RegistryKeyEntityProperties extends EntityCommonProperties { /** * Creates an instance of RegistryKeyEntityProperties class. */ - public RegistryKeyEntityProperties() { + private RegistryKeyEntityProperties() { } /** @@ -85,15 +85,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ 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 index 552d05aa45d2..5ad55b35eb6f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -53,7 +53,7 @@ public final class RegistryValueEntityProperties extends EntityCommonProperties /** * Creates an instance of RegistryValueEntityProperties class. */ - public RegistryValueEntityProperties() { + private RegistryValueEntityProperties() { } /** @@ -115,15 +115,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ 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 index d36f972e8ac0..1dbd279552c6 100644 --- 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 @@ -1,27 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import java.io.IOException; /** * Represents a relation between two resources. */ @Fluent -public final class RelationInner extends ResourceWithEtag { +public final class RelationInner extends ProxyResource { /* * Relation properties */ private RelationProperties innerProperties; + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -57,12 +62,31 @@ private RelationProperties innerProperties() { return this.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 RelationInner object itself. + */ + public RelationInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -97,15 +121,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public RelationInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the relatedResourceId property: The resource ID of the related resource. * @@ -156,26 +171,14 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -201,12 +204,12 @@ public static RelationInner fromJson(JsonReader jsonReader) throws IOException { deserializedRelationInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedRelationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRelationInner.innerProperties = RelationProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { - deserializedRelationInner.withEtag(reader.getString()); + deserializedRelationInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedRelationInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedRelationInner.innerProperties = RelationProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index f77fad7267a0..2e9e5d413700 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -90,21 +89,6 @@ 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.atError() - .log(new IllegalArgumentException( - "Missing required property relatedResourceId in model RelationProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RelationProperties.class); - /** * {@inheritDoc} */ 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..b00843d689b1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a repository. + */ +@Immutable +public final class RepoInner implements JsonSerializable { + /* + * The url to access the repository. + */ + private String url; + + /* + * The name of the repository. + */ + private String fullName; + + /* + * The installation id of the repository. + */ + private Long installationId; + + /* + * Array of branches. + */ + private List branches; + + /** + * Creates an instance of RepoInner class. + */ + private RepoInner() { + } + + /** + * Get the url property: The url to access the repository. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the fullName property: The name of the repository. + * + * @return the fullName value. + */ + public String fullName() { + return this.fullName; + } + + /** + * Get the installationId property: The installation id of the repository. + * + * @return the installationId value. + */ + public Long installationId() { + return this.installationId; + } + + /** + * Get the branches property: Array of branches. + * + * @return the branches value. + */ + public List branches() { + return this.branches; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("fullName", this.fullName); + jsonWriter.writeNumberField("installationId", this.installationId); + jsonWriter.writeArrayField("branches", this.branches, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepoInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the RepoInner. + */ + public static RepoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepoInner deserializedRepoInner = new RepoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedRepoInner.url = reader.getString(); + } else if ("fullName".equals(fieldName)) { + deserializedRepoInner.fullName = reader.getString(); + } else if ("installationId".equals(fieldName)) { + deserializedRepoInner.installationId = reader.getNullable(JsonReader::getLong); + } else if ("branches".equals(fieldName)) { + List branches = reader.readArray(reader1 -> reader1.getString()); + deserializedRepoInner.branches = branches; + } else { + reader.skipChildren(); + } + } + + return deserializedRepoInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccess.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccess.java new file mode 100644 index 000000000000..a88352284151 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccess.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import java.io.IOException; + +/** + * Credentials to access repository. + */ +@Fluent +public final class RepositoryAccess implements JsonSerializable { + /* + * The kind of repository access credentials + */ + private RepositoryAccessKind kind; + + /* + * OAuth Code. Required when `kind` is `OAuth` + */ + private String code; + + /* + * OAuth State. Required when `kind` is `OAuth` + */ + private String state; + + /* + * OAuth ClientId. Required when `kind` is `OAuth` + */ + private String clientId; + + /* + * Personal Access Token. Required when `kind` is `PAT` + */ + private String token; + + /* + * Application installation ID. Required when `kind` is `App`. Supported by `GitHub` only. + */ + private String installationId; + + /** + * Creates an instance of RepositoryAccess class. + */ + public RepositoryAccess() { + } + + /** + * Get the kind property: The kind of repository access credentials. + * + * @return the kind value. + */ + public RepositoryAccessKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of repository access credentials. + * + * @param kind the kind value to set. + * @return the RepositoryAccess object itself. + */ + public RepositoryAccess withKind(RepositoryAccessKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the code property: OAuth Code. Required when `kind` is `OAuth`. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: OAuth Code. Required when `kind` is `OAuth`. + * + * @param code the code value to set. + * @return the RepositoryAccess object itself. + */ + public RepositoryAccess withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the state property: OAuth State. Required when `kind` is `OAuth`. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: OAuth State. Required when `kind` is `OAuth`. + * + * @param state the state value to set. + * @return the RepositoryAccess object itself. + */ + public RepositoryAccess withState(String state) { + this.state = state; + return this; + } + + /** + * Get the clientId property: OAuth ClientId. Required when `kind` is `OAuth`. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: OAuth ClientId. Required when `kind` is `OAuth`. + * + * @param clientId the clientId value to set. + * @return the RepositoryAccess object itself. + */ + public RepositoryAccess withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the token property: Personal Access Token. Required when `kind` is `PAT`. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Set the token property: Personal Access Token. Required when `kind` is `PAT`. + * + * @param token the token value to set. + * @return the RepositoryAccess object itself. + */ + public RepositoryAccess withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the installationId property: Application installation ID. Required when `kind` is `App`. Supported by + * `GitHub` only. + * + * @return the installationId value. + */ + public String installationId() { + return this.installationId; + } + + /** + * Set the installationId property: Application installation ID. Required when `kind` is `App`. Supported by + * `GitHub` only. + * + * @param installationId the installationId value to set. + * @return the RepositoryAccess object itself. + */ + public RepositoryAccess withInstallationId(String installationId) { + this.installationId = installationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("token", this.token); + jsonWriter.writeStringField("installationId", this.installationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepositoryAccess from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepositoryAccess if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RepositoryAccess. + */ + public static RepositoryAccess fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepositoryAccess deserializedRepositoryAccess = new RepositoryAccess(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedRepositoryAccess.kind = RepositoryAccessKind.fromString(reader.getString()); + } else if ("code".equals(fieldName)) { + deserializedRepositoryAccess.code = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedRepositoryAccess.state = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedRepositoryAccess.clientId = reader.getString(); + } else if ("token".equals(fieldName)) { + deserializedRepositoryAccess.token = reader.getString(); + } else if ("installationId".equals(fieldName)) { + deserializedRepositoryAccess.installationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRepositoryAccess; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccessObject.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccessObject.java new file mode 100644 index 000000000000..e07cc9996a43 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccessObject.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import java.io.IOException; + +/** + * Credentials to access repository. + */ +@Fluent +public final class RepositoryAccessObject implements JsonSerializable { + /* + * RepositoryAccess properties + */ + private RepositoryAccess innerRepositoryAccess = new RepositoryAccess(); + + /** + * Creates an instance of RepositoryAccessObject class. + */ + public RepositoryAccessObject() { + } + + /** + * Get the innerRepositoryAccess property: RepositoryAccess properties. + * + * @return the innerRepositoryAccess value. + */ + private RepositoryAccess innerRepositoryAccess() { + return this.innerRepositoryAccess; + } + + /** + * Get the kind property: The kind of repository access credentials. + * + * @return the kind value. + */ + public RepositoryAccessKind kind() { + return this.innerRepositoryAccess() == null ? null : this.innerRepositoryAccess().kind(); + } + + /** + * Set the kind property: The kind of repository access credentials. + * + * @param kind the kind value to set. + * @return the RepositoryAccessObject object itself. + */ + public RepositoryAccessObject withKind(RepositoryAccessKind kind) { + if (this.innerRepositoryAccess() == null) { + this.innerRepositoryAccess = new RepositoryAccess(); + } + this.innerRepositoryAccess().withKind(kind); + return this; + } + + /** + * Get the code property: OAuth Code. Required when `kind` is `OAuth`. + * + * @return the code value. + */ + public String code() { + return this.innerRepositoryAccess() == null ? null : this.innerRepositoryAccess().code(); + } + + /** + * Set the code property: OAuth Code. Required when `kind` is `OAuth`. + * + * @param code the code value to set. + * @return the RepositoryAccessObject object itself. + */ + public RepositoryAccessObject withCode(String code) { + if (this.innerRepositoryAccess() == null) { + this.innerRepositoryAccess = new RepositoryAccess(); + } + this.innerRepositoryAccess().withCode(code); + return this; + } + + /** + * Get the state property: OAuth State. Required when `kind` is `OAuth`. + * + * @return the state value. + */ + public String state() { + return this.innerRepositoryAccess() == null ? null : this.innerRepositoryAccess().state(); + } + + /** + * Set the state property: OAuth State. Required when `kind` is `OAuth`. + * + * @param state the state value to set. + * @return the RepositoryAccessObject object itself. + */ + public RepositoryAccessObject withState(String state) { + if (this.innerRepositoryAccess() == null) { + this.innerRepositoryAccess = new RepositoryAccess(); + } + this.innerRepositoryAccess().withState(state); + return this; + } + + /** + * Get the clientId property: OAuth ClientId. Required when `kind` is `OAuth`. + * + * @return the clientId value. + */ + public String clientId() { + return this.innerRepositoryAccess() == null ? null : this.innerRepositoryAccess().clientId(); + } + + /** + * Set the clientId property: OAuth ClientId. Required when `kind` is `OAuth`. + * + * @param clientId the clientId value to set. + * @return the RepositoryAccessObject object itself. + */ + public RepositoryAccessObject withClientId(String clientId) { + if (this.innerRepositoryAccess() == null) { + this.innerRepositoryAccess = new RepositoryAccess(); + } + this.innerRepositoryAccess().withClientId(clientId); + return this; + } + + /** + * Get the token property: Personal Access Token. Required when `kind` is `PAT`. + * + * @return the token value. + */ + public String token() { + return this.innerRepositoryAccess() == null ? null : this.innerRepositoryAccess().token(); + } + + /** + * Set the token property: Personal Access Token. Required when `kind` is `PAT`. + * + * @param token the token value to set. + * @return the RepositoryAccessObject object itself. + */ + public RepositoryAccessObject withToken(String token) { + if (this.innerRepositoryAccess() == null) { + this.innerRepositoryAccess = new RepositoryAccess(); + } + this.innerRepositoryAccess().withToken(token); + return this; + } + + /** + * Get the installationId property: Application installation ID. Required when `kind` is `App`. Supported by + * `GitHub` only. + * + * @return the installationId value. + */ + public String installationId() { + return this.innerRepositoryAccess() == null ? null : this.innerRepositoryAccess().installationId(); + } + + /** + * Set the installationId property: Application installation ID. Required when `kind` is `App`. Supported by + * `GitHub` only. + * + * @param installationId the installationId value to set. + * @return the RepositoryAccessObject object itself. + */ + public RepositoryAccessObject withInstallationId(String installationId) { + if (this.innerRepositoryAccess() == null) { + this.innerRepositoryAccess = new RepositoryAccess(); + } + this.innerRepositoryAccess().withInstallationId(installationId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("repositoryAccess", this.innerRepositoryAccess); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepositoryAccessObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepositoryAccessObject if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RepositoryAccessObject. + */ + public static RepositoryAccessObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepositoryAccessObject deserializedRepositoryAccessObject = new RepositoryAccessObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("repositoryAccess".equals(fieldName)) { + deserializedRepositoryAccessObject.innerRepositoryAccess = RepositoryAccess.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRepositoryAccessObject; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RestApiPollerDataConnectorProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RestApiPollerDataConnectorProperties.java new file mode 100644 index 000000000000..2bc3348fadfc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RestApiPollerDataConnectorProperties.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.CcpAuthConfig; +import com.azure.resourcemanager.securityinsights.models.CcpResponseConfig; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestConfig; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingConfig; +import java.io.IOException; +import java.util.Map; + +/** + * Rest Api Poller data connector properties. + */ +@Fluent +public final class RestApiPollerDataConnectorProperties + implements JsonSerializable { + /* + * The connector definition name (the dataConnectorDefinition resource id). + */ + private String connectorDefinitionName; + + /* + * The a authentication model. + */ + private CcpAuthConfig auth; + + /* + * The request configuration. + */ + private RestApiPollerRequestConfig request; + + /* + * The DCR related properties. + */ + private DCRConfiguration dcrConfig; + + /* + * Indicates whether the connector is active or not. + */ + private Boolean isActive; + + /* + * The Log Analytics table destination. + */ + private String dataType; + + /* + * The response configuration. + */ + private CcpResponseConfig response; + + /* + * The paging configuration. + */ + private RestApiPollerRequestPagingConfig paging; + + /* + * The add on attributes. The key name will become attribute name (a column) and the value will become the attribute + * value in the payload. + */ + private Map addOnAttributes; + + /** + * Creates an instance of RestApiPollerDataConnectorProperties class. + */ + public RestApiPollerDataConnectorProperties() { + } + + /** + * Get the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @return the connectorDefinitionName value. + */ + public String connectorDefinitionName() { + return this.connectorDefinitionName; + } + + /** + * Set the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @param connectorDefinitionName the connectorDefinitionName value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withConnectorDefinitionName(String connectorDefinitionName) { + this.connectorDefinitionName = connectorDefinitionName; + return this; + } + + /** + * Get the auth property: The a authentication model. + * + * @return the auth value. + */ + public CcpAuthConfig auth() { + return this.auth; + } + + /** + * Set the auth property: The a authentication model. + * + * @param auth the auth value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withAuth(CcpAuthConfig auth) { + this.auth = auth; + return this; + } + + /** + * Get the request property: The request configuration. + * + * @return the request value. + */ + public RestApiPollerRequestConfig request() { + return this.request; + } + + /** + * Set the request property: The request configuration. + * + * @param request the request value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withRequest(RestApiPollerRequestConfig request) { + this.request = request; + return this; + } + + /** + * Get the dcrConfig property: The DCR related properties. + * + * @return the dcrConfig value. + */ + public DCRConfiguration dcrConfig() { + return this.dcrConfig; + } + + /** + * Set the dcrConfig property: The DCR related properties. + * + * @param dcrConfig the dcrConfig value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withDcrConfig(DCRConfiguration dcrConfig) { + this.dcrConfig = dcrConfig; + return this; + } + + /** + * Get the isActive property: Indicates whether the connector is active or not. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Set the isActive property: Indicates whether the connector is active or not. + * + * @param isActive the isActive value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withIsActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get the dataType property: The Log Analytics table destination. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * Set the dataType property: The Log Analytics table destination. + * + * @param dataType the dataType value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withDataType(String dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the response property: The response configuration. + * + * @return the response value. + */ + public CcpResponseConfig response() { + return this.response; + } + + /** + * Set the response property: The response configuration. + * + * @param response the response value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withResponse(CcpResponseConfig response) { + this.response = response; + return this; + } + + /** + * Get the paging property: The paging configuration. + * + * @return the paging value. + */ + public RestApiPollerRequestPagingConfig paging() { + return this.paging; + } + + /** + * Set the paging property: The paging configuration. + * + * @param paging the paging value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withPaging(RestApiPollerRequestPagingConfig paging) { + this.paging = paging; + return this; + } + + /** + * Get the addOnAttributes property: The add on attributes. The key name will become attribute name (a column) and + * the value will become the attribute value in the payload. + * + * @return the addOnAttributes value. + */ + public Map addOnAttributes() { + return this.addOnAttributes; + } + + /** + * Set the addOnAttributes property: The add on attributes. The key name will become attribute name (a column) and + * the value will become the attribute value in the payload. + * + * @param addOnAttributes the addOnAttributes value to set. + * @return the RestApiPollerDataConnectorProperties object itself. + */ + public RestApiPollerDataConnectorProperties withAddOnAttributes(Map addOnAttributes) { + this.addOnAttributes = addOnAttributes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectorDefinitionName", this.connectorDefinitionName); + jsonWriter.writeJsonField("auth", this.auth); + jsonWriter.writeJsonField("request", this.request); + jsonWriter.writeJsonField("dcrConfig", this.dcrConfig); + jsonWriter.writeBooleanField("isActive", this.isActive); + jsonWriter.writeStringField("dataType", this.dataType); + jsonWriter.writeJsonField("response", this.response); + jsonWriter.writeJsonField("paging", this.paging); + jsonWriter.writeMapField("addOnAttributes", this.addOnAttributes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestApiPollerDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestApiPollerDataConnectorProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RestApiPollerDataConnectorProperties. + */ + public static RestApiPollerDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestApiPollerDataConnectorProperties deserializedRestApiPollerDataConnectorProperties + = new RestApiPollerDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectorDefinitionName".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.connectorDefinitionName = reader.getString(); + } else if ("auth".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.auth = CcpAuthConfig.fromJson(reader); + } else if ("request".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.request + = RestApiPollerRequestConfig.fromJson(reader); + } else if ("dcrConfig".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.dcrConfig = DCRConfiguration.fromJson(reader); + } else if ("isActive".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.isActive + = reader.getNullable(JsonReader::getBoolean); + } else if ("dataType".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.dataType = reader.getString(); + } else if ("response".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.response = CcpResponseConfig.fromJson(reader); + } else if ("paging".equals(fieldName)) { + deserializedRestApiPollerDataConnectorProperties.paging + = RestApiPollerRequestPagingConfig.fromJson(reader); + } else if ("addOnAttributes".equals(fieldName)) { + Map addOnAttributes = reader.readMap(reader1 -> reader1.getString()); + deserializedRestApiPollerDataConnectorProperties.addOnAttributes = addOnAttributes; + } else { + reader.skipChildren(); + } + } + + return deserializedRestApiPollerDataConnectorProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SapSolutionUsageStatisticProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SapSolutionUsageStatisticProperties.java new file mode 100644 index 000000000000..e14b60c14c21 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SapSolutionUsageStatisticProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the billing statistic about the Microsoft Sentinel solution for SAP usage. + */ +@Immutable +public final class SapSolutionUsageStatisticProperties + implements JsonSerializable { + /* + * The latest count of active SAP system IDs under the Microsoft Sentinel solution for SAP Usage + */ + private Long activeSystemIdCount; + + /** + * Creates an instance of SapSolutionUsageStatisticProperties class. + */ + private SapSolutionUsageStatisticProperties() { + } + + /** + * Get the activeSystemIdCount property: The latest count of active SAP system IDs under the Microsoft Sentinel + * solution for SAP Usage. + * + * @return the activeSystemIdCount value. + */ + public Long activeSystemIdCount() { + return this.activeSystemIdCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapSolutionUsageStatisticProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapSolutionUsageStatisticProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SapSolutionUsageStatisticProperties. + */ + public static SapSolutionUsageStatisticProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapSolutionUsageStatisticProperties deserializedSapSolutionUsageStatisticProperties + = new SapSolutionUsageStatisticProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activeSystemIdCount".equals(fieldName)) { + deserializedSapSolutionUsageStatisticProperties.activeSystemIdCount + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedSapSolutionUsageStatisticProperties; + }); + } +} 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 index 65cef73d2007..5613ebedb63e 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -17,6 +16,7 @@ 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.SentinelEntityMapping; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.io.IOException; import java.time.Duration; @@ -80,6 +80,11 @@ public final class ScheduledAlertRuleProperties extends ScheduledAlertRuleCommon */ private List techniques; + /* + * The sub-techniques of the alert rule + */ + private List subTechniques; + /* * The settings of the incidents that created from alerts triggered by this analytics rule */ @@ -286,6 +291,26 @@ public ScheduledAlertRuleProperties withTechniques(List techniques) { return this; } + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.subTechniques; + } + + /** + * Set the subTechniques property: The sub-techniques of the alert rule. + * + * @param subTechniques the subTechniques value to set. + * @return the ScheduledAlertRuleProperties object itself. + */ + public ScheduledAlertRuleProperties withSubTechniques(List subTechniques) { + this.subTechniques = subTechniques; + return this; + } + /** * Get the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this * analytics rule. @@ -399,37 +424,14 @@ public ScheduledAlertRuleProperties withAlertDetailsOverride(AlertDetailsOverrid } /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. + * {@inheritDoc} */ @Override - public void validate() { - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model ScheduledAlertRuleProperties")); - } - if (suppressionDuration() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property suppressionDuration in model ScheduledAlertRuleProperties")); - } - if (incidentConfiguration() != null) { - incidentConfiguration().validate(); - } - if (eventGroupingSettings() != null) { - eventGroupingSettings().validate(); - } - if (entityMappings() != null) { - entityMappings().forEach(e -> e.validate()); - } - if (alertDetailsOverride() != null) { - alertDetailsOverride().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ScheduledAlertRuleProperties.class); + public ScheduledAlertRuleProperties + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + super.withSentinelEntitiesMappings(sentinelEntitiesMappings); + return this; + } /** * {@inheritDoc} @@ -447,6 +449,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeMapField("customDetails", customDetails(), (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("entityMappings", entityMappings(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("alertDetailsOverride", alertDetailsOverride()); + jsonWriter.writeArrayField("sentinelEntitiesMappings", sentinelEntitiesMappings(), + (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("displayName", this.displayName); jsonWriter.writeBooleanField("enabled", this.enabled); jsonWriter.writeStringField("suppressionDuration", @@ -458,6 +462,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("tactics", this.tactics, (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subTechniques", this.subTechniques, + (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("incidentConfiguration", this.incidentConfiguration); return jsonWriter.writeEndObject(); } @@ -506,6 +512,10 @@ public static ScheduledAlertRuleProperties fromJson(JsonReader jsonReader) throw } else if ("alertDetailsOverride".equals(fieldName)) { deserializedScheduledAlertRuleProperties .withAlertDetailsOverride(AlertDetailsOverride.fromJson(reader)); + } else if ("sentinelEntitiesMappings".equals(fieldName)) { + List sentinelEntitiesMappings + = reader.readArray(reader1 -> SentinelEntityMapping.fromJson(reader1)); + deserializedScheduledAlertRuleProperties.withSentinelEntitiesMappings(sentinelEntitiesMappings); } else if ("displayName".equals(fieldName)) { deserializedScheduledAlertRuleProperties.displayName = reader.getString(); } else if ("enabled".equals(fieldName)) { @@ -531,6 +541,9 @@ public static ScheduledAlertRuleProperties fromJson(JsonReader jsonReader) throw } else if ("techniques".equals(fieldName)) { List techniques = reader.readArray(reader1 -> reader1.getString()); deserializedScheduledAlertRuleProperties.techniques = techniques; + } else if ("subTechniques".equals(fieldName)) { + List subTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedScheduledAlertRuleProperties.subTechniques = subTechniques; } else if ("incidentConfiguration".equals(fieldName)) { deserializedScheduledAlertRuleProperties.incidentConfiguration = IncidentConfiguration.fromJson(reader); 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 index 1e674e1d961b..52d98aadbd04 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -16,6 +16,7 @@ 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.SentinelEntityMapping; import com.azure.resourcemanager.securityinsights.models.TemplateStatus; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.io.IOException; @@ -27,11 +28,11 @@ /** * Scheduled alert rule template properties. */ -@Fluent +@Immutable public final class ScheduledAlertRuleTemplateProperties implements JsonSerializable { /* - * the number of alert rules that were created by this template + * The number of alert rules that were created by this template */ private Integer alertRulesCreatedByTemplateCount; @@ -101,10 +102,15 @@ public final class ScheduledAlertRuleTemplateProperties private List tactics; /* - * The techniques of the alert rule template + * The techniques of the alert rule */ private List techniques; + /* + * The sub-techniques of the alert rule + */ + private List subTechniques; + /* * The version of this template - in format , where all are numbers. For example <1.0.2>. */ @@ -130,14 +136,19 @@ public final class ScheduledAlertRuleTemplateProperties */ private AlertDetailsOverride alertDetailsOverride; + /* + * Array of the sentinel entity mappings of the alert rule + */ + private List sentinelEntitiesMappings; + /** * Creates an instance of ScheduledAlertRuleTemplateProperties class. */ - public ScheduledAlertRuleTemplateProperties() { + private ScheduledAlertRuleTemplateProperties() { } /** - * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. * * @return the alertRulesCreatedByTemplateCount value. */ @@ -145,18 +156,6 @@ 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 ScheduledAlertRuleTemplateProperties object itself. - */ - public ScheduledAlertRuleTemplateProperties - withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { - this.alertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - return this; - } - /** * Get the createdDateUtc property: The time that this alert rule template has been added. * @@ -184,17 +183,6 @@ 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 ScheduledAlertRuleTemplateProperties object itself. - */ - public ScheduledAlertRuleTemplateProperties withDescription(String description) { - this.description = description; - return this; - } - /** * Get the displayName property: The display name for alert rule template. * @@ -204,17 +192,6 @@ 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 ScheduledAlertRuleTemplateProperties object itself. - */ - public ScheduledAlertRuleTemplateProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - /** * Get the requiredDataConnectors property: The required data connectors for this template. * @@ -224,18 +201,6 @@ public List requiredDataConnectors() { return this.requiredDataConnectors; } - /** - * Set the requiredDataConnectors property: The required data connectors for this template. - * - * @param requiredDataConnectors the requiredDataConnectors value to set. - * @return the ScheduledAlertRuleTemplateProperties object itself. - */ - public ScheduledAlertRuleTemplateProperties - withRequiredDataConnectors(List requiredDataConnectors) { - this.requiredDataConnectors = requiredDataConnectors; - return this; - } - /** * Get the status property: The alert rule template status. * @@ -245,17 +210,6 @@ public TemplateStatus status() { return this.status; } - /** - * Set the status property: The alert rule template status. - * - * @param status the status value to set. - * @return the ScheduledAlertRuleTemplateProperties object itself. - */ - public ScheduledAlertRuleTemplateProperties withStatus(TemplateStatus status) { - this.status = status; - return this; - } - /** * Get the query property: The query that creates alerts for this rule. * @@ -265,17 +219,6 @@ 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 queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. * @@ -285,17 +228,6 @@ 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. * @@ -305,17 +237,6 @@ 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 severity property: The severity for alerts created by this alert rule. * @@ -325,17 +246,6 @@ 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 triggerOperator property: The operation against the threshold that triggers alert rule. * @@ -345,17 +255,6 @@ 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. * @@ -365,17 +264,6 @@ 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 tactics property: The tactics of the alert rule template. * @@ -386,18 +274,7 @@ public List tactics() { } /** - * Set the tactics property: The tactics of the alert rule template. - * - * @param tactics the tactics value to set. - * @return the ScheduledAlertRuleTemplateProperties object itself. - */ - public ScheduledAlertRuleTemplateProperties withTactics(List tactics) { - this.tactics = tactics; - return this; - } - - /** - * Get the techniques property: The techniques of the alert rule template. + * Get the techniques property: The techniques of the alert rule. * * @return the techniques value. */ @@ -406,14 +283,12 @@ public List techniques() { } /** - * Set the techniques property: The techniques of the alert rule template. + * Get the subTechniques property: The sub-techniques of the alert rule. * - * @param techniques the techniques value to set. - * @return the ScheduledAlertRuleTemplateProperties object itself. + * @return the subTechniques value. */ - public ScheduledAlertRuleTemplateProperties withTechniques(List techniques) { - this.techniques = techniques; - return this; + public List subTechniques() { + return this.subTechniques; } /** @@ -426,18 +301,6 @@ 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 eventGroupingSettings property: The event grouping settings. * @@ -447,17 +310,6 @@ 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; - } - /** * Get the customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. * @@ -467,17 +319,6 @@ 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. * @@ -487,17 +328,6 @@ 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. * @@ -508,34 +338,12 @@ public AlertDetailsOverride alertDetailsOverride() { } /** - * Set the alertDetailsOverride property: The alert details override settings. + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. * - * @param alertDetailsOverride the alertDetailsOverride value to set. - * @return the ScheduledAlertRuleTemplateProperties object itself. + * @return the sentinelEntitiesMappings value. */ - public ScheduledAlertRuleTemplateProperties withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { - this.alertDetailsOverride = alertDetailsOverride; - 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()); - } - if (eventGroupingSettings() != null) { - eventGroupingSettings().validate(); - } - if (entityMappings() != null) { - entityMappings().forEach(e -> e.validate()); - } - if (alertDetailsOverride() != null) { - alertDetailsOverride().validate(); - } + public List sentinelEntitiesMappings() { + return this.sentinelEntitiesMappings; } /** @@ -560,12 +368,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("tactics", this.tactics, (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subTechniques", this.subTechniques, + (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("version", this.version); jsonWriter.writeJsonField("eventGroupingSettings", this.eventGroupingSettings); jsonWriter.writeMapField("customDetails", this.customDetails, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("entityMappings", this.entityMappings, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("alertDetailsOverride", this.alertDetailsOverride); + jsonWriter.writeArrayField("sentinelEntitiesMappings", this.sentinelEntitiesMappings, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -629,6 +441,9 @@ public static ScheduledAlertRuleTemplateProperties fromJson(JsonReader jsonReade } else if ("techniques".equals(fieldName)) { List techniques = reader.readArray(reader1 -> reader1.getString()); deserializedScheduledAlertRuleTemplateProperties.techniques = techniques; + } else if ("subTechniques".equals(fieldName)) { + List subTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedScheduledAlertRuleTemplateProperties.subTechniques = subTechniques; } else if ("version".equals(fieldName)) { deserializedScheduledAlertRuleTemplateProperties.version = reader.getString(); } else if ("eventGroupingSettings".equals(fieldName)) { @@ -643,6 +458,11 @@ public static ScheduledAlertRuleTemplateProperties fromJson(JsonReader jsonReade } else if ("alertDetailsOverride".equals(fieldName)) { deserializedScheduledAlertRuleTemplateProperties.alertDetailsOverride = AlertDetailsOverride.fromJson(reader); + } else if ("sentinelEntitiesMappings".equals(fieldName)) { + List sentinelEntitiesMappings + = reader.readArray(reader1 -> SentinelEntityMapping.fromJson(reader1)); + deserializedScheduledAlertRuleTemplateProperties.sentinelEntitiesMappings + = sentinelEntitiesMappings; } else { reader.skipChildren(); } 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 index 19a2db480876..96e70c917058 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -25,7 +25,7 @@ /** * SecurityAlert entity property bag. */ -@Fluent +@Immutable public final class SecurityAlertProperties extends EntityCommonProperties { /* * The display name of the alert. @@ -167,7 +167,7 @@ public final class SecurityAlertProperties extends EntityCommonProperties { /** * Creates an instance of SecurityAlertProperties class. */ - public SecurityAlertProperties() { + private SecurityAlertProperties() { } /** @@ -325,17 +325,6 @@ 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). @@ -431,18 +420,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (confidenceReasons() != null) { - confidenceReasons().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 index 2a1850dbd719..fc94918140ac 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -11,7 +11,6 @@ import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * SecurityGroup entity property bag. @@ -26,7 +25,7 @@ public final class SecurityGroupEntityProperties extends EntityCommonProperties /* * A single-value attribute that is the unique identifier for the object, assigned by active directory. */ - private UUID objectGuid; + private String objectGuid; /* * The SID attribute is a single-value attribute that specifies the security identifier (SID) of the group @@ -47,7 +46,7 @@ public final class SecurityGroupEntityProperties extends EntityCommonProperties /** * Creates an instance of SecurityGroupEntityProperties class. */ - public SecurityGroupEntityProperties() { + private SecurityGroupEntityProperties() { } /** @@ -65,7 +64,7 @@ public String distinguishedName() { * * @return the objectGuid value. */ - public UUID objectGuid() { + public String objectGuid() { return this.objectGuid; } @@ -101,15 +100,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -143,8 +133,7 @@ public static SecurityGroupEntityProperties fromJson(JsonReader jsonReader) thro } else if ("distinguishedName".equals(fieldName)) { deserializedSecurityGroupEntityProperties.distinguishedName = reader.getString(); } else if ("objectGuid".equals(fieldName)) { - deserializedSecurityGroupEntityProperties.objectGuid - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedSecurityGroupEntityProperties.objectGuid = reader.getString(); } else if ("sid".equals(fieldName)) { deserializedSecurityGroupEntityProperties.sid = reader.getString(); } else { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityMLAnalyticsSettingInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityMLAnalyticsSettingInner.java index bf6974991be3..81a74f5fc128 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityMLAnalyticsSettingInner.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityMLAnalyticsSettingInner.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.securityinsights.models.AnomalySecurityMLAnalyticsSettings; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsKind; import java.io.IOException; @@ -18,13 +18,20 @@ * Security ML Analytics Setting. */ @Fluent -public class SecurityMLAnalyticsSettingInner extends ResourceWithEtag { +public class SecurityMLAnalyticsSettingInner extends ProxyResource { /* - * The kind of security ML Analytics Settings + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private SecurityMLAnalyticsSettingsKind kind = SecurityMLAnalyticsSettingsKind.fromString("SecurityMLAnalyticsSetting"); + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -52,7 +59,9 @@ public SecurityMLAnalyticsSettingInner() { } /** - * Get the kind property: The kind of security ML Analytics Settings. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -60,16 +69,46 @@ public SecurityMLAnalyticsSettingsKind kind() { return this.kind; } + /** + * 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 SecurityMLAnalyticsSettingInner object itself. + */ + public SecurityMLAnalyticsSettingInner 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. */ - @Override public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the SecurityMLAnalyticsSettingInner object itself. + */ + SecurityMLAnalyticsSettingInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -100,32 +139,14 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public SecurityMLAnalyticsSettingInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -177,13 +198,13 @@ static SecurityMLAnalyticsSettingInner fromJsonKnownDiscriminator(JsonReader jso deserializedSecurityMLAnalyticsSettingInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSecurityMLAnalyticsSettingInner.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedSecurityMLAnalyticsSettingInner.withEtag(reader.getString()); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityMLAnalyticsSettingInner.systemData = SystemData.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedSecurityMLAnalyticsSettingInner.kind = SecurityMLAnalyticsSettingsKind.fromString(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedSecurityMLAnalyticsSettingInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSecurityMLAnalyticsSettingInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 index 5321f97c79d0..97eee12426a0 100644 --- 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 @@ -1,27 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import java.io.IOException; /** * Sentinel onboarding state. */ @Fluent -public final class SentinelOnboardingStateInner extends ResourceWithEtag { +public final class SentinelOnboardingStateInner extends ProxyResource { /* * The Sentinel onboarding state object */ private SentinelOnboardingStateProperties innerProperties; + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -57,12 +62,31 @@ private SentinelOnboardingStateProperties innerProperties() { return this.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 SentinelOnboardingStateInner object itself. + */ + public SentinelOnboardingStateInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -97,15 +121,6 @@ public String id() { return this.id; } - /** - * {@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. * @@ -129,26 +144,14 @@ public SentinelOnboardingStateInner withCustomerManagedKey(Boolean customerManag return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -174,13 +177,13 @@ public static SentinelOnboardingStateInner fromJson(JsonReader jsonReader) throw deserializedSentinelOnboardingStateInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSentinelOnboardingStateInner.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedSentinelOnboardingStateInner.withEtag(reader.getString()); - } else if ("systemData".equals(fieldName)) { - deserializedSentinelOnboardingStateInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedSentinelOnboardingStateInner.innerProperties = SentinelOnboardingStateProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedSentinelOnboardingStateInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSentinelOnboardingStateInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 index 74633f9d9751..d2f9cc6c18aa 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -47,14 +47,6 @@ public SentinelOnboardingStateProperties withCustomerManagedKey(Boolean customer return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index fa660096dce9..40c4378c28ee 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +15,7 @@ /** * List of the Sentinel onboarding states. */ -@Fluent +@Immutable public final class SentinelOnboardingStatesListInner implements JsonSerializable { /* * Array of Sentinel onboarding states @@ -26,7 +25,7 @@ public final class SentinelOnboardingStatesListInner implements JsonSerializable /** * Creates an instance of SentinelOnboardingStatesListInner class. */ - public SentinelOnboardingStatesListInner() { + private SentinelOnboardingStatesListInner() { } /** @@ -38,34 +37,6 @@ 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.atError() - .log(new IllegalArgumentException( - "Missing required property value in model SentinelOnboardingStatesListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SentinelOnboardingStatesListInner.class); - /** * {@inheritDoc} */ 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..8ac303bad4ca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.SettingKind; +import com.azure.resourcemanager.securityinsights.models.Ueba; +import java.io.IOException; + +/** + * The Setting. + */ +@Fluent +public class SettingsInner extends ProxyResource { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private SettingKind kind = SettingKind.fromString("Settings"); + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SettingsInner class. + */ + public SettingsInner() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + public SettingKind kind() { + return this.kind; + } + + /** + * 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 SettingsInner object itself. + */ + public SettingsInner 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the SettingsInner object itself. + */ + SettingsInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SettingsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SettingsInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SettingsInner. + */ + public static SettingsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Anomalies".equals(discriminatorValue)) { + return Anomalies.fromJson(readerToUse.reset()); + } else if ("EyesOn".equals(discriminatorValue)) { + return EyesOn.fromJson(readerToUse.reset()); + } else if ("EntityAnalytics".equals(discriminatorValue)) { + return EntityAnalytics.fromJson(readerToUse.reset()); + } else if ("Ueba".equals(discriminatorValue)) { + return Ueba.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SettingsInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SettingsInner deserializedSettingsInner = new SettingsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSettingsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSettingsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSettingsInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedSettingsInner.kind = SettingKind.fromString(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedSettingsInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSettingsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSettingsInner; + }); + } +} 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..910e2166af23 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlInner.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.DeploymentInfo; +import com.azure.resourcemanager.securityinsights.models.PullRequest; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import com.azure.resourcemanager.securityinsights.models.RepositoryResourceInfo; +import com.azure.resourcemanager.securityinsights.models.ServicePrincipal; +import com.azure.resourcemanager.securityinsights.models.Version; +import com.azure.resourcemanager.securityinsights.models.WorkloadIdentityFederation; +import java.io.IOException; +import java.util.List; + +/** + * Represents a SourceControl in Azure Security Insights. + */ +@Fluent +public final class SourceControlInner extends ProxyResource { + /* + * source control properties + */ + private SourceControlProperties innerProperties = new SourceControlProperties(); + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SourceControlInner class. + */ + public SourceControlInner() { + } + + /** + * Get the innerProperties property: source control properties. + * + * @return the innerProperties value. + */ + private SourceControlProperties innerProperties() { + return this.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 SourceControlInner object itself. + */ + public SourceControlInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * Get the version property: The version number associated with the source control. + * + * @return the version value. + */ + public Version version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * 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; + } + + /** + * Get the servicePrincipal property: Service principal metadata. + * + * @return the servicePrincipal value. + */ + public ServicePrincipal servicePrincipal() { + return this.innerProperties() == null ? null : this.innerProperties().servicePrincipal(); + } + + /** + * Set the servicePrincipal property: Service principal metadata. + * + * @param servicePrincipal the servicePrincipal value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withServicePrincipal(ServicePrincipal servicePrincipal) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withServicePrincipal(servicePrincipal); + return this; + } + + /** + * Get the workloadIdentityFederation property: Workload Identity metadata. + * + * @return the workloadIdentityFederation value. + */ + public WorkloadIdentityFederation workloadIdentityFederation() { + return this.innerProperties() == null ? null : this.innerProperties().workloadIdentityFederation(); + } + + /** + * Get the repositoryAccess property: Repository access credentials. This is write-only object and it never returns + * back to a user. + * + * @return the repositoryAccess value. + */ + public RepositoryAccess repositoryAccess() { + return this.innerProperties() == null ? null : this.innerProperties().repositoryAccess(); + } + + /** + * Set the repositoryAccess property: Repository access credentials. This is write-only object and it never returns + * back to a user. + * + * @param repositoryAccess the repositoryAccess value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withRepositoryAccess(RepositoryAccess repositoryAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withRepositoryAccess(repositoryAccess); + return this; + } + + /** + * Get the repositoryResourceInfo property: Information regarding the resources created in user's repository. + * + * @return the repositoryResourceInfo value. + */ + public RepositoryResourceInfo repositoryResourceInfo() { + return this.innerProperties() == null ? null : this.innerProperties().repositoryResourceInfo(); + } + + /** + * Set the repositoryResourceInfo property: Information regarding the resources created in user's repository. + * + * @param repositoryResourceInfo the repositoryResourceInfo value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withRepositoryResourceInfo(RepositoryResourceInfo repositoryResourceInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withRepositoryResourceInfo(repositoryResourceInfo); + return this; + } + + /** + * Get the lastDeploymentInfo property: Information regarding the latest deployment for the source control. + * + * @return the lastDeploymentInfo value. + */ + public DeploymentInfo lastDeploymentInfo() { + return this.innerProperties() == null ? null : this.innerProperties().lastDeploymentInfo(); + } + + /** + * Get the pullRequest property: Information regarding the pull request of the source control. + * + * @return the pullRequest value. + */ + public PullRequest pullRequest() { + return this.innerProperties() == null ? null : this.innerProperties().pullRequest(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceControlInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceControlInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SourceControlInner. + */ + public static SourceControlInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceControlInner deserializedSourceControlInner = new SourceControlInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSourceControlInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSourceControlInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSourceControlInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSourceControlInner.innerProperties = SourceControlProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedSourceControlInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSourceControlInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceControlInner; + }); + } +} 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..2cfd982a21ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlProperties.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.DeploymentInfo; +import com.azure.resourcemanager.securityinsights.models.PullRequest; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import com.azure.resourcemanager.securityinsights.models.RepositoryResourceInfo; +import com.azure.resourcemanager.securityinsights.models.ServicePrincipal; +import com.azure.resourcemanager.securityinsights.models.Version; +import com.azure.resourcemanager.securityinsights.models.WorkloadIdentityFederation; +import java.io.IOException; +import java.util.List; + +/** + * Describes source control properties. + */ +@Fluent +public final class SourceControlProperties implements JsonSerializable { + /* + * The id (a Guid) of the source control + */ + private String id; + + /* + * The version number associated with the source control + */ + private Version version; + + /* + * The display name of the source control + */ + private String displayName; + + /* + * A description of the source control + */ + private String description; + + /* + * The repository type of the source control + */ + private RepoType repoType; + + /* + * Array of source control content types. + */ + private List contentTypes; + + /* + * Repository metadata. + */ + private Repository repository; + + /* + * Service principal metadata. + */ + private ServicePrincipal servicePrincipal; + + /* + * Workload Identity metadata. + */ + private WorkloadIdentityFederation workloadIdentityFederation; + + /* + * Repository access credentials. This is write-only object and it never returns back to a user. + */ + private RepositoryAccess repositoryAccess; + + /* + * Information regarding the resources created in user's repository. + */ + private RepositoryResourceInfo repositoryResourceInfo; + + /* + * Information regarding the latest deployment for the source control. + */ + private DeploymentInfo lastDeploymentInfo; + + /* + * Information regarding the pull request of the source control. + */ + private PullRequest pullRequest; + + /** + * Creates an instance of SourceControlProperties class. + */ + public SourceControlProperties() { + } + + /** + * Get the id property: The id (a Guid) of the source control. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the version property: The version number associated with the source control. + * + * @return the version value. + */ + public Version version() { + return this.version; + } + + /** + * 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; + } + + /** + * Get the servicePrincipal property: Service principal metadata. + * + * @return the servicePrincipal value. + */ + public ServicePrincipal servicePrincipal() { + return this.servicePrincipal; + } + + /** + * Set the servicePrincipal property: Service principal metadata. + * + * @param servicePrincipal the servicePrincipal value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withServicePrincipal(ServicePrincipal servicePrincipal) { + this.servicePrincipal = servicePrincipal; + return this; + } + + /** + * Get the workloadIdentityFederation property: Workload Identity metadata. + * + * @return the workloadIdentityFederation value. + */ + public WorkloadIdentityFederation workloadIdentityFederation() { + return this.workloadIdentityFederation; + } + + /** + * Get the repositoryAccess property: Repository access credentials. This is write-only object and it never returns + * back to a user. + * + * @return the repositoryAccess value. + */ + public RepositoryAccess repositoryAccess() { + return this.repositoryAccess; + } + + /** + * Set the repositoryAccess property: Repository access credentials. This is write-only object and it never returns + * back to a user. + * + * @param repositoryAccess the repositoryAccess value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withRepositoryAccess(RepositoryAccess repositoryAccess) { + this.repositoryAccess = repositoryAccess; + return this; + } + + /** + * Get the repositoryResourceInfo property: Information regarding the resources created in user's repository. + * + * @return the repositoryResourceInfo value. + */ + public RepositoryResourceInfo repositoryResourceInfo() { + return this.repositoryResourceInfo; + } + + /** + * Set the repositoryResourceInfo property: Information regarding the resources created in user's repository. + * + * @param repositoryResourceInfo the repositoryResourceInfo value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withRepositoryResourceInfo(RepositoryResourceInfo repositoryResourceInfo) { + this.repositoryResourceInfo = repositoryResourceInfo; + return this; + } + + /** + * Get the lastDeploymentInfo property: Information regarding the latest deployment for the source control. + * + * @return the lastDeploymentInfo value. + */ + public DeploymentInfo lastDeploymentInfo() { + return this.lastDeploymentInfo; + } + + /** + * Get the pullRequest property: Information regarding the pull request of the source control. + * + * @return the pullRequest value. + */ + public PullRequest pullRequest() { + return this.pullRequest; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("repoType", this.repoType == null ? null : this.repoType.toString()); + jsonWriter.writeArrayField("contentTypes", this.contentTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("repository", this.repository); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("servicePrincipal", this.servicePrincipal); + jsonWriter.writeJsonField("repositoryAccess", this.repositoryAccess); + jsonWriter.writeJsonField("repositoryResourceInfo", this.repositoryResourceInfo); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceControlProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceControlProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SourceControlProperties. + */ + public static SourceControlProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceControlProperties deserializedSourceControlProperties = new SourceControlProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedSourceControlProperties.displayName = reader.getString(); + } else if ("repoType".equals(fieldName)) { + deserializedSourceControlProperties.repoType = RepoType.fromString(reader.getString()); + } else if ("contentTypes".equals(fieldName)) { + List contentTypes + = reader.readArray(reader1 -> ContentType.fromString(reader1.getString())); + deserializedSourceControlProperties.contentTypes = contentTypes; + } else if ("repository".equals(fieldName)) { + deserializedSourceControlProperties.repository = Repository.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedSourceControlProperties.id = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedSourceControlProperties.version = Version.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedSourceControlProperties.description = reader.getString(); + } else if ("servicePrincipal".equals(fieldName)) { + deserializedSourceControlProperties.servicePrincipal = ServicePrincipal.fromJson(reader); + } else if ("workloadIdentityFederation".equals(fieldName)) { + deserializedSourceControlProperties.workloadIdentityFederation + = WorkloadIdentityFederation.fromJson(reader); + } else if ("repositoryAccess".equals(fieldName)) { + deserializedSourceControlProperties.repositoryAccess = RepositoryAccess.fromJson(reader); + } else if ("repositoryResourceInfo".equals(fieldName)) { + deserializedSourceControlProperties.repositoryResourceInfo + = RepositoryResourceInfo.fromJson(reader); + } else if ("lastDeploymentInfo".equals(fieldName)) { + deserializedSourceControlProperties.lastDeploymentInfo = DeploymentInfo.fromJson(reader); + } else if ("pullRequest".equals(fieldName)) { + deserializedSourceControlProperties.pullRequest = PullRequest.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceControlProperties; + }); + } +} 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 index 989af236d8e5..540e44c87dff 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -13,7 +13,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; -import java.util.UUID; /** * Submission mail entity property bag. @@ -23,12 +22,12 @@ public final class SubmissionMailEntityProperties extends EntityCommonProperties /* * The network message id of email to which submission belongs */ - private UUID networkMessageId; + private String networkMessageId; /* * The submission id */ - private UUID submissionId; + private String submissionId; /* * The submitter @@ -84,7 +83,7 @@ public final class SubmissionMailEntityProperties extends EntityCommonProperties /** * Creates an instance of SubmissionMailEntityProperties class. */ - public SubmissionMailEntityProperties() { + private SubmissionMailEntityProperties() { } /** @@ -92,7 +91,7 @@ public SubmissionMailEntityProperties() { * * @return the networkMessageId value. */ - public UUID networkMessageId() { + public String networkMessageId() { return this.networkMessageId; } @@ -101,7 +100,7 @@ public UUID networkMessageId() { * * @return the submissionId value. */ - public UUID submissionId() { + public String submissionId() { return this.submissionId; } @@ -200,15 +199,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -240,11 +230,9 @@ public static SubmissionMailEntityProperties fromJson(JsonReader jsonReader) thr } else if ("friendlyName".equals(fieldName)) { deserializedSubmissionMailEntityProperties.friendlyName = reader.getString(); } else if ("networkMessageId".equals(fieldName)) { - deserializedSubmissionMailEntityProperties.networkMessageId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedSubmissionMailEntityProperties.networkMessageId = reader.getString(); } else if ("submissionId".equals(fieldName)) { - deserializedSubmissionMailEntityProperties.submissionId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedSubmissionMailEntityProperties.submissionId = reader.getString(); } else if ("submitter".equals(fieldName)) { deserializedSubmissionMailEntityProperties.submitter = reader.getString(); } else if ("submissionDate".equals(fieldName)) { 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..083d805a76e7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TICheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * Threat Intelligence Platforms data connector required properties. + */ +@Fluent +public final class TICheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of TICheckRequirementsProperties class. + */ + public TICheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public TICheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TICheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TICheckRequirementsProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TICheckRequirementsProperties. + */ + public static TICheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TICheckRequirementsProperties deserializedTICheckRequirementsProperties + = new TICheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedTICheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTICheckRequirementsProperties; + }); + } +} 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 index e6fb8cbf6e93..59234238afd0 100644 --- 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 @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; import com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes; import java.io.IOException; import java.time.OffsetDateTime; @@ -19,12 +19,7 @@ * TI (Threat Intelligence) data connector properties. */ @Fluent -public final class TIDataConnectorProperties implements JsonSerializable { - /* - * The tenant id to connect to, and get the data from. - */ - private String tenantId; - +public final class TIDataConnectorProperties extends DataConnectorTenantId { /* * The lookback period for the feed to be imported. */ @@ -41,26 +36,6 @@ public final class TIDataConnectorProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("dataTypes".equals(fieldName)) { - deserializedTIDataConnectorProperties.dataTypes = TIDataConnectorDataTypes.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectCommonProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectCommonProperties.java new file mode 100644 index 000000000000..8ada2915611b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectCommonProperties.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.RelationshipHint; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Describes properties common to all threat intelligence objects. + */ +@Immutable +public final class TIObjectCommonProperties implements JsonSerializable { + /* + * The core STIX object that this TI object represents. + */ + private Map data; + + /* + * The UserInfo of the user/entity which originally created this TI object. + */ + private UserInfo createdBy; + + /* + * The source name for this TI object. + */ + private String source; + + /* + * The timestamp for the first time this object was ingested. + */ + private OffsetDateTime firstIngestedTimeUtc; + + /* + * The timestamp for the last time this object was ingested. + */ + private OffsetDateTime lastIngestedTimeUtc; + + /* + * The ID of the rules version that was active when this TI object was last ingested. + */ + private String ingestionRulesVersion; + + /* + * The name of the method/application that initiated the last write to this TI object. + */ + private String lastUpdateMethod; + + /* + * The UserInfo of the user/entity which last modified this TI object. + */ + private UserInfo lastModifiedBy; + + /* + * The timestamp for the last time this TI object was updated. + */ + private OffsetDateTime lastUpdatedDateTimeUtc; + + /* + * A dictionary used to help follow relationships from this object to other STIX objects. The keys are field names + * from the STIX object (in the 'data' field), and the values are lists of sources that can be prepended to the + * object ID in order to efficiently locate the target TI object. + */ + private List relationshipHints; + + /** + * Creates an instance of TIObjectCommonProperties class. + */ + private TIObjectCommonProperties() { + } + + /** + * Get the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + public Map data() { + return this.data; + } + + /** + * Get the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.createdBy; + } + + /** + * Get the source property: The source name for this TI object. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Get the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + public OffsetDateTime firstIngestedTimeUtc() { + return this.firstIngestedTimeUtc; + } + + /** + * Get the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + public OffsetDateTime lastIngestedTimeUtc() { + return this.lastIngestedTimeUtc; + } + + /** + * Get the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + public String ingestionRulesVersion() { + return this.ingestionRulesVersion; + } + + /** + * Get the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + public String lastUpdateMethod() { + return this.lastUpdateMethod; + } + + /** + * Get the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + public UserInfo lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Get the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.lastUpdatedDateTimeUtc; + } + + /** + * Get the relationshipHints property: A dictionary used to help follow relationships from this object to other STIX + * objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of sources + * that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + public List relationshipHints() { + return this.relationshipHints; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TIObjectCommonProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TIObjectCommonProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TIObjectCommonProperties. + */ + public static TIObjectCommonProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TIObjectCommonProperties deserializedTIObjectCommonProperties = new TIObjectCommonProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + Map data = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedTIObjectCommonProperties.data = data; + } else if ("createdBy".equals(fieldName)) { + deserializedTIObjectCommonProperties.createdBy = UserInfo.fromJson(reader); + } else if ("source".equals(fieldName)) { + deserializedTIObjectCommonProperties.source = reader.getString(); + } else if ("firstIngestedTimeUtc".equals(fieldName)) { + deserializedTIObjectCommonProperties.firstIngestedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastIngestedTimeUtc".equals(fieldName)) { + deserializedTIObjectCommonProperties.lastIngestedTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("ingestionRulesVersion".equals(fieldName)) { + deserializedTIObjectCommonProperties.ingestionRulesVersion = reader.getString(); + } else if ("lastUpdateMethod".equals(fieldName)) { + deserializedTIObjectCommonProperties.lastUpdateMethod = reader.getString(); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedTIObjectCommonProperties.lastModifiedBy = UserInfo.fromJson(reader); + } else if ("lastUpdatedDateTimeUtc".equals(fieldName)) { + deserializedTIObjectCommonProperties.lastUpdatedDateTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("relationshipHints".equals(fieldName)) { + List relationshipHints + = reader.readArray(reader1 -> RelationshipHint.fromJson(reader1)); + deserializedTIObjectCommonProperties.relationshipHints = relationshipHints; + } else { + reader.skipChildren(); + } + } + + return deserializedTIObjectCommonProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectInner.java new file mode 100644 index 000000000000..93e112f134a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectInner.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AttackPattern; +import com.azure.resourcemanager.securityinsights.models.Identity; +import com.azure.resourcemanager.securityinsights.models.Indicator; +import com.azure.resourcemanager.securityinsights.models.Relationship; +import com.azure.resourcemanager.securityinsights.models.RelationshipHint; +import com.azure.resourcemanager.securityinsights.models.TIObjectKind; +import com.azure.resourcemanager.securityinsights.models.ThreatActor; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents a threat intelligence object in Azure Security Insights. + */ +@Immutable +public class TIObjectInner extends ProxyResource { + /* + * The kind of the TI object + */ + private TIObjectKind kind = TIObjectKind.fromString("TIObject"); + + /* + * The properties of the TI object + */ + private TIObjectCommonProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TIObjectInner class. + */ + protected TIObjectInner() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + public TIObjectKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: The properties of the TI object. + * + * @return the innerProperties value. + */ + private TIObjectCommonProperties innerProperties() { + return this.innerProperties; + } + + /** + * Set the innerProperties property: The properties of the TI object. + * + * @param innerProperties the innerProperties value to set. + * @return the TIObjectInner object itself. + */ + TIObjectInner withInnerProperties(TIObjectCommonProperties innerProperties) { + this.innerProperties = innerProperties; + 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the TIObjectInner object itself. + */ + TIObjectInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + public Map data() { + return this.innerProperties() == null ? null : this.innerProperties().data(); + } + + /** + * Get the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the source property: The source name for this TI object. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + public OffsetDateTime firstIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstIngestedTimeUtc(); + } + + /** + * Get the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + public OffsetDateTime lastIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastIngestedTimeUtc(); + } + + /** + * Get the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + public String ingestionRulesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionRulesVersion(); + } + + /** + * Get the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + public String lastUpdateMethod() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdateMethod(); + } + + /** + * Get the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + public UserInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateTimeUtc(); + } + + /** + * Get the relationshipHints property: A dictionary used to help follow relationships from this object to other STIX + * objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of sources + * that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + public List relationshipHints() { + return this.innerProperties() == null ? null : this.innerProperties().relationshipHints(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TIObjectInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TIObjectInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TIObjectInner. + */ + public static TIObjectInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ThreatActor".equals(discriminatorValue)) { + return ThreatActor.fromJson(readerToUse.reset()); + } else if ("AttackPattern".equals(discriminatorValue)) { + return AttackPattern.fromJson(readerToUse.reset()); + } else if ("Identity".equals(discriminatorValue)) { + return Identity.fromJson(readerToUse.reset()); + } else if ("Relationship".equals(discriminatorValue)) { + return Relationship.fromJson(readerToUse.reset()); + } else if ("Indicator".equals(discriminatorValue)) { + return Indicator.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static TIObjectInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TIObjectInner deserializedTIObjectInner = new TIObjectInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTIObjectInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTIObjectInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTIObjectInner.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedTIObjectInner.kind = TIObjectKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedTIObjectInner.innerProperties = TIObjectCommonProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTIObjectInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTIObjectInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateModelInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateModelInner.java new file mode 100644 index 000000000000..6525d71cd9d7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateModelInner.java @@ -0,0 +1,798 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; + +/** + * Template resource definition. + */ +@Fluent +public final class TemplateModelInner extends ProxyResource { + /* + * template properties + */ + private TemplateProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TemplateModelInner class. + */ + public TemplateModelInner() { + } + + /** + * Get the innerProperties property: template properties. + * + * @return the innerProperties value. + */ + private TemplateProperties innerProperties() { + return this.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 TemplateModelInner object itself. + */ + public TemplateModelInner 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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 TemplateModelInner object itself. + */ + public TemplateModelInner withContentId(String contentId) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withContentId(contentId); + return this; + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.innerProperties() == null ? null : this.innerProperties().contentProductId(); + } + + /** + * Set the contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @param contentProductId the contentProductId value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withContentProductId(String contentProductId) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withContentProductId(contentProductId); + return this; + } + + /** + * Get the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @return the packageVersion value. + */ + public String packageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().packageVersion(); + } + + /** + * Set the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @param packageVersion the packageVersion value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withPackageVersion(String packageVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withPackageVersion(packageVersion); + 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 metadata 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 metadata best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @param version the version value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the displayName property: The display name of the template. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the template. + * + * @param displayName the displayName value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the contentKind property: The kind of content the template is for. + * + * @return the contentKind value. + */ + public Kind contentKind() { + return this.innerProperties() == null ? null : this.innerProperties().contentKind(); + } + + /** + * Set the contentKind property: The kind of content the template is for. + * + * @param contentKind the contentKind value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withContentKind(Kind contentKind) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withContentKind(contentKind); + 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 TemplateModelInner object itself. + */ + public TemplateModelInner withSource(MetadataSource source) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + 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 TemplateModelInner object itself. + */ + public TemplateModelInner withAuthor(MetadataAuthor author) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withAuthor(author); + return this; + } + + /** + * Get the support property: Support information for the template - 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 template - type, name, contact information. + * + * @param support the support value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withSupport(MetadataSupport support) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + 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 TemplateModelInner object itself. + */ + public TemplateModelInner withDependencies(MetadataDependencies dependencies) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withDependencies(dependencies); + return this; + } + + /** + * Get the categories property: Categories for the item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.innerProperties() == null ? null : this.innerProperties().categories(); + } + + /** + * Set the categories property: Categories for the item. + * + * @param categories the categories value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withCategories(MetadataCategories categories) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withCategories(categories); + return this; + } + + /** + * Get the providers property: Providers for the content item. + * + * @return the providers value. + */ + public List providers() { + return this.innerProperties() == null ? null : this.innerProperties().providers(); + } + + /** + * Set the providers property: Providers for the content item. + * + * @param providers the providers value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withProviders(List providers) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withProviders(providers); + return this; + } + + /** + * Get the firstPublishDate property: first publish date content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.innerProperties() == null ? null : this.innerProperties().firstPublishDate(); + } + + /** + * Set the firstPublishDate property: first publish date content item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withFirstPublishDate(LocalDate firstPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withFirstPublishDate(firstPublishDate); + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the 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 content item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withLastPublishDate(LocalDate lastPublishDate) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withLastPublishDate(lastPublishDate); + return this; + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.innerProperties() == null ? null : this.innerProperties().customVersion(); + } + + /** + * Set the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion the customVersion value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withCustomVersion(String customVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withCustomVersion(customVersion); + return this; + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentSchemaVersion(); + } + + /** + * Set the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withContentSchemaVersion(String contentSchemaVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.innerProperties() == null ? null : this.innerProperties().icon(); + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withIcon(String icon) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withIcon(icon); + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTactics(); + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withThreatAnalysisTactics(List threatAnalysisTactics) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTechniques(); + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withThreatAnalysisTechniques(List threatAnalysisTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.innerProperties() == null ? null : this.innerProperties().previewImages(); + } + + /** + * Set the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @param previewImages the previewImages value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withPreviewImages(List previewImages) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withPreviewImages(previewImages); + return this; + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.innerProperties() == null ? null : this.innerProperties().previewImagesDark(); + } + + /** + * Set the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @param previewImagesDark the previewImagesDark value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withPreviewImagesDark(List previewImagesDark) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withPreviewImagesDark(previewImagesDark); + return this; + } + + /** + * Get the packageId property: the package Id contains this template. + * + * @return the packageId value. + */ + public String packageId() { + return this.innerProperties() == null ? null : this.innerProperties().packageId(); + } + + /** + * Set the packageId property: the package Id contains this template. + * + * @param packageId the packageId value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withPackageId(String packageId) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withPackageId(packageId); + return this; + } + + /** + * Get the packageKind property: the packageKind of the package contains this template. + * + * @return the packageKind value. + */ + public PackageKind packageKind() { + return this.innerProperties() == null ? null : this.innerProperties().packageKind(); + } + + /** + * Set the packageKind property: the packageKind of the package contains this template. + * + * @param packageKind the packageKind value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withPackageKind(PackageKind packageKind) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withPackageKind(packageKind); + return this; + } + + /** + * Get the packageName property: the name of the package contains this template. + * + * @return the packageName value. + */ + public String packageName() { + return this.innerProperties() == null ? null : this.innerProperties().packageName(); + } + + /** + * Set the packageName property: the name of the package contains this template. + * + * @param packageName the packageName value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withPackageName(String packageName) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withPackageName(packageName); + return this; + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.innerProperties() == null ? null : this.innerProperties().isDeprecated(); + } + + /** + * Get the mainTemplate property: The JSON of the ARM template to deploy active content. Expandable. + * + * @return the mainTemplate value. + */ + public Object mainTemplate() { + return this.innerProperties() == null ? null : this.innerProperties().mainTemplate(); + } + + /** + * Set the mainTemplate property: The JSON of the ARM template to deploy active content. Expandable. + * + * @param mainTemplate the mainTemplate value to set. + * @return the TemplateModelInner object itself. + */ + public TemplateModelInner withMainTemplate(Object mainTemplate) { + if (this.innerProperties() == null) { + this.innerProperties = new TemplateProperties(); + } + this.innerProperties().withMainTemplate(mainTemplate); + return this; + } + + /** + * Get the dependantTemplates property: Dependant templates. Expandable. + * + * @return the dependantTemplates value. + */ + public List dependantTemplates() { + return this.innerProperties() == null ? null : this.innerProperties().dependantTemplates(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TemplateModelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TemplateModelInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TemplateModelInner. + */ + public static TemplateModelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TemplateModelInner deserializedTemplateModelInner = new TemplateModelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTemplateModelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTemplateModelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTemplateModelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTemplateModelInner.innerProperties = TemplateProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedTemplateModelInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedTemplateModelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTemplateModelInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateProperties.java new file mode 100644 index 000000000000..53bfb5b6043f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateProperties.java @@ -0,0 +1,845 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Template property bag. + */ +@Fluent +public final class TemplateProperties implements JsonSerializable { + /* + * 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 + */ + private String contentId; + + /* + * Unique ID for the content. It should be generated based on the contentId of the package, contentId of the + * template, contentKind of the template and the contentVersion of the template + */ + private String contentProductId; + + /* + * Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM + * metadata best practices. Can also be any string, but then we cannot guarantee any version checks + */ + private String packageVersion; + + /* + * Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM + * metadata best practices. Can also be any string, but then we cannot guarantee any version checks + */ + private String version; + + /* + * The display name of the template + */ + private String displayName; + + /* + * The kind of content the template is for. + */ + private Kind contentKind; + + /* + * Source of the content. This is where/how it was created. + */ + private MetadataSource source; + + /* + * The creator of the content item. + */ + private MetadataAuthor author; + + /* + * Support information for the template - type, name, contact information + */ + 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. + */ + private MetadataDependencies dependencies; + + /* + * Categories for the item + */ + private MetadataCategories categories; + + /* + * Providers for the content item + */ + private List providers; + + /* + * first publish date content item + */ + private LocalDate firstPublishDate; + + /* + * last publish date for the content item + */ + private LocalDate lastPublishDate; + + /* + * The custom version of the content. A optional free text + */ + private String customVersion; + + /* + * Schema version of the content. Can be used to distinguish between different flow based on the schema version + */ + private String contentSchemaVersion; + + /* + * the icon identifier. this id can later be fetched from the content metadata + */ + private String icon; + + /* + * the tactics the resource covers + */ + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + private List threatAnalysisTechniques; + + /* + * preview image file names. These will be taken from the solution artifacts + */ + private List previewImages; + + /* + * preview image file names. These will be taken from the solution artifacts. used for dark theme support + */ + private List previewImagesDark; + + /* + * the package Id contains this template + */ + private String packageId; + + /* + * the packageKind of the package contains this template + */ + private PackageKind packageKind; + + /* + * the name of the package contains this template + */ + private String packageName; + + /* + * Flag indicates if this template is deprecated + */ + private Flag isDeprecated; + + /* + * The JSON of the ARM template to deploy active content. Expandable. + */ + private Object mainTemplate; + + /* + * Dependant templates. Expandable. + */ + private List dependantTemplates; + + /** + * Creates an instance of TemplateProperties class. + */ + public TemplateProperties() { + } + + /** + * 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 TemplateProperties object itself. + */ + public TemplateProperties withContentId(String contentId) { + this.contentId = contentId; + return this; + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.contentProductId; + } + + /** + * Set the contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @param contentProductId the contentProductId value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withContentProductId(String contentProductId) { + this.contentProductId = contentProductId; + return this; + } + + /** + * Get the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @return the packageVersion value. + */ + public String packageVersion() { + return this.packageVersion; + } + + /** + * Set the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @param packageVersion the packageVersion value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + 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 metadata 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 metadata best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @param version the version value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the displayName property: The display name of the template. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the template. + * + * @param displayName the displayName value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the contentKind property: The kind of content the template is for. + * + * @return the contentKind value. + */ + public Kind contentKind() { + return this.contentKind; + } + + /** + * Set the contentKind property: The kind of content the template is for. + * + * @param contentKind the contentKind value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withContentKind(Kind contentKind) { + this.contentKind = contentKind; + 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 TemplateProperties object itself. + */ + public TemplateProperties 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 TemplateProperties object itself. + */ + public TemplateProperties withAuthor(MetadataAuthor author) { + this.author = author; + return this; + } + + /** + * Get the support property: Support information for the template - type, name, contact information. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.support; + } + + /** + * Set the support property: Support information for the template - type, name, contact information. + * + * @param support the support value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties 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 TemplateProperties object itself. + */ + public TemplateProperties withDependencies(MetadataDependencies dependencies) { + this.dependencies = dependencies; + return this; + } + + /** + * Get the categories property: Categories for the item. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.categories; + } + + /** + * Set the categories property: Categories for the item. + * + * @param categories the categories value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withCategories(MetadataCategories categories) { + this.categories = categories; + return this; + } + + /** + * Get the providers property: Providers for the content item. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: Providers for the content item. + * + * @param providers the providers value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the firstPublishDate property: first publish date content item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Set the firstPublishDate property: first publish date content item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withFirstPublishDate(LocalDate firstPublishDate) { + this.firstPublishDate = firstPublishDate; + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the content item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Set the lastPublishDate property: last publish date for the content item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withLastPublishDate(LocalDate lastPublishDate) { + this.lastPublishDate = lastPublishDate; + return this; + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.customVersion; + } + + /** + * Set the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion the customVersion value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withCustomVersion(String customVersion) { + this.customVersion = customVersion; + return this; + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.contentSchemaVersion; + } + + /** + * Set the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withContentSchemaVersion(String contentSchemaVersion) { + this.contentSchemaVersion = contentSchemaVersion; + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withIcon(String icon) { + this.icon = icon; + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.threatAnalysisTactics; + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withThreatAnalysisTactics(List threatAnalysisTactics) { + this.threatAnalysisTactics = threatAnalysisTactics; + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.threatAnalysisTechniques; + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withThreatAnalysisTechniques(List threatAnalysisTechniques) { + this.threatAnalysisTechniques = threatAnalysisTechniques; + return this; + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.previewImages; + } + + /** + * Set the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @param previewImages the previewImages value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withPreviewImages(List previewImages) { + this.previewImages = previewImages; + return this; + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.previewImagesDark; + } + + /** + * Set the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @param previewImagesDark the previewImagesDark value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withPreviewImagesDark(List previewImagesDark) { + this.previewImagesDark = previewImagesDark; + return this; + } + + /** + * Get the packageId property: the package Id contains this template. + * + * @return the packageId value. + */ + public String packageId() { + return this.packageId; + } + + /** + * Set the packageId property: the package Id contains this template. + * + * @param packageId the packageId value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withPackageId(String packageId) { + this.packageId = packageId; + return this; + } + + /** + * Get the packageKind property: the packageKind of the package contains this template. + * + * @return the packageKind value. + */ + public PackageKind packageKind() { + return this.packageKind; + } + + /** + * Set the packageKind property: the packageKind of the package contains this template. + * + * @param packageKind the packageKind value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withPackageKind(PackageKind packageKind) { + this.packageKind = packageKind; + return this; + } + + /** + * Get the packageName property: the name of the package contains this template. + * + * @return the packageName value. + */ + public String packageName() { + return this.packageName; + } + + /** + * Set the packageName property: the name of the package contains this template. + * + * @param packageName the packageName value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withPackageName(String packageName) { + this.packageName = packageName; + return this; + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.isDeprecated; + } + + /** + * Get the mainTemplate property: The JSON of the ARM template to deploy active content. Expandable. + * + * @return the mainTemplate value. + */ + public Object mainTemplate() { + return this.mainTemplate; + } + + /** + * Set the mainTemplate property: The JSON of the ARM template to deploy active content. Expandable. + * + * @param mainTemplate the mainTemplate value to set. + * @return the TemplateProperties object itself. + */ + public TemplateProperties withMainTemplate(Object mainTemplate) { + this.mainTemplate = mainTemplate; + return this; + } + + /** + * Get the dependantTemplates property: Dependant templates. Expandable. + * + * @return the dependantTemplates value. + */ + public List dependantTemplates() { + return this.dependantTemplates; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentId", this.contentId); + jsonWriter.writeStringField("contentProductId", this.contentProductId); + jsonWriter.writeStringField("packageVersion", this.packageVersion); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("contentKind", this.contentKind == null ? null : this.contentKind.toString()); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("author", this.author); + jsonWriter.writeJsonField("support", this.support); + jsonWriter.writeJsonField("dependencies", this.dependencies); + jsonWriter.writeJsonField("categories", this.categories); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstPublishDate", Objects.toString(this.firstPublishDate, null)); + jsonWriter.writeStringField("lastPublishDate", Objects.toString(this.lastPublishDate, null)); + jsonWriter.writeStringField("customVersion", this.customVersion); + jsonWriter.writeStringField("contentSchemaVersion", this.contentSchemaVersion); + jsonWriter.writeStringField("icon", this.icon); + jsonWriter.writeArrayField("threatAnalysisTactics", this.threatAnalysisTactics, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threatAnalysisTechniques", this.threatAnalysisTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImages", this.previewImages, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("previewImagesDark", this.previewImagesDark, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("packageId", this.packageId); + jsonWriter.writeStringField("packageKind", this.packageKind == null ? null : this.packageKind.toString()); + jsonWriter.writeStringField("packageName", this.packageName); + if (this.mainTemplate != null) { + jsonWriter.writeUntypedField("mainTemplate", this.mainTemplate); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TemplateProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TemplateProperties. + */ + public static TemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TemplateProperties deserializedTemplateProperties = new TemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentId".equals(fieldName)) { + deserializedTemplateProperties.contentId = reader.getString(); + } else if ("contentProductId".equals(fieldName)) { + deserializedTemplateProperties.contentProductId = reader.getString(); + } else if ("packageVersion".equals(fieldName)) { + deserializedTemplateProperties.packageVersion = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedTemplateProperties.version = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedTemplateProperties.displayName = reader.getString(); + } else if ("contentKind".equals(fieldName)) { + deserializedTemplateProperties.contentKind = Kind.fromString(reader.getString()); + } else if ("source".equals(fieldName)) { + deserializedTemplateProperties.source = MetadataSource.fromJson(reader); + } else if ("author".equals(fieldName)) { + deserializedTemplateProperties.author = MetadataAuthor.fromJson(reader); + } else if ("support".equals(fieldName)) { + deserializedTemplateProperties.support = MetadataSupport.fromJson(reader); + } else if ("dependencies".equals(fieldName)) { + deserializedTemplateProperties.dependencies = MetadataDependencies.fromJson(reader); + } else if ("categories".equals(fieldName)) { + deserializedTemplateProperties.categories = MetadataCategories.fromJson(reader); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedTemplateProperties.providers = providers; + } else if ("firstPublishDate".equals(fieldName)) { + deserializedTemplateProperties.firstPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("lastPublishDate".equals(fieldName)) { + deserializedTemplateProperties.lastPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("customVersion".equals(fieldName)) { + deserializedTemplateProperties.customVersion = reader.getString(); + } else if ("contentSchemaVersion".equals(fieldName)) { + deserializedTemplateProperties.contentSchemaVersion = reader.getString(); + } else if ("icon".equals(fieldName)) { + deserializedTemplateProperties.icon = reader.getString(); + } else if ("threatAnalysisTactics".equals(fieldName)) { + List threatAnalysisTactics = reader.readArray(reader1 -> reader1.getString()); + deserializedTemplateProperties.threatAnalysisTactics = threatAnalysisTactics; + } else if ("threatAnalysisTechniques".equals(fieldName)) { + List threatAnalysisTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedTemplateProperties.threatAnalysisTechniques = threatAnalysisTechniques; + } else if ("previewImages".equals(fieldName)) { + List previewImages = reader.readArray(reader1 -> reader1.getString()); + deserializedTemplateProperties.previewImages = previewImages; + } else if ("previewImagesDark".equals(fieldName)) { + List previewImagesDark = reader.readArray(reader1 -> reader1.getString()); + deserializedTemplateProperties.previewImagesDark = previewImagesDark; + } else if ("packageId".equals(fieldName)) { + deserializedTemplateProperties.packageId = reader.getString(); + } else if ("packageKind".equals(fieldName)) { + deserializedTemplateProperties.packageKind = PackageKind.fromString(reader.getString()); + } else if ("packageName".equals(fieldName)) { + deserializedTemplateProperties.packageName = reader.getString(); + } else if ("isDeprecated".equals(fieldName)) { + deserializedTemplateProperties.isDeprecated = Flag.fromString(reader.getString()); + } else if ("mainTemplate".equals(fieldName)) { + deserializedTemplateProperties.mainTemplate = reader.readUntyped(); + } else if ("dependantTemplates".equals(fieldName)) { + List dependantTemplates + = reader.readArray(reader1 -> TemplateProperties.fromJson(reader1)); + deserializedTemplateProperties.dependantTemplates = dependantTemplates; + } else { + reader.skipChildren(); + } + } + + return deserializedTemplateProperties; + }); + } +} 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..c12d7bea0eec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Threat Intelligence alert rule base property bag. + */ +@Fluent +public final class ThreatIntelligenceAlertRuleProperties + implements JsonSerializable { + /* + * The Name of the alert rule template used to create this rule. + */ + private String alertRuleTemplateName; + + /* + * The description of the alert rule. + */ + private String description; + + /* + * The display name for alerts created by this alert rule. + */ + private String displayName; + + /* + * Determines whether this alert rule is enabled or disabled. + */ + private boolean enabled; + + /* + * The last time that this alert has been modified. + */ + private OffsetDateTime lastModifiedUtc; + + /* + * The severity for alerts created by this alert rule. + */ + private AlertSeverity severity; + + /* + * The tactics of the alert rule + */ + private List tactics; + + /* + * The techniques of the alert rule + */ + private List techniques; + + /* + * The sub-techniques of the alert rule + */ + private List subTechniques; + + /** + * Creates an instance of ThreatIntelligenceAlertRuleProperties class. + */ + public ThreatIntelligenceAlertRuleProperties() { + } + + /** + * 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; + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.subTechniques; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("alertRuleTemplateName", this.alertRuleTemplateName); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreatIntelligenceAlertRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreatIntelligenceAlertRuleProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreatIntelligenceAlertRuleProperties. + */ + public static ThreatIntelligenceAlertRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreatIntelligenceAlertRuleProperties deserializedThreatIntelligenceAlertRuleProperties + = new ThreatIntelligenceAlertRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertRuleTemplateName".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleProperties.alertRuleTemplateName = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleProperties.enabled = reader.getBoolean(); + } else if ("description".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleProperties.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleProperties.displayName = reader.getString(); + } else if ("lastModifiedUtc".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleProperties.lastModifiedUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("severity".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleProperties.severity + = AlertSeverity.fromString(reader.getString()); + } else if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedThreatIntelligenceAlertRuleProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedThreatIntelligenceAlertRuleProperties.techniques = techniques; + } else if ("subTechniques".equals(fieldName)) { + List subTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedThreatIntelligenceAlertRuleProperties.subTechniques = subTechniques; + } else { + reader.skipChildren(); + } + } + + return deserializedThreatIntelligenceAlertRuleProperties; + }); + } +} 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..a2ce16385554 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateWithMitreProperties; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Threat Intelligence alert rule template properties. + */ +@Immutable +public final class ThreatIntelligenceAlertRuleTemplateProperties extends AlertRuleTemplateWithMitreProperties { + /* + * The severity for alerts created by this alert rule. + */ + private AlertSeverity severity; + + /* + * The techniques of the alert rule + */ + private List techniques; + + /* + * The tactics of the alert rule + */ + private List tactics; + + /* + * The alert rule template status. + */ + private TemplateStatus status; + + /* + * The required data sources for this template + */ + private List requiredDataConnectors; + + /* + * The display name for alert rule template. + */ + private String displayName; + + /* + * The description of the alert rule template. + */ + private String description; + + /* + * The time that this alert rule template has been added. + */ + private OffsetDateTime createdDateUtc; + + /* + * The last time that this alert rule template has been updated. + */ + private OffsetDateTime lastUpdatedDateUtc; + + /* + * The number of alert rules that were created by this template + */ + private Integer alertRulesCreatedByTemplateCount; + + /** + * Creates an instance of ThreatIntelligenceAlertRuleTemplateProperties class. + */ + private ThreatIntelligenceAlertRuleTemplateProperties() { + } + + /** + * 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 techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + @Override + public List techniques() { + return this.techniques; + } + + /** + * Get the tactics property: The tactics of the alert rule. + * + * @return the tactics value. + */ + @Override + public List tactics() { + return this.tactics; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + @Override + public TemplateStatus status() { + return this.status; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + @Override + public List requiredDataConnectors() { + return this.requiredDataConnectors; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + @Override + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + @Override + public String description() { + return this.description; + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + @Override + public OffsetDateTime createdDateUtc() { + return this.createdDateUtc; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + @Override + public OffsetDateTime lastUpdatedDateUtc() { + return this.lastUpdatedDateUtc; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + @Override + public Integer alertRulesCreatedByTemplateCount() { + return this.alertRulesCreatedByTemplateCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("alertRulesCreatedByTemplateCount", alertRulesCreatedByTemplateCount()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeArrayField("requiredDataConnectors", requiredDataConnectors(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeArrayField("tactics", tactics(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("techniques", techniques(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreatIntelligenceAlertRuleTemplateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreatIntelligenceAlertRuleTemplateProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreatIntelligenceAlertRuleTemplateProperties. + */ + public static ThreatIntelligenceAlertRuleTemplateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreatIntelligenceAlertRuleTemplateProperties deserializedThreatIntelligenceAlertRuleTemplateProperties + = new ThreatIntelligenceAlertRuleTemplateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertRulesCreatedByTemplateCount".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplateProperties.alertRulesCreatedByTemplateCount + = reader.getNullable(JsonReader::getInt); + } else if ("lastUpdatedDateUTC".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplateProperties.lastUpdatedDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateUTC".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplateProperties.createdDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplateProperties.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplateProperties.displayName = reader.getString(); + } else if ("requiredDataConnectors".equals(fieldName)) { + List requiredDataConnectors + = reader.readArray(reader1 -> AlertRuleTemplateDataSource.fromJson(reader1)); + deserializedThreatIntelligenceAlertRuleTemplateProperties.requiredDataConnectors + = requiredDataConnectors; + } else if ("status".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplateProperties.status + = TemplateStatus.fromString(reader.getString()); + } else if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedThreatIntelligenceAlertRuleTemplateProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedThreatIntelligenceAlertRuleTemplateProperties.techniques = techniques; + } else if ("severity".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplateProperties.severity + = AlertSeverity.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedThreatIntelligenceAlertRuleTemplateProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceCountInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceCountInner.java new file mode 100644 index 000000000000..7b23a894f7d1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceCountInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Count of all the threat intelligence objects on the workspace that match the provided query. + */ +@Immutable +public final class ThreatIntelligenceCountInner implements JsonSerializable { + /* + * Count of all the threat intelligence objects on the workspace that match the provided query. + */ + private int count; + + /** + * Creates an instance of ThreatIntelligenceCountInner class. + */ + private ThreatIntelligenceCountInner() { + } + + /** + * Get the count property: Count of all the threat intelligence objects on the workspace that match the provided + * query. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreatIntelligenceCountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreatIntelligenceCountInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreatIntelligenceCountInner. + */ + public static ThreatIntelligenceCountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreatIntelligenceCountInner deserializedThreatIntelligenceCountInner = new ThreatIntelligenceCountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedThreatIntelligenceCountInner.count = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedThreatIntelligenceCountInner; + }); + } +} 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 index 3e5856bdc96a..d27bc2b49761 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -765,27 +765,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void 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()); - } - } - /** * {@inheritDoc} */ 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 index cd12d97cfcee..02cc583bd36f 100644 --- 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 @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceInnerKind; import java.io.IOException; @@ -18,13 +18,20 @@ * Threat intelligence information object. */ @Fluent -public class ThreatIntelligenceInformationInner extends ResourceWithEtag { +public class ThreatIntelligenceInformationInner extends ProxyResource { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private ThreatIntelligenceResourceInnerKind kind = ThreatIntelligenceResourceInnerKind.fromString("ThreatIntelligenceInformation"); + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -52,7 +59,9 @@ public ThreatIntelligenceInformationInner() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -60,16 +69,46 @@ public ThreatIntelligenceResourceInnerKind kind() { return this.kind; } + /** + * 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 ThreatIntelligenceInformationInner object itself. + */ + public ThreatIntelligenceInformationInner 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. */ - @Override public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the ThreatIntelligenceInformationInner object itself. + */ + ThreatIntelligenceInformationInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -100,32 +139,14 @@ public String id() { return this.id; } - /** - * {@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() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -177,13 +198,13 @@ static ThreatIntelligenceInformationInner fromJsonKnownDiscriminator(JsonReader deserializedThreatIntelligenceInformationInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedThreatIntelligenceInformationInner.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedThreatIntelligenceInformationInner.withEtag(reader.getString()); - } else if ("systemData".equals(fieldName)) { - deserializedThreatIntelligenceInformationInner.systemData = SystemData.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedThreatIntelligenceInformationInner.kind = ThreatIntelligenceResourceInnerKind.fromString(reader.getString()); + } else if ("etag".equals(fieldName)) { + deserializedThreatIntelligenceInformationInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedThreatIntelligenceInformationInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 index 9d8595ace6e8..2bdd0fa3dd0f 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * List of all the threat intelligence metric fields (type/threat type/source). */ -@Fluent +@Immutable public final class ThreatIntelligenceMetricsListInner implements JsonSerializable { /* * Array of threat intelligence metric fields (type/threat type/source). @@ -27,7 +26,7 @@ public final class ThreatIntelligenceMetricsListInner implements JsonSerializabl /** * Creates an instance of ThreatIntelligenceMetricsListInner class. */ - public ThreatIntelligenceMetricsListInner() { + private ThreatIntelligenceMetricsListInner() { } /** @@ -39,34 +38,6 @@ 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.atError() - .log(new IllegalArgumentException( - "Missing required property value in model ThreatIntelligenceMetricsListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ThreatIntelligenceMetricsListInner.class); - /** * {@inheritDoc} */ 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..c52d808dd03c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import java.io.IOException; + +/** + * Threat Intelligence TAXII data connector required properties. + */ +@Fluent +public final class TiTaxiiCheckRequirementsProperties extends DataConnectorTenantId { + /** + * Creates an instance of TiTaxiiCheckRequirementsProperties class. + */ + public TiTaxiiCheckRequirementsProperties() { + } + + /** + * {@inheritDoc} + */ + @Override + public TiTaxiiCheckRequirementsProperties withTenantId(String tenantId) { + super.withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TiTaxiiCheckRequirementsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TiTaxiiCheckRequirementsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TiTaxiiCheckRequirementsProperties. + */ + public static TiTaxiiCheckRequirementsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TiTaxiiCheckRequirementsProperties deserializedTiTaxiiCheckRequirementsProperties + = new TiTaxiiCheckRequirementsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedTiTaxiiCheckRequirementsProperties.withTenantId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTiTaxiiCheckRequirementsProperties; + }); + } +} 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..d62c96a5d5b3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiDataConnectorProperties.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import com.azure.resourcemanager.securityinsights.models.PollingFrequency; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Threat Intelligence TAXII data connector properties. + */ +@Fluent +public final class TiTaxiiDataConnectorProperties extends DataConnectorTenantId { + /* + * The workspace id. + */ + private String workspaceId; + + /* + * The friendly name for the TAXII server. + */ + private String friendlyName; + + /* + * The API root for the TAXII server. + */ + private String taxiiServer; + + /* + * The collection id of the TAXII server. + */ + private String collectionId; + + /* + * The userName for the TAXII server. + */ + private String userName; + + /* + * The password for the TAXII server. + */ + private String password; + + /* + * The lookback period for the TAXII server. + */ + private OffsetDateTime taxiiLookbackPeriod; + + /* + * The polling frequency for the TAXII server. + */ + private PollingFrequency pollingFrequency; + + /* + * The available data types for Threat Intelligence TAXII data connector. + */ + private TiTaxiiDataConnectorDataTypes dataTypes; + + /** + * Creates an instance of TiTaxiiDataConnectorProperties class. + */ + public TiTaxiiDataConnectorProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", tenantId()); + jsonWriter.writeStringField("pollingFrequency", + this.pollingFrequency == null ? null : this.pollingFrequency.toString()); + jsonWriter.writeJsonField("dataTypes", this.dataTypes); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeStringField("taxiiServer", this.taxiiServer); + jsonWriter.writeStringField("collectionId", this.collectionId); + jsonWriter.writeStringField("userName", this.userName); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("taxiiLookbackPeriod", + this.taxiiLookbackPeriod == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.taxiiLookbackPeriod)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TiTaxiiDataConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TiTaxiiDataConnectorProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TiTaxiiDataConnectorProperties. + */ + public static TiTaxiiDataConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TiTaxiiDataConnectorProperties deserializedTiTaxiiDataConnectorProperties + = new TiTaxiiDataConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.withTenantId(reader.getString()); + } else if ("pollingFrequency".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.pollingFrequency + = PollingFrequency.fromString(reader.getString()); + } else if ("dataTypes".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.dataTypes + = TiTaxiiDataConnectorDataTypes.fromJson(reader); + } else if ("workspaceId".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.workspaceId = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.friendlyName = reader.getString(); + } else if ("taxiiServer".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.taxiiServer = reader.getString(); + } else if ("collectionId".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.collectionId = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.userName = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.password = reader.getString(); + } else if ("taxiiLookbackPeriod".equals(fieldName)) { + deserializedTiTaxiiDataConnectorProperties.taxiiLookbackPeriod = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTiTaxiiDataConnectorProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunInner.java new file mode 100644 index 000000000000..0df69a2bde5e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * The triggered analytics rule run. + */ +@Immutable +public final class TriggeredAnalyticsRuleRunInner extends ProxyResource { + /* + * The triggered analytics rule run Properties + */ + private TriggeredAnalyticsRuleRunProperties innerProperties; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TriggeredAnalyticsRuleRunInner class. + */ + private TriggeredAnalyticsRuleRunInner() { + } + + /** + * Get the innerProperties property: The triggered analytics rule run Properties. + * + * @return the innerProperties value. + */ + private TriggeredAnalyticsRuleRunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the executionTimeUtc property: The executionTimeUtc property. + * + * @return the executionTimeUtc value. + */ + public OffsetDateTime executionTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().executionTimeUtc(); + } + + /** + * Get the ruleId property: The ruleId property. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.innerProperties() == null ? null : this.innerProperties().ruleId(); + } + + /** + * Get the triggeredAnalyticsRuleRunId property: The triggeredAnalyticsRuleRunId property. + * + * @return the triggeredAnalyticsRuleRunId value. + */ + public String triggeredAnalyticsRuleRunId() { + return this.innerProperties() == null ? null : this.innerProperties().triggeredAnalyticsRuleRunId(); + } + + /** + * Get the provisioningState property: The triggered analytics rule run provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ruleRunAdditionalData property: Dictionary of <any>. + * + * @return the ruleRunAdditionalData value. + */ + public Map ruleRunAdditionalData() { + return this.innerProperties() == null ? null : this.innerProperties().ruleRunAdditionalData(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggeredAnalyticsRuleRunInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggeredAnalyticsRuleRunInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TriggeredAnalyticsRuleRunInner. + */ + public static TriggeredAnalyticsRuleRunInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggeredAnalyticsRuleRunInner deserializedTriggeredAnalyticsRuleRunInner + = new TriggeredAnalyticsRuleRunInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunInner.innerProperties + = TriggeredAnalyticsRuleRunProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggeredAnalyticsRuleRunInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunProperties.java new file mode 100644 index 000000000000..1b49260af042 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * The triggered analytics rule run Properties. + */ +@Immutable +public final class TriggeredAnalyticsRuleRunProperties + implements JsonSerializable { + /* + * The executionTimeUtc property. + */ + private OffsetDateTime executionTimeUtc; + + /* + * The ruleId property. + */ + private String ruleId; + + /* + * The triggeredAnalyticsRuleRunId property. + */ + private String triggeredAnalyticsRuleRunId; + + /* + * The triggered analytics rule run provisioning state + */ + private ProvisioningState provisioningState; + + /* + * Dictionary of + */ + private Map ruleRunAdditionalData; + + /** + * Creates an instance of TriggeredAnalyticsRuleRunProperties class. + */ + private TriggeredAnalyticsRuleRunProperties() { + } + + /** + * Get the executionTimeUtc property: The executionTimeUtc property. + * + * @return the executionTimeUtc value. + */ + public OffsetDateTime executionTimeUtc() { + return this.executionTimeUtc; + } + + /** + * Get the ruleId property: The ruleId property. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Get the triggeredAnalyticsRuleRunId property: The triggeredAnalyticsRuleRunId property. + * + * @return the triggeredAnalyticsRuleRunId value. + */ + public String triggeredAnalyticsRuleRunId() { + return this.triggeredAnalyticsRuleRunId; + } + + /** + * Get the provisioningState property: The triggered analytics rule run provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the ruleRunAdditionalData property: Dictionary of <any>. + * + * @return the ruleRunAdditionalData value. + */ + public Map ruleRunAdditionalData() { + return this.ruleRunAdditionalData; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("executionTimeUtc", + this.executionTimeUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.executionTimeUtc)); + jsonWriter.writeStringField("ruleId", this.ruleId); + jsonWriter.writeStringField("triggeredAnalyticsRuleRunId", this.triggeredAnalyticsRuleRunId); + jsonWriter.writeMapField("ruleRunAdditionalData", this.ruleRunAdditionalData, + (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggeredAnalyticsRuleRunProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggeredAnalyticsRuleRunProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TriggeredAnalyticsRuleRunProperties. + */ + public static TriggeredAnalyticsRuleRunProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggeredAnalyticsRuleRunProperties deserializedTriggeredAnalyticsRuleRunProperties + = new TriggeredAnalyticsRuleRunProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("executionTimeUtc".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunProperties.executionTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("ruleId".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunProperties.ruleId = reader.getString(); + } else if ("triggeredAnalyticsRuleRunId".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunProperties.triggeredAnalyticsRuleRunId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRunProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("ruleRunAdditionalData".equals(fieldName)) { + Map ruleRunAdditionalData = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedTriggeredAnalyticsRuleRunProperties.ruleRunAdditionalData = ruleRunAdditionalData; + } else { + reader.skipChildren(); + } + } + + return deserializedTriggeredAnalyticsRuleRunProperties; + }); + } +} 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..a33192e2c2af --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UebaProperties.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.UebaDataSources; +import java.io.IOException; +import java.util.List; + +/** + * Ueba property bag. + */ +@Fluent +public final class UebaProperties implements JsonSerializable { + /* + * The relevant data sources that enriched by ueba + */ + private List dataSources; + + /** + * Creates an instance of UebaProperties class. + */ + public UebaProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataSources", this.dataSources, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UebaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UebaProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UebaProperties. + */ + public static UebaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UebaProperties deserializedUebaProperties = new UebaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataSources".equals(fieldName)) { + List dataSources + = reader.readArray(reader1 -> UebaDataSources.fromString(reader1.getString())); + deserializedUebaProperties.dataSources = dataSources; + } else { + reader.skipChildren(); + } + } + + return deserializedUebaProperties; + }); + } +} 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 index 8915c47a43c1..d17e450e5b0d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; @@ -36,7 +36,7 @@ public final class UrlEntityProperties extends EntityCommonProperties { /** * Creates an instance of UrlEntityProperties class. */ - public UrlEntityProperties() { + private UrlEntityProperties() { } /** @@ -70,15 +70,6 @@ public Map additionalData() { return this.additionalData; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WarningInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WarningInner.java new file mode 100644 index 000000000000..e6bc65379554 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WarningInner.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.WarningBody; +import java.io.IOException; + +/** + * Warning response structure. + */ +@Immutable +public final class WarningInner implements JsonSerializable { + /* + * Warning data. + */ + private WarningBody warning; + + /** + * Creates an instance of WarningInner class. + */ + private WarningInner() { + } + + /** + * Get the warning property: Warning data. + * + * @return the warning value. + */ + public WarningBody warning() { + return this.warning; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WarningInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WarningInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WarningInner. + */ + public static WarningInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WarningInner deserializedWarningInner = new WarningInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("warning".equals(fieldName)) { + deserializedWarningInner.warning = WarningBody.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWarningInner; + }); + } +} 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 index f1c148d085ba..8222c51c7d0d 100644 --- 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 @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; -import com.azure.resourcemanager.securityinsights.models.Source; +import com.azure.resourcemanager.securityinsights.models.SourceType; import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.azure.resourcemanager.securityinsights.models.WatchlistProvisioningState; import java.io.IOException; import java.time.Duration; import java.time.OffsetDateTime; @@ -21,12 +22,17 @@ * Represents a Watchlist in Azure Security Insights. */ @Fluent -public final class WatchlistInner extends ResourceWithEtag { +public final class WatchlistInner extends ProxyResource { /* * Watchlist properties */ private WatchlistProperties innerProperties; + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -62,12 +68,31 @@ private WatchlistProperties innerProperties() { return this.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 WatchlistInner object itself. + */ + public WatchlistInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -102,15 +127,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public WatchlistInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the watchlistId property: The id (a Guid) of the watchlist. * @@ -181,21 +197,21 @@ public WatchlistInner withProvider(String provider) { } /** - * Get the source property: The source of the watchlist. + * Get the source property: The filename of the watchlist, called 'source'. * * @return the source value. */ - public Source source() { + public String source() { return this.innerProperties() == null ? null : this.innerProperties().source(); } /** - * Set the source property: The source of the watchlist. + * Set the source property: The filename of the watchlist, called 'source'. * * @param source the source value to set. * @return the WatchlistInner object itself. */ - public WatchlistInner withSource(Source source) { + public WatchlistInner withSource(String source) { if (this.innerProperties() == null) { this.innerProperties = new WatchlistProperties(); } @@ -203,6 +219,29 @@ public WatchlistInner withSource(Source source) { return this; } + /** + * Get the sourceType property: The sourceType of the watchlist. + * + * @return the sourceType value. + */ + public SourceType sourceType() { + return this.innerProperties() == null ? null : this.innerProperties().sourceType(); + } + + /** + * Set the sourceType property: The sourceType of the watchlist. + * + * @param sourceType the sourceType value to set. + * @return the WatchlistInner object itself. + */ + public WatchlistInner withSourceType(SourceType sourceType) { + if (this.innerProperties() == null) { + this.innerProperties = new WatchlistProperties(); + } + this.innerProperties().withSourceType(sourceType); + return this; + } + /** * Get the created property: The time the watchlist was created. * @@ -457,7 +496,7 @@ public WatchlistInner withTenantId(String tenantId) { } /** - * Get the numberOfLinesToSkip property: The number of lines in a csv content to skip before the header. + * Get the numberOfLinesToSkip property: The number of lines in a csv/tsv content to skip before the header. * * @return the numberOfLinesToSkip value. */ @@ -466,7 +505,7 @@ public Integer numberOfLinesToSkip() { } /** - * Set the numberOfLinesToSkip property: The number of lines in a csv content to skip before the header. + * 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. @@ -480,10 +519,8 @@ public WatchlistInner withNumberOfLinesToSkip(Integer numberOfLinesToSkip) { } /** - * Get the rawContent property: The raw content that represents to watchlist items to create. Example : This line - * will be skipped - * header1,header2 - * value1,value2. + * 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. */ @@ -492,10 +529,8 @@ public String rawContent() { } /** - * Set the rawContent property: The raw content that represents to watchlist items to create. Example : This line - * will be skipped - * header1,header2 - * value1,value2. + * 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. @@ -536,7 +571,7 @@ public WatchlistInner withItemsSearchKey(String itemsSearchKey) { } /** - * Get the contentType property: The content type of the raw content. For now, only text/csv is valid. + * Get the contentType property: The content type of the raw content. Example : text/csv or text/tsv. * * @return the contentType value. */ @@ -545,7 +580,7 @@ public String contentType() { } /** - * Set the contentType property: The content type of the raw content. For now, only text/csv is valid. + * 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. @@ -584,15 +619,12 @@ public WatchlistInner withUploadStatus(String uploadStatus) { } /** - * Validates the instance. + * Get the provisioningState property: Describes provisioning state. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the provisioningState value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public WatchlistProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -601,8 +633,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -628,12 +660,12 @@ public static WatchlistInner fromJson(JsonReader jsonReader) throws IOException deserializedWatchlistInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedWatchlistInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWatchlistInner.innerProperties = WatchlistProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { - deserializedWatchlistInner.withEtag(reader.getString()); + deserializedWatchlistInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedWatchlistInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedWatchlistInner.innerProperties = WatchlistProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index 29b647f184b2..acd462dba1a4 100644 --- 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 @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag; import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.io.IOException; import java.time.OffsetDateTime; @@ -18,12 +18,17 @@ * Represents a Watchlist Item in Azure Security Insights. */ @Fluent -public final class WatchlistItemInner extends ResourceWithEtag { +public final class WatchlistItemInner extends ProxyResource { /* * Watchlist Item properties */ private WatchlistItemProperties innerProperties; + /* + * Etag of the azure resource + */ + private String etag; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -59,12 +64,31 @@ private WatchlistItemProperties innerProperties() { return this.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 WatchlistItemInner object itself. + */ + public WatchlistItemInner 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. */ - @Override public SystemData systemData() { return this.systemData; } @@ -99,15 +123,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public WatchlistItemInner withEtag(String etag) { - super.withEtag(etag); - return this; - } - /** * Get the watchlistItemType property: The type of the watchlist item. * @@ -338,26 +353,14 @@ public WatchlistItemInner withEntityMapping(Object entityMapping) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("etag", etag()); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); return jsonWriter.writeEndObject(); } @@ -383,12 +386,12 @@ public static WatchlistItemInner fromJson(JsonReader jsonReader) throws IOExcept deserializedWatchlistItemInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedWatchlistItemInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWatchlistItemInner.innerProperties = WatchlistItemProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { - deserializedWatchlistItemInner.withEtag(reader.getString()); + deserializedWatchlistItemInner.etag = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedWatchlistItemInner.systemData = SystemData.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedWatchlistItemInner.innerProperties = WatchlistItemProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index 741f56aac22b..f280f1a289f3 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -277,27 +276,6 @@ public WatchlistItemProperties withEntityMapping(Object 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.atError() - .log(new IllegalArgumentException( - "Missing required property itemsKeyValue in model WatchlistItemProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WatchlistItemProperties.class); - /** * {@inheritDoc} */ @@ -315,7 +293,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.updated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updated)); jsonWriter.writeJsonField("createdBy", this.createdBy); jsonWriter.writeJsonField("updatedBy", this.updatedBy); - jsonWriter.writeUntypedField("entityMapping", this.entityMapping); + if (this.entityMapping != null) { + jsonWriter.writeUntypedField("entityMapping", this.entityMapping); + } return jsonWriter.writeEndObject(); } 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 index 4f771bbc5193..87c9571f6a41 100644 --- 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 @@ -1,18 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.models.Source; +import com.azure.resourcemanager.securityinsights.models.SourceType; import com.azure.resourcemanager.securityinsights.models.UserInfo; +import com.azure.resourcemanager.securityinsights.models.WatchlistProvisioningState; import java.io.IOException; import java.time.Duration; import java.time.OffsetDateTime; @@ -40,9 +40,14 @@ public final class WatchlistProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); @@ -672,6 +675,9 @@ public static WatchlistProperties fromJson(JsonReader jsonReader) throws IOExcep deserializedWatchlistProperties.contentType = reader.getString(); } else if ("uploadStatus".equals(fieldName)) { deserializedWatchlistProperties.uploadStatus = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedWatchlistProperties.provisioningState + = WatchlistProvisioningState.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentInner.java new file mode 100644 index 000000000000..f412d3f3fb8d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentInner.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import com.azure.resourcemanager.securityinsights.models.JobProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The workspace manager assignment. + */ +@Fluent +public final class WorkspaceManagerAssignmentInner extends ProxyResource { + /* + * The workspace manager assignment object + */ + private WorkspaceManagerAssignmentProperties innerProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of WorkspaceManagerAssignmentInner class. + */ + public WorkspaceManagerAssignmentInner() { + } + + /** + * Get the innerProperties property: The workspace manager assignment object. + * + * @return the innerProperties value. + */ + private WorkspaceManagerAssignmentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the targetResourceName property: The resource name of the workspace manager group targeted by the workspace + * manager assignment. + * + * @return the targetResourceName value. + */ + public String targetResourceName() { + return this.innerProperties() == null ? null : this.innerProperties().targetResourceName(); + } + + /** + * Set the targetResourceName property: The resource name of the workspace manager group targeted by the workspace + * manager assignment. + * + * @param targetResourceName the targetResourceName value to set. + * @return the WorkspaceManagerAssignmentInner object itself. + */ + public WorkspaceManagerAssignmentInner withTargetResourceName(String targetResourceName) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerAssignmentProperties(); + } + this.innerProperties().withTargetResourceName(targetResourceName); + return this; + } + + /** + * Get the lastJobEndTime property: The time the last job associated to this assignment ended at. + * + * @return the lastJobEndTime value. + */ + public OffsetDateTime lastJobEndTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastJobEndTime(); + } + + /** + * Get the lastJobProvisioningState property: State of the last job associated to this assignment. + * + * @return the lastJobProvisioningState value. + */ + public JobProvisioningState lastJobProvisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().lastJobProvisioningState(); + } + + /** + * Get the items property: List of resources included in this workspace manager assignment. + * + * @return the items value. + */ + public List items() { + return this.innerProperties() == null ? null : this.innerProperties().items(); + } + + /** + * Set the items property: List of resources included in this workspace manager assignment. + * + * @param items the items value to set. + * @return the WorkspaceManagerAssignmentInner object itself. + */ + public WorkspaceManagerAssignmentInner withItems(List items) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerAssignmentProperties(); + } + this.innerProperties().withItems(items); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerAssignmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerAssignmentInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerAssignmentInner. + */ + public static WorkspaceManagerAssignmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerAssignmentInner deserializedWorkspaceManagerAssignmentInner + = new WorkspaceManagerAssignmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentInner.innerProperties + = WorkspaceManagerAssignmentProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerAssignmentInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentProperties.java new file mode 100644 index 000000000000..01a0a64d6800 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import com.azure.resourcemanager.securityinsights.models.JobProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The workspace manager assignment properties. + */ +@Fluent +public final class WorkspaceManagerAssignmentProperties + implements JsonSerializable { + /* + * The resource name of the workspace manager group targeted by the workspace manager assignment + */ + private String targetResourceName; + + /* + * The time the last job associated to this assignment ended at + */ + private OffsetDateTime lastJobEndTime; + + /* + * State of the last job associated to this assignment + */ + private JobProvisioningState lastJobProvisioningState; + + /* + * List of resources included in this workspace manager assignment + */ + private List items; + + /** + * Creates an instance of WorkspaceManagerAssignmentProperties class. + */ + public WorkspaceManagerAssignmentProperties() { + } + + /** + * Get the targetResourceName property: The resource name of the workspace manager group targeted by the workspace + * manager assignment. + * + * @return the targetResourceName value. + */ + public String targetResourceName() { + return this.targetResourceName; + } + + /** + * Set the targetResourceName property: The resource name of the workspace manager group targeted by the workspace + * manager assignment. + * + * @param targetResourceName the targetResourceName value to set. + * @return the WorkspaceManagerAssignmentProperties object itself. + */ + public WorkspaceManagerAssignmentProperties withTargetResourceName(String targetResourceName) { + this.targetResourceName = targetResourceName; + return this; + } + + /** + * Get the lastJobEndTime property: The time the last job associated to this assignment ended at. + * + * @return the lastJobEndTime value. + */ + public OffsetDateTime lastJobEndTime() { + return this.lastJobEndTime; + } + + /** + * Get the lastJobProvisioningState property: State of the last job associated to this assignment. + * + * @return the lastJobProvisioningState value. + */ + public JobProvisioningState lastJobProvisioningState() { + return this.lastJobProvisioningState; + } + + /** + * Get the items property: List of resources included in this workspace manager assignment. + * + * @return the items value. + */ + public List items() { + return this.items; + } + + /** + * Set the items property: List of resources included in this workspace manager assignment. + * + * @param items the items value to set. + * @return the WorkspaceManagerAssignmentProperties object itself. + */ + public WorkspaceManagerAssignmentProperties withItems(List items) { + this.items = items; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceName", this.targetResourceName); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerAssignmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerAssignmentProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerAssignmentProperties. + */ + public static WorkspaceManagerAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerAssignmentProperties deserializedWorkspaceManagerAssignmentProperties + = new WorkspaceManagerAssignmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceName".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentProperties.targetResourceName = reader.getString(); + } else if ("items".equals(fieldName)) { + List items = reader.readArray(reader1 -> AssignmentItem.fromJson(reader1)); + deserializedWorkspaceManagerAssignmentProperties.items = items; + } else if ("lastJobEndTime".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentProperties.lastJobEndTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastJobProvisioningState".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentProperties.lastJobProvisioningState + = JobProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerAssignmentProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationInner.java new file mode 100644 index 000000000000..cc87faa0c10b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationInner.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Mode; +import java.io.IOException; + +/** + * The workspace manager configuration. + */ +@Fluent +public final class WorkspaceManagerConfigurationInner extends ProxyResource { + /* + * The workspace manager configuration object + */ + private WorkspaceManagerConfigurationProperties innerProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of WorkspaceManagerConfigurationInner class. + */ + public WorkspaceManagerConfigurationInner() { + } + + /** + * Get the innerProperties property: The workspace manager configuration object. + * + * @return the innerProperties value. + */ + private WorkspaceManagerConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the mode property: The current mode of the workspace manager configuration. + * + * @return the mode value. + */ + public Mode mode() { + return this.innerProperties() == null ? null : this.innerProperties().mode(); + } + + /** + * Set the mode property: The current mode of the workspace manager configuration. + * + * @param mode the mode value to set. + * @return the WorkspaceManagerConfigurationInner object itself. + */ + public WorkspaceManagerConfigurationInner withMode(Mode mode) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerConfigurationProperties(); + } + this.innerProperties().withMode(mode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerConfigurationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerConfigurationInner. + */ + public static WorkspaceManagerConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerConfigurationInner deserializedWorkspaceManagerConfigurationInner + = new WorkspaceManagerConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationInner.innerProperties + = WorkspaceManagerConfigurationProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerConfigurationInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationProperties.java new file mode 100644 index 000000000000..90b162aa09c1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Mode; +import java.io.IOException; + +/** + * The workspace manager configuration properties. + */ +@Fluent +public final class WorkspaceManagerConfigurationProperties + implements JsonSerializable { + /* + * The current mode of the workspace manager configuration + */ + private Mode mode; + + /** + * Creates an instance of WorkspaceManagerConfigurationProperties class. + */ + public WorkspaceManagerConfigurationProperties() { + } + + /** + * Get the mode property: The current mode of the workspace manager configuration. + * + * @return the mode value. + */ + public Mode mode() { + return this.mode; + } + + /** + * Set the mode property: The current mode of the workspace manager configuration. + * + * @param mode the mode value to set. + * @return the WorkspaceManagerConfigurationProperties object itself. + */ + public WorkspaceManagerConfigurationProperties withMode(Mode mode) { + this.mode = mode; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerConfigurationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerConfigurationProperties. + */ + public static WorkspaceManagerConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerConfigurationProperties deserializedWorkspaceManagerConfigurationProperties + = new WorkspaceManagerConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationProperties.mode = Mode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerConfigurationProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupInner.java new file mode 100644 index 000000000000..fa73240e43f9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupInner.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The workspace manager group. + */ +@Fluent +public final class WorkspaceManagerGroupInner extends ProxyResource { + /* + * The workspace manager group object + */ + private WorkspaceManagerGroupProperties innerProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of WorkspaceManagerGroupInner class. + */ + public WorkspaceManagerGroupInner() { + } + + /** + * Get the innerProperties property: The workspace manager group object. + * + * @return the innerProperties value. + */ + private WorkspaceManagerGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: The description of the workspace manager group. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the workspace manager group. + * + * @param description the description value to set. + * @return the WorkspaceManagerGroupInner object itself. + */ + public WorkspaceManagerGroupInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerGroupProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the displayName property: The display name of the workspace manager group. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the workspace manager group. + * + * @param displayName the displayName value to set. + * @return the WorkspaceManagerGroupInner object itself. + */ + public WorkspaceManagerGroupInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerGroupProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the memberResourceNames property: The names of the workspace manager members participating in this group. + * + * @return the memberResourceNames value. + */ + public List memberResourceNames() { + return this.innerProperties() == null ? null : this.innerProperties().memberResourceNames(); + } + + /** + * Set the memberResourceNames property: The names of the workspace manager members participating in this group. + * + * @param memberResourceNames the memberResourceNames value to set. + * @return the WorkspaceManagerGroupInner object itself. + */ + public WorkspaceManagerGroupInner withMemberResourceNames(List memberResourceNames) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerGroupProperties(); + } + this.innerProperties().withMemberResourceNames(memberResourceNames); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerGroupInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerGroupInner. + */ + public static WorkspaceManagerGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerGroupInner deserializedWorkspaceManagerGroupInner = new WorkspaceManagerGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceManagerGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceManagerGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceManagerGroupInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceManagerGroupInner.innerProperties + = WorkspaceManagerGroupProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedWorkspaceManagerGroupInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceManagerGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerGroupInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupProperties.java new file mode 100644 index 000000000000..7567117bf1e3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The workspace manager group properties. + */ +@Fluent +public final class WorkspaceManagerGroupProperties implements JsonSerializable { + /* + * The description of the workspace manager group + */ + private String description; + + /* + * The display name of the workspace manager group + */ + private String displayName; + + /* + * The names of the workspace manager members participating in this group. + */ + private List memberResourceNames; + + /** + * Creates an instance of WorkspaceManagerGroupProperties class. + */ + public WorkspaceManagerGroupProperties() { + } + + /** + * Get the description property: The description of the workspace manager group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the workspace manager group. + * + * @param description the description value to set. + * @return the WorkspaceManagerGroupProperties object itself. + */ + public WorkspaceManagerGroupProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the displayName property: The display name of the workspace manager group. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the workspace manager group. + * + * @param displayName the displayName value to set. + * @return the WorkspaceManagerGroupProperties object itself. + */ + public WorkspaceManagerGroupProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the memberResourceNames property: The names of the workspace manager members participating in this group. + * + * @return the memberResourceNames value. + */ + public List memberResourceNames() { + return this.memberResourceNames; + } + + /** + * Set the memberResourceNames property: The names of the workspace manager members participating in this group. + * + * @param memberResourceNames the memberResourceNames value to set. + * @return the WorkspaceManagerGroupProperties object itself. + */ + public WorkspaceManagerGroupProperties withMemberResourceNames(List memberResourceNames) { + this.memberResourceNames = memberResourceNames; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("memberResourceNames", this.memberResourceNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerGroupProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerGroupProperties. + */ + public static WorkspaceManagerGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerGroupProperties deserializedWorkspaceManagerGroupProperties + = new WorkspaceManagerGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedWorkspaceManagerGroupProperties.displayName = reader.getString(); + } else if ("memberResourceNames".equals(fieldName)) { + List memberResourceNames = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspaceManagerGroupProperties.memberResourceNames = memberResourceNames; + } else if ("description".equals(fieldName)) { + deserializedWorkspaceManagerGroupProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerGroupProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberInner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberInner.java new file mode 100644 index 000000000000..85f04a2769cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The workspace manager member. + */ +@Fluent +public final class WorkspaceManagerMemberInner extends ProxyResource { + /* + * The workspace manager member object + */ + private WorkspaceManagerMemberProperties innerProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of WorkspaceManagerMemberInner class. + */ + public WorkspaceManagerMemberInner() { + } + + /** + * Get the innerProperties property: The workspace manager member object. + * + * @return the innerProperties value. + */ + private WorkspaceManagerMemberProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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 type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the targetWorkspaceResourceId property: Fully qualified resource ID of the target Sentinel workspace joining + * the given Sentinel workspace manager. + * + * @return the targetWorkspaceResourceId value. + */ + public String targetWorkspaceResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetWorkspaceResourceId(); + } + + /** + * Set the targetWorkspaceResourceId property: Fully qualified resource ID of the target Sentinel workspace joining + * the given Sentinel workspace manager. + * + * @param targetWorkspaceResourceId the targetWorkspaceResourceId value to set. + * @return the WorkspaceManagerMemberInner object itself. + */ + public WorkspaceManagerMemberInner withTargetWorkspaceResourceId(String targetWorkspaceResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerMemberProperties(); + } + this.innerProperties().withTargetWorkspaceResourceId(targetWorkspaceResourceId); + return this; + } + + /** + * Get the targetWorkspaceTenantId property: Tenant id of the target Sentinel workspace joining the given Sentinel + * workspace manager. + * + * @return the targetWorkspaceTenantId value. + */ + public String targetWorkspaceTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().targetWorkspaceTenantId(); + } + + /** + * Set the targetWorkspaceTenantId property: Tenant id of the target Sentinel workspace joining the given Sentinel + * workspace manager. + * + * @param targetWorkspaceTenantId the targetWorkspaceTenantId value to set. + * @return the WorkspaceManagerMemberInner object itself. + */ + public WorkspaceManagerMemberInner withTargetWorkspaceTenantId(String targetWorkspaceTenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceManagerMemberProperties(); + } + this.innerProperties().withTargetWorkspaceTenantId(targetWorkspaceTenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerMemberInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerMemberInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerMemberInner. + */ + public static WorkspaceManagerMemberInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerMemberInner deserializedWorkspaceManagerMemberInner = new WorkspaceManagerMemberInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkspaceManagerMemberInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedWorkspaceManagerMemberInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWorkspaceManagerMemberInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedWorkspaceManagerMemberInner.innerProperties + = WorkspaceManagerMemberProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedWorkspaceManagerMemberInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedWorkspaceManagerMemberInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerMemberInner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberProperties.java new file mode 100644 index 000000000000..78307a38a56c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberProperties.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The workspace manager member properties. + */ +@Fluent +public final class WorkspaceManagerMemberProperties implements JsonSerializable { + /* + * Fully qualified resource ID of the target Sentinel workspace joining the given Sentinel workspace manager + */ + private String targetWorkspaceResourceId; + + /* + * Tenant id of the target Sentinel workspace joining the given Sentinel workspace manager + */ + private String targetWorkspaceTenantId; + + /** + * Creates an instance of WorkspaceManagerMemberProperties class. + */ + public WorkspaceManagerMemberProperties() { + } + + /** + * Get the targetWorkspaceResourceId property: Fully qualified resource ID of the target Sentinel workspace joining + * the given Sentinel workspace manager. + * + * @return the targetWorkspaceResourceId value. + */ + public String targetWorkspaceResourceId() { + return this.targetWorkspaceResourceId; + } + + /** + * Set the targetWorkspaceResourceId property: Fully qualified resource ID of the target Sentinel workspace joining + * the given Sentinel workspace manager. + * + * @param targetWorkspaceResourceId the targetWorkspaceResourceId value to set. + * @return the WorkspaceManagerMemberProperties object itself. + */ + public WorkspaceManagerMemberProperties withTargetWorkspaceResourceId(String targetWorkspaceResourceId) { + this.targetWorkspaceResourceId = targetWorkspaceResourceId; + return this; + } + + /** + * Get the targetWorkspaceTenantId property: Tenant id of the target Sentinel workspace joining the given Sentinel + * workspace manager. + * + * @return the targetWorkspaceTenantId value. + */ + public String targetWorkspaceTenantId() { + return this.targetWorkspaceTenantId; + } + + /** + * Set the targetWorkspaceTenantId property: Tenant id of the target Sentinel workspace joining the given Sentinel + * workspace manager. + * + * @param targetWorkspaceTenantId the targetWorkspaceTenantId value to set. + * @return the WorkspaceManagerMemberProperties object itself. + */ + public WorkspaceManagerMemberProperties withTargetWorkspaceTenantId(String targetWorkspaceTenantId) { + this.targetWorkspaceTenantId = targetWorkspaceTenantId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetWorkspaceResourceId", this.targetWorkspaceResourceId); + jsonWriter.writeStringField("targetWorkspaceTenantId", this.targetWorkspaceTenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerMemberProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerMemberProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerMemberProperties. + */ + public static WorkspaceManagerMemberProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerMemberProperties deserializedWorkspaceManagerMemberProperties + = new WorkspaceManagerMemberProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetWorkspaceResourceId".equals(fieldName)) { + deserializedWorkspaceManagerMemberProperties.targetWorkspaceResourceId = reader.getString(); + } else if ("targetWorkspaceTenantId".equals(fieldName)) { + deserializedWorkspaceManagerMemberProperties.targetWorkspaceTenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerMemberProperties; + }); + } +} 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 index 3a995c02679e..293a87a21ac5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the inner data models for SecurityInsights. 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 index 6a2422a27ae4..f2f3f89ed966 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the service clients for SecurityInsights. 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 index c905955280fb..e42b4a2f5a82 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -91,7 +91,6 @@ public ActionResponse create(Context context) { } ActionResponseImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { - this.innerObject = new ActionResponseInner(); this.serviceManager = serviceManager; this.actionId = name; this.createAction = new ActionRequest(); @@ -175,6 +174,6 @@ public ActionResponseImpl withLogicAppResourceId(String logicAppResourceId) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || 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 index 0a66325d74f0..c425d3a509af 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,8 +30,8 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.ActionsClient; import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; +import com.azure.resourcemanager.securityinsights.implementation.models.ActionsList; import com.azure.resourcemanager.securityinsights.models.ActionRequest; -import com.azure.resourcemanager.securityinsights.models.ActionsList; import reactor.core.publisher.Mono; /** @@ -46,232 +46,121 @@ public final class ActionsClientImpl implements ActionsClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of ActionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ActionsClientImpl(SecurityInsightsImpl client) { + ActionsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientActions to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsActi") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientActions") public interface ActionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAlertRule(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("ruleId") String ruleId, @PathParam("actionId") String actionId, + @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, + Response getSync(@HostParam("endpoint") 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, + Mono> createOrUpdate(@HostParam("endpoint") 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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ActionRequest action, 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) + Response createOrUpdateSync(@HostParam("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ActionRequest action, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") 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, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + @PathParam("ruleId") String ruleId, @PathParam("actionId") String actionId, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions") @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAlertRuleAsync(String resourceGroupName, String workspaceName, - String ruleId) { - return new PagedFlux<>(() -> listByAlertRuleSinglePageAsync(resourceGroupName, workspaceName, ruleId), - nextLink -> listByAlertRuleNextSinglePageAsync(nextLink)); - } + Mono> listByAlertRule(@HostParam("endpoint") 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); - /** - * 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 as paginated response with {@link PagedFlux}. - */ - @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)); - } + @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) + Response listByAlertRuleSync(@HostParam("endpoint") 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); - /** - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, - String ruleId) { - return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, workspaceName, ruleId)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAlertRuleNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") 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. - * @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, - String ruleId, Context context) { - return new PagedIterable<>(listByAlertRuleAsync(resourceGroupName, workspaceName, ruleId, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByAlertRuleNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -282,27 +171,6 @@ public PagedIterable listByAlertRule(String resourceGroupNa @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(), @@ -314,50 +182,7 @@ private Mono> getWithResponseAsync(String resource * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -376,7 +201,7 @@ private Mono getAsync(String resourceGroupName, String work * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param context The context to associate with this operation. @@ -388,14 +213,16 @@ private Mono getAsync(String resourceGroupName, String work @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(); + final String accept = "application/json"; + return service.getSync(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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -412,7 +239,7 @@ public ActionResponseInner get(String resourceGroupName, String workspaceName, S * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. @@ -424,37 +251,12 @@ public ActionResponseInner get(String resourceGroupName, String workspaceName, S @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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, contentType, + accept, action, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -462,57 +264,7 @@ private Mono> createOrUpdateWithResponseAsync(Stri * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. @@ -532,7 +284,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. @@ -545,15 +297,18 @@ private Mono createOrUpdateAsync(String resourceGroupName, @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(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, contentType, accept, + action, 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @param action The action. @@ -573,7 +328,7 @@ public ActionResponseInner createOrUpdate(String resourceGroupName, String works * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param actionId Action ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -584,31 +339,9 @@ public ActionResponseInner createOrUpdate(String resourceGroupName, String works @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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -616,96 +349,175 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * 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 workspaceName The name of the monitor 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 {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @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); + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId) + .flatMap(ignored -> 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 workspaceName The name of the monitor 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 A {@link Mono} that completes when a successful response is received. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleId, String actionId) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, actionId) - .flatMap(ignored -> Mono.empty()); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, + String actionId, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, actionId, 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 workspaceName The name of the monitor 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 {@link 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(); + public void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId) { + deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE); } /** - * Delete the action of alert rule. + * 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 workspaceName The name of the monitor 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 all actions of alert rule along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId) { - deleteWithResponse(resourceGroupName, workspaceName, ruleId, actionId, Context.NONE); + private Mono> listByAlertRuleSinglePageAsync(String resourceGroupName, + String workspaceName, String ruleId) { + 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 monitor 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 as paginated response with {@link PagedFlux}. + */ + @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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAlertRuleSinglePage(String resourceGroupName, String workspaceName, + String ruleId) { + final String accept = "application/json"; + Response res = service.listByAlertRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, accept, Context.NONE); + return 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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAlertRuleSinglePage(String resourceGroupName, String workspaceName, + String ruleId, Context context) { + final String accept = "application/json"; + Response res = service.listByAlertRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, accept, context); + return 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, + String ruleId) { + return new PagedIterable<>(() -> listByAlertRuleSinglePage(resourceGroupName, workspaceName, ruleId), + nextLink -> listByAlertRuleNextSinglePage(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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, + String ruleId, Context context) { + return new PagedIterable<>(() -> listByAlertRuleSinglePage(resourceGroupName, workspaceName, ruleId, context), + nextLink -> listByAlertRuleNextSinglePage(nextLink, context)); } /** @@ -715,17 +527,10 @@ public void delete(String resourceGroupName, String workspaceName, String ruleId * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all actions of alert rule along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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)) @@ -734,6 +539,24 @@ private Mono> listByAlertRuleNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByAlertRuleNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByAlertRuleNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -742,22 +565,14 @@ private Mono> listByAlertRuleNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all actions of alert rule along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listByAlertRuleNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listByAlertRuleNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 4def627c6079..71a0578e4d73 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,30 +27,12 @@ public ActionsImpl(ActionsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, - String ruleId) { - PagedIterable inner - = this.serviceClient().listByAlertRule(resourceGroupName, workspaceName, ruleId); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new ActionResponseImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ActionResponseImpl(inner.getValue(), this.manager())); } public ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId) { @@ -71,6 +53,20 @@ public void delete(String resourceGroupName, String workspaceName, String ruleId this.serviceClient().delete(resourceGroupName, workspaceName, ruleId, actionId); } + public PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, + String ruleId) { + PagedIterable inner + = this.serviceClient().listByAlertRule(resourceGroupName, workspaceName, ruleId); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new ActionResponseImpl(inner1, this.manager())); + } + public ActionResponse getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 index 8661ffc31d4b..09122b8eccde 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public AlertRuleKind kind() { + return this.innerModel().kind(); + } + public String etag() { return this.innerModel().etag(); } @@ -40,10 +44,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public AlertRuleKind kind() { - return this.innerModel().kind(); - } - public AlertRuleInner innerModel() { return this.innerObject; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsClientImpl.java new file mode 100644 index 000000000000..7bde18450841 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.securityinsights.fluent.AlertRuleOperationsClient; +import com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AlertRuleOperationsClient. + */ +public final class AlertRuleOperationsClientImpl implements AlertRuleOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AlertRuleOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of AlertRuleOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertRuleOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(AlertRuleOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientAlertRuleOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientAlertRuleOperations") + public interface AlertRuleOperationsService { + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/triggerRuleRun") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> triggerRuleRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/triggerRuleRun") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response triggerRuleRunSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerRuleRunWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.triggerRuleRun(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, contentType, + analyticsRuleRunTriggerParameter, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerRuleRunWithResponse(String resourceGroupName, String workspaceName, + String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + final String contentType = "application/json"; + return service.triggerRuleRunSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, contentType, + analyticsRuleRunTriggerParameter, Context.NONE); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerRuleRunWithResponse(String resourceGroupName, String workspaceName, + String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context) { + final String contentType = "application/json"; + return service.triggerRuleRunSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, contentType, + analyticsRuleRunTriggerParameter, context); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginTriggerRuleRunAsync(String resourceGroupName, String workspaceName, + String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + Mono>> mono = triggerRuleRunWithResponseAsync(resourceGroupName, workspaceName, + ruleId, analyticsRuleRunTriggerParameter); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginTriggerRuleRun(String resourceGroupName, String workspaceName, + String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + Response response + = triggerRuleRunWithResponse(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginTriggerRuleRun(String resourceGroupName, String workspaceName, + String ruleId, AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context) { + Response response = triggerRuleRunWithResponse(resourceGroupName, workspaceName, ruleId, + analyticsRuleRunTriggerParameter, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerRuleRunAsync(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + return beginTriggerRuleRunAsync(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + beginTriggerRuleRun(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter) + .getFinalResult(); + } + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context) { + beginTriggerRuleRun(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter, context) + .getFinalResult(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsImpl.java new file mode 100644 index 000000000000..33ea7357a9d2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.AlertRuleOperationsClient; +import com.azure.resourcemanager.securityinsights.models.AlertRuleOperations; +import com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger; + +public final class AlertRuleOperationsImpl implements AlertRuleOperations { + private static final ClientLogger LOGGER = new ClientLogger(AlertRuleOperationsImpl.class); + + private final AlertRuleOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public AlertRuleOperationsImpl(AlertRuleOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter) { + this.serviceClient().triggerRuleRun(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter); + } + + public void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context) { + this.serviceClient() + .triggerRuleRun(resourceGroupName, workspaceName, ruleId, analyticsRuleRunTriggerParameter, context); + } + + private AlertRuleOperationsClient 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/AlertRuleTemplateImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplateImpl.java index 2b080a9bbca4..d575a3136b13 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index 1b086d27e094..ee975fb716c7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatesList; +import com.azure.resourcemanager.securityinsights.implementation.models.AlertRuleTemplatesList; import reactor.core.publisher.Mono; /** @@ -42,322 +42,280 @@ public final class AlertRuleTemplatesClientImpl implements AlertRuleTemplatesCli /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of AlertRuleTemplatesClientImpl. * * @param client the instance of the service client containing this operation class. */ - AlertRuleTemplatesClientImpl(SecurityInsightsImpl client) { + AlertRuleTemplatesClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientAlertRuleTemplates to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsAler") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientAlertRuleTemplates") public interface AlertRuleTemplatesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates/{alertRuleTemplateId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("alertRuleTemplateId") String alertRuleTemplateId, @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, + Response getSync(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRuleTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all alert rule templates. + * 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 workspaceName The name of the monitor 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 all alert rule templates along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the alert rule template along with {@link Response} on successful completion of {@link Mono}. */ @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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String alertRuleTemplateId) { 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)) + 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 all alert rule templates. + * 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 context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 all alert rule templates along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the alert rule template on successful completion of {@link Mono}. */ @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)); + private Mono getAsync(String resourceGroupName, String workspaceName, + String alertRuleTemplateId) { + return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all alert rule templates. + * 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 workspaceName The name of the monitor 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 all alert rule templates as paginated response with {@link PagedFlux}. + * @return the alert rule template along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String alertRuleTemplateId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, alertRuleTemplateId, accept, context); } /** - * Gets all alert rule templates. + * 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 context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 all alert rule templates as paginated response with {@link PagedFlux}. + * @return the alert rule template. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { + return getWithResponse(resourceGroupName, workspaceName, alertRuleTemplateId, Context.NONE).getValue(); } /** * 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 workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + * @return all alert rule templates along with {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + * @return all alert rule templates as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. + * @param workspaceName The name of the monitor 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 the alert rule template along with {@link Response} on successful completion of {@link Mono}. + * @return all alert rule templates along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { 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())); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. + * @param workspaceName The name of the monitor 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 the alert rule template along with {@link Response} on successful completion of {@link Mono}. + * @return all alert rule templates along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { 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); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. + * @param workspaceName The name of the monitor 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 the alert rule template on successful completion of {@link Mono}. + * @return all alert rule templates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String workspaceName, - String alertRuleTemplateId) { - return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); } /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. + * @param workspaceName The name of the monitor 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 the alert rule template along with {@link Response}. + * @return all alert rule templates as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String workspaceName, - String alertRuleTemplateId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, alertRuleTemplateId, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Gets the alert rule template. + * Get the next page of items. * - * @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 nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return all alert rule templates along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertRuleTemplateInner get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { - return getWithResponse(resourceGroupName, workspaceName, alertRuleTemplateId, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); } /** @@ -367,23 +325,15 @@ public AlertRuleTemplateInner get(String resourceGroupName, String workspaceName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all alert rule templates along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink) { 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())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -394,22 +344,14 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all alert rule templates along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 16fc67c7120e..227c99f4c51c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,27 +27,12 @@ public AlertRuleTemplatesImpl(AlertRuleTemplatesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new AlertRuleTemplateImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertRuleTemplateImpl(inner.getValue(), this.manager())); } public AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId) { @@ -59,6 +44,17 @@ public AlertRuleTemplate get(String resourceGroupName, String workspaceName, Str } } + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new AlertRuleTemplateImpl(inner1, this.manager())); + } + private AlertRuleTemplatesClient serviceClient() { return this.innerClient; } 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 index 1e9190ca1845..f83e2da80c7f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; -import com.azure.resourcemanager.securityinsights.models.AlertRulesList; +import com.azure.resourcemanager.securityinsights.implementation.models.AlertRulesList; import reactor.core.publisher.Mono; /** @@ -45,214 +45,120 @@ public final class AlertRulesClientImpl implements AlertRulesClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of AlertRulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - AlertRulesClientImpl(SecurityInsightsImpl client) { + AlertRulesClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientAlertRules to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsAler") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientAlertRules") public interface AlertRulesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @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}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") 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, + Mono> createOrUpdate(@HostParam("endpoint") 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); + @PathParam("ruleId") String ruleId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AlertRuleInner alertRule, + 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) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AlertRuleInner alertRule, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleId") String ruleId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + @PathParam("ruleId") String ruleId, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules") @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } + Mono> list(@HostParam("endpoint") 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); - /** - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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); - /** - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") 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. - * @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -262,24 +168,6 @@ public PagedIterable list(String resourceGroupName, String works @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(), @@ -291,46 +179,7 @@ private Mono> getWithResponseAsync(String resourceGroup * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -347,7 +196,7 @@ private Mono getAsync(String resourceGroupName, String workspace * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -358,14 +207,16 @@ private Mono getAsync(String resourceGroupName, String workspace @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); + final String accept = "application/json"; + return service.getSync(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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -381,7 +232,7 @@ public AlertRuleInner get(String resourceGroupName, String workspaceName, String * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -392,33 +243,12 @@ public AlertRuleInner get(String resourceGroupName, String workspaceName, String @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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, contentType, accept, + alertRule, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -426,52 +256,7 @@ private Mono> createOrUpdateWithResponseAsync(String re * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -490,7 +275,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @param context The context to associate with this operation. @@ -502,14 +287,18 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin @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(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, contentType, accept, alertRule, + 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -527,7 +316,7 @@ public AlertRuleInner createOrUpdate(String resourceGroupName, String workspaceN * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -537,28 +326,9 @@ public AlertRuleInner createOrUpdate(String resourceGroupName, String workspaceN @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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -566,88 +336,160 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * 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 workspaceName The name of the monitor 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 {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @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); + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId).flatMap(ignored -> 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 workspaceName The name of the monitor 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 A {@link Mono} that completes when a successful response is received. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleId) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId).flatMap(ignored -> Mono.empty()); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleId, 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 workspaceName The name of the monitor 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) { + deleteWithResponse(resourceGroupName, workspaceName, ruleId, Context.NONE); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + 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 monitor 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 as paginated response with {@link PagedFlux}. + */ + @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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return 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 monitor 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 the {@link Response}. + * @return all alert rules along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, ruleId, context).block(); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Delete the alert rule. + * 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 ruleId Alert rule ID. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String ruleId) { - deleteWithResponse(resourceGroupName, workspaceName, ruleId, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -657,17 +499,10 @@ public void delete(String resourceGroupName, String workspaceName, String ruleId * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all alert rules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(), @@ -675,6 +510,23 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -683,21 +535,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all alert rules along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index eb6aa3964151..cba3acb34631 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,26 +27,12 @@ public AlertRulesImpl(AlertRulesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new AlertRuleImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertRuleImpl(inner.getValue(), this.manager())); } public AlertRule get(String resourceGroupName, String workspaceName, String ruleId) { @@ -62,12 +48,8 @@ public Response createOrUpdateWithResponse(String resourceGroupName, 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AlertRuleImpl(inner.getValue(), this.manager())); } public AlertRule createOrUpdate(String resourceGroupName, String workspaceName, String ruleId, @@ -89,6 +71,16 @@ public void delete(String resourceGroupName, String workspaceName, String ruleId this.serviceClient().delete(resourceGroupName, workspaceName, ruleId); } + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new AlertRuleImpl(inner1, this.manager())); + } + private AlertRulesClient serviceClient() { return this.innerClient; } 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 index 4ab5d524456a..1299b37603a1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index 7f2a30c73c43..1a84d1bffb3f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient; import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; -import com.azure.resourcemanager.securityinsights.models.AutomationRulesList; +import com.azure.resourcemanager.securityinsights.implementation.models.AutomationRulesList; import reactor.core.publisher.Mono; /** @@ -45,31 +45,41 @@ public final class AutomationRulesClientImpl implements AutomationRulesClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of AutomationRulesClientImpl. * * @param client the instance of the service client containing this operation class. */ - AutomationRulesClientImpl(SecurityInsightsImpl client) { + AutomationRulesClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientAutomationRules to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsAuto") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientAutomationRules") public interface AutomationRulesService { @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, + Mono> get(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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, @@ -79,19 +89,38 @@ Mono> get(@HostParam("$host") String endpoint, @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, + Mono> createOrUpdate(@HostParam("endpoint") 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 automationRuleToUpsert, - @HeaderParam("Accept") String accept, Context context); + @PathParam("automationRuleId") String automationRuleId, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AutomationRuleInner automationRuleToUpsert, 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) + Response createOrUpdateSync(@HostParam("endpoint") 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, + @BodyParam("application/json") AutomationRuleInner automationRuleToUpsert, 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, + Mono> delete(@HostParam("endpoint") 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" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") 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); @@ -100,7 +129,16 @@ Mono> delete(@HostParam("$host") String endpoint, @QueryParam(" @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, + Mono> list(@HostParam("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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); @@ -110,14 +148,21 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 workspaceName The name of the monitor workspace. * @param automationRuleId Automation rule ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -127,25 +172,6 @@ Mono> listNext(@PathParam(value = "nextLink", enco @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(), @@ -157,47 +183,7 @@ private Mono> getWithResponseAsync(String resource * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param automationRuleId Automation rule ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -215,7 +201,7 @@ private Mono getAsync(String resourceGroupName, String work * 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 workspaceName The name of the monitor workspace. * @param automationRuleId Automation rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -226,14 +212,16 @@ private Mono getAsync(String resourceGroupName, String work @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); + final String accept = "application/json"; + return service.getSync(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 workspaceName The name of the monitor workspace. * @param automationRuleId Automation rule ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -250,43 +238,22 @@ public AutomationRuleInner get(String resourceGroupName, String workspaceName, S * * @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 automationRuleId The automation rule ID. * @param automationRuleToUpsert 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 the response body along with {@link Response} on successful completion of {@link Mono}. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, String automationRuleId, AutomationRuleInner automationRuleToUpsert) { - 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 (automationRuleToUpsert != null) { - automationRuleToUpsert.validate(); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, automationRuleId, - automationRuleToUpsert, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, automationRuleId, accept, + automationRuleToUpsert, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -295,56 +262,12 @@ private Mono> createOrUpdateWithResponseAsync(Stri * * @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 automationRuleToUpsert 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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String automationRuleId, AutomationRuleInner automationRuleToUpsert, 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 (automationRuleToUpsert != null) { - automationRuleToUpsert.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, automationRuleToUpsert, - 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 automationRuleId The 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 response body on successful completion of {@link Mono}. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, @@ -359,19 +282,22 @@ private Mono createOrUpdateAsync(String resourceGroupName, * * @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 automationRuleId The automation rule ID. * @param automationRuleToUpsert 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 the response body along with {@link Response}. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, AutomationRuleInner automationRuleToUpsert, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, - automationRuleToUpsert, context).block(); + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, automationRuleId, accept, + automationRuleToUpsert, context); } /** @@ -379,11 +305,11 @@ public Response createOrUpdateWithResponse(String resourceG * * @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 automationRuleId The 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 response. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. */ @ServiceMethod(returns = ReturnType.SINGLE) public AutomationRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String automationRuleId) { @@ -396,35 +322,16 @@ public AutomationRuleInner createOrUpdate(String resourceGroupName, String works * 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 workspaceName The name of the monitor 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 any object along with {@link Response} on successful completion of {@link Mono}. + * @return anything along with {@link Response} on successful completion of {@link Mono}. */ @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(), @@ -436,52 +343,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, * 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 workspaceName The name of the monitor 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 any object along with {@link Response} on successful completion of {@link Mono}. - */ - @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 any object on successful completion of {@link Mono}. + * @return anything on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String workspaceName, String automationRuleId) { @@ -493,30 +360,32 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, * 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 workspaceName The name of the monitor 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 any object along with {@link Response}. + * @return anything along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, automationRuleId, context).block(); + final String accept = "application/json"; + return service.deleteSync(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 workspaceName The name of the monitor 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 any object. + * @return anything. */ @ServiceMethod(returns = ReturnType.SINGLE) public Object delete(String resourceGroupName, String workspaceName, String automationRuleId) { @@ -527,7 +396,7 @@ public Object delete(String resourceGroupName, String workspaceName, String auto * 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 workspaceName The name of the monitor 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. @@ -536,21 +405,6 @@ public Object delete(String resourceGroupName, String workspaceName, String auto @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(), @@ -564,78 +418,63 @@ private Mono> listSinglePageAsync(String reso * 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. + * @param workspaceName The name of the monitor 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all automation rules as paginated response with {@link PagedFlux}. */ - @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)); + @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 workspaceName The name of the monitor 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 as paginated response with {@link PagedFlux}. + * @return all automation rules along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return 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. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedFlux}. + * @return all automation rules along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return 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. + * @param workspaceName The name of the monitor 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. @@ -643,14 +482,15 @@ private PagedFlux listAsync(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(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 workspaceName The name of the monitor 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. @@ -659,7 +499,8 @@ public PagedIterable list(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -669,17 +510,10 @@ public PagedIterable list(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all automation rules along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(), @@ -687,6 +521,24 @@ private Mono> listNextSinglePageAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -695,21 +547,13 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all automation rules along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 9af46719e080..31013ee3d771 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, String 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AutomationRuleImpl(inner.getValue(), this.manager())); } public AutomationRule get(String resourceGroupName, String workspaceName, String automationRuleId) { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticImpl.java new file mode 100644 index 000000000000..68555ecbc951 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import com.azure.resourcemanager.securityinsights.models.BillingStatistic; +import com.azure.resourcemanager.securityinsights.models.BillingStatisticKind; + +public final class BillingStatisticImpl implements BillingStatistic { + private BillingStatisticInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + BillingStatisticImpl(BillingStatisticInner 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 BillingStatisticKind kind() { + return this.innerModel().kind(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BillingStatisticInner 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/BillingStatisticsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsClientImpl.java new file mode 100644 index 000000000000..18b6874abd90 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsClientImpl.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.BillingStatisticsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import com.azure.resourcemanager.securityinsights.implementation.models.BillingStatisticList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BillingStatisticsClient. + */ +public final class BillingStatisticsClientImpl implements BillingStatisticsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BillingStatisticsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of BillingStatisticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BillingStatisticsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(BillingStatisticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientBillingStatistics to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientBillingStatistics") + public interface BillingStatisticsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/billingStatistics/{billingStatisticName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("billingStatisticName") String billingStatisticName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/billingStatistics/{billingStatisticName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("billingStatisticName") String billingStatisticName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/billingStatistics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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/billingStatistics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 billing statistic along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String billingStatisticName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, billingStatisticName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 billing statistic on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String billingStatisticName) { + return getWithResponseAsync(resourceGroupName, workspaceName, billingStatisticName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @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 billing statistic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String billingStatisticName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, billingStatisticName, accept, context); + } + + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 billing statistic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingStatisticInner get(String resourceGroupName, String workspaceName, String billingStatisticName) { + return getWithResponse(resourceGroupName, workspaceName, billingStatisticName, Context.NONE).getValue(); + } + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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 Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Microsoft Sentinel billing statistics along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Microsoft Sentinel billing statistics along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Microsoft Sentinel billing statistics along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/BillingStatisticsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsImpl.java new file mode 100644 index 000000000000..158633c44a3c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BillingStatisticsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import com.azure.resourcemanager.securityinsights.models.BillingStatistic; +import com.azure.resourcemanager.securityinsights.models.BillingStatistics; + +public final class BillingStatisticsImpl implements BillingStatistics { + private static final ClientLogger LOGGER = new ClientLogger(BillingStatisticsImpl.class); + + private final BillingStatisticsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public BillingStatisticsImpl(BillingStatisticsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String billingStatisticName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, billingStatisticName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BillingStatisticImpl(inner.getValue(), this.manager())); + } + + public BillingStatistic get(String resourceGroupName, String workspaceName, String billingStatisticName) { + BillingStatisticInner inner = this.serviceClient().get(resourceGroupName, workspaceName, billingStatisticName); + if (inner != null) { + return new BillingStatisticImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BillingStatisticImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BillingStatisticImpl(inner1, this.manager())); + } + + private BillingStatisticsClient 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/BookmarkExpandResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkExpandResponseImpl.java new file mode 100644 index 000000000000..217314d11380 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkExpandResponseImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 index 6a8a343cf14a..1f3ae155cd66 100644 --- 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 @@ -1,13 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.AttackTactic; import com.azure.resourcemanager.securityinsights.models.Bookmark; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.time.OffsetDateTime; @@ -96,6 +98,33 @@ public IncidentInfo incidentInfo() { return this.innerModel().incidentInfo(); } + public List entityMappings() { + List inner = this.innerModel().entityMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List tactics() { + List inner = this.innerModel().tactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List techniques() { + List inner = this.innerModel().techniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String resourceGroupName() { return resourceGroupName; } @@ -256,4 +285,19 @@ public BookmarkImpl withIncidentInfo(IncidentInfo incidentInfo) { this.innerModel().withIncidentInfo(incidentInfo); return this; } + + public BookmarkImpl withEntityMappings(List entityMappings) { + this.innerModel().withEntityMappings(entityMappings); + return this; + } + + public BookmarkImpl withTactics(List tactics) { + this.innerModel().withTactics(tactics); + return this; + } + + public BookmarkImpl withTechniques(List techniques) { + this.innerModel().withTechniques(techniques); + 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..f216f6ca368c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsClientImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.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 { + /** + * The proxy service used to perform REST calls. + */ + private final BookmarkOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of BookmarkOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BookmarkOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(BookmarkOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientBookmarkOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientBookmarkOperations") + public interface BookmarkOperationsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> expand(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BookmarkExpandParameters parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response expandSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BookmarkExpandParameters parameters, + Context context); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> expandWithResponseAsync(String resourceGroupName, + String workspaceName, String bookmarkId, BookmarkExpandParameters parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.expand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, contentType, accept, + parameters, 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 monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono expandAsync(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkExpandParameters parameters) { + return expandWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response expandWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkExpandParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.expandSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, contentType, accept, + parameters, context); + } + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BookmarkExpandResponseInner expand(String resourceGroupName, String workspaceName, String bookmarkId, + BookmarkExpandParameters parameters) { + return expandWithResponse(resourceGroupName, workspaceName, bookmarkId, parameters, Context.NONE).getValue(); + } +} 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..3b050f8aa1ff --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class BookmarkOperationsImpl implements BookmarkOperations { + private static 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 Response expandWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkExpandParameters parameters, Context context) { + Response inner = this.serviceClient() + .expandWithResponse(resourceGroupName, workspaceName, bookmarkId, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BookmarkExpandResponseImpl(inner.getValue(), this.manager())); + } + + 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; + } + } + + 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..39e02d4ee247 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsClientImpl.java @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.BookmarkRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.implementation.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 { + /** + * The proxy service used to perform REST calls. + */ + private final BookmarkRelationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of BookmarkRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BookmarkRelationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(BookmarkRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientBookmarkRelations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientBookmarkRelations") + public interface BookmarkRelationsService { + @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("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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); + + @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("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelationInner relation, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelationInner relation, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") 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, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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) + Response deleteSync(@HostParam("endpoint") 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, + Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName) { + return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + final String accept = "application/json"; + return service.getSync(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) + public RelationInner get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + return getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE).getValue(); + } + + /** + * 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String bookmarkId, String relationName, RelationInner relation) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, relationName, + contentType, accept, relation, 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 Resource create parameters. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName, RelationInner relation, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, relationName, contentType, + accept, relation, 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, relation, + Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, relationName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, relationName) + .flatMap(ignored -> 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. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, relationName, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String bookmarkId, String filter, String orderby, Integer top, String skipToken) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String bookmarkId, String filter, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, accept, Context.NONE); + return 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. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String bookmarkId, String filter, String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken, accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedIterable}. + */ + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, bookmarkId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(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 as paginated response with {@link PagedIterable}. + */ + @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<>(() -> listSinglePage(resourceGroupName, workspaceName, bookmarkId, filter, orderby, + top, skipToken, context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..83564450210e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class BookmarkRelationsImpl implements BookmarkRelations { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), 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 deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String bookmarkId, String relationName) { + this.serviceClient().delete(resourceGroupName, workspaceName, bookmarkId, relationName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, bookmarkId); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); + } + + public Relation getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 index 73ae6fd5ddbf..2e034eee50cc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.BookmarksClient; import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; -import com.azure.resourcemanager.securityinsights.models.BookmarkList; +import com.azure.resourcemanager.securityinsights.implementation.models.BookmarkList; import reactor.core.publisher.Mono; /** @@ -45,214 +45,120 @@ public final class BookmarksClientImpl implements BookmarksClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of BookmarksClientImpl. * * @param client the instance of the service client containing this operation class. */ - BookmarksClientImpl(SecurityInsightsImpl client) { + BookmarksClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientBookmarks to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsBook") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientBookmarks") public interface BookmarksService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("bookmarkId") String bookmarkId, @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, + Response getSync(@HostParam("endpoint") 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, + Mono> createOrUpdate(@HostParam("endpoint") 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); + @PathParam("bookmarkId") String bookmarkId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BookmarkInner bookmark, + 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) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BookmarkInner bookmark, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("bookmarkId") String bookmarkId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + @PathParam("bookmarkId") String bookmarkId, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks") @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } + Mono> list(@HostParam("endpoint") 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); - /** - * 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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); - /** - * 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") 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. - * @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -262,24 +168,6 @@ public PagedIterable list(String resourceGroupName, String worksp @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(), @@ -291,46 +179,7 @@ private Mono> getWithResponseAsync(String resourceGroupN * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -347,7 +196,7 @@ private Mono getAsync(String resourceGroupName, String workspaceN * Gets a bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -358,14 +207,16 @@ private Mono getAsync(String resourceGroupName, String workspaceN @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); + final String accept = "application/json"; + return service.getSync(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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -381,7 +232,7 @@ public BookmarkInner get(String resourceGroupName, String workspaceName, String * 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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -393,34 +244,12 @@ public BookmarkInner get(String resourceGroupName, String workspaceName, String @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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, contentType, accept, + bookmark, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -428,53 +257,7 @@ private Mono> createOrUpdateWithResponseAsync(String res * 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -493,7 +276,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * 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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. * @param context The context to associate with this operation. @@ -505,14 +288,18 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @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(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, contentType, accept, + bookmark, 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 workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @param bookmark The bookmark. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -531,7 +318,7 @@ public BookmarkInner createOrUpdate(String resourceGroupName, String workspaceNa * Delete the bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param bookmarkId Bookmark ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -541,28 +328,9 @@ public BookmarkInner createOrUpdate(String resourceGroupName, String workspaceNa @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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -570,88 +338,160 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * Delete the bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @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); + private Mono deleteAsync(String resourceGroupName, String workspaceName, String bookmarkId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId).flatMap(ignored -> 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 workspaceName The name of the monitor 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 {@link Mono} that completes when a successful response is received. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String bookmarkId) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId).flatMap(ignored -> Mono.empty()); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, bookmarkId, 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 workspaceName The name of the monitor 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) { + deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + 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 monitor 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 as paginated response with {@link PagedFlux}. + */ + @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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return 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 monitor 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 the {@link Response}. + * @return all bookmarks along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, bookmarkId, context).block(); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Delete the bookmark. + * Gets all bookmarks. * * @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 workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String bookmarkId) { - deleteWithResponse(resourceGroupName, workspaceName, bookmarkId, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all bookmarks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -661,17 +501,10 @@ public void delete(String resourceGroupName, String workspaceName, String bookma * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all bookmarks along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(), @@ -679,6 +512,23 @@ private Mono> listNextSinglePageAsync(String nextLi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -687,21 +537,13 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all bookmarks along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index e1cd3e1fae8b..be24c29afeb6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,26 +27,12 @@ public BookmarksImpl(BookmarksClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new BookmarkImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BookmarkImpl(inner.getValue(), this.manager())); } public Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId) { @@ -67,6 +53,16 @@ public void delete(String resourceGroupName, String workspaceName, String bookma this.serviceClient().delete(resourceGroupName, workspaceName, bookmarkId); } + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new BookmarkImpl(inner1, this.manager())); + } + public Bookmark getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsClientImpl.java new file mode 100644 index 000000000000..c653805a6483 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsClientImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContentPackageOperationsClient. + */ +public final class ContentPackageOperationsClientImpl implements ContentPackageOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContentPackageOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ContentPackageOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentPackageOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(ContentPackageOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientContentPackageOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientContentPackageOperations") + public interface ContentPackageOperationsService { + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> install(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") PackageModelInner packageInstallationProperties, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response installSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") PackageModelInner packageInstallationProperties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> uninstall(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response uninstallSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, Context context); + } + + /** + * Install a package to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package Id. + * @param packageInstallationProperties Package installation 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 represents a Package in Azure Security Insights along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> installWithResponseAsync(String resourceGroupName, String workspaceName, + String packageId, PackageModelInner packageInstallationProperties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.install(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, contentType, accept, + packageInstallationProperties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Install a package to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package Id. + * @param packageInstallationProperties Package installation 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 represents a Package in Azure Security Insights on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono installAsync(String resourceGroupName, String workspaceName, String packageId, + PackageModelInner packageInstallationProperties) { + return installWithResponseAsync(resourceGroupName, workspaceName, packageId, packageInstallationProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Install a package to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package Id. + * @param packageInstallationProperties Package installation 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 represents a Package in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response installWithResponse(String resourceGroupName, String workspaceName, + String packageId, PackageModelInner packageInstallationProperties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.installSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, contentType, accept, + packageInstallationProperties, context); + } + + /** + * Install a package to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package Id. + * @param packageInstallationProperties Package installation 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 represents a Package in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageModelInner install(String resourceGroupName, String workspaceName, String packageId, + PackageModelInner packageInstallationProperties) { + return installWithResponse(resourceGroupName, workspaceName, packageId, packageInstallationProperties, + Context.NONE).getValue(); + } + + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> uninstallWithResponseAsync(String resourceGroupName, String workspaceName, + String packageId) { + return FluxUtil + .withContext(context -> service.uninstall(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uninstallAsync(String resourceGroupName, String workspaceName, String packageId) { + return uninstallWithResponseAsync(resourceGroupName, workspaceName, packageId).flatMap(ignored -> Mono.empty()); + } + + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uninstallWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context) { + return service.uninstallSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, context); + } + + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 uninstall(String resourceGroupName, String workspaceName, String packageId) { + uninstallWithResponse(resourceGroupName, workspaceName, packageId, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsImpl.java new file mode 100644 index 000000000000..f24c7fdaf7fd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient; +import com.azure.resourcemanager.securityinsights.models.ContentPackageOperations; + +public final class ContentPackageOperationsImpl implements ContentPackageOperations { + private static final ClientLogger LOGGER = new ClientLogger(ContentPackageOperationsImpl.class); + + private final ContentPackageOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ContentPackageOperationsImpl(ContentPackageOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response uninstallWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context) { + return this.serviceClient().uninstallWithResponse(resourceGroupName, workspaceName, packageId, context); + } + + public void uninstall(String resourceGroupName, String workspaceName, String packageId) { + this.serviceClient().uninstall(resourceGroupName, workspaceName, packageId); + } + + private ContentPackageOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public PackageModelImpl define(String name) { + return new PackageModelImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesClientImpl.java new file mode 100644 index 000000000000..f3f998b99b69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesClientImpl.java @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ContentPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; +import com.azure.resourcemanager.securityinsights.implementation.models.PackageList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContentPackagesClient. + */ +public final class ContentPackagesClientImpl implements ContentPackagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContentPackagesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ContentPackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentPackagesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(ContentPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientContentPackages to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientContentPackages") + public interface ContentPackagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages/{packageId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("$search") String search, @QueryParam("$count") Boolean count, @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, @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/contentPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("$search") String search, @QueryParam("$count") Boolean count, @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String packageId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String packageId) { + return getWithResponseAsync(resourceGroupName, workspaceName, packageId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, packageId, accept, context); + } + + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PackageModelInner get(String resourceGroupName, String workspaceName, String packageId) { + return getWithResponse(resourceGroupName, workspaceName, packageId, Context.NONE).getValue(); + } + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, search, count, top, + skip, 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 installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed packages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String filter, + String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed packages as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final String search = null; + final Boolean count = null; + final Integer top = null; + final Integer skip = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed packages along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, search, count, top, + skip, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed packages along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, search, count, top, + skip, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final String search = null; + final Boolean count = null; + final Integer top = null; + final Integer skip = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed packages as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken, context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 installed packages along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 installed packages along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 installed packages along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ContentPackagesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesImpl.java new file mode 100644 index 000000000000..2d4c55a380ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContentPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; +import com.azure.resourcemanager.securityinsights.models.ContentPackages; +import com.azure.resourcemanager.securityinsights.models.PackageModel; + +public final class ContentPackagesImpl implements ContentPackages { + private static final ClientLogger LOGGER = new ClientLogger(ContentPackagesImpl.class); + + private final ContentPackagesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ContentPackagesImpl(ContentPackagesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, packageId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PackageModelImpl(inner.getValue(), this.manager())); + } + + public PackageModel get(String resourceGroupName, String workspaceName, String packageId) { + PackageModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName, packageId); + if (inner != null) { + return new PackageModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PackageModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, filter, orderby, search, count, top, skip, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PackageModelImpl(inner1, this.manager())); + } + + private ContentPackagesClient 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/ContentTemplatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesClientImpl.java new file mode 100644 index 000000000000..544dfa12bfd2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesClientImpl.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ContentTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContentTemplatesClient. + */ +public final class ContentTemplatesClientImpl implements ContentTemplatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContentTemplatesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ContentTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentTemplatesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(ContentTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientContentTemplates to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientContentTemplates") + public interface ContentTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> install(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") TemplateModelInner templateInstallationProperties, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response installSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") TemplateModelInner templateInstallationProperties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates/{templateId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, Context context); + } + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String templateId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, templateId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String templateId) { + return getWithResponseAsync(resourceGroupName, workspaceName, templateId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String templateId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, templateId, accept, context); + } + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TemplateModelInner get(String resourceGroupName, String workspaceName, String templateId) { + return getWithResponse(resourceGroupName, workspaceName, templateId, Context.NONE).getValue(); + } + + /** + * Install a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId template Id. + * @param templateInstallationProperties Template installation 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 template resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> installWithResponseAsync(String resourceGroupName, String workspaceName, + String templateId, TemplateModelInner templateInstallationProperties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.install(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, templateId, contentType, accept, + templateInstallationProperties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Install a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId template Id. + * @param templateInstallationProperties Template installation 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 template resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono installAsync(String resourceGroupName, String workspaceName, String templateId, + TemplateModelInner templateInstallationProperties) { + return installWithResponseAsync(resourceGroupName, workspaceName, templateId, templateInstallationProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Install a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId template Id. + * @param templateInstallationProperties Template installation 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 template resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response installWithResponse(String resourceGroupName, String workspaceName, + String templateId, TemplateModelInner templateInstallationProperties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.installSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, templateId, contentType, accept, + templateInstallationProperties, context); + } + + /** + * Install a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId template Id. + * @param templateInstallationProperties Template installation 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 template resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TemplateModelInner install(String resourceGroupName, String workspaceName, String templateId, + TemplateModelInner templateInstallationProperties) { + return installWithResponse(resourceGroupName, workspaceName, templateId, templateInstallationProperties, + Context.NONE).getValue(); + } + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String templateId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, templateId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String templateId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, templateId).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, templateId, context); + } + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String templateId) { + deleteWithResponse(resourceGroupName, workspaceName, templateId, Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java new file mode 100644 index 000000000000..5ab10b39751d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContentTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.ContentTemplates; +import com.azure.resourcemanager.securityinsights.models.TemplateModel; + +public final class ContentTemplatesImpl implements ContentTemplates { + private static final ClientLogger LOGGER = new ClientLogger(ContentTemplatesImpl.class); + + private final ContentTemplatesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ContentTemplatesImpl(ContentTemplatesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, templateId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TemplateModelImpl(inner.getValue(), this.manager())); + } + + public TemplateModel get(String resourceGroupName, String workspaceName, String templateId) { + TemplateModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName, templateId); + if (inner != null) { + return new TemplateModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, templateId, context); + } + + public void delete(String resourceGroupName, String workspaceName, String templateId) { + this.serviceClient().delete(resourceGroupName, workspaceName, templateId); + } + + public TemplateModel getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 templateId = ResourceManagerUtils.getValueFromIdByName(id, "contentTemplates"); + if (templateId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contentTemplates'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, templateId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 templateId = ResourceManagerUtils.getValueFromIdByName(id, "contentTemplates"); + if (templateId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contentTemplates'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, templateId, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 templateId = ResourceManagerUtils.getValueFromIdByName(id, "contentTemplates"); + if (templateId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contentTemplates'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, templateId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 templateId = ResourceManagerUtils.getValueFromIdByName(id, "contentTemplates"); + if (templateId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'contentTemplates'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, templateId, context); + } + + private ContentTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public TemplateModelImpl define(String name) { + return new TemplateModelImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsClientImpl.java new file mode 100644 index 000000000000..8deb38a57c22 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsClientImpl.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ContentTemplatesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import com.azure.resourcemanager.securityinsights.implementation.models.TemplateList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ContentTemplatesOperationsClient. + */ +public final class ContentTemplatesOperationsClientImpl implements ContentTemplatesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ContentTemplatesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ContentTemplatesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContentTemplatesOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(ContentTemplatesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientContentTemplatesOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientContentTemplatesOperations") + public interface ContentTemplatesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("$expand") String expand, @QueryParam("$search") String search, + @QueryParam("$count") Boolean count, @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @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/contentTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("$expand") String expand, @QueryParam("$search") String search, + @QueryParam("$count") Boolean count, @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param expand Expands the object with optional fiends that are not included by default. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, String expand, String search, Boolean count, Integer top, Integer skip, + String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, expand, search, + count, top, skip, 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param expand Expands the object with optional fiends that are not included by default. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String filter, + String orderby, String expand, String search, Boolean count, Integer top, Integer skip, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, expand, + search, count, top, skip, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final String expand = null; + final String search = null; + final Boolean count = null; + final Integer top = null; + final Integer skip = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, expand, + search, count, top, skip, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param expand Expands the object with optional fiends that are not included by default. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, String expand, String search, Boolean count, Integer top, Integer skip, + String skipToken) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, expand, search, count, + top, skip, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param expand Expands the object with optional fiends that are not included by default. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, String expand, String search, Boolean count, Integer top, Integer skip, + String skipToken, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, expand, search, count, + top, skip, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final String expand = null; + final String search = null; + final Boolean count = null; + final Integer top = null; + final Integer skip = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, expand, + search, count, top, skip, skipToken), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param expand Expands the object with optional fiends that are not included by default. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String expand, String search, Boolean count, Integer top, Integer skip, String skipToken, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, expand, + search, count, top, skip, skipToken, context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ContentTemplatesOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsImpl.java new file mode 100644 index 000000000000..7a2df10a90ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ContentTemplatesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.ContentTemplatesOperations; +import com.azure.resourcemanager.securityinsights.models.TemplateModel; + +public final class ContentTemplatesOperationsImpl implements ContentTemplatesOperations { + private static final ClientLogger LOGGER = new ClientLogger(ContentTemplatesOperationsImpl.class); + + private final ContentTemplatesOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ContentTemplatesOperationsImpl(ContentTemplatesOperationsClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new TemplateModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String expand, String search, Boolean count, Integer top, Integer skip, String skipToken, + Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, filter, orderby, expand, search, count, top, skip, skipToken, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TemplateModelImpl(inner1, this.manager())); + } + + private ContentTemplatesOperationsClient 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/DataConnectorDefinitionImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionImpl.java new file mode 100644 index 000000000000..6764788fb617 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitionKind; + +public final class DataConnectorDefinitionImpl implements DataConnectorDefinition { + private DataConnectorDefinitionInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + DataConnectorDefinitionImpl(DataConnectorDefinitionInner 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 DataConnectorDefinitionKind kind() { + return this.innerModel().kind(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DataConnectorDefinitionInner 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/DataConnectorDefinitionsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsClientImpl.java new file mode 100644 index 000000000000..1c752d3d8612 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsClientImpl.java @@ -0,0 +1,572 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import com.azure.resourcemanager.securityinsights.implementation.models.DataConnectorDefinitionArmCollectionWrapper; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataConnectorDefinitionsClient. + */ +public final class DataConnectorDefinitionsClientImpl implements DataConnectorDefinitionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataConnectorDefinitionsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of DataConnectorDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectorDefinitionsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(DataConnectorDefinitionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientDataConnectorDefinitions to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientDataConnectorDefinitions") + public interface DataConnectorDefinitionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataConnectorDefinitionInner connectorDefinitionInput, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataConnectorDefinitionInner connectorDefinitionInput, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions/{dataConnectorDefinitionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorDefinitionName") String dataConnectorDefinitionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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/dataConnectorDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String dataConnectorDefinitionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorDefinitionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, dataConnectorDefinitionName, accept, context); + } + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorDefinitionInner get(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName) { + return getWithResponse(resourceGroupName, workspaceName, dataConnectorDefinitionName, Context.NONE).getValue(); + } + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String dataConnectorDefinitionName, + DataConnectorDefinitionInner connectorDefinitionInput) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorDefinitionName, + contentType, accept, connectorDefinitionInput, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataConnectorDefinitionName, + connectorDefinitionInput).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorDefinitionName, contentType, + accept, connectorDefinitionInput, context); + } + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorDefinitionInner createOrUpdate(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorDefinitionName, + connectorDefinitionInput, Context.NONE).getValue(); + } + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorDefinitionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String dataConnectorDefinitionName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorDefinitionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorDefinitionName, context); + } + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 dataConnectorDefinitionName) { + deleteWithResponse(resourceGroupName, workspaceName, dataConnectorDefinitionName, Context.NONE); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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 connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 connector definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 connector definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 connector definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/DataConnectorDefinitionsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsImpl.java new file mode 100644 index 000000000000..c664c82b7947 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsImpl.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.DataConnectorDefinitionsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitions; + +public final class DataConnectorDefinitionsImpl implements DataConnectorDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(DataConnectorDefinitionsImpl.class); + + private final DataConnectorDefinitionsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public DataConnectorDefinitionsImpl(DataConnectorDefinitionsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, dataConnectorDefinitionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorDefinitionImpl(inner.getValue(), this.manager())); + } + + public DataConnectorDefinition get(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName) { + DataConnectorDefinitionInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, dataConnectorDefinitionName); + if (inner != null) { + return new DataConnectorDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorDefinitionName, + connectorDefinitionInput, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorDefinitionImpl(inner.getValue(), this.manager())); + } + + public DataConnectorDefinition createOrUpdate(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput) { + DataConnectorDefinitionInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, dataConnectorDefinitionName, connectorDefinitionInput); + if (inner != null) { + return new DataConnectorDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, dataConnectorDefinitionName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String dataConnectorDefinitionName) { + this.serviceClient().delete(resourceGroupName, workspaceName, dataConnectorDefinitionName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorDefinitionImpl(inner1, this.manager())); + } + + private DataConnectorDefinitionsClient 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/DataConnectorImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorImpl.java index c4e003ea8cd5..95881c84ea3c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public DataConnectorKind kind() { + return this.innerModel().kind(); + } + public String etag() { return this.innerModel().etag(); } @@ -40,10 +44,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public DataConnectorKind kind() { - return this.innerModel().kind(); - } - public DataConnectorInner innerModel() { return this.innerObject; } 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..94d94aee18fb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorRequirementsStateImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..ebeb23c296df --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsClientImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.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 { + /** + * The proxy service used to perform REST calls. + */ + private final DataConnectorsCheckRequirementsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of DataConnectorsCheckRequirementsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataConnectorsCheckRequirementsOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(DataConnectorsCheckRequirementsOperationsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * SecurityInsightsManagementClientDataConnectorsCheckRequirementsOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientDataConnectorsCheckRequirementsOperations") + public interface DataConnectorsCheckRequirementsOperationsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataConnectorsCheckRequirements dataConnectorsCheckRequirements, + 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> postWithResponseAsync(String resourceGroupName, + String workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, + dataConnectorsCheckRequirements, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(String resourceGroupName, String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + return postWithResponseAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postWithResponse(String resourceGroupName, + String workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, contentType, accept, dataConnectorsCheckRequirements, 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) + public DataConnectorRequirementsStateInner post(String resourceGroupName, String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements) { + return postWithResponse(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, Context.NONE) + .getValue(); + } +} 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..8ef892006dc9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class DataConnectorsCheckRequirementsOperationsImpl implements DataConnectorsCheckRequirementsOperations { + private static 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 Response postWithResponse(String resourceGroupName, String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, Context context) { + Response inner = this.serviceClient() + .postWithResponse(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorRequirementsStateImpl(inner.getValue(), this.manager())); + } + + 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; + } + } + + 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 index e43d5c7f004d..41efaaed4d79 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -13,6 +13,7 @@ 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; @@ -30,7 +31,8 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; -import com.azure.resourcemanager.securityinsights.models.DataConnectorList; +import com.azure.resourcemanager.securityinsights.implementation.models.DataConnectorList; +import com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody; import reactor.core.publisher.Mono; /** @@ -45,581 +47,602 @@ public final class DataConnectorsClientImpl implements DataConnectorsClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of DataConnectorsClientImpl. * * @param client the instance of the service client containing this operation class. */ - DataConnectorsClientImpl(SecurityInsightsImpl client) { + DataConnectorsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientDataConnectors to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsData") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientDataConnectors") public interface DataConnectorsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("dataConnectorId") String dataConnectorId, @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, + Response getSync(@HostParam("endpoint") 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, + Mono> createOrUpdate(@HostParam("endpoint") 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, + @PathParam("dataConnectorId") String dataConnectorId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DataConnectorInner dataConnector, 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) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DataConnectorInner dataConnector, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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) + Response deleteSync(@HostParam("endpoint") 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); + @PathParam("dataConnectorId") String dataConnectorId, Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/connect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> connect(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DataConnectorConnectBody connectBody, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/connect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response connectSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") DataConnectorConnectBody connectBody, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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) + Response disconnectSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataConnectorId") String dataConnectorId, 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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all data connectors. + * 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 workspaceName The name of the monitor 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 all data connectors along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a data connector along with {@link Response} on successful completion of {@link Mono}. */ @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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId) { 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)) + .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 all data connectors. + * Gets a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { + return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 workspaceName The name of the monitor 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 all data connectors along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a data connector along with {@link Response}. */ @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.")); - } + public Response getWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorId, Context context) { 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)); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, dataConnectorId, accept, context); } /** - * Gets all data connectors. + * 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 workspaceName The name of the monitor 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 all data connectors as paginated response with {@link PagedFlux}. + * @return a data connector. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public DataConnectorInner get(String resourceGroupName, String workspaceName, String dataConnectorId) { + return getWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE).getValue(); } /** - * Gets all data connectors. + * 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 context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 all data connectors as paginated response with {@link PagedFlux}. + * @return data connector along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String dataConnectorId, DataConnectorInner dataConnector) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, contentType, accept, + dataConnector, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all data connectors. + * 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 workspaceName The name of the monitor 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 all data connectors as paginated response with {@link PagedIterable}. + * @return data connector on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorInner dataConnector) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, dataConnector) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all data connectors. + * 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 workspaceName The name of the monitor 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 all data connectors as paginated response with {@link PagedIterable}. + * @return data connector along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorInner dataConnector, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, contentType, accept, + dataConnector, context); } /** - * Gets a data connector. + * 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 workspaceName The name of the monitor 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 a data connector along with {@link Response} on successful completion of {@link Mono}. + * @return 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())); + public DataConnectorInner createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorInner dataConnector) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorId, dataConnector, + Context.NONE).getValue(); } /** - * Gets a data connector. + * 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 workspaceName The name of the monitor 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 along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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); + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a data connector. + * 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 workspaceName The name of the monitor 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 on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) + .flatMap(ignored -> Mono.empty()); } /** - * Gets a data connector. + * 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 workspaceName The name of the monitor 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 along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String workspaceName, - String dataConnectorId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, context); } /** - * Gets a data connector. + * 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 workspaceName The name of the monitor 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 getWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE).getValue(); + public void delete(String resourceGroupName, String workspaceName, String dataConnectorId) { + deleteWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE); } /** - * Creates or updates the data connector. + * 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 dataConnectorId Connector ID. - * @param dataConnector The data connector. + * @param workspaceName The name of the monitor 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 data connector along with {@link Response} on successful completion of {@link Mono}. + * @return all data connectors along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(); - } + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { 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)) + .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())); } /** - * Creates or updates the data connector. + * 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 dataConnectorId Connector ID. - * @param dataConnector The data connector. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedFlux}. + */ + @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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return 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 monitor 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 data connector along with {@link Response} on successful completion of {@link Mono}. + * @return all data connectors along with {@link PagedResponse}. */ @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(); - } + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { 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); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates or updates the data connector. + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. - * @param dataConnector The data connector. + * @param connectBody The content of the action 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 data connector on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - String dataConnectorId, DataConnectorInner dataConnector) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, dataConnector) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> connectWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId, DataConnectorConnectBody connectBody) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.connect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, contentType, + connectBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates the data connector. + * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. - * @param dataConnector The data connector. - * @param context The context to associate with this operation. + * @param connectBody The content of the action 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 data connector along with {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @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(); + private Mono connectAsync(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody) { + return connectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody) + .flatMap(ignored -> Mono.empty()); } /** - * Creates or updates the data connector. + * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. - * @param dataConnector The data connector. + * @param connectBody The content of the action 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 data connector. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataConnectorInner createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId, - DataConnectorInner dataConnector) { - return createOrUpdateWithResponse(resourceGroupName, workspaceName, dataConnectorId, dataConnector, - Context.NONE).getValue(); + public Response connectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody, Context context) { + final String contentType = "application/json"; + return service.connectSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, contentType, + connectBody, context); } /** - * Delete the data connector. + * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. + * @param connectBody The content of the action 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 the {@link Response} on successful completion of {@link Mono}. */ @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())); + public void connect(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody) { + connectWithResponse(resourceGroupName, workspaceName, dataConnectorId, connectBody, Context.NONE); } /** - * Delete the data connector. + * 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 workspaceName The name of the monitor 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 {@link Response} on successful completion of {@link Mono}. */ @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); + private Mono> disconnectWithResponseAsync(String resourceGroupName, String workspaceName, + String dataConnectorId) { + return FluxUtil + .withContext(context -> service.disconnect(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete the data connector. + * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -627,16 +650,16 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) + private Mono disconnectAsync(String resourceGroupName, String workspaceName, String dataConnectorId) { + return disconnectWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId) .flatMap(ignored -> Mono.empty()); } /** - * Delete the data connector. + * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -645,24 +668,25 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + public Response disconnectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataConnectorId, context).block(); + return service.disconnectSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, dataConnectorId, context); } /** - * Delete the data connector. + * 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 workspaceName The name of the monitor 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) { - deleteWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE); + public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) { + disconnectWithResponse(resourceGroupName, workspaceName, dataConnectorId, Context.NONE); } /** @@ -672,17 +696,10 @@ public void delete(String resourceGroupName, String workspaceName, String dataCo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all data connectors along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(), @@ -690,6 +707,24 @@ private Mono> listNextSinglePageAsync(String n .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -698,21 +733,13 @@ private Mono> listNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all data connectors along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 4899f0b8fe3e..e713aa84ec19 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -12,6 +12,7 @@ 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; public final class DataConnectorsImpl implements DataConnectors { @@ -27,26 +28,12 @@ public DataConnectorsImpl(DataConnectorsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorImpl(inner.getValue(), this.manager())); } public DataConnector get(String resourceGroupName, String workspaceName, String dataConnectorId) { @@ -62,12 +49,8 @@ public Response createOrUpdateWithResponse(String resourceGroupNa 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DataConnectorImpl(inner.getValue(), this.manager())); } public DataConnector createOrUpdate(String resourceGroupName, String workspaceName, String dataConnectorId, @@ -90,6 +73,36 @@ public void delete(String resourceGroupName, String workspaceName, String dataCo this.serviceClient().delete(resourceGroupName, workspaceName, dataConnectorId); } + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new DataConnectorImpl(inner1, this.manager())); + } + + public Response connectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody, Context context) { + return this.serviceClient() + .connectWithResponse(resourceGroupName, workspaceName, dataConnectorId, connectBody, context); + } + + public void connect(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody) { + this.serviceClient().connect(resourceGroupName, workspaceName, dataConnectorId, connectBody); + } + + public Response disconnectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + Context context) { + return this.serviceClient().disconnectWithResponse(resourceGroupName, workspaceName, dataConnectorId, context); + } + + public void disconnect(String resourceGroupName, String workspaceName, String dataConnectorId) { + this.serviceClient().disconnect(resourceGroupName, workspaceName, dataConnectorId); + } + private DataConnectorsClient serviceClient() { return this.innerClient; } 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..be8878a2bd95 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..5f539bfa67a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentIpGeodataImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 cityConfidenceFactor() { + return this.innerModel().cityConfidenceFactor(); + } + + public String continent() { + return this.innerModel().continent(); + } + + public String country() { + return this.innerModel().country(); + } + + public Integer countryConfidenceFactor() { + return this.innerModel().countryConfidenceFactor(); + } + + 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 stateConfidenceFactor() { + return this.innerModel().stateConfidenceFactor(); + } + + 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..0db75c0b445e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesClientImpl.java @@ -0,0 +1,885 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.EntityQueryItemInner; +import com.azure.resourcemanager.securityinsights.implementation.models.EntityList; +import com.azure.resourcemanager.securityinsights.implementation.models.GetQueriesResponse; +import com.azure.resourcemanager.securityinsights.models.Entity; +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.EntityManualTriggerRequestBody; +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 { + /** + * The proxy service used to perform REST calls. + */ + private final EntitiesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of EntitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntitiesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(EntitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientEntities to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientEntities") + public interface EntitiesService { + @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("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityIdentifier}/runPlaybook") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> runPlaybook(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityIdentifier") String entityIdentifier, + @BodyParam("application/json") EntityManualTriggerRequestBody requestBody, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityIdentifier}/runPlaybook") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response runPlaybookSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityIdentifier") String entityIdentifier, + @BodyParam("application/json") EntityManualTriggerRequestBody requestBody, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> expand(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EntityExpandParameters parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response expandSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EntityExpandParameters parameters, + 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("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response queriesSync(@HostParam("endpoint") 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); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getInsights(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EntityGetInsightsParameters parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getInsightsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EntityGetInsightsParameters parameters, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> queriesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response queriesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String entityId) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String entityId) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, + Context context) { + final String accept = "application/json"; + return service.getSync(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) + public Entity get(String resourceGroupName, String workspaceName, String entityId) { + return getWithResponse(resourceGroupName, workspaceName, entityId, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedFlux}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return 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. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier entity ID. + * @param requestBody Describes the request body for triggering a playbook on an 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> runPlaybookWithResponseAsync(String resourceGroupName, String workspaceName, + String entityIdentifier, EntityManualTriggerRequestBody requestBody) { + return FluxUtil + .withContext(context -> service.runPlaybook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityIdentifier, requestBody, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runPlaybookAsync(String resourceGroupName, String workspaceName, String entityIdentifier) { + final EntityManualTriggerRequestBody requestBody = null; + return runPlaybookWithResponseAsync(resourceGroupName, workspaceName, entityIdentifier, requestBody) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier entity ID. + * @param requestBody Describes the request body for triggering a playbook on an 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, + String entityIdentifier, EntityManualTriggerRequestBody requestBody, Context context) { + return service.runPlaybookSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityIdentifier, requestBody, context); + } + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void runPlaybook(String resourceGroupName, String workspaceName, String entityIdentifier) { + final EntityManualTriggerRequestBody requestBody = null; + runPlaybookWithResponse(resourceGroupName, workspaceName, entityIdentifier, requestBody, Context.NONE); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> expandWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityExpandParameters parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.expand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, contentType, accept, + parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono expandAsync(String resourceGroupName, String workspaceName, String entityId, + EntityExpandParameters parameters) { + return expandWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response expandWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityExpandParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.expandSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, contentType, accept, + parameters, 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) + public EntityExpandResponseInner expand(String resourceGroupName, String workspaceName, String entityId, + EntityExpandParameters parameters) { + return expandWithResponse(resourceGroupName, workspaceName, entityId, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queriesSinglePageAsync(String resourceGroupName, + String workspaceName, String entityId, EntityItemQueryKind kind) { + 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)) + .>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 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux queriesAsync(String resourceGroupName, String workspaceName, + String entityId, EntityItemQueryKind kind) { + return new PagedFlux<>(() -> queriesSinglePageAsync(resourceGroupName, workspaceName, entityId, kind), + nextLink -> queriesNextSinglePageAsync(nextLink)); + } + + /** + * 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse queriesSinglePage(String resourceGroupName, String workspaceName, + String entityId, EntityItemQueryKind kind) { + final String accept = "application/json"; + Response res = service.queriesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, kind, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse queriesSinglePage(String resourceGroupName, String workspaceName, + String entityId, EntityItemQueryKind kind, Context context) { + final String accept = "application/json"; + Response res = service.queriesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, kind, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind) { + return new PagedIterable<>(() -> queriesSinglePage(resourceGroupName, workspaceName, entityId, kind), + nextLink -> queriesNextSinglePage(nextLink)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind, Context context) { + return new PagedIterable<>(() -> queriesSinglePage(resourceGroupName, workspaceName, entityId, kind, context), + nextLink -> queriesNextSinglePage(nextLink, 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInsightsWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityGetInsightsParameters parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getInsights(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, contentType, accept, + parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInsightsAsync(String resourceGroupName, String workspaceName, + String entityId, EntityGetInsightsParameters parameters) { + return getInsightsWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInsightsWithResponse(String resourceGroupName, + String workspaceName, String entityId, EntityGetInsightsParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.getInsightsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, contentType, accept, + parameters, 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) + public EntityGetInsightsResponseInner getInsights(String resourceGroupName, String workspaceName, String entityId, + EntityGetInsightsParameters parameters) { + return getInsightsWithResponse(resourceGroupName, workspaceName, entityId, parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queriesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.queriesNext(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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse queriesNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.queriesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse queriesNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.queriesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..2fa0d2d1c732 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.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 { + /** + * The proxy service used to perform REST calls. + */ + private final EntitiesGetTimelinesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of EntitiesGetTimelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntitiesGetTimelinesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(EntitiesGetTimelinesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientEntitiesGetTimelines to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientEntitiesGetTimelines") + public interface EntitiesGetTimelinesService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EntityTimelineParameters parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityId") String entityId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EntityTimelineParameters parameters, + 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String workspaceName, String entityId, EntityTimelineParameters parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityId, contentType, accept, + parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String workspaceName, String entityId, + EntityTimelineParameters parameters) { + return listWithResponseAsync(resourceGroupName, workspaceName, entityId, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityTimelineParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, contentType, accept, parameters, 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) + public EntityTimelineResponseInner list(String resourceGroupName, String workspaceName, String entityId, + EntityTimelineParameters parameters) { + return listWithResponse(resourceGroupName, workspaceName, entityId, parameters, Context.NONE).getValue(); + } +} 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..6f27bdfafd9e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class EntitiesGetTimelinesImpl implements EntitiesGetTimelines { + private static 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 Response listWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityTimelineParameters parameters, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityTimelineResponseImpl(inner.getValue(), this.manager())); + } + + 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; + } + } + + 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..31a6b0653943 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesImpl.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.EntityQueryItemInner; +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.EntityManualTriggerRequestBody; +import com.azure.resourcemanager.securityinsights.models.EntityQueryItem; + +public final class EntitiesImpl implements Entities { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, + Context context) { + return this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityId, context); + } + + public Entity get(String resourceGroupName, String workspaceName, String entityId) { + return this.serviceClient().get(resourceGroupName, workspaceName, entityId); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + return this.serviceClient().list(resourceGroupName, workspaceName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return this.serviceClient().list(resourceGroupName, workspaceName, context); + } + + public Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, + String entityIdentifier, EntityManualTriggerRequestBody requestBody, Context context) { + return this.serviceClient() + .runPlaybookWithResponse(resourceGroupName, workspaceName, entityIdentifier, requestBody, context); + } + + public void runPlaybook(String resourceGroupName, String workspaceName, String entityIdentifier) { + this.serviceClient().runPlaybook(resourceGroupName, workspaceName, entityIdentifier); + } + + public Response expandWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityExpandParameters parameters, Context context) { + Response inner + = this.serviceClient().expandWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityExpandResponseImpl(inner.getValue(), this.manager())); + } + + 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 PagedIterable queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind) { + PagedIterable inner + = this.serviceClient().queries(resourceGroupName, workspaceName, entityId, kind); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryItemImpl(inner1, this.manager())); + } + + public PagedIterable queries(String resourceGroupName, String workspaceName, String entityId, + EntityItemQueryKind kind, Context context) { + PagedIterable inner + = this.serviceClient().queries(resourceGroupName, workspaceName, entityId, kind, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryItemImpl(inner1, this.manager())); + } + + public Response getInsightsWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityGetInsightsParameters parameters, Context context) { + Response inner = this.serviceClient() + .getInsightsWithResponse(resourceGroupName, workspaceName, entityId, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityGetInsightsResponseImpl(inner.getValue(), this.manager())); + } + + 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; + } + } + + 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..47e02697a66e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsClientImpl.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.EntitiesRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; +import com.azure.resourcemanager.securityinsights.implementation.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 { + /** + * The proxy service used to perform REST calls. + */ + private final EntitiesRelationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of EntitiesRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntitiesRelationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(EntitiesRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientEntitiesRelations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientEntitiesRelations") + public 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("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String entityId, String filter, String orderby, Integer top, String skipToken) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String entityId, + String filter, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, accept, Context.NONE); + return 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. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String entityId, + String filter, String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedIterable}. + */ + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(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 as paginated response with {@link PagedIterable}. + */ + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, entityId, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..457e7c2ee319 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class EntitiesRelationsImpl implements EntitiesRelations { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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..6c49283b64e7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityExpandResponseImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..033d7cf8293b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityGetInsightsResponseImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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/EntityQueriesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesClientImpl.java new file mode 100644 index 000000000000..779922bc00f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesClientImpl.java @@ -0,0 +1,578 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.EntityQueriesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.azure.resourcemanager.securityinsights.implementation.models.EntityQueryList; +import com.azure.resourcemanager.securityinsights.models.CustomEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; +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 { + /** + * The proxy service used to perform REST calls. + */ + private final EntityQueriesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of EntityQueriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntityQueriesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(EntityQueriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientEntityQueries to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientEntityQueries") + public interface EntityQueriesService { + @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("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomEntityQuery entityQuery, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomEntityQuery entityQuery, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("entityQueryId") String entityQueryId, Context context); + + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("kind") EntityQueryTemplateKind kind, @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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("kind") EntityQueryTemplateKind kind, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String entityQueryId) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String entityQueryId) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, Context context) { + final String accept = "application/json"; + return service.getSync(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) + public EntityQueryInner get(String resourceGroupName, String workspaceName, String entityQueryId) { + return getWithResponse(resourceGroupName, workspaceName, entityQueryId, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String entityQueryId, CustomEntityQuery entityQuery) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityQueryId, contentType, accept, + entityQuery, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String entityQueryId, CustomEntityQuery entityQuery) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, CustomEntityQuery entityQuery, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityQueryId, contentType, accept, + entityQuery, 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) + public EntityQueryInner createOrUpdate(String resourceGroupName, String workspaceName, String entityQueryId, + CustomEntityQuery entityQuery) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, entityQueryId, entityQuery, Context.NONE) + .getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String entityQueryId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityQueryId, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String entityQueryId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, entityQueryId) + .flatMap(ignored -> 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. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, entityQueryId, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String entityQueryId) { + deleteWithResponse(resourceGroupName, workspaceName, entityQueryId, Context.NONE); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, kind, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final EntityQueryTemplateKind 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, kind, accept, Context.NONE); + return 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. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, kind, accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final EntityQueryTemplateKind kind = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, kind), + nextLink -> listNextSinglePage(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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, kind, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..b9923bd5f7f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.EntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; + +public final class EntityQueriesImpl implements EntityQueries { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityQueryImpl(inner.getValue(), 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 createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, CustomEntityQuery entityQuery, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, entityQueryId, entityQuery, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityQueryImpl(inner.getValue(), this.manager())); + } + + 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 deleteWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, entityQueryId, context); + } + + public void delete(String resourceGroupName, String workspaceName, String entityQueryId) { + this.serviceClient().delete(resourceGroupName, workspaceName, entityQueryId); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, EntityQueryTemplateKind kind, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, kind, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryImpl(inner1, this.manager())); + } + + 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..fe043056f1c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; +import com.azure.resourcemanager.securityinsights.models.EntityQueryKind; + +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 EntityQueryKind kind() { + return this.innerModel().kind(); + } + + 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/EntityQueryItemImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryItemImpl.java new file mode 100644 index 000000000000..14869b687864 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryItemImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryItemInner; +import com.azure.resourcemanager.securityinsights.models.EntityQueryItem; +import com.azure.resourcemanager.securityinsights.models.EntityQueryKind; + +public final class EntityQueryItemImpl implements EntityQueryItem { + private EntityQueryItemInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + EntityQueryItemImpl(EntityQueryItemInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public EntityQueryKind kind() { + return this.innerModel().kind(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EntityQueryItemInner 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..2409660d63da --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplateImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; + +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 EntityQueryTemplateKind kind() { + return this.innerModel().kind(); + } + + 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..43d6e412fa5a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesClientImpl.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import com.azure.resourcemanager.securityinsights.implementation.models.EntityQueryTemplateList; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; +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 { + /** + * The proxy service used to perform REST calls. + */ + private final EntityQueryTemplatesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of EntityQueryTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntityQueryTemplatesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(EntityQueryTemplatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientEntityQueryTemplates to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientEntityQueryTemplates") + public interface EntityQueryTemplatesService { + @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("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("kind") EntityQueryTemplateKind kind, @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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("kind") EntityQueryTemplateKind kind, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String entityQueryTemplateId) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String entityQueryTemplateId) { + return getWithResponseAsync(resourceGroupName, workspaceName, entityQueryTemplateId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryTemplateId, Context context) { + final String accept = "application/json"; + return service.getSync(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) + public EntityQueryTemplateInner get(String resourceGroupName, String workspaceName, String entityQueryTemplateId) { + return getWithResponse(resourceGroupName, workspaceName, entityQueryTemplateId, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, EntityQueryTemplateKind kind) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, kind, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final EntityQueryTemplateKind 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, kind, accept, Context.NONE); + return 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. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, kind, accept, context); + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final EntityQueryTemplateKind kind = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, kind), + nextLink -> listNextSinglePage(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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, kind, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..30e7c1c30e25 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.EntityQueryTemplate; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplates; + +public final class EntityQueryTemplatesImpl implements EntityQueryTemplates { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryTemplateId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, entityQueryTemplateId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EntityQueryTemplateImpl(inner.getValue(), 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 PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, kind, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EntityQueryTemplateImpl(inner1, this.manager())); + } + + 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..68507205b19d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsClientImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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 { + /** + * The proxy service used to perform REST calls. + */ + private final EntityRelationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of EntityRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EntityRelationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(EntityRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientEntityRelations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientEntityRelations") + public 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("endpoint") 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); + + @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) + Response getRelationSync(@HostParam("endpoint") 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRelationWithResponseAsync(String resourceGroupName, String workspaceName, + String entityId, String relationName) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRelationAsync(String resourceGroupName, String workspaceName, String entityId, + String relationName) { + return getRelationWithResponseAsync(resourceGroupName, workspaceName, entityId, relationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRelationWithResponse(String resourceGroupName, String workspaceName, + String entityId, String relationName, Context context) { + final String accept = "application/json"; + return service.getRelationSync(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) + public RelationInner getRelation(String resourceGroupName, String workspaceName, String entityId, + String relationName) { + return getRelationWithResponse(resourceGroupName, workspaceName, entityId, relationName, Context.NONE) + .getValue(); + } +} 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..3dd3e2eb2c1e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class EntityRelationsImpl implements EntityRelations { + private static 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 Response getRelationWithResponse(String resourceGroupName, String workspaceName, String entityId, + String relationName, Context context) { + Response inner = this.serviceClient() + .getRelationWithResponse(resourceGroupName, workspaceName, entityId, relationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } + + 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; + } + } + + 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..e54304fb9e03 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityTimelineResponseImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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/FileImportImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportImpl.java new file mode 100644 index 000000000000..5870899080cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportImpl.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.FileImportInner; +import com.azure.resourcemanager.securityinsights.models.FileImport; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileImportState; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import com.azure.resourcemanager.securityinsights.models.ValidationError; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class FileImportImpl implements FileImport, FileImport.Definition { + private FileImportInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + FileImportImpl(FileImportInner 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 IngestionMode ingestionMode() { + return this.innerModel().ingestionMode(); + } + + public FileImportContentType contentType() { + return this.innerModel().contentType(); + } + + public OffsetDateTime createdTimeUTC() { + return this.innerModel().createdTimeUTC(); + } + + public FileMetadata errorFile() { + return this.innerModel().errorFile(); + } + + public List errorsPreview() { + List inner = this.innerModel().errorsPreview(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public FileMetadata importFile() { + return this.innerModel().importFile(); + } + + public Integer ingestedRecordCount() { + return this.innerModel().ingestedRecordCount(); + } + + public String source() { + return this.innerModel().source(); + } + + public FileImportState state() { + return this.innerModel().state(); + } + + public Integer totalRecordCount() { + return this.innerModel().totalRecordCount(); + } + + public Integer validRecordCount() { + return this.innerModel().validRecordCount(); + } + + public OffsetDateTime filesValidUntilTimeUTC() { + return this.innerModel().filesValidUntilTimeUTC(); + } + + public OffsetDateTime importValidUntilTimeUTC() { + return this.innerModel().importValidUntilTimeUTC(); + } + + public FileImportInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String fileImportId; + + public FileImportImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public FileImport create() { + this.innerObject = serviceManager.serviceClient() + .getFileImports() + .createWithResponse(resourceGroupName, workspaceName, fileImportId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public FileImport create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileImports() + .createWithResponse(resourceGroupName, workspaceName, fileImportId, this.innerModel(), context) + .getValue(); + return this; + } + + FileImportImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new FileImportInner(); + this.serviceManager = serviceManager; + this.fileImportId = name; + } + + public FileImport refresh() { + this.innerObject = serviceManager.serviceClient() + .getFileImports() + .getWithResponse(resourceGroupName, workspaceName, fileImportId, Context.NONE) + .getValue(); + return this; + } + + public FileImport refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileImports() + .getWithResponse(resourceGroupName, workspaceName, fileImportId, context) + .getValue(); + return this; + } + + public FileImportImpl withIngestionMode(IngestionMode ingestionMode) { + this.innerModel().withIngestionMode(ingestionMode); + return this; + } + + public FileImportImpl withContentType(FileImportContentType contentType) { + this.innerModel().withContentType(contentType); + return this; + } + + public FileImportImpl withImportFile(FileMetadata importFile) { + this.innerModel().withImportFile(importFile); + return this; + } + + public FileImportImpl withSource(String source) { + this.innerModel().withSource(source); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsClientImpl.java new file mode 100644 index 000000000000..52a1f1447f26 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsClientImpl.java @@ -0,0 +1,718 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.securityinsights.fluent.FileImportsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner; +import com.azure.resourcemanager.securityinsights.implementation.models.FileImportList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FileImportsClient. + */ +public final class FileImportsClientImpl implements FileImportsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FileImportsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of FileImportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileImportsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(FileImportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientFileImports to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientFileImports") + public interface FileImportsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("fileImportId") String fileImportId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("fileImportId") String fileImportId, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("fileImportId") String fileImportId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileImportInner fileImport, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("fileImportId") String fileImportId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileImportInner fileImport, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("fileImportId") String fileImportId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("fileImportId") String fileImportId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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/fileImports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, fileImportId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String fileImportId) { + return getWithResponseAsync(resourceGroupName, workspaceName, fileImportId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String fileImportId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, fileImportId, accept, context); + } + + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileImportInner get(String resourceGroupName, String workspaceName, String fileImportId) { + return getWithResponse(resourceGroupName, workspaceName, fileImportId, Context.NONE).getValue(); + } + + /** + * Creates the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID. + * @param fileImport The file import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 file import in Azure Security Insights along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId, FileImportInner fileImport) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, fileImportId, contentType, accept, + fileImport, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID. + * @param fileImport The file import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 file import in Azure Security Insights on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String workspaceName, String fileImportId, + FileImportInner fileImport) { + return createWithResponseAsync(resourceGroupName, workspaceName, fileImportId, fileImport) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID. + * @param fileImport The file import. + * @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 file import in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String workspaceName, + String fileImportId, FileImportInner fileImport, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, fileImportId, contentType, accept, + fileImport, context); + } + + /** + * Creates the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import ID. + * @param fileImport The file import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 file import in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileImportInner create(String resourceGroupName, String workspaceName, String fileImportId, + FileImportInner fileImport) { + return createWithResponse(resourceGroupName, workspaceName, fileImportId, fileImport, Context.NONE).getValue(); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 represents a file import in Azure Security Insights along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String fileImportId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, fileImportId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 represents a file import in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String fileImportId) { + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, fileImportId, accept, Context.NONE); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 represents a file import in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, String fileImportId, + Context context) { + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, fileImportId, accept, context); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 {@link PollerFlux} for polling of represents a file import in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String fileImportId) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, fileImportId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 {@link SyncPoller} for polling of represents a file import in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String fileImportId) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, fileImportId); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 {@link SyncPoller} for polling of represents a file import in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String fileImportId, Context context) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, fileImportId, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 represents a file import in Azure Security Insights on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String fileImportId) { + return beginDeleteAsync(resourceGroupName, workspaceName, fileImportId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 fileImportId) { + beginDelete(resourceGroupName, workspaceName, fileImportId).getFinalResult(); + } + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String fileImportId, Context context) { + beginDelete(resourceGroupName, workspaceName, fileImportId, context).getFinalResult(); + } + + /** + * Gets all file imports. + * + * @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 file imports along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, String skipToken) { + 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 file imports. + * + * @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 file imports as paginated response with {@link PagedFlux}. + */ + @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 file imports. + * + * @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 file imports as paginated response with {@link PagedFlux}. + */ + @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 file imports. + * + * @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 file imports along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all file imports. + * + * @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 file imports along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all file imports. + * + * @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 file imports as paginated response with {@link PagedIterable}. + */ + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all file imports. + * + * @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 file imports as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 file imports along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 file imports along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 file imports along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/FileImportsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsImpl.java new file mode 100644 index 000000000000..413361457b14 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.FileImportsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner; +import com.azure.resourcemanager.securityinsights.models.FileImport; +import com.azure.resourcemanager.securityinsights.models.FileImports; + +public final class FileImportsImpl implements FileImports { + private static final ClientLogger LOGGER = new ClientLogger(FileImportsImpl.class); + + private final FileImportsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public FileImportsImpl(FileImportsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String fileImportId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, fileImportId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileImportImpl(inner.getValue(), this.manager())); + } + + public FileImport get(String resourceGroupName, String workspaceName, String fileImportId) { + FileImportInner inner = this.serviceClient().get(resourceGroupName, workspaceName, fileImportId); + if (inner != null) { + return new FileImportImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String fileImportId) { + this.serviceClient().delete(resourceGroupName, workspaceName, fileImportId); + } + + public void delete(String resourceGroupName, String workspaceName, String fileImportId, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, fileImportId, context); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileImportImpl(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 ResourceManagerUtils.mapPage(inner, inner1 -> new FileImportImpl(inner1, this.manager())); + } + + public FileImport getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 fileImportId = ResourceManagerUtils.getValueFromIdByName(id, "fileImports"); + if (fileImportId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileImports'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, fileImportId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 fileImportId = ResourceManagerUtils.getValueFromIdByName(id, "fileImports"); + if (fileImportId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileImports'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, fileImportId, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 fileImportId = ResourceManagerUtils.getValueFromIdByName(id, "fileImports"); + if (fileImportId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileImports'.", id))); + } + this.delete(resourceGroupName, workspaceName, fileImportId, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 fileImportId = ResourceManagerUtils.getValueFromIdByName(id, "fileImports"); + if (fileImportId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileImports'.", id))); + } + this.delete(resourceGroupName, workspaceName, fileImportId, context); + } + + private FileImportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public FileImportImpl define(String name) { + return new FileImportImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsClientImpl.java new file mode 100644 index 000000000000..f6d14c745969 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsClientImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.GetRecommendationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.implementation.models.RecommendationList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GetRecommendationsClient. + */ +public final class GetRecommendationsClientImpl implements GetRecommendationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GetRecommendationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of GetRecommendationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GetRecommendationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(GetRecommendationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientGetRecommendations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientGetRecommendations") + public interface GetRecommendationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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/recommendations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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 a list of all recommendations. + * + * @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 a list of all recommendations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all recommendations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all recommendations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 all recommendations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/GetRecommendationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsImpl.java new file mode 100644 index 000000000000..ba4dfbbcee34 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.GetRecommendationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.models.GetRecommendations; +import com.azure.resourcemanager.securityinsights.models.Recommendation; + +public final class GetRecommendationsImpl implements GetRecommendations { + private static final ClientLogger LOGGER = new ClientLogger(GetRecommendationsImpl.class); + + private final GetRecommendationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public GetRecommendationsImpl(GetRecommendationsClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new RecommendationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecommendationImpl(inner1, this.manager())); + } + + private GetRecommendationsClient 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/GetTriggeredAnalyticsRuleRunsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsClientImpl.java new file mode 100644 index 000000000000..f1a26c73bc76 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsClientImpl.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.GetTriggeredAnalyticsRuleRunsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import com.azure.resourcemanager.securityinsights.implementation.models.TriggeredAnalyticsRuleRuns; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GetTriggeredAnalyticsRuleRunsClient. + */ +public final class GetTriggeredAnalyticsRuleRunsClientImpl implements GetTriggeredAnalyticsRuleRunsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GetTriggeredAnalyticsRuleRunsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of GetTriggeredAnalyticsRuleRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GetTriggeredAnalyticsRuleRunsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(GetTriggeredAnalyticsRuleRunsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientGetTriggeredAnalyticsRuleRuns to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientGetTriggeredAnalyticsRuleRuns") + public interface GetTriggeredAnalyticsRuleRunsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/triggeredAnalyticsRuleRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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/triggeredAnalyticsRuleRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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 the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 triggered analytics rule runs along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 triggered analytics rule runs along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 triggered analytics rule runs along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/GetTriggeredAnalyticsRuleRunsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsImpl.java new file mode 100644 index 000000000000..7483bb776291 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.GetTriggeredAnalyticsRuleRunsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import com.azure.resourcemanager.securityinsights.models.GetTriggeredAnalyticsRuleRuns; +import com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRun; + +public final class GetTriggeredAnalyticsRuleRunsImpl implements GetTriggeredAnalyticsRuleRuns { + private static final ClientLogger LOGGER = new ClientLogger(GetTriggeredAnalyticsRuleRunsImpl.class); + + private final GetTriggeredAnalyticsRuleRunsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public GetTriggeredAnalyticsRuleRunsImpl(GetTriggeredAnalyticsRuleRunsClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new TriggeredAnalyticsRuleRunImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TriggeredAnalyticsRuleRunImpl(inner1, this.manager())); + } + + private GetTriggeredAnalyticsRuleRunsClient 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/GetsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsClientImpl.java new file mode 100644 index 000000000000..a050bd2517bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsClientImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.GetsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GetsClient. + */ +public final class GetsClientImpl implements GetsClient { + /** + * The proxy service used to perform REST calls. + */ + private final GetsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of GetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GetsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(GetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientGets to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientGets") + public interface GetsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> singleRecommendation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") String recommendationId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response singleRecommendationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") String recommendationId, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> singleRecommendationWithResponseAsync(String resourceGroupName, + String workspaceName, String recommendationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.singleRecommendation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono singleRecommendationAsync(String resourceGroupName, String workspaceName, + String recommendationId) { + return singleRecommendationWithResponseAsync(resourceGroupName, workspaceName, recommendationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response singleRecommendationWithResponse(String resourceGroupName, + String workspaceName, String recommendationId, Context context) { + final String accept = "application/json"; + return service.singleRecommendationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, accept, context); + } + + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecommendationInner singleRecommendation(String resourceGroupName, String workspaceName, + String recommendationId) { + return singleRecommendationWithResponse(resourceGroupName, workspaceName, recommendationId, Context.NONE) + .getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsImpl.java new file mode 100644 index 000000000000..b39d061933ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.GetsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.models.Gets; +import com.azure.resourcemanager.securityinsights.models.Recommendation; + +public final class GetsImpl implements Gets { + private static final ClientLogger LOGGER = new ClientLogger(GetsImpl.class); + + private final GetsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public GetsImpl(GetsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response singleRecommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, Context context) { + Response inner = this.serviceClient() + .singleRecommendationWithResponse(resourceGroupName, workspaceName, recommendationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecommendationImpl(inner.getValue(), this.manager())); + } + + public Recommendation singleRecommendation(String resourceGroupName, String workspaceName, + String recommendationId) { + RecommendationInner inner + = this.serviceClient().singleRecommendation(resourceGroupName, workspaceName, recommendationId); + if (inner != null) { + return new RecommendationImpl(inner, this.manager()); + } else { + return null; + } + } + + private GetsClient 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/HuntCommentImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentImpl.java new file mode 100644 index 000000000000..f26af171794d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntCommentInner; +import com.azure.resourcemanager.securityinsights.models.HuntComment; + +public final class HuntCommentImpl implements HuntComment, HuntComment.Definition, HuntComment.Update { + private HuntCommentInner 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 message() { + return this.innerModel().message(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HuntCommentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String huntId; + + private String huntCommentId; + + public HuntCommentImpl withExistingHunt(String resourceGroupName, String workspaceName, String huntId) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.huntId = huntId; + return this; + } + + public HuntComment create() { + this.innerObject = serviceManager.serviceClient() + .getHuntComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public HuntComment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHuntComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, this.innerModel(), + context) + .getValue(); + return this; + } + + HuntCommentImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new HuntCommentInner(); + this.serviceManager = serviceManager; + this.huntCommentId = name; + } + + public HuntCommentImpl update() { + return this; + } + + public HuntComment apply() { + this.innerObject = serviceManager.serviceClient() + .getHuntComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public HuntComment apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHuntComments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, this.innerModel(), + context) + .getValue(); + return this; + } + + HuntCommentImpl(HuntCommentInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.huntId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hunts"); + this.huntCommentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "comments"); + } + + public HuntComment refresh() { + this.innerObject = serviceManager.serviceClient() + .getHuntComments() + .getWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, Context.NONE) + .getValue(); + return this; + } + + public HuntComment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHuntComments() + .getWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, context) + .getValue(); + return this; + } + + public HuntCommentImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public HuntCommentImpl 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/HuntCommentsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsClientImpl.java new file mode 100644 index 000000000000..5e623b3b7c36 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsClientImpl.java @@ -0,0 +1,641 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.HuntCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner; +import com.azure.resourcemanager.securityinsights.implementation.models.HuntCommentList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HuntCommentsClient. + */ +public final class HuntCommentsClientImpl implements HuntCommentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HuntCommentsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of HuntCommentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HuntCommentsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(HuntCommentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientHuntComments to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientHuntComments") + public interface HuntCommentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/comments/{huntCommentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntCommentId") String huntCommentId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/comments/{huntCommentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntCommentId") String huntCommentId, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/comments/{huntCommentId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntCommentId") String huntCommentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HuntCommentInner huntComment, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/comments/{huntCommentId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntCommentId") String huntCommentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HuntCommentInner huntComment, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/comments/{huntCommentId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntCommentId") String huntCommentId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/comments/{huntCommentId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntCommentId") String huntCommentId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/comments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @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/hunts/{huntId}/comments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String huntId, String huntCommentId) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntCommentId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId) { + return getWithResponseAsync(resourceGroupName, workspaceName, huntId, huntCommentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, huntId, huntCommentId, accept, context); + } + + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HuntCommentInner get(String resourceGroupName, String workspaceName, String huntId, String huntCommentId) { + return getWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, Context.NONE).getValue(); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment id (GUID). + * @param huntComment The hunt 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 a Hunt Comment in Azure Security Insights along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String huntId, String huntCommentId, HuntCommentInner huntComment) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntCommentId, contentType, + accept, huntComment, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment id (GUID). + * @param huntComment The hunt 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 a Hunt Comment in Azure Security Insights on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, HuntCommentInner huntComment) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, huntId, huntCommentId, huntComment) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment id (GUID). + * @param huntComment The hunt 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 a Hunt Comment in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String huntId, String huntCommentId, HuntCommentInner huntComment, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntCommentId, contentType, + accept, huntComment, context); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment id (GUID). + * @param huntComment The hunt 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 a Hunt Comment in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HuntCommentInner createOrUpdate(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, HuntCommentInner huntComment) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, huntComment, + Context.NONE).getValue(); + } + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntCommentId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, huntId, huntCommentId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntCommentId, context); + } + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 huntId, String huntCommentId) { + deleteWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, Context.NONE); + } + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt comments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String huntId, String filter, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, 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 hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt comments as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String huntId, + String filter, String orderby, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt comments as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String huntId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String huntId, String filter, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String huntId, String filter, String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt comments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt comments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId, + String filter, String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 hunt comments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 hunt comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 hunt comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/HuntCommentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsImpl.java new file mode 100644 index 000000000000..57091f95da38 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner; +import com.azure.resourcemanager.securityinsights.models.HuntComment; +import com.azure.resourcemanager.securityinsights.models.HuntComments; + +public final class HuntCommentsImpl implements HuntComments { + private static final ClientLogger LOGGER = new ClientLogger(HuntCommentsImpl.class); + + private final HuntCommentsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public HuntCommentsImpl(HuntCommentsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HuntCommentImpl(inner.getValue(), this.manager())); + } + + public HuntComment get(String resourceGroupName, String workspaceName, String huntId, String huntCommentId) { + HuntCommentInner inner = this.serviceClient().get(resourceGroupName, workspaceName, huntId, huntCommentId); + if (inner != null) { + return new HuntCommentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, context); + } + + public void delete(String resourceGroupName, String workspaceName, String huntId, String huntCommentId) { + this.serviceClient().delete(resourceGroupName, workspaceName, huntId, huntCommentId); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, huntId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HuntCommentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId, String filter, + String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HuntCommentImpl(inner1, this.manager())); + } + + public HuntComment getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); + if (huntCommentId == 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, huntId, huntCommentId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); + if (huntCommentId == 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, huntId, huntCommentId, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); + if (huntCommentId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'comments'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, huntId, huntCommentId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntCommentId = ResourceManagerUtils.getValueFromIdByName(id, "comments"); + if (huntCommentId == 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, huntId, huntCommentId, context); + } + + private HuntCommentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public HuntCommentImpl define(String name) { + return new HuntCommentImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntImpl.java new file mode 100644 index 000000000000..21b9188ecdaa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntInner; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.Hunt; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.util.Collections; +import java.util.List; + +public final class HuntImpl implements Hunt, Hunt.Definition, Hunt.Update { + private HuntInner 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 String description() { + return this.innerModel().description(); + } + + public Status status() { + return this.innerModel().status(); + } + + public HypothesisStatus hypothesisStatus() { + return this.innerModel().hypothesisStatus(); + } + + public List attackTactics() { + List inner = this.innerModel().attackTactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List attackTechniques() { + List inner = this.innerModel().attackTechniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public HuntOwner owner() { + return this.innerModel().owner(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HuntInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String huntId; + + public HuntImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public Hunt create() { + this.innerObject = serviceManager.serviceClient() + .getHunts() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Hunt create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHunts() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, this.innerModel(), context) + .getValue(); + return this; + } + + HuntImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new HuntInner(); + this.serviceManager = serviceManager; + this.huntId = name; + } + + public HuntImpl update() { + return this; + } + + public Hunt apply() { + this.innerObject = serviceManager.serviceClient() + .getHunts() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Hunt apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHunts() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, this.innerModel(), context) + .getValue(); + return this; + } + + HuntImpl(HuntInner innerObject, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.huntId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hunts"); + } + + public Hunt refresh() { + this.innerObject = serviceManager.serviceClient() + .getHunts() + .getWithResponse(resourceGroupName, workspaceName, huntId, Context.NONE) + .getValue(); + return this; + } + + public Hunt refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHunts() + .getWithResponse(resourceGroupName, workspaceName, huntId, context) + .getValue(); + return this; + } + + public HuntImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public HuntImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public HuntImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public HuntImpl withStatus(Status status) { + this.innerModel().withStatus(status); + return this; + } + + public HuntImpl withHypothesisStatus(HypothesisStatus hypothesisStatus) { + this.innerModel().withHypothesisStatus(hypothesisStatus); + return this; + } + + public HuntImpl withAttackTactics(List attackTactics) { + this.innerModel().withAttackTactics(attackTactics); + return this; + } + + public HuntImpl withAttackTechniques(List attackTechniques) { + this.innerModel().withAttackTechniques(attackTechniques); + return this; + } + + public HuntImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } + + public HuntImpl withOwner(HuntOwner owner) { + this.innerModel().withOwner(owner); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationImpl.java new file mode 100644 index 000000000000..d1f5369df6fe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntRelationInner; +import com.azure.resourcemanager.securityinsights.models.HuntRelation; +import java.util.Collections; +import java.util.List; + +public final class HuntRelationImpl implements HuntRelation, HuntRelation.Definition, HuntRelation.Update { + private HuntRelationInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String relatedResourceId() { + return this.innerModel().relatedResourceId(); + } + + public String relatedResourceName() { + return this.innerModel().relatedResourceName(); + } + + public String relationType() { + return this.innerModel().relationType(); + } + + public String relatedResourceKind() { + return this.innerModel().relatedResourceKind(); + } + + public List labels() { + List inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public HuntRelationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String huntId; + + private String huntRelationId; + + public HuntRelationImpl withExistingHunt(String resourceGroupName, String workspaceName, String huntId) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.huntId = huntId; + return this; + } + + public HuntRelation create() { + this.innerObject = serviceManager.serviceClient() + .getHuntRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public HuntRelation create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHuntRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, this.innerModel(), + context) + .getValue(); + return this; + } + + HuntRelationImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new HuntRelationInner(); + this.serviceManager = serviceManager; + this.huntRelationId = name; + } + + public HuntRelationImpl update() { + return this; + } + + public HuntRelation apply() { + this.innerObject = serviceManager.serviceClient() + .getHuntRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public HuntRelation apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHuntRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, this.innerModel(), + context) + .getValue(); + return this; + } + + HuntRelationImpl(HuntRelationInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.huntId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hunts"); + this.huntRelationId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "relations"); + } + + public HuntRelation refresh() { + this.innerObject = serviceManager.serviceClient() + .getHuntRelations() + .getWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, Context.NONE) + .getValue(); + return this; + } + + public HuntRelation refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getHuntRelations() + .getWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, context) + .getValue(); + return this; + } + + public HuntRelationImpl withRelatedResourceId(String relatedResourceId) { + this.innerModel().withRelatedResourceId(relatedResourceId); + return this; + } + + public HuntRelationImpl withLabels(List labels) { + this.innerModel().withLabels(labels); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsClientImpl.java new file mode 100644 index 000000000000..9fd606575fc3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsClientImpl.java @@ -0,0 +1,642 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.HuntRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner; +import com.azure.resourcemanager.securityinsights.implementation.models.HuntRelationList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HuntRelationsClient. + */ +public final class HuntRelationsClientImpl implements HuntRelationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HuntRelationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of HuntRelationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HuntRelationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(HuntRelationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientHuntRelations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientHuntRelations") + public interface HuntRelationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations/{huntRelationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntRelationId") String huntRelationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations/{huntRelationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntRelationId") String huntRelationId, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations/{huntRelationId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntRelationId") String huntRelationId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HuntRelationInner huntRelation, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations/{huntRelationId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntRelationId") String huntRelationId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HuntRelationInner huntRelation, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations/{huntRelationId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntRelationId") String huntRelationId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations/{huntRelationId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @PathParam("huntRelationId") String huntRelationId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @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/hunts/{huntId}/relations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String huntId, String huntRelationId) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntRelationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId) { + return getWithResponseAsync(resourceGroupName, workspaceName, huntId, huntRelationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, huntId, huntRelationId, accept, context); + } + + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HuntRelationInner get(String resourceGroupName, String workspaceName, String huntId, String huntRelationId) { + return getWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, Context.NONE).getValue(); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation id (GUID). + * @param huntRelation The hunt relation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Hunt Relation in Azure Security Insights along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String huntId, String huntRelationId, HuntRelationInner huntRelation) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntRelationId, contentType, + accept, huntRelation, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation id (GUID). + * @param huntRelation The hunt relation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Hunt Relation in Azure Security Insights on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, HuntRelationInner huntRelation) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, huntId, huntRelationId, huntRelation) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation id (GUID). + * @param huntRelation The hunt relation. + * @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 Hunt Relation in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String huntId, String huntRelationId, HuntRelationInner huntRelation, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntRelationId, contentType, + accept, huntRelation, context); + } + + /** + * Creates or updates a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation id (GUID). + * @param huntRelation The hunt relation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Hunt Relation in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HuntRelationInner createOrUpdate(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, HuntRelationInner huntRelation) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, huntRelation, + Context.NONE).getValue(); + } + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntRelationId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, huntId, huntRelationId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, huntRelationId, context); + } + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 huntId, String huntRelationId) { + deleteWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, Context.NONE); + } + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt relations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String huntId, String filter, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, 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 hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt relations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String huntId, + String filter, String orderby, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt relations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String huntId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt relations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String huntId, String filter, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt relations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String huntId, String filter, String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt relations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId) { + final String filter = null; + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt relations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId, + String filter, String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 hunt relations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 hunt relations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 hunt relations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/HuntRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsImpl.java new file mode 100644 index 000000000000..723236faaecf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner; +import com.azure.resourcemanager.securityinsights.models.HuntRelation; +import com.azure.resourcemanager.securityinsights.models.HuntRelations; + +public final class HuntRelationsImpl implements HuntRelations { + private static final ClientLogger LOGGER = new ClientLogger(HuntRelationsImpl.class); + + private final HuntRelationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public HuntRelationsImpl(HuntRelationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HuntRelationImpl(inner.getValue(), this.manager())); + } + + public HuntRelation get(String resourceGroupName, String workspaceName, String huntId, String huntRelationId) { + HuntRelationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, huntId, huntRelationId); + if (inner != null) { + return new HuntRelationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, context); + } + + public void delete(String resourceGroupName, String workspaceName, String huntId, String huntRelationId) { + this.serviceClient().delete(resourceGroupName, workspaceName, huntId, huntRelationId); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, huntId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HuntRelationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String huntId, + String filter, String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, huntId, filter, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HuntRelationImpl(inner1, this.manager())); + } + + public HuntRelation getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntRelationId = ResourceManagerUtils.getValueFromIdByName(id, "relations"); + if (huntRelationId == 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, huntId, huntRelationId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntRelationId = ResourceManagerUtils.getValueFromIdByName(id, "relations"); + if (huntRelationId == 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, huntId, huntRelationId, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntRelationId = ResourceManagerUtils.getValueFromIdByName(id, "relations"); + if (huntRelationId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'relations'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, huntId, huntRelationId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + String huntRelationId = ResourceManagerUtils.getValueFromIdByName(id, "relations"); + if (huntRelationId == 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, huntId, huntRelationId, context); + } + + private HuntRelationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public HuntRelationImpl define(String name) { + return new HuntRelationImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsClientImpl.java new file mode 100644 index 000000000000..ae7b5098bd21 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsClientImpl.java @@ -0,0 +1,616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.HuntsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntInner; +import com.azure.resourcemanager.securityinsights.implementation.models.HuntList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in HuntsClient. + */ +public final class HuntsClientImpl implements HuntsClient { + /** + * The proxy service used to perform REST calls. + */ + private final HuntsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of HuntsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HuntsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(HuntsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientHunts to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientHunts") + public interface HuntsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") HuntInner hunt, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") HuntInner hunt, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("huntId") String huntId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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/hunts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String huntId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String huntId) { + return getWithResponseAsync(resourceGroupName, workspaceName, huntId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, huntId, accept, context); + } + + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HuntInner get(String resourceGroupName, String workspaceName, String huntId) { + return getWithResponse(resourceGroupName, workspaceName, huntId, Context.NONE).getValue(); + } + + /** + * Create or update a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param hunt The hunt. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Hunt in Azure Security Insights along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, + String huntId, HuntInner hunt) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, contentType, accept, hunt, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param hunt The hunt. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Hunt in Azure Security Insights on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String huntId, + HuntInner hunt) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, huntId, hunt) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param hunt The hunt. + * @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 Hunt in Azure Security Insights along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String huntId, + HuntInner hunt, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, contentType, accept, hunt, + context); + } + + /** + * Create or update a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param hunt The hunt. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Hunt in Azure Security Insights. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HuntInner createOrUpdate(String resourceGroupName, String workspaceName, String huntId, HuntInner hunt) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, huntId, hunt, Context.NONE).getValue(); + } + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String huntId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String huntId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, huntId).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, huntId, context); + } + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 huntId) { + deleteWithResponse(resourceGroupName, workspaceName, huntId, Context.NONE); + } + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, String skipToken) { + 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 hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedFlux}. + */ + @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 hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedFlux}. + */ + @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 hunts, without relations and comments. + * + * @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 hunts, without relations and comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedIterable}. + */ + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 hunts, without relations and comments along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 hunts, without relations and comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 hunts, without relations and comments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/HuntsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsImpl.java new file mode 100644 index 000000000000..1ccbfa6a73d3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntInner; +import com.azure.resourcemanager.securityinsights.models.Hunt; +import com.azure.resourcemanager.securityinsights.models.Hunts; + +public final class HuntsImpl implements Hunts { + private static final ClientLogger LOGGER = new ClientLogger(HuntsImpl.class); + + private final HuntsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public HuntsImpl(HuntsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, huntId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HuntImpl(inner.getValue(), this.manager())); + } + + public Hunt get(String resourceGroupName, String workspaceName, String huntId) { + HuntInner inner = this.serviceClient().get(resourceGroupName, workspaceName, huntId); + if (inner != null) { + return new HuntImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, huntId, context); + } + + public void delete(String resourceGroupName, String workspaceName, String huntId) { + this.serviceClient().delete(resourceGroupName, workspaceName, huntId); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HuntImpl(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 ResourceManagerUtils.mapPage(inner, inner1 -> new HuntImpl(inner1, this.manager())); + } + + public Hunt getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, huntId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, huntId, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, huntId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 huntId = ResourceManagerUtils.getValueFromIdByName(id, "hunts"); + if (huntId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hunts'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, huntId, context); + } + + private HuntsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public HuntImpl define(String name) { + return new HuntImpl(name, this.manager()); + } +} 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 index da24c3229fd5..f978e7dd9ecc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index 3fcfb2f4876a..5128e6d0e0f1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index af654f974fbf..cd524d0db323 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -36,6 +36,10 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public String message() { + return this.innerModel().message(); + } + public OffsetDateTime createdTimeUtc() { return this.innerModel().createdTimeUtc(); } @@ -44,10 +48,6 @@ public OffsetDateTime lastModifiedTimeUtc() { return this.innerModel().lastModifiedTimeUtc(); } - public String message() { - return this.innerModel().message(); - } - public ClientInfo author() { return this.innerModel().author(); } 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 index e3442d15b9f0..6dca0fbb9283 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient; import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; -import com.azure.resourcemanager.securityinsights.models.IncidentCommentList; +import com.azure.resourcemanager.securityinsights.implementation.models.IncidentCommentList; import reactor.core.publisher.Mono; /** @@ -45,748 +45,569 @@ public final class IncidentCommentsClientImpl implements IncidentCommentsClient /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of IncidentCommentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - IncidentCommentsClientImpl(SecurityInsightsImpl client) { + IncidentCommentsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientIncidentComments to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsInci") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientIncidentComments") public interface IncidentCommentsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("incidentId") String incidentId, @PathParam("incidentCommentId") String incidentCommentId, + @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, + Response getSync(@HostParam("endpoint") 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, + Mono> createOrUpdate(@HostParam("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncidentCommentInner incidentComment, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/comments/{incidentCommentId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncidentCommentInner incidentComment, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") 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" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all comments for a given incident. + * 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 workspaceName The name of the monitor 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 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 all comments for a given incident along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return an incident comment along with {@link Response} on successful completion of {@link Mono}. */ @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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId) { 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)) + .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 all comments for a given incident. + * 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 workspaceName The name of the monitor 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. + * @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 all comments for a given incident along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return an incident comment on successful completion of {@link Mono}. */ @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 comments for a given 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 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 comments for a given incident as paginated response with {@link PagedFlux}. - */ - @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 comments for a given 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 all comments for a given incident as paginated response with {@link PagedFlux}. - */ - @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)); + private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all comments for a given incident. + * 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 workspaceName The name of the monitor 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 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 all comments for a given incident as paginated response with {@link PagedFlux}. + * @return an incident comment along with {@link Response}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, incidentCommentId, accept, context); } /** - * Gets all comments for a given incident. + * 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 workspaceName The name of the monitor 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 all comments for a given incident as paginated response with {@link PagedIterable}. + * @return an incident comment. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentCommentInner get(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId) { + return getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) + .getValue(); } /** - * Gets all comments for a given incident. + * Creates or updates a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. + * @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 all comments for a given incident as paginated response with {@link PagedIterable}. + * @return represents an incident comment along with {@link Response} on successful completion of {@link Mono}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String incidentId, String incidentCommentId, IncidentCommentInner incidentComment) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, + contentType, accept, incidentComment, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a comment for a given incident. + * Creates or updates a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a comment for a given incident along with {@link Response} on successful completion of {@link Mono}. + * @return represents an incident comment on successful completion of {@link Mono}. */ @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())); + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId, IncidentCommentInner incidentComment) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, + incidentComment).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets a comment for a given incident. + * Creates or updates a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a comment for a given incident along with {@link Response} on successful completion of {@link Mono}. + * @return represents an incident comment along with {@link Response}. */ @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.")); - } + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId, IncidentCommentInner incidentComment, Context context) { + final String contentType = "application/json"; 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); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, + contentType, accept, incidentComment, context); } /** - * Gets a comment for a given incident. + * Creates or updates a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a comment for a given incident on successful completion of {@link Mono}. + * @return represents 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(res -> Mono.justOrEmpty(res.getValue())); + public IncidentCommentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, IncidentCommentInner incidentComment) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, + incidentComment, Context.NONE).getValue(); } /** - * Gets a comment for a given incident. + * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a comment for a given incident along with {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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(); + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentCommentId) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a comment for a given incident. + * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a comment for a given incident. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentCommentInner get(String resourceGroupName, String workspaceName, String incidentId, + private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { - return getWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE) - .getValue(); + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId) + .flatMap(ignored -> Mono.empty()); } /** - * Creates or updates a comment for a given incident. + * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @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())); + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentCommentId, context); } /** - * Creates or updates a comment for a given incident. + * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 along with {@link Response} on successful completion of {@link Mono}. */ @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); + public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { + deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE); } /** - * Creates or updates a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param incidentCommentId Incident comment ID. - * @param incidentComment The incident comment. + * @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 represents an incident comment on successful completion of {@link Mono}. + * @return all comments for a given incident along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @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(res -> Mono.justOrEmpty(res.getValue())); + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String incidentId, String filter, String orderby, Integer top, String skipToken) { + 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())); } /** - * Creates or updates a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param incidentCommentId Incident comment ID. - * @param incidentComment The incident comment. - * @param context The context to associate with this operation. + * @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 represents an incident comment along with {@link Response}. + * @return all comments for a given incident as paginated response with {@link PagedFlux}. */ - @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(); + @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)); } /** - * Creates or updates a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. + * @return all comments for a given incident as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentCommentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, - String incidentCommentId, IncidentCommentInner incidentComment) { - return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, - incidentComment, Context.NONE).getValue(); + @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)); } /** - * Deletes a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param incidentCommentId Incident comment 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 the {@link Response} on successful completion of {@link Mono}. + * @return all comments for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String incidentId, String filter, String orderby, Integer top, String skipToken) { 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())); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param incidentCommentId Incident comment 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 the {@link Response} on successful completion of {@link Mono}. + * @return all comments for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String incidentId, String filter, String orderby, Integer top, String skipToken, Context context) { 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); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 A {@link Mono} that completes when a successful response is received. + * @return all comments for a given incident as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId, - String incidentCommentId) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId) - .flatMap(ignored -> Mono.empty()); + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); } /** - * Deletes a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param incidentCommentId Incident comment 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 the {@link Response}. + * @return all comments for a given incident as paginated response with {@link PagedIterable}. */ - @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(); + @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<>(() -> listSinglePage(resourceGroupName, workspaceName, incidentId, filter, orderby, + top, skipToken, context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Deletes a comment for a given incident. + * Get the next page of items. * - * @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 nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 comments for a given incident along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId) { - deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentCommentId, Context.NONE); + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); } /** @@ -796,22 +617,15 @@ public void delete(String resourceGroupName, String workspaceName, String incide * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all comments for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink) { 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())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -822,21 +636,13 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all comments for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 15c93eaa6c5e..618622c3254c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,29 +27,12 @@ public IncidentCommentsImpl(IncidentCommentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, workspaceName, incidentId); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentCommentImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentCommentImpl(inner.getValue(), this.manager())); } public IncidentComment get(String resourceGroupName, String workspaceName, String incidentId, @@ -73,6 +56,19 @@ public void delete(String resourceGroupName, String workspaceName, String incide this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, incidentCommentId); } + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, incidentId); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentCommentImpl(inner1, this.manager())); + } + public IncidentComment getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 index 73760db49b7a..970553a20b83 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index 471fb1e3d100..c864601d32a5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -19,6 +19,7 @@ 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 java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -48,40 +49,36 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public IncidentAdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public IncidentClassification classification() { - return this.innerModel().classification(); + public String title() { + return this.innerModel().title(); } - public String classificationComment() { - return this.innerModel().classificationComment(); + public String description() { + return this.innerModel().description(); } - public IncidentClassificationReason classificationReason() { - return this.innerModel().classificationReason(); + public IncidentSeverity severity() { + return this.innerModel().severity(); } - public OffsetDateTime createdTimeUtc() { - return this.innerModel().createdTimeUtc(); + public IncidentStatus status() { + return this.innerModel().status(); } - public String description() { - return this.innerModel().description(); + public IncidentClassification classification() { + return this.innerModel().classification(); } - public OffsetDateTime firstActivityTimeUtc() { - return this.innerModel().firstActivityTimeUtc(); + public IncidentClassificationReason classificationReason() { + return this.innerModel().classificationReason(); } - public String incidentUrl() { - return this.innerModel().incidentUrl(); + public String classificationComment() { + return this.innerModel().classificationComment(); } - public Integer incidentNumber() { - return this.innerModel().incidentNumber(); + public IncidentOwnerInfo owner() { + return this.innerModel().owner(); } public List labels() { @@ -93,6 +90,10 @@ public List labels() { } } + public OffsetDateTime firstActivityTimeUtc() { + return this.innerModel().firstActivityTimeUtc(); + } + public OffsetDateTime lastActivityTimeUtc() { return this.innerModel().lastActivityTimeUtc(); } @@ -101,8 +102,16 @@ public OffsetDateTime lastModifiedTimeUtc() { return this.innerModel().lastModifiedTimeUtc(); } - public IncidentOwnerInfo owner() { - return this.innerModel().owner(); + public OffsetDateTime createdTimeUtc() { + return this.innerModel().createdTimeUtc(); + } + + public Integer incidentNumber() { + return this.innerModel().incidentNumber(); + } + + public IncidentAdditionalData additionalData() { + return this.innerModel().additionalData(); } public List relatedAnalyticRuleIds() { @@ -114,16 +123,20 @@ public List relatedAnalyticRuleIds() { } } - public IncidentSeverity severity() { - return this.innerModel().severity(); + public String incidentUrl() { + return this.innerModel().incidentUrl(); } - public IncidentStatus status() { - return this.innerModel().status(); + public String providerName() { + return this.innerModel().providerName(); } - public String title() { - return this.innerModel().title(); + public String providerIncidentId() { + return this.innerModel().providerIncidentId(); + } + + public TeamInformation teamInformation() { + return this.innerModel().teamInformation(); } public String resourceGroupName() { @@ -248,38 +261,38 @@ public IncidentImpl withEtag(String etag) { return this; } - public IncidentImpl withClassification(IncidentClassification classification) { - this.innerModel().withClassification(classification); + public IncidentImpl withTitle(String title) { + this.innerModel().withTitle(title); return this; } - public IncidentImpl withClassificationComment(String classificationComment) { - this.innerModel().withClassificationComment(classificationComment); + public IncidentImpl withDescription(String description) { + this.innerModel().withDescription(description); return this; } - public IncidentImpl withClassificationReason(IncidentClassificationReason classificationReason) { - this.innerModel().withClassificationReason(classificationReason); + public IncidentImpl withSeverity(IncidentSeverity severity) { + this.innerModel().withSeverity(severity); return this; } - public IncidentImpl withDescription(String description) { - this.innerModel().withDescription(description); + public IncidentImpl withStatus(IncidentStatus status) { + this.innerModel().withStatus(status); return this; } - public IncidentImpl withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { - this.innerModel().withFirstActivityTimeUtc(firstActivityTimeUtc); + public IncidentImpl withClassification(IncidentClassification classification) { + this.innerModel().withClassification(classification); return this; } - public IncidentImpl withLabels(List labels) { - this.innerModel().withLabels(labels); + public IncidentImpl withClassificationReason(IncidentClassificationReason classificationReason) { + this.innerModel().withClassificationReason(classificationReason); return this; } - public IncidentImpl withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) { - this.innerModel().withLastActivityTimeUtc(lastActivityTimeUtc); + public IncidentImpl withClassificationComment(String classificationComment) { + this.innerModel().withClassificationComment(classificationComment); return this; } @@ -288,18 +301,23 @@ public IncidentImpl withOwner(IncidentOwnerInfo owner) { return this; } - public IncidentImpl withSeverity(IncidentSeverity severity) { - this.innerModel().withSeverity(severity); + public IncidentImpl withLabels(List labels) { + this.innerModel().withLabels(labels); return this; } - public IncidentImpl withStatus(IncidentStatus status) { - this.innerModel().withStatus(status); + public IncidentImpl withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc) { + this.innerModel().withFirstActivityTimeUtc(firstActivityTimeUtc); return this; } - public IncidentImpl withTitle(String title) { - this.innerModel().withTitle(title); + public IncidentImpl withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc) { + this.innerModel().withLastActivityTimeUtc(lastActivityTimeUtc); + return this; + } + + public IncidentImpl withTeamInformation(TeamInformation teamInformation) { + this.innerModel().withTeamInformation(teamInformation); return this; } } 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 index eb6d0ddbea79..1cd86d17950b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient; import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; -import com.azure.resourcemanager.securityinsights.models.RelationList; +import com.azure.resourcemanager.securityinsights.implementation.models.RelationList; import reactor.core.publisher.Mono; /** @@ -45,736 +45,568 @@ public final class IncidentRelationsClientImpl implements IncidentRelationsClien /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of IncidentRelationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - IncidentRelationsClientImpl(SecurityInsightsImpl client) { + IncidentRelationsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientIncidentRelations to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsInci") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientIncidentRelations") public interface IncidentRelationsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("incidentId") String incidentId, @PathParam("relationName") String relationName, + @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, + Response getSync(@HostParam("endpoint") 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, + Mono> createOrUpdate(@HostParam("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelationInner relation, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/relations/{relationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RelationInner relation, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") 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" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all relations for a given incident. + * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 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 all relations for a given incident along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a relation for a given incident along with {@link Response} on successful completion of {@link Mono}. */ @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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String relationName) { 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)) + .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 all relations for a given incident. + * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. + * @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 all relations for a given incident along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a relation for a given incident on successful completion of {@link Mono}. */ @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)); + private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId, + String relationName) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all relations for a given incident. + * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 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 all relations for a given incident as paginated response with {@link PagedFlux}. + * @return a relation for a given incident along with {@link Response}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, relationName, accept, context); } /** - * Gets all relations for a given incident. + * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 all relations for a given incident as paginated response with {@link PagedFlux}. + * @return a relation for a given incident. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + return getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE).getValue(); } /** - * Gets all relations for a given incident. + * 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 workspaceName The name of the monitor 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. + * @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 all relations for a given incident as paginated response with {@link PagedFlux}. + * @return represents a relation between two resources along with {@link Response} on successful completion of + * {@link Mono}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String incidentId, String relationName, RelationInner relation) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, + contentType, accept, relation, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all relations for a given incident. + * 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 workspaceName The name of the monitor 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 all relations for a given incident as paginated response with {@link PagedIterable}. + * @return represents a relation between two resources on successful completion of {@link Mono}. */ - @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)); + @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(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all relations for a given incident. + * 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 workspaceName The name of the monitor 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 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 all relations for a given incident as paginated response with {@link PagedIterable}. + * @return represents a relation between two resources along with {@link Response}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String relationName, RelationInner relation, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, contentType, + accept, relation, context); } /** - * Gets a relation for a given incident. + * 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 workspaceName The name of the monitor 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 a relation for a given incident along with {@link Response} on successful completion of {@link Mono}. + * @return represents a relation between two resources. */ @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())); + public RelationInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + String relationName, RelationInner relation) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, relation, + Context.NONE).getValue(); } /** - * Gets a relation for a given incident. + * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a relation for a given incident along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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); + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String relationName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a relation for a given incident. + * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a relation for a given incident on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId, + private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId, String relationName) { - return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) + .flatMap(ignored -> Mono.empty()); } /** - * Gets a relation for a given incident. + * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a relation for a given incident along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, relationName, context); } /** - * Gets a relation for a given incident. + * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a relation for a given incident. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RelationInner get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { - return getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE).getValue(); + public void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName) { + deleteWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE); } /** - * Creates or updates a relation for a given incident. + * Gets all relations for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param relationName Relation Name. - * @param relation The relation model. + * @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 represents a relation between two resources along with {@link Response} on successful completion of + * @return all relations for a given incident along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @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(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String incidentId, String filter, String orderby, Integer top, String skipToken) { 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)) + .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())); } /** - * Creates or updates a relation for a given 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 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 a relation for a given 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 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 on successful completion of {@link Mono}. - */ - @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(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a relation for a given incident. + * Gets all relations for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param relationName Relation Name. - * @param relation The relation model. - * @param context The context to associate with this operation. + * @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 represents a relation between two resources along with {@link Response}. + * @return all relations for a given incident as paginated response with {@link PagedFlux}. */ - @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(); + @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)); } /** - * Creates or updates a relation for a given incident. + * Gets all relations for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. + * @return all relations for a given incident as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RelationInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, - String relationName, RelationInner relation) { - return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, relation, - Context.NONE).getValue(); + @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)); } /** - * Deletes a relation for a given incident. + * Gets all relations for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param relationName Relation Name. + * @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 the {@link Response} on successful completion of {@link Mono}. + * @return all relations for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String incidentId, String filter, String orderby, Integer top, String skipToken) { 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())); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes a relation for a given incident. + * Gets all relations for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param relationName Relation Name. + * @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 the {@link Response} on successful completion of {@link Mono}. + * @return all relations for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String incidentId, String filter, String orderby, Integer top, String skipToken, Context context) { 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); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes a relation for a given incident. + * Gets all relations for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 A {@link Mono} that completes when a successful response is received. + * @return all relations for a given incident as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId, - String relationName) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, relationName) - .flatMap(ignored -> Mono.empty()); + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, incidentId, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); } /** - * Deletes a relation for a given incident. + * Gets all relations for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param relationName Relation Name. + * @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 the {@link Response}. + * @return all relations for a given incident as paginated response with {@link PagedIterable}. */ - @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(); + @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<>(() -> listSinglePage(resourceGroupName, workspaceName, incidentId, filter, orderby, + top, skipToken, context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Deletes a relation for a given incident. + * Get the next page of items. * - * @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 nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 for a given incident along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName) { - deleteWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE); + private Mono> listNextSinglePageAsync(String nextLink) { + 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())); } /** @@ -784,22 +616,14 @@ public void delete(String resourceGroupName, String workspaceName, String incide * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all relations for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink) { 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())); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -810,21 +634,13 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all relations for a given incident along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 8421e8e535be..9b3eb9e60569 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,32 +27,35 @@ public IncidentRelationsImpl(IncidentRelationsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, incidentId); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), 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 SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RelationImpl(inner.getValue(), this.manager())); + return new RelationImpl(inner, this.manager()); } else { return null; } } - public Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName) { - RelationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, incidentId, relationName); + 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } + + 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 { @@ -70,101 +73,16 @@ public void delete(String resourceGroupName, String workspaceName, String incide this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, relationName); } - public Relation getById(String id) { - String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, Context.NONE); + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, incidentId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, context); + 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 ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); } private IncidentRelationsClient serviceClient() { @@ -174,8 +92,4 @@ private IncidentRelationsClient serviceClient() { 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/IncidentTaskImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTaskImpl.java new file mode 100644 index 000000000000..c55f7b80f6aa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTaskImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.IncidentTaskInner; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTask; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import java.time.OffsetDateTime; + +public final class IncidentTaskImpl implements IncidentTask, IncidentTask.Definition, IncidentTask.Update { + private IncidentTaskInner 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 title() { + return this.innerModel().title(); + } + + public String description() { + return this.innerModel().description(); + } + + public IncidentTaskStatus status() { + return this.innerModel().status(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + public IncidentTaskInner 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 incidentTaskId; + + public IncidentTaskImpl withExistingIncident(String resourceGroupName, String workspaceName, String incidentId) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.incidentId = incidentId; + return this; + } + + public IncidentTask create() { + this.innerObject = serviceManager.serviceClient() + .getIncidentTasks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public IncidentTask create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIncidentTasks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, this.innerModel(), + context) + .getValue(); + return this; + } + + IncidentTaskImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new IncidentTaskInner(); + this.serviceManager = serviceManager; + this.incidentTaskId = name; + } + + public IncidentTaskImpl update() { + return this; + } + + public IncidentTask apply() { + this.innerObject = serviceManager.serviceClient() + .getIncidentTasks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public IncidentTask apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIncidentTasks() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, this.innerModel(), + context) + .getValue(); + return this; + } + + IncidentTaskImpl(IncidentTaskInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.incidentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "incidents"); + this.incidentTaskId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "tasks"); + } + + public IncidentTask refresh() { + this.innerObject = serviceManager.serviceClient() + .getIncidentTasks() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, Context.NONE) + .getValue(); + return this; + } + + public IncidentTask refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getIncidentTasks() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, context) + .getValue(); + return this; + } + + public IncidentTaskImpl withTitle(String title) { + this.innerModel().withTitle(title); + return this; + } + + public IncidentTaskImpl withStatus(IncidentTaskStatus status) { + this.innerModel().withStatus(status); + return this; + } + + public IncidentTaskImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public IncidentTaskImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public IncidentTaskImpl withCreatedBy(ClientInfo createdBy) { + this.innerModel().withCreatedBy(createdBy); + return this; + } + + public IncidentTaskImpl withLastModifiedBy(ClientInfo lastModifiedBy) { + this.innerModel().withLastModifiedBy(lastModifiedBy); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksClientImpl.java new file mode 100644 index 000000000000..c093bcadf627 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksClientImpl.java @@ -0,0 +1,579 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.IncidentTasksClient; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner; +import com.azure.resourcemanager.securityinsights.implementation.models.IncidentTaskList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IncidentTasksClient. + */ +public final class IncidentTasksClientImpl implements IncidentTasksClient { + /** + * The proxy service used to perform REST calls. + */ + private final IncidentTasksService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of IncidentTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IncidentTasksClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(IncidentTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientIncidentTasks to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientIncidentTasks") + public interface IncidentTasksService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + @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}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncidentTaskInner incidentTask, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncidentTaskInner incidentTask, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks/{incidentTaskId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @PathParam("incidentTaskId") String incidentTaskId, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/tasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentTaskId, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentTaskId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, incidentTaskId, accept, context); + } + + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentTaskInner get(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId) { + return getWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, Context.NONE).getValue(); + } + + /** + * Creates or updates the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task ID. + * @param incidentTask The incident task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 incident task properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String incidentId, String incidentTaskId, IncidentTaskInner incidentTask) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentTaskId, + contentType, accept, incidentTask, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task ID. + * @param incidentTask The incident task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 incident task properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId, IncidentTaskInner incidentTask) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentTaskId, + incidentTask).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task ID. + * @param incidentTask The incident task. + * @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 incident task properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId, IncidentTaskInner incidentTask, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentTaskId, contentType, + accept, incidentTask, context); + } + + /** + * Creates or updates the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task ID. + * @param incidentTask The incident task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 incident task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentTaskInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, IncidentTaskInner incidentTask) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, incidentTask, + Context.NONE).getValue(); + } + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId, String incidentTaskId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentTaskId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, incidentTaskId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, incidentTaskId, context); + } + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 incidentTaskId) { + deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, Context.NONE); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String incidentId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, 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 tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String incidentId) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, incidentId), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String incidentId) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String incidentId, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, incidentId), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, incidentId, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 tasks along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 tasks along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 tasks along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/IncidentTasksImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksImpl.java new file mode 100644 index 000000000000..f4b7023a204e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.IncidentTasksClient; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner; +import com.azure.resourcemanager.securityinsights.models.IncidentTask; +import com.azure.resourcemanager.securityinsights.models.IncidentTasks; + +public final class IncidentTasksImpl implements IncidentTasks { + private static final ClientLogger LOGGER = new ClientLogger(IncidentTasksImpl.class); + + private final IncidentTasksClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public IncidentTasksImpl(IncidentTasksClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentTaskImpl(inner.getValue(), this.manager())); + } + + public IncidentTask get(String resourceGroupName, String workspaceName, String incidentId, String incidentTaskId) { + IncidentTaskInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, incidentId, incidentTaskId); + if (inner != null) { + return new IncidentTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, context); + } + + public void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentTaskId) { + this.serviceClient().delete(resourceGroupName, workspaceName, incidentId, incidentTaskId); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, incidentId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentTaskImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, incidentId, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentTaskImpl(inner1, this.manager())); + } + + public IncidentTask getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 incidentTaskId = ResourceManagerUtils.getValueFromIdByName(id, "tasks"); + if (incidentTaskId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 incidentTaskId = ResourceManagerUtils.getValueFromIdByName(id, "tasks"); + if (incidentTaskId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 incidentTaskId = ResourceManagerUtils.getValueFromIdByName(id, "tasks"); + if (incidentTaskId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 incidentTaskId = ResourceManagerUtils.getValueFromIdByName(id, "tasks"); + if (incidentTaskId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, incidentId, incidentTaskId, context); + } + + private IncidentTasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public IncidentTaskImpl define(String name) { + return new IncidentTaskImpl(name, this.manager()); + } +} 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 index 9f723572a798..f7ff68dd4a2f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -34,7 +34,8 @@ 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.models.IncidentList; +import com.azure.resourcemanager.securityinsights.implementation.models.IncidentList; +import com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody; import reactor.core.publisher.Mono; /** @@ -49,70 +50,138 @@ public final class IncidentsClientImpl implements IncidentsClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of IncidentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - IncidentsClientImpl(SecurityInsightsImpl client) { + IncidentsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientIncidents to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsInci") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientIncidents") public interface IncidentsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("incidentId") String incidentId, @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, + Response getSync(@HostParam("endpoint") 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, + Mono> createOrUpdate(@HostParam("endpoint") 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); + @PathParam("incidentId") String incidentId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") IncidentInner incident, + 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) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") IncidentInner incident, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentId") String incidentId, Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> runPlaybook(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentIdentifier") String incidentIdentifier, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManualTriggerRequestBody requestBody, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response runPlaybookSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("incidentIdentifier") String incidentIdentifier, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManualTriggerRequestBody requestBody, 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("endpoint") 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}/alerts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAlerts(@HostParam("$host") String endpoint, + Response listAlertsSync(@HostParam("endpoint") 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); @@ -121,7 +190,25 @@ Mono> listAlerts(@HostParam("$host") String end @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, + Mono> listBookmarks(@HostParam("endpoint") 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) + Response listBookmarksSync(@HostParam("endpoint") 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("endpoint") 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); @@ -130,7 +217,7 @@ Mono> listBookmarks(@HostParam("$host") Stri @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, + Response listEntitiesSync(@HostParam("endpoint") 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); @@ -140,662 +227,508 @@ Mono> listEntities(@HostParam("$host") S @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all incidents. + * Gets a given incident. * * @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 workspaceName The name of the monitor 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 incidents along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a given incident along with {@link Response} on successful completion of {@link Mono}. */ @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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId) { 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)) + .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 all incidents. + * Gets a given incident. * * @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. + * @param workspaceName The name of the monitor 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 incidents along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a given incident on successful completion of {@link Mono}. */ @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)); + private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId) { + return getWithResponseAsync(resourceGroupName, workspaceName, incidentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all incidents. + * Gets a given incident. * * @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 workspaceName The name of the monitor 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 incidents as paginated response with {@link PagedFlux}. + * @return a given incident along with {@link Response}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, incidentId, accept, context); } /** - * Gets all incidents. + * Gets a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 incidents as paginated response with {@link PagedFlux}. + * @return a given incident. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public IncidentInner get(String resourceGroupName, String workspaceName, String incidentId) { + return getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); } /** - * Gets all incidents. + * Creates or updates an incident. * * @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. + * @param workspaceName The name of the monitor 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 all incidents as paginated response with {@link PagedFlux}. + * @return represents an incident in Azure Security Insights along with {@link Response} on successful completion of + * {@link Mono}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String incidentId, IncidentInner incident) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, contentType, accept, + incident, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all incidents. + * Creates or updates an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 all incidents as paginated response with {@link PagedIterable}. + * @return represents an incident in Azure Security Insights on successful completion of {@link Mono}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String incidentId, + IncidentInner incident) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incident) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all incidents. + * Creates or updates an incident. * * @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 workspaceName The name of the monitor 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 all incidents as paginated response with {@link PagedIterable}. + * @return represents an incident in Azure Security Insights along with {@link Response}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String incidentId, IncidentInner incident, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, contentType, accept, + incident, context); } /** - * Gets a given incident. + * Creates or updates an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a given incident along with {@link Response} on successful completion of {@link Mono}. + * @return represents an incident in Azure Security Insights. */ @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())); + public IncidentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, + IncidentInner incident) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incident, Context.NONE) + .getValue(); } /** - * Gets a given incident. + * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a given incident along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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); + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a given incident. + * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a given incident on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String workspaceName, String incidentId) { - return getWithResponseAsync(resourceGroupName, workspaceName, incidentId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId).flatMap(ignored -> Mono.empty()); } /** - * Gets a given incident. + * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a given incident along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, context); } /** - * Gets a given incident. + * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a given incident. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentInner get(String resourceGroupName, String workspaceName, String incidentId) { - return getWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE).getValue(); + public void delete(String resourceGroupName, String workspaceName, String incidentId) { + deleteWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE); } /** - * Creates or updates an incident. + * Gets all incidents. * * @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 workspaceName The name of the monitor 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 represents an incident in Azure Security Insights along with {@link Response} on successful completion of - * {@link Mono}. + * @return all incidents along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, String skipToken) { 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)) + .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())); } /** - * Creates or updates an incident. + * Gets all incidents. * * @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. + * @param workspaceName The name of the monitor 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 represents an incident in Azure Security Insights along with {@link Response} on successful completion of - * {@link Mono}. + * @return all incidents as paginated response with {@link PagedFlux}. */ - @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); + @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)); } /** - * Creates or updates an incident. + * Gets all incidents. * * @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 workspaceName The name of the monitor 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 represents an incident in Azure Security Insights on successful completion of {@link Mono}. + * @return all incidents as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String incidentId, - IncidentInner incident) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, incidentId, incident) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @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)); } /** - * Creates or updates an incident. + * Gets all incidents. * * @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. + * @param workspaceName The name of the monitor 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 represents an incident in Azure Security Insights along with {@link Response}. + * @return all incidents along with {@link PagedResponse}. */ @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(); + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates or updates an incident. + * Gets all incidents. * * @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 workspaceName The name of the monitor 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 represents an incident in Azure Security Insights. + * @return all incidents along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IncidentInner createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, - IncidentInner incident) { - return createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, incident, Context.NONE) - .getValue(); + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes a given incident. + * Gets all incidents. * * @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 workspaceName The name of the monitor 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 the {@link Response} on successful completion of {@link Mono}. + * @return all incidents as paginated response with {@link PagedIterable}. */ - @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())); + @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<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); } /** - * Deletes a given incident. + * Gets all incidents. * * @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 workspaceName The name of the monitor 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 the {@link Response} on successful completion of {@link Mono}. + * @return all incidents as paginated response with {@link PagedIterable}. */ - @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); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Deletes a given incident. + * Triggers playbook on a specific 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 incidentIdentifier The incident identifier. + * @param requestBody Describes the request body for triggering a playbook on an 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 A {@link Mono} that completes when a successful response is received. + * @return anything along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String incidentId) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId).flatMap(ignored -> Mono.empty()); + private Mono> runPlaybookWithResponseAsync(String resourceGroupName, String workspaceName, + String incidentIdentifier, ManualTriggerRequestBody requestBody) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.runPlaybook(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentIdentifier, accept, + requestBody, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a given incident. + * Triggers playbook on a specific 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. + * @param incidentIdentifier The incident identifier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Response}. + * @return anything on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, - Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + private Mono runPlaybookAsync(String resourceGroupName, String workspaceName, String incidentIdentifier) { + final ManualTriggerRequestBody requestBody = null; + return runPlaybookWithResponseAsync(resourceGroupName, workspaceName, incidentIdentifier, requestBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a given incident. + * Triggers playbook on a specific 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 incidentIdentifier The incident identifier. + * @param requestBody Describes the request body for triggering a playbook on an 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 anything along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String workspaceName, String incidentId) { - deleteWithResponse(resourceGroupName, workspaceName, incidentId, Context.NONE); + public Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, + String incidentIdentifier, ManualTriggerRequestBody requestBody, Context context) { + final String accept = "application/json"; + return service.runPlaybookSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentIdentifier, accept, requestBody, + context); } /** - * Gets all alerts for an incident. + * Triggers playbook on a specific 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 incidentIdentifier The incident identifier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 alerts for an incident along with {@link Response} on successful completion of {@link Mono}. + * @return anything. */ @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())); + public Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier) { + final ManualTriggerRequestBody requestBody = null; + return runPlaybookWithResponse(resourceGroupName, workspaceName, incidentIdentifier, requestBody, Context.NONE) + .getValue(); } /** * Gets all alerts for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -803,36 +736,19 @@ private Mono> listAlertsWithResponseAsync(Strin */ @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.")); - } + String workspaceName, String incidentId) { 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); + 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 alerts for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -850,7 +766,7 @@ private Mono listAlertsAsync(String resourceGroupName, S * Gets all alerts for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -861,14 +777,16 @@ private Mono listAlertsAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response listAlertsWithResponse(String resourceGroupName, String workspaceName, String incidentId, Context context) { - return listAlertsWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + final String accept = "application/json"; + return service.listAlertsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context); } /** * Gets all alerts for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -884,7 +802,7 @@ public IncidentAlertListInner listAlerts(String resourceGroupName, String worksp * Gets all bookmarks for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -894,24 +812,6 @@ public IncidentAlertListInner listAlerts(String resourceGroupName, String worksp @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(), @@ -923,46 +823,7 @@ private Mono> listBookmarksWithResponseAsync * Gets all bookmarks for 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 all bookmarks for an incident along with {@link Response} on successful completion of {@link Mono}. - */ - @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 bookmarks for an incident. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -980,7 +841,7 @@ private Mono listBookmarksAsync(String resourceGroupN * Gets all bookmarks for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -991,14 +852,16 @@ private Mono listBookmarksAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response listBookmarksWithResponse(String resourceGroupName, String workspaceName, String incidentId, Context context) { - return listBookmarksWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + final String accept = "application/json"; + return service.listBookmarksSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context); } /** * Gets all bookmarks for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1014,7 +877,7 @@ public IncidentBookmarkListInner listBookmarks(String resourceGroupName, String * Gets all entities for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1024,24 +887,6 @@ public IncidentBookmarkListInner listBookmarks(String resourceGroupName, String @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(), @@ -1053,46 +898,7 @@ private Mono> listEntitiesWithResponseAs * Gets all entities for 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 all entities for an incident along with {@link Response} on successful completion of {@link Mono}. - */ - @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 entities for an incident. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1110,7 +916,7 @@ private Mono listEntitiesAsync(String resourceGro * Gets all entities for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1121,14 +927,16 @@ private Mono listEntitiesAsync(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) public Response listEntitiesWithResponse(String resourceGroupName, String workspaceName, String incidentId, Context context) { - return listEntitiesWithResponseAsync(resourceGroupName, workspaceName, incidentId, context).block(); + final String accept = "application/json"; + return service.listEntitiesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, incidentId, accept, context); } /** * Gets all entities for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1148,17 +956,10 @@ public IncidentEntitiesResponseInner listEntities(String resourceGroupName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all incidents along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(), @@ -1166,6 +967,23 @@ private Mono> listNextSinglePageAsync(String nextLi .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1174,21 +992,13 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all incidents along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index bebcafe951ff..e55007d6dac9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -19,6 +19,7 @@ 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.ManualTriggerRequestBody; public final class IncidentsImpl implements Incidents { private static final ClientLogger LOGGER = new ClientLogger(IncidentsImpl.class); @@ -33,28 +34,12 @@ public IncidentsImpl(IncidentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentImpl(inner.getValue(), this.manager())); } public Incident get(String resourceGroupName, String workspaceName, String incidentId) { @@ -75,16 +60,34 @@ public void delete(String resourceGroupName, String workspaceName, String incide this.serviceClient().delete(resourceGroupName, workspaceName, incidentId); } + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new IncidentImpl(inner1, this.manager())); + } + + public Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, + String incidentIdentifier, ManualTriggerRequestBody requestBody, Context context) { + return this.serviceClient() + .runPlaybookWithResponse(resourceGroupName, workspaceName, incidentIdentifier, requestBody, context); + } + + public Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier) { + return this.serviceClient().runPlaybook(resourceGroupName, workspaceName, incidentIdentifier); + } + 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentAlertListImpl(inner.getValue(), this.manager())); } public IncidentAlertList listAlerts(String resourceGroupName, String workspaceName, String incidentId) { @@ -100,12 +103,8 @@ public Response listBookmarksWithResponse(String resourceG 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentBookmarkListImpl(inner.getValue(), this.manager())); } public IncidentBookmarkList listBookmarks(String resourceGroupName, String workspaceName, String incidentId) { @@ -122,12 +121,8 @@ public Response listEntitiesWithResponse(String resour 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncidentEntitiesResponseImpl(inner.getValue(), this.manager())); } public IncidentEntitiesResponse listEntities(String resourceGroupName, String workspaceName, String incidentId) { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/JobImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/JobImpl.java new file mode 100644 index 000000000000..acf7be35a748 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/JobImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; +import com.azure.resourcemanager.securityinsights.models.Job; +import com.azure.resourcemanager.securityinsights.models.JobItem; +import com.azure.resourcemanager.securityinsights.models.JobProvisioningState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class JobImpl implements Job { + private JobInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + JobImpl(JobInner 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 OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List items() { + List inner = this.innerModel().items(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public JobProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public JobInner 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/MetadataModelImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadataModelImpl.java new file mode 100644 index 000000000000..878269180832 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadataModelImpl.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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 String 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 String customVersion() { + return this.innerModel().customVersion(); + } + + public String contentSchemaVersion() { + return this.innerModel().contentSchemaVersion(); + } + + public String icon() { + return this.innerModel().icon(); + } + + public List threatAnalysisTactics() { + List inner = this.innerModel().threatAnalysisTactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List threatAnalysisTechniques() { + List inner = this.innerModel().threatAnalysisTechniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List previewImages() { + List inner = this.innerModel().previewImages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List previewImagesDark() { + List inner = this.innerModel().previewImagesDark(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.metadataName = ResourceManagerUtils.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(String 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; + } + } + + public MetadataModelImpl withCustomVersion(String customVersion) { + if (isInCreateMode()) { + this.innerModel().withCustomVersion(customVersion); + return this; + } else { + this.updateMetadataPatch.withCustomVersion(customVersion); + return this; + } + } + + public MetadataModelImpl withContentSchemaVersion(String contentSchemaVersion) { + if (isInCreateMode()) { + this.innerModel().withContentSchemaVersion(contentSchemaVersion); + return this; + } else { + this.updateMetadataPatch.withContentSchemaVersion(contentSchemaVersion); + return this; + } + } + + public MetadataModelImpl withIcon(String icon) { + if (isInCreateMode()) { + this.innerModel().withIcon(icon); + return this; + } else { + this.updateMetadataPatch.withIcon(icon); + return this; + } + } + + public MetadataModelImpl withThreatAnalysisTactics(List threatAnalysisTactics) { + if (isInCreateMode()) { + this.innerModel().withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } else { + this.updateMetadataPatch.withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + } + + public MetadataModelImpl withThreatAnalysisTechniques(List threatAnalysisTechniques) { + if (isInCreateMode()) { + this.innerModel().withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } else { + this.updateMetadataPatch.withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + } + + public MetadataModelImpl withPreviewImages(List previewImages) { + if (isInCreateMode()) { + this.innerModel().withPreviewImages(previewImages); + return this; + } else { + this.updateMetadataPatch.withPreviewImages(previewImages); + return this; + } + } + + public MetadataModelImpl withPreviewImagesDark(List previewImagesDark) { + if (isInCreateMode()) { + this.innerModel().withPreviewImagesDark(previewImagesDark); + return this; + } else { + this.updateMetadataPatch.withPreviewImagesDark(previewImagesDark); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel() == null || 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..f710a6d7d51e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasClientImpl.java @@ -0,0 +1,715 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.MetadatasClient; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import com.azure.resourcemanager.securityinsights.implementation.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 { + /** + * The proxy service used to perform REST calls. + */ + private final MetadatasService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of MetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MetadatasClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(MetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientMetadatas to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientMetadatas") + public interface MetadatasService { + @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("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MetadataModelInner metadata, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MetadataModelInner metadata, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MetadataPatch metadataPatch, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MetadataPatch metadataPatch, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("metadataName") String metadataName, Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName) { + 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 monitor 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String metadataName) { + return getWithResponseAsync(resourceGroupName, workspaceName, metadataName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String metadataName, Context context) { + final String accept = "application/json"; + return service.getSync(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 monitor 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 getWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE).getValue(); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, MetadataModelInner metadata) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, contentType, accept, + metadata, 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 monitor 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String workspaceName, String metadataName, + MetadataModelInner metadata) { + return createWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadata) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String workspaceName, + String metadataName, MetadataModelInner metadata, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, contentType, accept, + metadata, context); + } + + /** + * Create a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 createWithResponse(resourceGroupName, workspaceName, metadataName, metadata, Context.NONE).getValue(); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName, MetadataPatch metadataPatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, contentType, accept, + metadataPatch, 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 monitor 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String workspaceName, String metadataName, + MetadataPatch metadataPatch) { + return updateWithResponseAsync(resourceGroupName, workspaceName, metadataName, metadataPatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String workspaceName, + String metadataName, MetadataPatch metadataPatch, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, contentType, accept, + metadataPatch, context); + } + + /** + * Update an existing Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 updateWithResponse(resourceGroupName, workspaceName, metadataName, metadataPatch, Context.NONE) + .getValue(); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String metadataName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, 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 monitor 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String metadataName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, metadataName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, metadataName, context); + } + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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) { + deleteWithResponse(resourceGroupName, workspaceName, metadataName, Context.NONE); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, Integer skip) { + 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 monitor 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 as paginated response with {@link PagedFlux}. + */ + @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 monitor 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 as paginated response with {@link PagedFlux}. + */ + @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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, Integer skip) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skip, accept, Context.NONE); + return 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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, Integer skip, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skip, accept, context); + return 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @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<>(() -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skip), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, Integer skip, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skip, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..aacb745e6a2c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class MetadatasImpl implements Metadatas { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, metadataName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MetadataModelImpl(inner.getValue(), 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 deleteWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, metadataName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String metadataName) { + this.serviceClient().delete(resourceGroupName, workspaceName, metadataName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new MetadataModelImpl(inner1, this.manager())); + } + + public MetadataModel getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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..88e5b8998ddf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..6f6d94e9dd11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsClientImpl.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.OfficeConsentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; +import com.azure.resourcemanager.securityinsights.implementation.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 { + /** + * The proxy service used to perform REST calls. + */ + private final OfficeConsentsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of OfficeConsentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OfficeConsentsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(OfficeConsentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientOfficeConsents to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientOfficeConsents") + public interface OfficeConsentsService { + @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("endpoint") 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("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("consentId") String consentId, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("consentId") String consentId, Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String consentId) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String consentId) { + return getWithResponseAsync(resourceGroupName, workspaceName, consentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String consentId, Context context) { + final String accept = "application/json"; + return service.getSync(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) + public OfficeConsentInner get(String resourceGroupName, String workspaceName, String consentId) { + return getWithResponse(resourceGroupName, workspaceName, consentId, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String consentId) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, consentId, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String consentId) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, consentId).flatMap(ignored -> 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. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String consentId, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, consentId, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String consentId) { + deleteWithResponse(resourceGroupName, workspaceName, consentId, Context.NONE); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedFlux}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return 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. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..b8556cb7178b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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; + +public final class OfficeConsentsImpl implements OfficeConsents { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, String consentId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, consentId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OfficeConsentImpl(inner.getValue(), 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 deleteWithResponse(String resourceGroupName, String workspaceName, String consentId, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, consentId, context); + } + + public void delete(String resourceGroupName, String workspaceName, String consentId) { + this.serviceClient().delete(resourceGroupName, workspaceName, consentId); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new OfficeConsentImpl(inner1, this.manager())); + } + + 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 index 4c8c3f86a760..e589bfd40c19 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index b8ff1cd399e5..69261ccea50e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.OperationsClient; import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; -import com.azure.resourcemanager.securityinsights.models.OperationsList; +import com.azure.resourcemanager.securityinsights.implementation.models.OperationsList; import reactor.core.publisher.Mono; /** @@ -42,31 +42,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(SecurityInsightsImpl client) { + OperationsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientOperations to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsOper") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.SecurityInsights/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.SecurityInsights/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,7 +81,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -87,10 +101,6 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = */ @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( @@ -103,24 +113,13 @@ private Mono> listSinglePageAsync() { /** * 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return lists the operations available in the SecurityInsights RP as paginated response with {@link PagedFlux}. */ - @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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,11 +127,15 @@ private Mono> listSinglePageAsync(Context context) * * @throws 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 as paginated response with {@link PagedFlux}. + * @return lists the operations available in the SecurityInsights RP along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -142,12 +145,15 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 as paginated response with {@link PagedFlux}. + * @return lists the operations available in the SecurityInsights RP along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -160,7 +166,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -175,7 +181,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -190,13 +196,6 @@ public PagedIterable list(Context context) { */ @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(), @@ -204,6 +203,23 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -212,22 +228,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return lists the operations available in the SecurityInsights RP along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index c00010c45fc5..e044fbb353df 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/PackageModelImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/PackageModelImpl.java new file mode 100644 index 000000000000..bcc74a1a4799 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/PackageModelImpl.java @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PackageModelInner; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import com.azure.resourcemanager.securityinsights.models.PackageModel; +import java.time.LocalDate; +import java.util.Collections; +import java.util.List; + +public final class PackageModelImpl implements PackageModel, PackageModel.Definition, PackageModel.Update { + private PackageModelInner 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 contentProductId() { + return this.innerModel().contentProductId(); + } + + public PackageKind contentKind() { + return this.innerModel().contentKind(); + } + + public String contentSchemaVersion() { + return this.innerModel().contentSchemaVersion(); + } + + public Flag isNew() { + return this.innerModel().isNew(); + } + + public Flag isPreview() { + return this.innerModel().isPreview(); + } + + public Flag isFeatured() { + return this.innerModel().isFeatured(); + } + + public Flag isDeprecated() { + return this.innerModel().isDeprecated(); + } + + public String version() { + return this.innerModel().version(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String publisherDisplayName() { + return this.innerModel().publisherDisplayName(); + } + + 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 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 MetadataCategories categories() { + return this.innerModel().categories(); + } + + public List threatAnalysisTactics() { + List inner = this.innerModel().threatAnalysisTactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List threatAnalysisTechniques() { + List inner = this.innerModel().threatAnalysisTechniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String icon() { + return this.innerModel().icon(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PackageModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String packageId; + + public PackageModelImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public PackageModel create() { + this.innerObject = serviceManager.serviceClient() + .getContentPackageOperations() + .installWithResponse(resourceGroupName, workspaceName, packageId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PackageModel create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentPackageOperations() + .installWithResponse(resourceGroupName, workspaceName, packageId, this.innerModel(), context) + .getValue(); + return this; + } + + PackageModelImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new PackageModelInner(); + this.serviceManager = serviceManager; + this.packageId = name; + } + + public PackageModelImpl update() { + return this; + } + + public PackageModel apply() { + this.innerObject = serviceManager.serviceClient() + .getContentPackageOperations() + .installWithResponse(resourceGroupName, workspaceName, packageId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PackageModel apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentPackageOperations() + .installWithResponse(resourceGroupName, workspaceName, packageId, this.innerModel(), context) + .getValue(); + return this; + } + + PackageModelImpl(PackageModelInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.packageId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "contentPackages"); + } + + public PackageModelImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public PackageModelImpl withContentId(String contentId) { + this.innerModel().withContentId(contentId); + return this; + } + + public PackageModelImpl withContentProductId(String contentProductId) { + this.innerModel().withContentProductId(contentProductId); + return this; + } + + public PackageModelImpl withContentKind(PackageKind contentKind) { + this.innerModel().withContentKind(contentKind); + return this; + } + + public PackageModelImpl withContentSchemaVersion(String contentSchemaVersion) { + this.innerModel().withContentSchemaVersion(contentSchemaVersion); + return this; + } + + public PackageModelImpl withIsNew(Flag isNew) { + this.innerModel().withIsNew(isNew); + return this; + } + + public PackageModelImpl withIsPreview(Flag isPreview) { + this.innerModel().withIsPreview(isPreview); + return this; + } + + public PackageModelImpl withIsFeatured(Flag isFeatured) { + this.innerModel().withIsFeatured(isFeatured); + return this; + } + + public PackageModelImpl withIsDeprecated(Flag isDeprecated) { + this.innerModel().withIsDeprecated(isDeprecated); + return this; + } + + public PackageModelImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public PackageModelImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public PackageModelImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public PackageModelImpl withPublisherDisplayName(String publisherDisplayName) { + this.innerModel().withPublisherDisplayName(publisherDisplayName); + return this; + } + + public PackageModelImpl withSource(MetadataSource source) { + this.innerModel().withSource(source); + return this; + } + + public PackageModelImpl withAuthor(MetadataAuthor author) { + this.innerModel().withAuthor(author); + return this; + } + + public PackageModelImpl withSupport(MetadataSupport support) { + this.innerModel().withSupport(support); + return this; + } + + public PackageModelImpl withDependencies(MetadataDependencies dependencies) { + this.innerModel().withDependencies(dependencies); + return this; + } + + public PackageModelImpl withProviders(List providers) { + this.innerModel().withProviders(providers); + return this; + } + + public PackageModelImpl withFirstPublishDate(LocalDate firstPublishDate) { + this.innerModel().withFirstPublishDate(firstPublishDate); + return this; + } + + public PackageModelImpl withLastPublishDate(LocalDate lastPublishDate) { + this.innerModel().withLastPublishDate(lastPublishDate); + return this; + } + + public PackageModelImpl withCategories(MetadataCategories categories) { + this.innerModel().withCategories(categories); + return this; + } + + public PackageModelImpl withThreatAnalysisTactics(List threatAnalysisTactics) { + this.innerModel().withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + public PackageModelImpl withThreatAnalysisTechniques(List threatAnalysisTechniques) { + this.innerModel().withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + public PackageModelImpl withIcon(String icon) { + this.innerModel().withIcon(icon); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageModelImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageModelImpl.java new file mode 100644 index 000000000000..57b326abe581 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageModelImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import com.azure.resourcemanager.securityinsights.models.ProductPackageModel; +import java.time.LocalDate; +import java.util.Collections; +import java.util.List; + +public final class ProductPackageModelImpl implements ProductPackageModel { + private ProductPackageModelInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + ProductPackageModelImpl(ProductPackageModelInner 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 contentId() { + return this.innerModel().contentId(); + } + + public String contentProductId() { + return this.innerModel().contentProductId(); + } + + public PackageKind contentKind() { + return this.innerModel().contentKind(); + } + + public String contentSchemaVersion() { + return this.innerModel().contentSchemaVersion(); + } + + public Flag isNew() { + return this.innerModel().isNew(); + } + + public Flag isPreview() { + return this.innerModel().isPreview(); + } + + public Flag isFeatured() { + return this.innerModel().isFeatured(); + } + + public Flag isDeprecated() { + return this.innerModel().isDeprecated(); + } + + public String version() { + return this.innerModel().version(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String publisherDisplayName() { + return this.innerModel().publisherDisplayName(); + } + + 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 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 MetadataCategories categories() { + return this.innerModel().categories(); + } + + public List threatAnalysisTactics() { + List inner = this.innerModel().threatAnalysisTactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List threatAnalysisTechniques() { + List inner = this.innerModel().threatAnalysisTechniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String icon() { + return this.innerModel().icon(); + } + + public String installedVersion() { + return this.innerModel().installedVersion(); + } + + public String metadataResourceId() { + return this.innerModel().metadataResourceId(); + } + + public Object packagedContent() { + return this.innerModel().packagedContent(); + } + + public ProductPackageModelInner 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/ProductPackagesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesClientImpl.java new file mode 100644 index 000000000000..a41f8e4ccd71 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesClientImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ProductPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProductPackagesClient. + */ +public final class ProductPackagesClientImpl implements ProductPackagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProductPackagesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ProductPackagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductPackagesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(ProductPackagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientProductPackages to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientProductPackages") + public interface ProductPackagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductPackages/{packageId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductPackages/{packageId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("packageId") String packageId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String packageId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, packageId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String packageId) { + return getWithResponseAsync(resourceGroupName, workspaceName, packageId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String packageId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, packageId, accept, context); + } + + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductPackageModelInner get(String resourceGroupName, String workspaceName, String packageId) { + return getWithResponse(resourceGroupName, workspaceName, packageId, Context.NONE).getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java new file mode 100644 index 000000000000..65b914f40918 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductPackageModel; +import com.azure.resourcemanager.securityinsights.models.ProductPackages; + +public final class ProductPackagesImpl implements ProductPackages { + private static final ClientLogger LOGGER = new ClientLogger(ProductPackagesImpl.class); + + private final ProductPackagesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ProductPackagesImpl(ProductPackagesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String packageId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, packageId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProductPackageModelImpl(inner.getValue(), this.manager())); + } + + public ProductPackageModel get(String resourceGroupName, String workspaceName, String packageId) { + ProductPackageModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName, packageId); + if (inner != null) { + return new ProductPackageModelImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProductPackagesClient 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/ProductPackagesOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsClientImpl.java new file mode 100644 index 000000000000..5346d27ad99a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsClientImpl.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ProductPackagesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.azure.resourcemanager.securityinsights.implementation.models.ProductPackageList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProductPackagesOperationsClient. + */ +public final class ProductPackagesOperationsClientImpl implements ProductPackagesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProductPackagesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ProductPackagesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductPackagesOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(ProductPackagesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientProductPackagesOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientProductPackagesOperations") + public interface ProductPackagesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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, + @QueryParam("$search") String search, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductPackages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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, + @QueryParam("$search") String search, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 search Searches for a substring in the response. 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String filter, String orderby, Integer top, String skipToken, String search) { + 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, + search, 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 search Searches for a substring in the response. 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, String search) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, search), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedFlux}. + */ + @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; + final String search = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, search), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 search Searches for a substring in the response. 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, String skipToken, String search) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, search, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 search Searches for a substring in the response. 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, Integer top, String skipToken, String search, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, orderby, top, skipToken, search, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedIterable}. + */ + @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; + final String search = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken, search), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 search Searches for a substring in the response. 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, String search, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, top, skipToken, search, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ProductPackagesOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsImpl.java new file mode 100644 index 000000000000..95cb34dcdaba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductPackagesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductPackageModel; +import com.azure.resourcemanager.securityinsights.models.ProductPackagesOperations; + +public final class ProductPackagesOperationsImpl implements ProductPackagesOperations { + private static final ClientLogger LOGGER = new ClientLogger(ProductPackagesOperationsImpl.class); + + private final ProductPackagesOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ProductPackagesOperationsImpl(ProductPackagesOperationsClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new ProductPackageModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, String search, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, filter, orderby, top, skipToken, search, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductPackageModelImpl(inner1, this.manager())); + } + + private ProductPackagesOperationsClient 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..856eceaaeef0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsClientImpl.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ProductSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.implementation.models.SettingList; +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 { + /** + * The proxy service used to perform REST calls. + */ + private final ProductSettingsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ProductSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductSettingsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(ProductSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientProductSettings to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientProductSettings") + public interface ProductSettingsService { + @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("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SettingsInner settings, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SettingsInner settings, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsName") String settingsName, Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String settingsName) { + return getWithResponseAsync(resourceGroupName, workspaceName, settingsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, String settingsName, + Context context) { + final String accept = "application/json"; + return service.getSync(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) + public SettingsInner get(String resourceGroupName, String workspaceName, String settingsName) { + return getWithResponse(resourceGroupName, workspaceName, settingsName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName, SettingsInner settings) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsName, contentType, accept, + settings, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String workspaceName, String settingsName, + SettingsInner settings) { + return updateWithResponseAsync(resourceGroupName, workspaceName, settingsName, settings) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String workspaceName, + String settingsName, SettingsInner settings, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsName, contentType, accept, + settings, 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) + public SettingsInner update(String resourceGroupName, String workspaceName, String settingsName, + SettingsInner settings) { + return updateWithResponse(resourceGroupName, workspaceName, settingsName, settings, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String settingsName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String settingsName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, settingsName).flatMap(ignored -> 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. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String settingsName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsName, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String settingsName) { + deleteWithResponse(resourceGroupName, workspaceName, settingsName, Context.NONE); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + 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())); + } + + /** + * 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ProductSettingsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsImpl.java new file mode 100644 index 000000000000..9e46df65e1e8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.models.ProductSettings; +import com.azure.resourcemanager.securityinsights.models.Settings; + +public final class ProductSettingsImpl implements ProductSettings { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, String settingsName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, settingsName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingsImpl(inner.getValue(), this.manager())); + } + + 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 updateWithResponse(String resourceGroupName, String workspaceName, String settingsName, + SettingsInner settings, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, workspaceName, settingsName, settings, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SettingsImpl(inner.getValue(), this.manager())); + } + + 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 deleteWithResponse(String resourceGroupName, String workspaceName, String settingsName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, settingsName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String settingsName) { + this.serviceClient().delete(resourceGroupName, workspaceName, settingsName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SettingsImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SettingsImpl(inner1, this.manager())); + } + + 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/ProductTemplateModelImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplateModelImpl.java new file mode 100644 index 000000000000..ad627a01d747 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplateModelImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateModel; +import java.time.LocalDate; +import java.util.Collections; +import java.util.List; + +public final class ProductTemplateModelImpl implements ProductTemplateModel { + private ProductTemplateModelInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + ProductTemplateModelImpl(ProductTemplateModelInner 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 contentId() { + return this.innerModel().contentId(); + } + + public String contentProductId() { + return this.innerModel().contentProductId(); + } + + public String packageVersion() { + return this.innerModel().packageVersion(); + } + + public String version() { + return this.innerModel().version(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public Kind contentKind() { + return this.innerModel().contentKind(); + } + + 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 String customVersion() { + return this.innerModel().customVersion(); + } + + public String contentSchemaVersion() { + return this.innerModel().contentSchemaVersion(); + } + + public String icon() { + return this.innerModel().icon(); + } + + public List threatAnalysisTactics() { + List inner = this.innerModel().threatAnalysisTactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List threatAnalysisTechniques() { + List inner = this.innerModel().threatAnalysisTechniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List previewImages() { + List inner = this.innerModel().previewImages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List previewImagesDark() { + List inner = this.innerModel().previewImagesDark(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String packageId() { + return this.innerModel().packageId(); + } + + public PackageKind packageKind() { + return this.innerModel().packageKind(); + } + + public String packageName() { + return this.innerModel().packageName(); + } + + public Flag isDeprecated() { + return this.innerModel().isDeprecated(); + } + + public Object packagedContent() { + return this.innerModel().packagedContent(); + } + + public ProductTemplateModelInner 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/ProductTemplatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesClientImpl.java new file mode 100644 index 000000000000..09fd3f0dcba0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesClientImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ProductTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProductTemplatesClient. + */ +public final class ProductTemplatesClientImpl implements ProductTemplatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProductTemplatesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ProductTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductTemplatesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(ProductTemplatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientProductTemplates to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientProductTemplates") + public interface ProductTemplatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentproducttemplates/{templateId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentproducttemplates/{templateId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("templateId") String templateId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String templateId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, templateId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String templateId) { + return getWithResponseAsync(resourceGroupName, workspaceName, templateId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String templateId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, templateId, accept, context); + } + + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProductTemplateModelInner get(String resourceGroupName, String workspaceName, String templateId) { + return getWithResponse(resourceGroupName, workspaceName, templateId, Context.NONE).getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java new file mode 100644 index 000000000000..1511c8a8b399 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateModel; +import com.azure.resourcemanager.securityinsights.models.ProductTemplates; + +public final class ProductTemplatesImpl implements ProductTemplates { + private static final ClientLogger LOGGER = new ClientLogger(ProductTemplatesImpl.class); + + private final ProductTemplatesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ProductTemplatesImpl(ProductTemplatesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String templateId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, templateId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProductTemplateModelImpl(inner.getValue(), this.manager())); + } + + public ProductTemplateModel get(String resourceGroupName, String workspaceName, String templateId) { + ProductTemplateModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName, templateId); + if (inner != null) { + return new ProductTemplateModelImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProductTemplatesClient 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/ProductTemplatesOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsClientImpl.java new file mode 100644 index 000000000000..a378b374f979 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsClientImpl.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ProductTemplatesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.azure.resourcemanager.securityinsights.implementation.models.ProductTemplateList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProductTemplatesOperationsClient. + */ +public final class ProductTemplatesOperationsClientImpl implements ProductTemplatesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProductTemplatesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ProductTemplatesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProductTemplatesOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(ProductTemplatesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientProductTemplatesOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientProductTemplatesOperations") + public interface ProductTemplatesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/contentProductTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") 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("$search") String search, @QueryParam("$count") Boolean count, @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, @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/contentProductTemplates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("$search") String search, @QueryParam("$count") Boolean count, @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 templates in the catalog along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String filter, String orderby, String search, Boolean count, Integer top, Integer skip, + String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, search, count, top, + skip, 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 templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 templates in the catalog as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String filter, String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 templates in the catalog as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final String search = null; + final Boolean count = null; + final Integer top = null; + final Integer skip = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 templates in the catalog along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, search, count, top, + skip, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 templates in the catalog along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String filter, String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, filter, orderby, search, count, top, + skip, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 templates in the catalog as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String filter = null; + final String orderby = null; + final String search = null; + final Boolean count = null; + final Integer top = null; + final Integer skip = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 templates in the catalog as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, filter, orderby, search, + count, top, skip, skipToken, context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 templates in the catalog along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 templates in the catalog along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 templates in the catalog along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ProductTemplatesOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsImpl.java new file mode 100644 index 000000000000..bc1fd1b46254 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ProductTemplatesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateModel; +import com.azure.resourcemanager.securityinsights.models.ProductTemplatesOperations; + +public final class ProductTemplatesOperationsImpl implements ProductTemplatesOperations { + private static final ClientLogger LOGGER = new ClientLogger(ProductTemplatesOperationsImpl.class); + + private final ProductTemplatesOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ProductTemplatesOperationsImpl(ProductTemplatesOperationsClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new ProductTemplateModelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, filter, orderby, search, count, top, skip, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductTemplateModelImpl(inner1, this.manager())); + } + + private ProductTemplatesOperationsClient 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/RecommendationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RecommendationImpl.java new file mode 100644 index 000000000000..d58c6127808d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RecommendationImpl.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.models.Recommendation; +import com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion; +import com.azure.resourcemanager.securityinsights.models.State; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class RecommendationImpl implements Recommendation { + private RecommendationInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + RecommendationImpl(RecommendationInner 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 recommendationTypeId() { + return this.innerModel().recommendationTypeId(); + } + + public State state() { + return this.innerModel().state(); + } + + public String title() { + return this.innerModel().title(); + } + + public String description() { + return this.innerModel().description(); + } + + public OffsetDateTime creationTimeUtc() { + return this.innerModel().creationTimeUtc(); + } + + public OffsetDateTime lastEvaluatedTimeUtc() { + return this.innerModel().lastEvaluatedTimeUtc(); + } + + public OffsetDateTime lastModifiedTimeUtc() { + return this.innerModel().lastModifiedTimeUtc(); + } + + public List suggestions() { + List inner = this.innerModel().suggestions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public Map additionalProperties() { + Map inner = this.innerModel().additionalProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RecommendationInner 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/ReevaluateResponseImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluateResponseImpl.java new file mode 100644 index 000000000000..ac7c0a762d0b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluateResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner; +import com.azure.resourcemanager.securityinsights.models.ReevaluateResponse; +import java.time.OffsetDateTime; + +public final class ReevaluateResponseImpl implements ReevaluateResponse { + private ReevaluateResponseInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + ReevaluateResponseImpl(ReevaluateResponseInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OffsetDateTime lastEvaluatedTimeUtc() { + return this.innerModel().lastEvaluatedTimeUtc(); + } + + public ReevaluateResponseInner 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/ReevaluatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesClientImpl.java new file mode 100644 index 000000000000..43534d4959c0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesClientImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +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.resourcemanager.securityinsights.fluent.ReevaluatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ReevaluatesClient. + */ +public final class ReevaluatesClientImpl implements ReevaluatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ReevaluatesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ReevaluatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReevaluatesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(ReevaluatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientReevaluates to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientReevaluates") + public interface ReevaluatesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}/triggerEvaluation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> recommendation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") String recommendationId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}/triggerEvaluation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response recommendationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") String recommendationId, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> recommendationWithResponseAsync(String resourceGroupName, + String workspaceName, String recommendationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.recommendation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recommendationAsync(String resourceGroupName, String workspaceName, + String recommendationId) { + return recommendationWithResponseAsync(resourceGroupName, workspaceName, recommendationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, Context context) { + final String accept = "application/json"; + return service.recommendationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, accept, context); + } + + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReevaluateResponseInner recommendation(String resourceGroupName, String workspaceName, + String recommendationId) { + return recommendationWithResponse(resourceGroupName, workspaceName, recommendationId, Context.NONE).getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesImpl.java new file mode 100644 index 000000000000..d8d08e9cf59b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ReevaluatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner; +import com.azure.resourcemanager.securityinsights.models.ReevaluateResponse; +import com.azure.resourcemanager.securityinsights.models.Reevaluates; + +public final class ReevaluatesImpl implements Reevaluates { + private static final ClientLogger LOGGER = new ClientLogger(ReevaluatesImpl.class); + + private final ReevaluatesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ReevaluatesImpl(ReevaluatesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, Context context) { + Response inner = this.serviceClient() + .recommendationWithResponse(resourceGroupName, workspaceName, recommendationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReevaluateResponseImpl(inner.getValue(), this.manager())); + } + + public ReevaluateResponse recommendation(String resourceGroupName, String workspaceName, String recommendationId) { + ReevaluateResponseInner inner + = this.serviceClient().recommendation(resourceGroupName, workspaceName, recommendationId); + if (inner != null) { + return new ReevaluateResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ReevaluatesClient 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 index bd0182732144..4d24b7ab162c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -66,21 +66,21 @@ private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manag private String workspaceName; - private String incidentId; + private String bookmarkId; private String relationName; - public RelationImpl withExistingIncident(String resourceGroupName, String workspaceName, String incidentId) { + public RelationImpl withExistingBookmark(String resourceGroupName, String workspaceName, String bookmarkId) { this.resourceGroupName = resourceGroupName; this.workspaceName = workspaceName; - this.incidentId = incidentId; + this.bookmarkId = bookmarkId; return this; } public Relation create() { this.innerObject = serviceManager.serviceClient() - .getIncidentRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), Context.NONE) .getValue(); return this; @@ -88,8 +88,8 @@ public Relation create() { public Relation create(Context context) { this.innerObject = serviceManager.serviceClient() - .getIncidentRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), context) .getValue(); return this; @@ -107,8 +107,8 @@ public RelationImpl update() { public Relation apply() { this.innerObject = serviceManager.serviceClient() - .getIncidentRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), Context.NONE) .getValue(); return this; @@ -116,8 +116,8 @@ public Relation apply() { public Relation apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getIncidentRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), + .getBookmarkRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), context) .getValue(); return this; @@ -129,22 +129,22 @@ public Relation apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.incidentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "incidents"); + this.bookmarkId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bookmarks"); this.relationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "relations"); } public Relation refresh() { this.innerObject = serviceManager.serviceClient() - .getIncidentRelations() - .getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE) + .getBookmarkRelations() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE) .getValue(); return this; } public Relation refresh(Context context) { this.innerObject = serviceManager.serviceClient() - .getIncidentRelations() - .getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context) + .getBookmarkRelations() + .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context) .getValue(); 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..2aef3d87a2e5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RepoImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Long installationId() { + return this.innerModel().installationId(); + } + + 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/ResourceManagerUtils.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceManagerUtils.java index 53ba99bb2a06..810565cb6819 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceManagerUtils.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 000000000000..f3e2c1052294 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.resourcemanager.securityinsights.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** + * The proxy service used to perform REST calls. + */ + private final ResourceProvidersService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientResourceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientResourceProviders") + public interface ResourceProvidersService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/enrichment/{enrichmentType}/listGeodataByIp") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGeodataByIp(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("enrichmentType") EnrichmentType enrichmentType, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EnrichmentIpAddressBody ipAddressBody, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/enrichment/{enrichmentType}/listGeodataByIp") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listGeodataByIpSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("enrichmentType") EnrichmentType enrichmentType, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EnrichmentIpAddressBody ipAddressBody, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/enrichment/{enrichmentType}/listWhoisByDomain") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listWhoisByDomain(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("enrichmentType") EnrichmentType enrichmentType, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EnrichmentDomainBody domainBody, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/enrichment/{enrichmentType}/listWhoisByDomain") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listWhoisByDomainSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("enrichmentType") EnrichmentType enrichmentType, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EnrichmentDomainBody domainBody, + Context context); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGeodataByIpWithResponseAsync(String resourceGroupName, + String workspaceName, EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGeodataByIp(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, contentType, accept, + ipAddressBody, 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 workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listGeodataByIpAsync(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody) { + return listGeodataByIpWithResponseAsync(resourceGroupName, workspaceName, enrichmentType, ipAddressBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listGeodataByIpWithResponse(String resourceGroupName, + String workspaceName, EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listGeodataByIpSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, contentType, accept, + ipAddressBody, context); + } + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 listGeodataByIp(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody) { + return listGeodataByIpWithResponse(resourceGroupName, workspaceName, enrichmentType, ipAddressBody, + Context.NONE).getValue(); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWhoisByDomainWithResponseAsync(String resourceGroupName, + String workspaceName, EnrichmentType enrichmentType, EnrichmentDomainBody domainBody) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listWhoisByDomain(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, contentType, accept, + domainBody, 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 workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listWhoisByDomainAsync(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody) { + return listWhoisByDomainWithResponseAsync(resourceGroupName, workspaceName, enrichmentType, domainBody) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWhoisByDomainWithResponse(String resourceGroupName, + String workspaceName, EnrichmentType enrichmentType, EnrichmentDomainBody domainBody, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.listWhoisByDomainSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, enrichmentType, contentType, accept, + domainBody, context); + } + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 listWhoisByDomain(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody) { + return listWhoisByDomainWithResponse(resourceGroupName, workspaceName, enrichmentType, domainBody, Context.NONE) + .getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersImpl.java new file mode 100644 index 000000000000..a60074e70e31 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ResourceProvidersClient; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhois; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpGeodata; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; +import com.azure.resourcemanager.securityinsights.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ResourceProvidersImpl(ResourceProvidersClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listGeodataByIpWithResponse(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody, Context context) { + Response inner = this.serviceClient() + .listGeodataByIpWithResponse(resourceGroupName, workspaceName, enrichmentType, ipAddressBody, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnrichmentIpGeodataImpl(inner.getValue(), this.manager())); + } + + public EnrichmentIpGeodata listGeodataByIp(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody) { + EnrichmentIpGeodataInner inner + = this.serviceClient().listGeodataByIp(resourceGroupName, workspaceName, enrichmentType, ipAddressBody); + if (inner != null) { + return new EnrichmentIpGeodataImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWhoisByDomainWithResponse(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody, Context context) { + Response inner = this.serviceClient() + .listWhoisByDomainWithResponse(resourceGroupName, workspaceName, enrichmentType, domainBody, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnrichmentDomainWhoisImpl(inner.getValue(), this.manager())); + } + + public EnrichmentDomainWhois listWhoisByDomain(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody) { + EnrichmentDomainWhoisInner inner + = this.serviceClient().listWhoisByDomain(resourceGroupName, workspaceName, enrichmentType, domainBody); + if (inner != null) { + return new EnrichmentDomainWhoisImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient 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/SecurityInsightsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java deleted file mode 100644 index 5888fc900e7b..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsImpl.java +++ /dev/null @@ -1,544 +0,0 @@ -// Copyright (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.HttpHeaderName; -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.CoreUtils; -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.BookmarksClient; -import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient; -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.OperationsClient; -import com.azure.resourcemanager.securityinsights.fluent.SecurityInsights; -import com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient; -import com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient; -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 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 { - /** - * 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 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 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 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 SecurityMLAnalyticsSettingsClient object to access its operations. - */ - private final SecurityMLAnalyticsSettingsClient securityMLAnalyticsSettings; - - /** - * Gets the SecurityMLAnalyticsSettingsClient object to access its operations. - * - * @return the SecurityMLAnalyticsSettingsClient object. - */ - public SecurityMLAnalyticsSettingsClient getSecurityMLAnalyticsSettings() { - return this.securityMLAnalyticsSettings; - } - - /** - * 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 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 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; - } - - /** - * 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 = "2022-11-01"; - 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.dataConnectors = new DataConnectorsClientImpl(this); - this.incidents = new IncidentsClientImpl(this); - this.incidentComments = new IncidentCommentsClientImpl(this); - this.incidentRelations = new IncidentRelationsClientImpl(this); - this.sentinelOnboardingStates = new SentinelOnboardingStatesClientImpl(this); - this.securityMLAnalyticsSettings = new SecurityMLAnalyticsSettingsClientImpl(this); - this.threatIntelligenceIndicators = new ThreatIntelligenceIndicatorsClientImpl(this); - this.threatIntelligenceIndicatorsOperations = new ThreatIntelligenceIndicatorsOperationsClientImpl(this); - this.threatIntelligenceIndicatorMetrics = new ThreatIntelligenceIndicatorMetricsClientImpl(this); - this.watchlists = new WatchlistsClientImpl(this); - this.watchlistItems = new WatchlistItemsClientImpl(this); - this.operations = new OperationsClientImpl(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) { - return CoreUtils.mergeContexts(this.getContext(), 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(HttpHeaderName.fromString(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)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityInsightsImpl.class); -} 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/SecurityInsightsManagementClientBuilder.java similarity index 63% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsBuilder.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsManagementClientBuilder.java index 4fa4da61617c..bf9f04f97975 100644 --- 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/SecurityInsightsManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the SecurityInsightsImpl type. + * A builder for creating a new instance of the SecurityInsightsManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { SecurityInsightsImpl.class }) -public final class SecurityInsightsBuilder { +@ServiceClientBuilder(serviceClients = { SecurityInsightsManagementClientImpl.class }) +public final class SecurityInsightsManagementClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the SecurityInsightsBuilder. + * @param endpoint the endpoint value. + * @return the SecurityInsightsManagementClientBuilder. */ - public SecurityInsightsBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public SecurityInsightsManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the SecurityInsightsBuilder. + * @param subscriptionId the subscriptionId value. + * @return the SecurityInsightsManagementClientBuilder. */ - public SecurityInsightsBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public SecurityInsightsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public SecurityInsightsBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the SecurityInsightsBuilder. + * @return the SecurityInsightsManagementClientBuilder. */ - public SecurityInsightsBuilder environment(AzureEnvironment environment) { + public SecurityInsightsManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public SecurityInsightsBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the SecurityInsightsBuilder. + * @return the SecurityInsightsManagementClientBuilder. */ - public SecurityInsightsBuilder pipeline(HttpPipeline pipeline) { + public SecurityInsightsManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public SecurityInsightsBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the SecurityInsightsBuilder. + * @return the SecurityInsightsManagementClientBuilder. */ - public SecurityInsightsBuilder defaultPollInterval(Duration defaultPollInterval) { + public SecurityInsightsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public SecurityInsightsBuilder defaultPollInterval(Duration defaultPollInterval) * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the SecurityInsightsBuilder. + * @return the SecurityInsightsManagementClientBuilder. */ - public SecurityInsightsBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public SecurityInsightsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of SecurityInsightsImpl with the provided parameters. + * Builds an instance of SecurityInsightsManagementClientImpl with the provided parameters. * - * @return an instance of SecurityInsightsImpl. + * @return an instance of SecurityInsightsManagementClientImpl. */ - public SecurityInsightsImpl buildClient() { + public SecurityInsightsManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public SecurityInsightsImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - SecurityInsightsImpl client = new SecurityInsightsImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + SecurityInsightsManagementClientImpl client = new SecurityInsightsManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsManagementClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsManagementClientImpl.java new file mode 100644 index 000000000000..6a87577ac199 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsManagementClientImpl.java @@ -0,0 +1,1252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +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.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +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.polling.SyncPoller; +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.AlertRuleOperationsClient; +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.BillingStatisticsClient; +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.ContentPackageOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ContentPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsCheckRequirementsOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient; +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.FileImportsClient; +import com.azure.resourcemanager.securityinsights.fluent.GetRecommendationsClient; +import com.azure.resourcemanager.securityinsights.fluent.GetTriggeredAnalyticsRuleRunsClient; +import com.azure.resourcemanager.securityinsights.fluent.GetsClient; +import com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.HuntsClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient; +import com.azure.resourcemanager.securityinsights.fluent.IncidentsClient; +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.ProductPackagesClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductPackagesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesClient; +import com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.ReevaluatesClient; +import com.azure.resourcemanager.securityinsights.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.securityinsights.fluent.SecurityInsightsManagementClient; +import com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient; +import com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient; +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.ThreatIntelligencesClient; +import com.azure.resourcemanager.securityinsights.fluent.TriggeredAnalyticsRuleRunOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.UpdatesClient; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient; +import com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient; +import com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient; +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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the SecurityInsightsManagementClientImpl type. + */ +@ServiceClient(builder = SecurityInsightsManagementClientBuilder.class) +public final class SecurityInsightsManagementClientImpl implements SecurityInsightsManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * 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 ResourceProvidersClient object to access its operations. + */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** + * 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 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 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 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 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 DataConnectorDefinitionsClient object to access its operations. + */ + private final DataConnectorDefinitionsClient dataConnectorDefinitions; + + /** + * Gets the DataConnectorDefinitionsClient object to access its operations. + * + * @return the DataConnectorDefinitionsClient object. + */ + public DataConnectorDefinitionsClient getDataConnectorDefinitions() { + return this.dataConnectorDefinitions; + } + + /** + * 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 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 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 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 IncidentTasksClient object to access its operations. + */ + private final IncidentTasksClient incidentTasks; + + /** + * Gets the IncidentTasksClient object to access its operations. + * + * @return the IncidentTasksClient object. + */ + public IncidentTasksClient getIncidentTasks() { + return this.incidentTasks; + } + + /** + * 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 SecurityMLAnalyticsSettingsClient object to access its operations. + */ + private final SecurityMLAnalyticsSettingsClient securityMLAnalyticsSettings; + + /** + * Gets the SecurityMLAnalyticsSettingsClient object to access its operations. + * + * @return the SecurityMLAnalyticsSettingsClient object. + */ + public SecurityMLAnalyticsSettingsClient getSecurityMLAnalyticsSettings() { + return this.securityMLAnalyticsSettings; + } + + /** + * 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 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 BillingStatisticsClient object to access its operations. + */ + private final BillingStatisticsClient billingStatistics; + + /** + * Gets the BillingStatisticsClient object to access its operations. + * + * @return the BillingStatisticsClient object. + */ + public BillingStatisticsClient getBillingStatistics() { + return this.billingStatistics; + } + + /** + * 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 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 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; + } + + /** + * The FileImportsClient object to access its operations. + */ + private final FileImportsClient fileImports; + + /** + * Gets the FileImportsClient object to access its operations. + * + * @return the FileImportsClient object. + */ + public FileImportsClient getFileImports() { + return this.fileImports; + } + + /** + * The HuntsClient object to access its operations. + */ + private final HuntsClient hunts; + + /** + * Gets the HuntsClient object to access its operations. + * + * @return the HuntsClient object. + */ + public HuntsClient getHunts() { + return this.hunts; + } + + /** + * The HuntCommentsClient object to access its operations. + */ + private final HuntCommentsClient huntComments; + + /** + * Gets the HuntCommentsClient object to access its operations. + * + * @return the HuntCommentsClient object. + */ + public HuntCommentsClient getHuntComments() { + return this.huntComments; + } + + /** + * The HuntRelationsClient object to access its operations. + */ + private final HuntRelationsClient huntRelations; + + /** + * Gets the HuntRelationsClient object to access its operations. + * + * @return the HuntRelationsClient object. + */ + public HuntRelationsClient getHuntRelations() { + return this.huntRelations; + } + + /** + * 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 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 TriggeredAnalyticsRuleRunOperationsClient object to access its operations. + */ + private final TriggeredAnalyticsRuleRunOperationsClient triggeredAnalyticsRuleRunOperations; + + /** + * Gets the TriggeredAnalyticsRuleRunOperationsClient object to access its operations. + * + * @return the TriggeredAnalyticsRuleRunOperationsClient object. + */ + public TriggeredAnalyticsRuleRunOperationsClient getTriggeredAnalyticsRuleRunOperations() { + return this.triggeredAnalyticsRuleRunOperations; + } + + /** + * The WorkspaceManagerAssignmentsClient object to access its operations. + */ + private final WorkspaceManagerAssignmentsClient workspaceManagerAssignments; + + /** + * Gets the WorkspaceManagerAssignmentsClient object to access its operations. + * + * @return the WorkspaceManagerAssignmentsClient object. + */ + public WorkspaceManagerAssignmentsClient getWorkspaceManagerAssignments() { + return this.workspaceManagerAssignments; + } + + /** + * The WorkspaceManagerConfigurationsClient object to access its operations. + */ + private final WorkspaceManagerConfigurationsClient workspaceManagerConfigurations; + + /** + * Gets the WorkspaceManagerConfigurationsClient object to access its operations. + * + * @return the WorkspaceManagerConfigurationsClient object. + */ + public WorkspaceManagerConfigurationsClient getWorkspaceManagerConfigurations() { + return this.workspaceManagerConfigurations; + } + + /** + * The WorkspaceManagerGroupsClient object to access its operations. + */ + private final WorkspaceManagerGroupsClient workspaceManagerGroups; + + /** + * Gets the WorkspaceManagerGroupsClient object to access its operations. + * + * @return the WorkspaceManagerGroupsClient object. + */ + public WorkspaceManagerGroupsClient getWorkspaceManagerGroups() { + return this.workspaceManagerGroups; + } + + /** + * The WorkspaceManagerMembersClient object to access its operations. + */ + private final WorkspaceManagerMembersClient workspaceManagerMembers; + + /** + * Gets the WorkspaceManagerMembersClient object to access its operations. + * + * @return the WorkspaceManagerMembersClient object. + */ + public WorkspaceManagerMembersClient getWorkspaceManagerMembers() { + return this.workspaceManagerMembers; + } + + /** + * The AlertRuleOperationsClient object to access its operations. + */ + private final AlertRuleOperationsClient alertRuleOperations; + + /** + * Gets the AlertRuleOperationsClient object to access its operations. + * + * @return the AlertRuleOperationsClient object. + */ + public AlertRuleOperationsClient getAlertRuleOperations() { + return this.alertRuleOperations; + } + + /** + * 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 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 ContentPackagesClient object to access its operations. + */ + private final ContentPackagesClient contentPackages; + + /** + * Gets the ContentPackagesClient object to access its operations. + * + * @return the ContentPackagesClient object. + */ + public ContentPackagesClient getContentPackages() { + return this.contentPackages; + } + + /** + * The ContentPackageOperationsClient object to access its operations. + */ + private final ContentPackageOperationsClient contentPackageOperations; + + /** + * Gets the ContentPackageOperationsClient object to access its operations. + * + * @return the ContentPackageOperationsClient object. + */ + public ContentPackageOperationsClient getContentPackageOperations() { + return this.contentPackageOperations; + } + + /** + * The ProductPackagesClient object to access its operations. + */ + private final ProductPackagesClient productPackages; + + /** + * Gets the ProductPackagesClient object to access its operations. + * + * @return the ProductPackagesClient object. + */ + public ProductPackagesClient getProductPackages() { + return this.productPackages; + } + + /** + * The ProductPackagesOperationsClient object to access its operations. + */ + private final ProductPackagesOperationsClient productPackagesOperations; + + /** + * Gets the ProductPackagesOperationsClient object to access its operations. + * + * @return the ProductPackagesOperationsClient object. + */ + public ProductPackagesOperationsClient getProductPackagesOperations() { + return this.productPackagesOperations; + } + + /** + * The ProductTemplatesClient object to access its operations. + */ + private final ProductTemplatesClient productTemplates; + + /** + * Gets the ProductTemplatesClient object to access its operations. + * + * @return the ProductTemplatesClient object. + */ + public ProductTemplatesClient getProductTemplates() { + return this.productTemplates; + } + + /** + * The ProductTemplatesOperationsClient object to access its operations. + */ + private final ProductTemplatesOperationsClient productTemplatesOperations; + + /** + * Gets the ProductTemplatesOperationsClient object to access its operations. + * + * @return the ProductTemplatesOperationsClient object. + */ + public ProductTemplatesOperationsClient getProductTemplatesOperations() { + return this.productTemplatesOperations; + } + + /** + * The ContentTemplatesClient object to access its operations. + */ + private final ContentTemplatesClient contentTemplates; + + /** + * Gets the ContentTemplatesClient object to access its operations. + * + * @return the ContentTemplatesClient object. + */ + public ContentTemplatesClient getContentTemplates() { + return this.contentTemplates; + } + + /** + * The ContentTemplatesOperationsClient object to access its operations. + */ + private final ContentTemplatesOperationsClient contentTemplatesOperations; + + /** + * Gets the ContentTemplatesOperationsClient object to access its operations. + * + * @return the ContentTemplatesOperationsClient object. + */ + public ContentTemplatesOperationsClient getContentTemplatesOperations() { + return this.contentTemplatesOperations; + } + + /** + * 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 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 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 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 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 SourceControlOperationsClient object to access its operations. + */ + private final SourceControlOperationsClient sourceControlOperations; + + /** + * Gets the SourceControlOperationsClient object to access its operations. + * + * @return the SourceControlOperationsClient object. + */ + public SourceControlOperationsClient getSourceControlOperations() { + return this.sourceControlOperations; + } + + /** + * 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 ThreatIntelligencesClient object to access its operations. + */ + private final ThreatIntelligencesClient threatIntelligences; + + /** + * Gets the ThreatIntelligencesClient object to access its operations. + * + * @return the ThreatIntelligencesClient object. + */ + public ThreatIntelligencesClient getThreatIntelligences() { + return this.threatIntelligences; + } + + /** + * 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 GetsClient object to access its operations. + */ + private final GetsClient gets; + + /** + * Gets the GetsClient object to access its operations. + * + * @return the GetsClient object. + */ + public GetsClient getGets() { + return this.gets; + } + + /** + * The UpdatesClient object to access its operations. + */ + private final UpdatesClient updates; + + /** + * Gets the UpdatesClient object to access its operations. + * + * @return the UpdatesClient object. + */ + public UpdatesClient getUpdates() { + return this.updates; + } + + /** + * The GetRecommendationsClient object to access its operations. + */ + private final GetRecommendationsClient getRecommendations; + + /** + * Gets the GetRecommendationsClient object to access its operations. + * + * @return the GetRecommendationsClient object. + */ + public GetRecommendationsClient getGetRecommendations() { + return this.getRecommendations; + } + + /** + * The ReevaluatesClient object to access its operations. + */ + private final ReevaluatesClient reevaluates; + + /** + * Gets the ReevaluatesClient object to access its operations. + * + * @return the ReevaluatesClient object. + */ + public ReevaluatesClient getReevaluates() { + return this.reevaluates; + } + + /** + * The GetTriggeredAnalyticsRuleRunsClient object to access its operations. + */ + private final GetTriggeredAnalyticsRuleRunsClient getTriggeredAnalyticsRuleRuns; + + /** + * Gets the GetTriggeredAnalyticsRuleRunsClient object to access its operations. + * + * @return the GetTriggeredAnalyticsRuleRunsClient object. + */ + public GetTriggeredAnalyticsRuleRunsClient getGetTriggeredAnalyticsRuleRuns() { + return this.getTriggeredAnalyticsRuleRuns; + } + + /** + * The WorkspaceManagerAssignmentJobsClient object to access its operations. + */ + private final WorkspaceManagerAssignmentJobsClient workspaceManagerAssignmentJobs; + + /** + * Gets the WorkspaceManagerAssignmentJobsClient object to access its operations. + * + * @return the WorkspaceManagerAssignmentJobsClient object. + */ + public WorkspaceManagerAssignmentJobsClient getWorkspaceManagerAssignmentJobs() { + return this.workspaceManagerAssignmentJobs; + } + + /** + * Initializes an instance of SecurityInsightsManagementClient 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 endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + SecurityInsightsManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-10-01-preview"; + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.alertRules = new AlertRulesClientImpl(this); + this.alertRuleTemplates = new AlertRuleTemplatesClientImpl(this); + this.automationRules = new AutomationRulesClientImpl(this); + this.incidents = new IncidentsClientImpl(this); + this.bookmarks = new BookmarksClientImpl(this); + this.dataConnectorDefinitions = new DataConnectorDefinitionsClientImpl(this); + this.dataConnectors = new DataConnectorsClientImpl(this); + this.incidentComments = new IncidentCommentsClientImpl(this); + this.bookmarkRelations = new BookmarkRelationsClientImpl(this); + this.entityRelations = new EntityRelationsClientImpl(this); + this.incidentTasks = new IncidentTasksClientImpl(this); + this.sentinelOnboardingStates = new SentinelOnboardingStatesClientImpl(this); + this.securityMLAnalyticsSettings = new SecurityMLAnalyticsSettingsClientImpl(this); + this.sourceControls = new SourceControlsClientImpl(this); + this.watchlists = new WatchlistsClientImpl(this); + this.watchlistItems = new WatchlistItemsClientImpl(this); + this.billingStatistics = new BillingStatisticsClientImpl(this); + this.entities = new EntitiesClientImpl(this); + this.entityQueries = new EntityQueriesClientImpl(this); + this.entityQueryTemplates = new EntityQueryTemplatesClientImpl(this); + this.fileImports = new FileImportsClientImpl(this); + this.hunts = new HuntsClientImpl(this); + this.huntComments = new HuntCommentsClientImpl(this); + this.huntRelations = new HuntRelationsClientImpl(this); + this.officeConsents = new OfficeConsentsClientImpl(this); + this.productSettings = new ProductSettingsClientImpl(this); + this.triggeredAnalyticsRuleRunOperations = new TriggeredAnalyticsRuleRunOperationsClientImpl(this); + this.workspaceManagerAssignments = new WorkspaceManagerAssignmentsClientImpl(this); + this.workspaceManagerConfigurations = new WorkspaceManagerConfigurationsClientImpl(this); + this.workspaceManagerGroups = new WorkspaceManagerGroupsClientImpl(this); + this.workspaceManagerMembers = new WorkspaceManagerMembersClientImpl(this); + this.alertRuleOperations = new AlertRuleOperationsClientImpl(this); + this.actions = new ActionsClientImpl(this); + this.bookmarkOperations = new BookmarkOperationsClientImpl(this); + this.contentPackages = new ContentPackagesClientImpl(this); + this.contentPackageOperations = new ContentPackageOperationsClientImpl(this); + this.productPackages = new ProductPackagesClientImpl(this); + this.productPackagesOperations = new ProductPackagesOperationsClientImpl(this); + this.productTemplates = new ProductTemplatesClientImpl(this); + this.productTemplatesOperations = new ProductTemplatesOperationsClientImpl(this); + this.contentTemplates = new ContentTemplatesClientImpl(this); + this.contentTemplatesOperations = new ContentTemplatesOperationsClientImpl(this); + this.incidentRelations = new IncidentRelationsClientImpl(this); + this.entitiesRelations = new EntitiesRelationsClientImpl(this); + this.metadatas = new MetadatasClientImpl(this); + this.threatIntelligenceIndicators = new ThreatIntelligenceIndicatorsClientImpl(this); + this.threatIntelligenceIndicatorsOperations = new ThreatIntelligenceIndicatorsOperationsClientImpl(this); + this.dataConnectorsCheckRequirementsOperations = new DataConnectorsCheckRequirementsOperationsClientImpl(this); + this.sourceControlOperations = new SourceControlOperationsClientImpl(this); + this.threatIntelligenceIndicatorMetrics = new ThreatIntelligenceIndicatorMetricsClientImpl(this); + this.threatIntelligences = new ThreatIntelligencesClientImpl(this); + this.entitiesGetTimelines = new EntitiesGetTimelinesClientImpl(this); + this.gets = new GetsClientImpl(this); + this.updates = new UpdatesClientImpl(this); + this.getRecommendations = new GetRecommendationsClientImpl(this); + this.reevaluates = new ReevaluatesClientImpl(this); + this.getTriggeredAnalyticsRuleRuns = new GetTriggeredAnalyticsRuleRunsClientImpl(this); + this.workspaceManagerAssignmentJobs = new WorkspaceManagerAssignmentJobsClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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 long running operation result. + * + * @param activationResponse the response of activation operation. + * @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 SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.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 ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityInsightsManagementClientImpl.class); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingImpl.java index 73e9d09a5962..12e5e8174cea 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public SecurityMLAnalyticsSettingsKind kind() { + return this.innerModel().kind(); + } + public String etag() { return this.innerModel().etag(); } @@ -40,10 +44,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public SecurityMLAnalyticsSettingsKind kind() { - return this.innerModel().kind(); - } - public SecurityMLAnalyticsSettingInner innerModel() { return this.innerObject; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsClientImpl.java index 1a274cbf57c5..0465883bf3c2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsClientImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; -import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsList; +import com.azure.resourcemanager.securityinsights.implementation.models.SecurityMLAnalyticsSettingsList; import reactor.core.publisher.Mono; /** @@ -45,223 +45,124 @@ public final class SecurityMLAnalyticsSettingsClientImpl implements SecurityMLAn /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of SecurityMLAnalyticsSettingsClientImpl. * * @param client the instance of the service client containing this operation class. */ - SecurityMLAnalyticsSettingsClientImpl(SecurityInsightsImpl client) { + SecurityMLAnalyticsSettingsClientImpl(SecurityInsightsManagementClientImpl client) { this.service = RestProxy.create(SecurityMLAnalyticsSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for SecurityInsightsSecurityMLAnalyticsSettings to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for SecurityInsightsManagementClientSecurityMLAnalyticsSettings to be + * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsSecu") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientSecurityMLAnalyticsSettings") public interface SecurityMLAnalyticsSettingsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") 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); + @PathParam("settingsResourceName") String settingsResourceName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("settingsResourceName") String settingsResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("settingsResourceName") String settingsResourceName, - @BodyParam("application/json") SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsResourceName") String settingsResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("settingsResourceName") String settingsResourceName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @PathParam("settingsResourceName") String settingsResourceName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("settingsResourceName") String settingsResourceName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") 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); - } - - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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 Security ML Analytics 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 all Security ML Analytics Settings along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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 Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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); - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -271,25 +172,6 @@ public PagedIterable list(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, String settingsResourceName) { - 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 (settingsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter settingsResourceName 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, settingsResourceName, accept, context)) @@ -300,47 +182,7 @@ private Mono> getWithResponseAsync(Str * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param settingsResourceName Security ML Analytics Settings resource 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 Security ML Analytics Settings along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String workspaceName, String settingsResourceName, 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 (settingsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter settingsResourceName 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, settingsResourceName, accept, context); - } - - /** - * Gets the Security ML Analytics Settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -358,7 +200,7 @@ private Mono getAsync(String resourceGroupName, * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -369,14 +211,16 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String settingsResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, settingsResourceName, accept, context); } /** * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -393,7 +237,7 @@ public SecurityMLAnalyticsSettingInner get(String resourceGroupName, String work * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -404,36 +248,12 @@ public SecurityMLAnalyticsSettingInner get(String resourceGroupName, String work @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String workspaceName, String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting) { - 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 (settingsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter settingsResourceName is required and cannot be null.")); - } - if (securityMLAnalyticsSetting == null) { - return Mono.error( - new IllegalArgumentException("Parameter securityMLAnalyticsSetting is required and cannot be null.")); - } else { - securityMLAnalyticsSetting.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsResourceName, - securityMLAnalyticsSetting, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsResourceName, contentType, + accept, securityMLAnalyticsSetting, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -441,56 +261,7 @@ private Mono> createOrUpdateWithRespon * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param settingsResourceName Security ML Analytics Settings resource name. - * @param securityMLAnalyticsSetting The security ML Analytics 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 security ML Analytics Setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, - 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 (settingsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter settingsResourceName is required and cannot be null.")); - } - if (securityMLAnalyticsSetting == null) { - return Mono.error( - new IllegalArgumentException("Parameter securityMLAnalyticsSetting is required and cannot be null.")); - } else { - securityMLAnalyticsSetting.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, settingsResourceName, - securityMLAnalyticsSetting, accept, context); - } - - /** - * Creates or updates the Security ML Analytics Settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -509,7 +280,7 @@ private Mono createOrUpdateAsync(String resourc * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @param context The context to associate with this operation. @@ -522,15 +293,18 @@ private Mono createOrUpdateAsync(String resourc public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String settingsResourceName, SecurityMLAnalyticsSettingInner securityMLAnalyticsSetting, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, - securityMLAnalyticsSetting, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsResourceName, contentType, + accept, securityMLAnalyticsSetting, context); } /** * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -549,7 +323,7 @@ public SecurityMLAnalyticsSettingInner createOrUpdate(String resourceGroupName, * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -559,28 +333,9 @@ public SecurityMLAnalyticsSettingInner createOrUpdate(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, String settingsResourceName) { - 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 (settingsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter settingsResourceName 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, settingsResourceName, accept, context)) + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsResourceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -588,47 +343,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param settingsResourceName Security ML Analytics Settings resource 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String settingsResourceName, 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 (settingsResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter settingsResourceName 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, settingsResourceName, accept, context); - } - - /** - * Delete the Security ML Analytics Settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -645,7 +360,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -656,14 +371,15 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String settingsResourceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, settingsResourceName, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, settingsResourceName, context); } /** * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -674,6 +390,122 @@ public void delete(String resourceGroupName, String workspaceName, String settin deleteWithResponse(resourceGroupName, workspaceName, settingsResourceName, Context.NONE); } + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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 Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Get the next page of items. * @@ -681,18 +513,11 @@ public void delete(String resourceGroupName, String workspaceName, String settin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 SecurityMLAnalyticsSettings along with {@link PagedResponse} on successful completion of + * @return all Security ML Analytics Settings along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @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(), @@ -700,6 +525,24 @@ private Mono> listNextSinglePageA .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Security ML Analytics Settings along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -708,23 +551,14 @@ private Mono> listNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 SecurityMLAnalyticsSettings along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return all Security ML Analytics Settings along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/SecurityMLAnalyticsSettingsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsImpl.java index ac8c9cba1d72..b9090c7d7147 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsImpl.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,31 +27,12 @@ public SecurityMLAnalyticsSettingsImpl(SecurityMLAnalyticsSettingsClient innerCl this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, workspaceName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityMLAnalyticsSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String workspaceName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, workspaceName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityMLAnalyticsSettingImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String workspaceName, String settingsResourceName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, settingsResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); } public SecurityMLAnalyticsSetting get(String resourceGroupName, String workspaceName, String settingsResourceName) { @@ -70,12 +51,8 @@ public Response createOrUpdateWithResponse(String re Response inner = this.serviceClient() .createOrUpdateWithResponse(resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityMLAnalyticsSettingImpl(inner.getValue(), this.manager())); } public SecurityMLAnalyticsSetting createOrUpdate(String resourceGroupName, String workspaceName, @@ -98,6 +75,21 @@ public void delete(String resourceGroupName, String workspaceName, String settin this.serviceClient().delete(resourceGroupName, workspaceName, settingsResourceName); } + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityMLAnalyticsSettingImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityMLAnalyticsSettingImpl(inner1, this.manager())); + } + private SecurityMLAnalyticsSettingsClient serviceClient() { return this.innerClient; } 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 index 4b51b08a0064..105db0e2f711 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index 2790a7726d8f..3b69b58ff26c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -41,31 +41,41 @@ public final class SentinelOnboardingStatesClientImpl implements SentinelOnboard /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of SentinelOnboardingStatesClientImpl. * * @param client the instance of the service client containing this operation class. */ - SentinelOnboardingStatesClientImpl(SecurityInsightsImpl client) { + SentinelOnboardingStatesClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientSentinelOnboardingStates to be used + * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsSent") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientSentinelOnboardingStates") public 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, + Mono> get(@HostParam("endpoint") 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/{sentinelOnboardingStateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, @@ -75,28 +85,58 @@ Mono> get(@HostParam("$host") String endp @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, + Mono> create(@HostParam("endpoint") 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, @BodyParam("application/json") SentinelOnboardingStateInner sentinelOnboardingStateParameter, - @HeaderParam("Accept") String accept, Context context); + 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) + Response createSync(@HostParam("endpoint") 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, + @BodyParam("application/json") SentinelOnboardingStateInner sentinelOnboardingStateParameter, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, + @PathParam("sentinelOnboardingStateName") String sentinelOnboardingStateName, 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("endpoint") 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/onboardingStates") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") 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); @@ -106,7 +146,7 @@ Mono> list(@HostParam("$host") Strin * 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 workspaceName The name of the monitor 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. @@ -116,25 +156,6 @@ Mono> list(@HostParam("$host") Strin @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(), @@ -147,47 +168,7 @@ private Mono> getWithResponseAsync(String * 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor 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. @@ -205,7 +186,7 @@ private Mono getAsync(String resourceGroupName, St * 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 workspaceName The name of the monitor 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. @@ -216,14 +197,16 @@ private Mono getAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); + final String accept = "application/json"; + return service.getSync(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 workspaceName The name of the monitor 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. @@ -252,82 +235,14 @@ public SentinelOnboardingStateInner get(String resourceGroupName, String workspa 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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sentinelOnboardingStateName, accept, + sentinelOnboardingStateParameter, 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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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. * @@ -364,8 +279,10 @@ private Mono createAsync(String resourceGroupName, public Response createWithResponse(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, SentinelOnboardingStateInner sentinelOnboardingStateParameter, Context context) { - return createWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, - sentinelOnboardingStateParameter, context).block(); + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sentinelOnboardingStateName, accept, + sentinelOnboardingStateParameter, context); } /** @@ -391,7 +308,7 @@ public SentinelOnboardingStateInner create(String resourceGroupName, String work * 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 workspaceName The name of the monitor 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. @@ -401,30 +318,8 @@ public SentinelOnboardingStateInner create(String resourceGroupName, String work @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)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sentinelOnboardingStateName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -432,47 +327,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * 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 {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor 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. @@ -489,7 +344,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * 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 workspaceName The name of the monitor 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. @@ -500,14 +355,15 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String sentinelOnboardingStateName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sentinelOnboardingStateName, 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 workspaceName The name of the monitor 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. @@ -531,21 +387,6 @@ public void delete(String resourceGroupName, String workspaceName, String sentin @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(), @@ -553,41 +394,6 @@ private Mono> listWithResponseAsync( .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 along with {@link Response} on successful completion of {@link Mono}. - */ - @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. * @@ -617,7 +423,9 @@ private Mono listAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, accept, context); } /** 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 index c8a8091e886c..cb29889daf8b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -32,12 +32,8 @@ public Response getWithResponse(String resourceGroupNam 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SentinelOnboardingStateImpl(inner.getValue(), this.manager())); } public SentinelOnboardingState get(String resourceGroupName, String workspaceName, @@ -65,12 +61,8 @@ public Response listWithResponse(String resourceGr 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SentinelOnboardingStatesListImpl(inner.getValue(), this.manager())); } public SentinelOnboardingStatesList list(String resourceGroupName, String workspaceName) { 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 index 4b169ba8f761..4f4261067766 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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..0b44c844a42f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingsImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SettingKind; +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 SettingKind kind() { + return this.innerModel().kind(); + } + + 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..2a4c114e9ff4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.RepositoryAccess; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.azure.resourcemanager.securityinsights.models.ContentType; +import com.azure.resourcemanager.securityinsights.models.DeploymentInfo; +import com.azure.resourcemanager.securityinsights.models.PullRequest; +import com.azure.resourcemanager.securityinsights.models.RepoType; +import com.azure.resourcemanager.securityinsights.models.Repository; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; +import com.azure.resourcemanager.securityinsights.models.RepositoryResourceInfo; +import com.azure.resourcemanager.securityinsights.models.ServicePrincipal; +import com.azure.resourcemanager.securityinsights.models.SourceControl; +import com.azure.resourcemanager.securityinsights.models.Version; +import com.azure.resourcemanager.securityinsights.models.Warning; +import com.azure.resourcemanager.securityinsights.models.WorkloadIdentityFederation; +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 Version version() { + return this.innerModel().version(); + } + + 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 ServicePrincipal servicePrincipal() { + return this.innerModel().servicePrincipal(); + } + + public WorkloadIdentityFederation workloadIdentityFederation() { + return this.innerModel().workloadIdentityFederation(); + } + + public RepositoryAccess repositoryAccess() { + return this.innerModel().repositoryAccess(); + } + + public RepositoryResourceInfo repositoryResourceInfo() { + return this.innerModel().repositoryResourceInfo(); + } + + public DeploymentInfo lastDeploymentInfo() { + return this.innerModel().lastDeploymentInfo(); + } + + public PullRequest pullRequest() { + return this.innerModel().pullRequest(); + } + + 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() + .getSourceControls() + .createWithResponse(resourceGroupName, workspaceName, sourceControlId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SourceControl create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSourceControls() + .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() + .getSourceControls() + .getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE) + .getValue(); + return this; + } + + public SourceControl refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSourceControls() + .getWithResponse(resourceGroupName, workspaceName, sourceControlId, context) + .getValue(); + return this; + } + + public Response deleteWithResponse(RepositoryAccessProperties repositoryAccess, Context context) { + return serviceManager.sourceControls() + .deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, repositoryAccess, context); + } + + public Warning delete(RepositoryAccessProperties repositoryAccess) { + return serviceManager.sourceControls() + .delete(resourceGroupName, workspaceName, sourceControlId, repositoryAccess); + } + + public SourceControlImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + 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; + } + + public SourceControlImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public SourceControlImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SourceControlImpl withServicePrincipal(ServicePrincipal servicePrincipal) { + this.innerModel().withServicePrincipal(servicePrincipal); + return this; + } + + public SourceControlImpl withRepositoryAccess(RepositoryAccess repositoryAccess) { + this.innerModel().withRepositoryAccess(repositoryAccess); + return this; + } + + public SourceControlImpl withRepositoryResourceInfo(RepositoryResourceInfo repositoryResourceInfo) { + this.innerModel().withRepositoryResourceInfo(repositoryResourceInfo); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsClientImpl.java new file mode 100644 index 000000000000..494d3e668870 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsClientImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.SourceControlOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import com.azure.resourcemanager.securityinsights.implementation.models.RepoList; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SourceControlOperationsClient. + */ +public final class SourceControlOperationsClientImpl implements SourceControlOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SourceControlOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of SourceControlOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SourceControlOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(SourceControlOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientSourceControlOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientSourceControlOperations") + public interface SourceControlOperationsService { + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RepositoryAccessProperties repositoryAccess, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listRepositoriesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RepositoryAccessProperties repositoryAccess, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRepositoriesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listRepositoriesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") 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 repositoryAccess The content of the action 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 a list of repositories metadata along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRepositoriesSinglePageAsync(String resourceGroupName, + String workspaceName, RepositoryAccessProperties repositoryAccess) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRepositories(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, repositoryAccess, 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 repositoryAccess The content of the action 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 a list of repositories metadata as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRepositoriesAsync(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess) { + return new PagedFlux<>( + () -> listRepositoriesSinglePageAsync(resourceGroupName, workspaceName, repositoryAccess), + 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 repositoryAccess The content of the action 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 a list of repositories metadata along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRepositoriesSinglePage(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess) { + final String accept = "application/json"; + Response res = service.listRepositoriesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, repositoryAccess, Context.NONE); + return 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 repositoryAccess The content of the action 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 a list of repositories metadata along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRepositoriesSinglePage(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess, Context context) { + final String accept = "application/json"; + Response res = service.listRepositoriesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, repositoryAccess, context); + return 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 repositoryAccess The content of the action 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 a list of repositories metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess) { + return new PagedIterable<>(() -> listRepositoriesSinglePage(resourceGroupName, workspaceName, repositoryAccess), + nextLink -> listRepositoriesNextSinglePage(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 repositoryAccess The content of the action 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 a list of repositories metadata as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess, Context context) { + return new PagedIterable<>( + () -> listRepositoriesSinglePage(resourceGroupName, workspaceName, repositoryAccess, context), + nextLink -> listRepositoriesNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRepositoriesNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRepositoriesNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listRepositoriesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRepositoriesNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listRepositoriesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/SourceControlOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsImpl.java new file mode 100644 index 000000000000..2c5217d4cdfb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SourceControlOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import com.azure.resourcemanager.securityinsights.models.Repo; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; +import com.azure.resourcemanager.securityinsights.models.SourceControlOperations; + +public final class SourceControlOperationsImpl implements SourceControlOperations { + private static final ClientLogger LOGGER = new ClientLogger(SourceControlOperationsImpl.class); + + private final SourceControlOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public SourceControlOperationsImpl(SourceControlOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess) { + PagedIterable inner + = this.serviceClient().listRepositories(resourceGroupName, workspaceName, repositoryAccess); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RepoImpl(inner1, this.manager())); + } + + public PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess, Context context) { + PagedIterable inner + = this.serviceClient().listRepositories(resourceGroupName, workspaceName, repositoryAccess, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RepoImpl(inner1, this.manager())); + } + + private SourceControlOperationsClient 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/SourceControlsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java new file mode 100644 index 000000000000..5a8a3f6ae5c0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java @@ -0,0 +1,574 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.resourcemanager.securityinsights.fluent.SourceControlsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.azure.resourcemanager.securityinsights.fluent.models.WarningInner; +import com.azure.resourcemanager.securityinsights.implementation.models.SourceControlList; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; +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 { + /** + * The proxy service used to perform REST calls. + */ + private final SourceControlsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of SourceControlsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SourceControlsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service + = RestProxy.create(SourceControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientSourceControls to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientSourceControls") + public interface SourceControlsService { + @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("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") 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); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SourceControlInner sourceControl, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SourceControlInner sourceControl, + Context context); + + @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("endpoint") 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}/delete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RepositoryAccessProperties repositoryAccess, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}/delete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("sourceControlId") String sourceControlId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RepositoryAccessProperties repositoryAccess, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, 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 monitor 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId) { + 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 monitor 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String sourceControlId) { + return getWithResponseAsync(resourceGroupName, workspaceName, sourceControlId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, Context context) { + final String accept = "application/json"; + return service.getSync(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 monitor 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 getWithResponse(resourceGroupName, workspaceName, sourceControlId, Context.NONE).getValue(); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId, SourceControlInner sourceControl) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sourceControlId, contentType, accept, + sourceControl, 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 monitor 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String workspaceName, String sourceControlId, + SourceControlInner sourceControl) { + return createWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, SourceControlInner sourceControl, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sourceControlId, contentType, accept, + sourceControl, context); + } + + /** + * Creates a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 createWithResponse(resourceGroupName, workspaceName, sourceControlId, sourceControl, Context.NONE) + .getValue(); + } + + /** + * 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 monitor 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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 monitor 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 as paginated response with {@link PagedFlux}. + */ + @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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, Context.NONE); + return 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 monitor 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context); + return 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName), + nextLink -> listNextSinglePage(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 monitor 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return warning response structure along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String sourceControlId, RepositoryAccessProperties repositoryAccess) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sourceControlId, contentType, accept, + repositoryAccess, 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 monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return warning response structure on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sourceControlId, repositoryAccess) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @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 warning response structure along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, RepositoryAccessProperties repositoryAccess, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, sourceControlId, contentType, accept, + repositoryAccess, context); + } + + /** + * Delete a source control. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return warning response structure. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WarningInner delete(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess) { + return deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, repositoryAccess, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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..61c8bf220995 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SourceControlsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import com.azure.resourcemanager.securityinsights.fluent.models.WarningInner; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; +import com.azure.resourcemanager.securityinsights.models.SourceControl; +import com.azure.resourcemanager.securityinsights.models.SourceControls; +import com.azure.resourcemanager.securityinsights.models.Warning; + +public final class SourceControlsImpl implements SourceControls { + private static 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 Response getWithResponse(String resourceGroupName, String workspaceName, + String sourceControlId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sourceControlId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SourceControlImpl(inner.getValue(), 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 PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess, Context context) { + Response inner = this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, repositoryAccess, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WarningImpl(inner.getValue(), this.manager())); + } + + public Warning delete(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess) { + WarningInner inner + = this.serviceClient().delete(resourceGroupName, workspaceName, sourceControlId, repositoryAccess); + if (inner != null) { + return new WarningImpl(inner, this.manager()); + } else { + return null; + } + } + + public SourceControl getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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); + } + + private SourceControlsClient 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/TIObjectImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TIObjectImpl.java new file mode 100644 index 000000000000..dbb1891d42c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TIObjectImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.azure.resourcemanager.securityinsights.models.RelationshipHint; +import com.azure.resourcemanager.securityinsights.models.TIObject; +import com.azure.resourcemanager.securityinsights.models.TIObjectKind; +import com.azure.resourcemanager.securityinsights.models.UserInfo; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class TIObjectImpl implements TIObject { + private TIObjectInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + TIObjectImpl(TIObjectInner 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 TIObjectKind kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Map data() { + Map inner = this.innerModel().data(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public UserInfo createdBy() { + return this.innerModel().createdBy(); + } + + public String source() { + return this.innerModel().source(); + } + + public OffsetDateTime firstIngestedTimeUtc() { + return this.innerModel().firstIngestedTimeUtc(); + } + + public OffsetDateTime lastIngestedTimeUtc() { + return this.innerModel().lastIngestedTimeUtc(); + } + + public String ingestionRulesVersion() { + return this.innerModel().ingestionRulesVersion(); + } + + public String lastUpdateMethod() { + return this.innerModel().lastUpdateMethod(); + } + + public UserInfo lastModifiedBy() { + return this.innerModel().lastModifiedBy(); + } + + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.innerModel().lastUpdatedDateTimeUtc(); + } + + public List relationshipHints() { + List inner = this.innerModel().relationshipHints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public TIObjectInner 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/TemplateModelImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TemplateModelImpl.java new file mode 100644 index 000000000000..b1042d7e13bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TemplateModelImpl.java @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TemplateModelInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateProperties; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.PackageKind; +import com.azure.resourcemanager.securityinsights.models.TemplateModel; +import java.time.LocalDate; +import java.util.Collections; +import java.util.List; + +public final class TemplateModelImpl implements TemplateModel, TemplateModel.Definition, TemplateModel.Update { + private TemplateModelInner 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 contentProductId() { + return this.innerModel().contentProductId(); + } + + public String packageVersion() { + return this.innerModel().packageVersion(); + } + + public String version() { + return this.innerModel().version(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public Kind contentKind() { + return this.innerModel().contentKind(); + } + + 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 String customVersion() { + return this.innerModel().customVersion(); + } + + public String contentSchemaVersion() { + return this.innerModel().contentSchemaVersion(); + } + + public String icon() { + return this.innerModel().icon(); + } + + public List threatAnalysisTactics() { + List inner = this.innerModel().threatAnalysisTactics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List threatAnalysisTechniques() { + List inner = this.innerModel().threatAnalysisTechniques(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List previewImages() { + List inner = this.innerModel().previewImages(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List previewImagesDark() { + List inner = this.innerModel().previewImagesDark(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String packageId() { + return this.innerModel().packageId(); + } + + public PackageKind packageKind() { + return this.innerModel().packageKind(); + } + + public String packageName() { + return this.innerModel().packageName(); + } + + public Flag isDeprecated() { + return this.innerModel().isDeprecated(); + } + + public Object mainTemplate() { + return this.innerModel().mainTemplate(); + } + + public List dependantTemplates() { + List inner = this.innerModel().dependantTemplates(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TemplateModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String templateId; + + public TemplateModelImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public TemplateModel create() { + this.innerObject = serviceManager.serviceClient() + .getContentTemplates() + .installWithResponse(resourceGroupName, workspaceName, templateId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TemplateModel create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentTemplates() + .installWithResponse(resourceGroupName, workspaceName, templateId, this.innerModel(), context) + .getValue(); + return this; + } + + TemplateModelImpl(String name, com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new TemplateModelInner(); + this.serviceManager = serviceManager; + this.templateId = name; + } + + public TemplateModelImpl update() { + return this; + } + + public TemplateModel apply() { + this.innerObject = serviceManager.serviceClient() + .getContentTemplates() + .installWithResponse(resourceGroupName, workspaceName, templateId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TemplateModel apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentTemplates() + .installWithResponse(resourceGroupName, workspaceName, templateId, this.innerModel(), context) + .getValue(); + return this; + } + + TemplateModelImpl(TemplateModelInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.templateId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "contentTemplates"); + } + + public TemplateModel refresh() { + this.innerObject = serviceManager.serviceClient() + .getContentTemplates() + .getWithResponse(resourceGroupName, workspaceName, templateId, Context.NONE) + .getValue(); + return this; + } + + public TemplateModel refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getContentTemplates() + .getWithResponse(resourceGroupName, workspaceName, templateId, context) + .getValue(); + return this; + } + + public TemplateModelImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public TemplateModelImpl withContentId(String contentId) { + this.innerModel().withContentId(contentId); + return this; + } + + public TemplateModelImpl withContentProductId(String contentProductId) { + this.innerModel().withContentProductId(contentProductId); + return this; + } + + public TemplateModelImpl withPackageVersion(String packageVersion) { + this.innerModel().withPackageVersion(packageVersion); + return this; + } + + public TemplateModelImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public TemplateModelImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public TemplateModelImpl withContentKind(Kind contentKind) { + this.innerModel().withContentKind(contentKind); + return this; + } + + public TemplateModelImpl withSource(MetadataSource source) { + this.innerModel().withSource(source); + return this; + } + + public TemplateModelImpl withAuthor(MetadataAuthor author) { + this.innerModel().withAuthor(author); + return this; + } + + public TemplateModelImpl withSupport(MetadataSupport support) { + this.innerModel().withSupport(support); + return this; + } + + public TemplateModelImpl withDependencies(MetadataDependencies dependencies) { + this.innerModel().withDependencies(dependencies); + return this; + } + + public TemplateModelImpl withCategories(MetadataCategories categories) { + this.innerModel().withCategories(categories); + return this; + } + + public TemplateModelImpl withProviders(List providers) { + this.innerModel().withProviders(providers); + return this; + } + + public TemplateModelImpl withFirstPublishDate(LocalDate firstPublishDate) { + this.innerModel().withFirstPublishDate(firstPublishDate); + return this; + } + + public TemplateModelImpl withLastPublishDate(LocalDate lastPublishDate) { + this.innerModel().withLastPublishDate(lastPublishDate); + return this; + } + + public TemplateModelImpl withCustomVersion(String customVersion) { + this.innerModel().withCustomVersion(customVersion); + return this; + } + + public TemplateModelImpl withContentSchemaVersion(String contentSchemaVersion) { + this.innerModel().withContentSchemaVersion(contentSchemaVersion); + return this; + } + + public TemplateModelImpl withIcon(String icon) { + this.innerModel().withIcon(icon); + return this; + } + + public TemplateModelImpl withThreatAnalysisTactics(List threatAnalysisTactics) { + this.innerModel().withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + public TemplateModelImpl withThreatAnalysisTechniques(List threatAnalysisTechniques) { + this.innerModel().withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + public TemplateModelImpl withPreviewImages(List previewImages) { + this.innerModel().withPreviewImages(previewImages); + return this; + } + + public TemplateModelImpl withPreviewImagesDark(List previewImagesDark) { + this.innerModel().withPreviewImagesDark(previewImagesDark); + return this; + } + + public TemplateModelImpl withPackageId(String packageId) { + this.innerModel().withPackageId(packageId); + return this; + } + + public TemplateModelImpl withPackageKind(PackageKind packageKind) { + this.innerModel().withPackageKind(packageKind); + return this; + } + + public TemplateModelImpl withPackageName(String packageName) { + this.innerModel().withPackageName(packageName); + return this; + } + + public TemplateModelImpl withMainTemplate(Object mainTemplate) { + this.innerModel().withMainTemplate(mainTemplate); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceCountImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceCountImpl.java new file mode 100644 index 000000000000..c146f4b6a6ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceCountImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceCount; + +public final class ThreatIntelligenceCountImpl implements ThreatIntelligenceCount { + private ThreatIntelligenceCountInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + ThreatIntelligenceCountImpl(ThreatIntelligenceCountInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public int count() { + return this.innerModel().count(); + } + + public ThreatIntelligenceCountInner 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 index cf7de22bc943..a641d678aaec 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -37,31 +37,40 @@ public final class ThreatIntelligenceIndicatorMetricsClientImpl implements Threa /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of ThreatIntelligenceIndicatorMetricsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ThreatIntelligenceIndicatorMetricsClientImpl(SecurityInsightsImpl client) { + ThreatIntelligenceIndicatorMetricsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientThreatIntelligenceIndicatorMetrics to + * be used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsThre") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientThreatIntelligenceIndicatorMetrics") public 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, + Mono> list(@HostParam("endpoint") 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/threatIntelligence/main/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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); @@ -71,7 +80,7 @@ Mono> list(@HostParam("$host") Stri * 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 workspaceName The name of the monitor 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. @@ -81,21 +90,6 @@ Mono> list(@HostParam("$host") Stri @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(), @@ -107,43 +101,7 @@ private Mono> listWithResponseAsync * 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) along with - * {@link Response} on successful completion of {@link Mono}. - */ - @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. + * @param workspaceName The name of the monitor 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. @@ -159,7 +117,7 @@ private Mono listAsync(String resourceGroupN * 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 workspaceName The name of the monitor 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. @@ -170,14 +128,16 @@ private Mono listAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + final String accept = "application/json"; + return service.listSync(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. + * @param workspaceName The name of the monitor 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. 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 index e827c2be6120..4774c9a5ee5b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,12 +30,8 @@ public Response listWithResponse(String resourceG 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceMetricsListImpl(inner.getValue(), this.manager())); } public ThreatIntelligenceMetricsList list(String resourceGroupName, String workspaceName) { 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 index f7fca6f201f4..5d31a3d80efa 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -31,10 +31,10 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; +import com.azure.resourcemanager.securityinsights.implementation.models.ThreatIntelligenceInformationList; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformationList; import reactor.core.publisher.Mono; /** @@ -49,255 +49,190 @@ public final class ThreatIntelligenceIndicatorsClientImpl implements ThreatIntel /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of ThreatIntelligenceIndicatorsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ThreatIntelligenceIndicatorsClientImpl(SecurityInsightsImpl client) { + ThreatIntelligenceIndicatorsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientThreatIntelligenceIndicators to be + * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsThre") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientThreatIntelligenceIndicators") public 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 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createIndicator(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @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, + Response getSync(@HostParam("endpoint") 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, + Mono> create(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceProperties, - @HeaderParam("Accept") String accept, Context context); + 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) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceProperties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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); + @PathParam("name") String name, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators") + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/appendTags") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> queryIndicators(@HostParam("$host") String endpoint, + Mono> appendTags(@HostParam("endpoint") 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); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @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, + Response appendTagsSync(@HostParam("endpoint") 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); + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ThreatIntelligenceAppendTags threatIntelligenceAppendTags, 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, + Mono> replaceTags(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @PathParam("name") String name, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> queryIndicatorsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } + Response replaceTagsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, + 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createIndicatorWithResponseAsync( - String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel 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())); - } + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceProperties, + 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. - * @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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createIndicatorWithResponseAsync( - String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel 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); - } + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createIndicatorSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThreatIntelligenceIndicatorModel threatIntelligenceProperties, + 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createIndicatorAsync(String resourceGroupName, - String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { - return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + 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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createIndicatorWithResponse(String resourceGroupName, - String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, Context context) { - return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties, context) - .block(); - } + @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) + Response queryIndicatorsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + 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) - public ThreatIntelligenceInformationInner createIndicator(String resourceGroupName, String workspaceName, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { - return createIndicatorWithResponse(resourceGroupName, workspaceName, threatIntelligenceProperties, Context.NONE) - .getValue(); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> queryIndicatorsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response queryIndicatorsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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 workspaceName The name of the monitor 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. @@ -308,24 +243,6 @@ public ThreatIntelligenceInformationInner createIndicator(String resourceGroupNa @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(), @@ -337,47 +254,7 @@ private Mono> getWithResponseAsync( * 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @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 workspaceName The name of the monitor 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. @@ -395,7 +272,7 @@ private Mono getAsync(String resourceGroupNa * 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 workspaceName The name of the monitor 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. @@ -406,14 +283,16 @@ private Mono getAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String name, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + final String accept = "application/json"; + return service.getSync(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 workspaceName The name of the monitor 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. @@ -429,7 +308,7 @@ public ThreatIntelligenceInformationInner get(String resourceGroupName, String w * 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 workspaceName The name of the monitor 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. @@ -441,35 +320,12 @@ public ThreatIntelligenceInformationInner get(String resourceGroupName, String w @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceIndicatorModel 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 contentType = "application/json"; 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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, contentType, accept, + threatIntelligenceProperties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -477,55 +333,7 @@ private Mono> createWithResponseAsy * 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String workspaceName, String name, ThreatIntelligenceIndicatorModel 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 workspaceName The name of the monitor 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. @@ -544,7 +352,7 @@ private Mono createAsync(String resourceGrou * 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 workspaceName The name of the monitor 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. @@ -557,15 +365,18 @@ private Mono createAsync(String resourceGrou public Response createWithResponse(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, Context context) { - return createWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, contentType, accept, + threatIntelligenceProperties, 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 workspaceName The name of the monitor 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. @@ -584,7 +395,7 @@ public ThreatIntelligenceInformationInner create(String resourceGroupName, Strin * 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 workspaceName The name of the monitor 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. @@ -593,28 +404,9 @@ public ThreatIntelligenceInformationInner create(String resourceGroupName, Strin */ @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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -622,46 +414,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * 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 {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor 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. @@ -677,7 +430,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * 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 workspaceName The name of the monitor 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. @@ -688,14 +441,15 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String name, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, name, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, 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 workspaceName The name of the monitor 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. @@ -707,481 +461,384 @@ public void delete(String resourceGroupName, String workspaceName, String name) } /** - * Query threat intelligence indicators as per filtering criteria. + * 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 threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param workspaceName The name of the monitor 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 list of all the threat intelligence information objects along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @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"; + private Mono> appendTagsWithResponseAsync(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + final String contentType = "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)) + .withContext(context -> service.appendTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, contentType, + threatIntelligenceAppendTags, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Query threat intelligence indicators as per filtering criteria. + * 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 monitor 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono appendTagsAsync(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + return appendTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags) + .flatMap(ignored -> 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 threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param workspaceName The name of the monitor 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 list of all the threat intelligence information objects along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the {@link Response}. */ @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)); + public Response appendTagsWithResponse(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context) { + final String contentType = "application/json"; + return service.appendTagsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, contentType, + threatIntelligenceAppendTags, context); } /** - * Query threat intelligence indicators as per filtering criteria. + * 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 threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param workspaceName The name of the monitor 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 list of all the threat intelligence information objects as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux queryIndicatorsAsync(String resourceGroupName, - String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { - return new PagedFlux<>( - () -> queryIndicatorsSinglePageAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria), - nextLink -> queryIndicatorsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void appendTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { + appendTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, Context.NONE); } /** - * Query threat intelligence indicators as per filtering criteria. + * 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 threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. - * @param context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 list of all the threat intelligence information objects as paginated response with {@link PagedFlux}. + * @return threat intelligence information object along with {@link Response} on successful completion of + * {@link Mono}. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> replaceTagsWithResponseAsync(String resourceGroupName, + String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.replaceTags(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, contentType, accept, + threatIntelligenceReplaceTags, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Query threat intelligence indicators as per filtering criteria. + * 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 threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param workspaceName The name of the monitor 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 list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. + * @return threat intelligence information object on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable queryIndicators(String resourceGroupName, - String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { - return new PagedIterable<>( - queryIndicatorsAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono replaceTagsAsync(String resourceGroupName, String workspaceName, + String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + return replaceTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Query threat intelligence indicators as per filtering criteria. + * 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 threatIntelligenceFilteringCriteria Filtering criteria for querying threat intelligence indicators. + * @param workspaceName The name of the monitor 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 list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. + * @return threat intelligence information object along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable queryIndicators(String resourceGroupName, - String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response replaceTagsWithResponse(String resourceGroupName, + String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, Context context) { - return new PagedIterable<>( - queryIndicatorsAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, context)); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.replaceTagsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, name, contentType, accept, + threatIntelligenceReplaceTags, context); } /** - * Append tags to a threat intelligence indicator. + * 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 workspaceName The name of the monitor workspace. * @param name Threat intelligence indicator name field. - * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @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 the {@link Response} on successful completion of {@link Mono}. + * @return threat intelligence information object. */ @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())); + public ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + return replaceTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, + Context.NONE).getValue(); } /** - * Append tags to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceAppendTags The threat intelligence append tags request body. - * @param context The context to associate with this operation. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 the {@link Response} on successful completion of {@link Mono}. + * @return threat intelligence information object along with {@link Response} on successful completion of + * {@link Mono}. */ @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(); - } + private Mono> createIndicatorWithResponseAsync( + String resourceGroupName, String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { + final String contentType = "application/json"; 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); + return FluxUtil + .withContext(context -> service.createIndicator(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, + threatIntelligenceProperties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Append tags to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 A {@link Mono} that completes when a successful response is received. + * @return threat intelligence information object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono appendTagsAsync(String resourceGroupName, String workspaceName, String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { - return appendTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags) - .flatMap(ignored -> Mono.empty()); + private Mono createIndicatorAsync(String resourceGroupName, + String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { + return createIndicatorWithResponseAsync(resourceGroupName, workspaceName, threatIntelligenceProperties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Append tags to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 the {@link Response}. + * @return threat intelligence information object along with {@link 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(); + public Response createIndicatorWithResponse(String resourceGroupName, + String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createIndicatorSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, contentType, accept, + threatIntelligenceProperties, context); } /** - * Append tags to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceAppendTags The threat intelligence append tags request body. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 threat intelligence information object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void appendTags(String resourceGroupName, String workspaceName, String name, - ThreatIntelligenceAppendTags threatIntelligenceAppendTags) { - appendTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceAppendTags, Context.NONE); + public ThreatIntelligenceInformationInner createIndicator(String resourceGroupName, String workspaceName, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { + return createIndicatorWithResponse(resourceGroupName, workspaceName, threatIntelligenceProperties, Context.NONE) + .getValue(); } /** - * Replace tags added to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 threat intelligence information object along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of all the threat intelligence information objects along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> replaceTagsWithResponseAsync(String resourceGroupName, - String workspaceName, String name, ThreatIntelligenceIndicatorModel 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(); - } + private Mono> queryIndicatorsSinglePageAsync( + String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { 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)) + .withContext(context -> service.queryIndicators(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, + threatIntelligenceFilteringCriteria, 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())); } /** - * Replace tags added to a threat intelligence indicator. + * 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 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. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 threat intelligence information object along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of all the threat intelligence information objects as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> replaceTagsWithResponseAsync(String resourceGroupName, - String workspaceName, String name, ThreatIntelligenceIndicatorModel 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); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux queryIndicatorsAsync(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + return new PagedFlux<>( + () -> queryIndicatorsSinglePageAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria), + nextLink -> queryIndicatorsNextSinglePageAsync(nextLink)); } /** - * Replace tags added to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 threat intelligence information object on successful completion of {@link Mono}. + * @return list of all the threat intelligence information objects along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono replaceTagsAsync(String resourceGroupName, String workspaceName, - String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { - return replaceTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse queryIndicatorsSinglePage(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + final String accept = "application/json"; + Response res = service.queryIndicatorsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, + threatIntelligenceFilteringCriteria, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Replace tags added to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 threat intelligence information object along with {@link Response}. + * @return list of all the threat intelligence information objects along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response replaceTagsWithResponse(String resourceGroupName, - String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags, + private PagedResponse queryIndicatorsSinglePage(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, Context context) { - return replaceTagsWithResponseAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, - context).block(); + final String accept = "application/json"; + Response res = service.queryIndicatorsSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, + threatIntelligenceFilteringCriteria, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Replace tags added to a threat intelligence indicator. + * 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 name Threat intelligence indicator name field. - * @param threatIntelligenceReplaceTags Tags in the threat intelligence indicator to be replaced. + * @param workspaceName The name of the monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 threat intelligence information object. + * @return list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, String workspaceName, String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { - return replaceTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, - Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable queryIndicators(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + return new PagedIterable<>( + () -> queryIndicatorsSinglePage(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria), + nextLink -> queryIndicatorsNextSinglePage(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 monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable queryIndicators(String resourceGroupName, + String workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, + Context context) { + return new PagedIterable<>(() -> queryIndicatorsSinglePage(resourceGroupName, workspaceName, + threatIntelligenceFilteringCriteria, context), + nextLink -> queryIndicatorsNextSinglePage(nextLink, context)); } /** @@ -1197,13 +854,6 @@ public ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, @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)) @@ -1212,6 +862,24 @@ public ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse queryIndicatorsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.queryIndicatorsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1220,23 +888,15 @@ public ThreatIntelligenceInformationInner replaceTags(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return list of all the threat intelligence information objects along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> queryIndicatorsNextSinglePageAsync(String nextLink, + private PagedResponse queryIndicatorsNextSinglePage(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)); + Response res + = service.queryIndicatorsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 1f2f48e617c9..b42875fd5e27 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,39 +30,12 @@ public ThreatIntelligenceIndicatorsImpl(ThreatIntelligenceIndicatorsClient inner this.serviceManager = serviceManager; } - public Response createIndicatorWithResponse(String resourceGroupName, - String workspaceName, ThreatIntelligenceIndicatorModel 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 createIndicator(String resourceGroupName, String workspaceName, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { - ThreatIntelligenceInformationInner inner - = this.serviceClient().createIndicator(resourceGroupName, workspaceName, threatIntelligenceProperties); - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); } public ThreatIntelligenceInformation get(String resourceGroupName, String workspaceName, String name) { @@ -78,12 +51,8 @@ public Response createWithResponse(String resourc String name, ThreatIntelligenceIndicatorModel 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); } public ThreatIntelligenceInformation create(String resourceGroupName, String workspaceName, String name, @@ -106,22 +75,6 @@ public void delete(String resourceGroupName, String workspaceName, String name) this.serviceClient().delete(resourceGroupName, workspaceName, name); } - public PagedIterable queryIndicators(String resourceGroupName, String workspaceName, - ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { - PagedIterable inner = this.serviceClient() - .queryIndicators(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria); - return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, - inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); - } - public Response appendTagsWithResponse(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceAppendTags threatIntelligenceAppendTags, Context context) { return this.serviceClient() @@ -138,18 +91,33 @@ public Response replaceTagsWithResponse(String re Context context) { Response inner = this.serviceClient() .replaceTagsWithResponse(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); + } + + public ThreatIntelligenceInformation replaceTags(String resourceGroupName, String workspaceName, String name, + ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + ThreatIntelligenceInformationInner inner + = this.serviceClient().replaceTags(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); + return new ThreatIntelligenceInformationImpl(inner, this.manager()); } else { return null; } } - public ThreatIntelligenceInformation replaceTags(String resourceGroupName, String workspaceName, String name, - ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags) { + public Response createIndicatorWithResponse(String resourceGroupName, + String workspaceName, ThreatIntelligenceIndicatorModel threatIntelligenceProperties, Context context) { + Response inner = this.serviceClient() + .createIndicatorWithResponse(resourceGroupName, workspaceName, threatIntelligenceProperties, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceInformationImpl(inner.getValue(), this.manager())); + } + + public ThreatIntelligenceInformation createIndicator(String resourceGroupName, String workspaceName, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties) { ThreatIntelligenceInformationInner inner - = this.serviceClient().replaceTags(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags); + = this.serviceClient().createIndicator(resourceGroupName, workspaceName, threatIntelligenceProperties); if (inner != null) { return new ThreatIntelligenceInformationImpl(inner, this.manager()); } else { @@ -157,6 +125,22 @@ public ThreatIntelligenceInformation replaceTags(String resourceGroupName, Strin } } + public PagedIterable queryIndicators(String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) { + PagedIterable inner = this.serviceClient() + .queryIndicators(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new ThreatIntelligenceInformationImpl(inner1, this.manager())); + } + private ThreatIntelligenceIndicatorsClient serviceClient() { return this.innerClient; } 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 index 188ed5388018..6ff14dc54599 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsOperationsClient; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformationList; +import com.azure.resourcemanager.securityinsights.implementation.models.ThreatIntelligenceInformationList; import reactor.core.publisher.Mono; /** @@ -44,31 +44,43 @@ public final class ThreatIntelligenceIndicatorsOperationsClientImpl /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of ThreatIntelligenceIndicatorsOperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ThreatIntelligenceIndicatorsOperationsClientImpl(SecurityInsightsImpl client) { + ThreatIntelligenceIndicatorsOperationsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for + * SecurityInsightsManagementClientThreatIntelligenceIndicatorsOperations to be used by the proxy service to perform + * REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsThre") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientThreatIntelligenceIndicatorsOperations") public 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, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @QueryParam("$orderby") String orderby, + @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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @@ -80,7 +92,15 @@ Mono> list(@HostParam("$host") Strin @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -88,7 +108,7 @@ Mono> listNext( * 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 workspaceName The name of the monitor workspace. * @param filter Filters the results, based on a Boolean condition. 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 @@ -104,21 +124,6 @@ Mono> listNext( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, String filter, Integer top, String skipToken, String orderby) { - 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(), @@ -133,52 +138,7 @@ private Mono> listSinglePageAs * 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 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 orderby Sorts the results. 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String workspaceName, String filter, Integer top, String skipToken, String orderby, 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, top, skipToken, orderby, 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 workspaceName The name of the monitor workspace. * @param filter Filters the results, based on a Boolean condition. 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 @@ -202,7 +162,7 @@ private PagedFlux listAsync(String resourceG * 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 workspaceName The name of the monitor 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. @@ -223,7 +183,34 @@ private PagedFlux listAsync(String resourceG * 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 workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. 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 orderby Sorts the results. 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName, String filter, Integer top, String skipToken, String orderby) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, top, skipToken, orderby, accept, Context.NONE); + return 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 monitor workspace. * @param filter Filters the results, based on a Boolean condition. 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 @@ -234,21 +221,24 @@ private PagedFlux listAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 as paginated response with {@link PagedFlux}. + * @return all threat intelligence indicators along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, - String filter, Integer top, String skipToken, String orderby, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, filter, top, skipToken, orderby, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName, String filter, Integer top, String skipToken, String orderby, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, filter, top, skipToken, orderby, accept, context); + return 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 workspaceName The name of the monitor 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. @@ -260,14 +250,16 @@ public PagedIterable list(String resourceGro final Integer top = null; final String skipToken = null; final String orderby = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, filter, top, skipToken, orderby)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, filter, top, skipToken, orderby), + nextLink -> listNextSinglePage(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 workspaceName The name of the monitor workspace. * @param filter Filters the results, based on a Boolean condition. 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 @@ -284,7 +276,8 @@ public PagedIterable list(String resourceGro public PagedIterable list(String resourceGroupName, String workspaceName, String filter, Integer top, String skipToken, String orderby, Context context) { return new PagedIterable<>( - listAsync(resourceGroupName, workspaceName, filter, top, skipToken, orderby, context)); + () -> listSinglePage(resourceGroupName, workspaceName, filter, top, skipToken, orderby, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -294,18 +287,11 @@ public PagedIterable list(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all threat intelligence indicators along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @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(), @@ -313,6 +299,24 @@ private Mono> listNextSinglePa .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -321,23 +325,14 @@ private Mono> listNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all threat intelligence indicators along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 62e78851e7a8..b1a366524a8e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index fcdd742c499e..5550b23d02ae 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -32,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public ThreatIntelligenceResourceInnerKind kind() { + return this.innerModel().kind(); + } + public String etag() { return this.innerModel().etag(); } @@ -40,10 +44,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public ThreatIntelligenceResourceInnerKind kind() { - return this.innerModel().kind(); - } - public ThreatIntelligenceInformationInner innerModel() { return this.innerObject; } 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 index 5913635a2b40..e611b34986ae 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesClientImpl.java new file mode 100644 index 000000000000..0ddec4dad8cf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesClientImpl.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.ThreatIntelligencesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; +import com.azure.resourcemanager.securityinsights.implementation.models.ThreatIntelligenceList; +import com.azure.resourcemanager.securityinsights.models.CountQuery; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.TiType; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThreatIntelligencesClient. + */ +public final class ThreatIntelligencesClientImpl implements ThreatIntelligencesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThreatIntelligencesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of ThreatIntelligencesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThreatIntelligencesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(ThreatIntelligencesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientThreatIntelligences to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientThreatIntelligences") + public interface ThreatIntelligencesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/{tiType}/count") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> count(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("tiType") TiType tiType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CountQuery query, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/{tiType}/count") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response countSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("tiType") TiType tiType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CountQuery query, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/{tiType}/query") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> query(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("tiType") TiType tiType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Query query, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/{tiType}/query") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response querySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("tiType") TiType tiType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") Query query, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> queryNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response queryNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 the count of all TI objects for the workspace along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> countWithResponseAsync(String resourceGroupName, + String workspaceName, TiType tiType, CountQuery query) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.count(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, tiType, accept, query, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 the count of all TI objects for the workspace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono countAsync(String resourceGroupName, String workspaceName, + TiType tiType) { + final CountQuery query = null; + return countWithResponseAsync(resourceGroupName, workspaceName, tiType, query) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 the count of all TI objects for the workspace along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response countWithResponse(String resourceGroupName, String workspaceName, + TiType tiType, CountQuery query, Context context) { + final String accept = "application/json"; + return service.countSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, tiType, accept, query, context); + } + + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 the count of all TI objects for the workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThreatIntelligenceCountInner count(String resourceGroupName, String workspaceName, TiType tiType) { + final CountQuery query = null; + return countWithResponse(resourceGroupName, workspaceName, tiType, query, Context.NONE).getValue(); + } + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 TI objects for the workspace along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> querySinglePageAsync(String resourceGroupName, String workspaceName, + TiType tiType, Query query) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.query(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, tiType, accept, query, 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 TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 TI objects for the workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux queryAsync(String resourceGroupName, String workspaceName, TiType tiType, + Query query) { + return new PagedFlux<>(() -> querySinglePageAsync(resourceGroupName, workspaceName, tiType, query), + nextLink -> queryNextSinglePageAsync(nextLink)); + } + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 all TI objects for the workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux queryAsync(String resourceGroupName, String workspaceName, TiType tiType) { + final Query query = null; + return new PagedFlux<>(() -> querySinglePageAsync(resourceGroupName, workspaceName, tiType, query), + nextLink -> queryNextSinglePageAsync(nextLink)); + } + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 TI objects for the workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse querySinglePage(String resourceGroupName, String workspaceName, TiType tiType, + Query query) { + final String accept = "application/json"; + Response res = service.querySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, tiType, accept, query, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 TI objects for the workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse querySinglePage(String resourceGroupName, String workspaceName, TiType tiType, + Query query, Context context) { + final String accept = "application/json"; + Response res = service.querySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, tiType, accept, query, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 all TI objects for the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType) { + final Query query = null; + return new PagedIterable<>(() -> querySinglePage(resourceGroupName, workspaceName, tiType, query), + nextLink -> queryNextSinglePage(nextLink)); + } + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 TI objects for the workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType, + Query query, Context context) { + return new PagedIterable<>(() -> querySinglePage(resourceGroupName, workspaceName, tiType, query, context), + nextLink -> queryNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 TI objects for the workspace along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> queryNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.queryNext(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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 TI objects for the workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse queryNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.queryNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 TI objects for the workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse queryNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.queryNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/ThreatIntelligencesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesImpl.java new file mode 100644 index 000000000000..e9d6dcdde32b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ThreatIntelligencesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; +import com.azure.resourcemanager.securityinsights.models.CountQuery; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.TIObject; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceCount; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligences; +import com.azure.resourcemanager.securityinsights.models.TiType; + +public final class ThreatIntelligencesImpl implements ThreatIntelligences { + private static final ClientLogger LOGGER = new ClientLogger(ThreatIntelligencesImpl.class); + + private final ThreatIntelligencesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public ThreatIntelligencesImpl(ThreatIntelligencesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response countWithResponse(String resourceGroupName, String workspaceName, + TiType tiType, CountQuery query, Context context) { + Response inner + = this.serviceClient().countWithResponse(resourceGroupName, workspaceName, tiType, query, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ThreatIntelligenceCountImpl(inner.getValue(), this.manager())); + } + + public ThreatIntelligenceCount count(String resourceGroupName, String workspaceName, TiType tiType) { + ThreatIntelligenceCountInner inner = this.serviceClient().count(resourceGroupName, workspaceName, tiType); + if (inner != null) { + return new ThreatIntelligenceCountImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType) { + PagedIterable inner = this.serviceClient().query(resourceGroupName, workspaceName, tiType); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TIObjectImpl(inner1, this.manager())); + } + + public PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType, Query query, + Context context) { + PagedIterable inner + = this.serviceClient().query(resourceGroupName, workspaceName, tiType, query, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TIObjectImpl(inner1, this.manager())); + } + + private ThreatIntelligencesClient 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/TriggeredAnalyticsRuleRunImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunImpl.java new file mode 100644 index 000000000000..8e71123aabca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import com.azure.resourcemanager.securityinsights.models.ProvisioningState; +import com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRun; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class TriggeredAnalyticsRuleRunImpl implements TriggeredAnalyticsRuleRun { + private TriggeredAnalyticsRuleRunInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + TriggeredAnalyticsRuleRunImpl(TriggeredAnalyticsRuleRunInner 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 OffsetDateTime executionTimeUtc() { + return this.innerModel().executionTimeUtc(); + } + + public String ruleId() { + return this.innerModel().ruleId(); + } + + public String triggeredAnalyticsRuleRunId() { + return this.innerModel().triggeredAnalyticsRuleRunId(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Map ruleRunAdditionalData() { + Map inner = this.innerModel().ruleRunAdditionalData(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public TriggeredAnalyticsRuleRunInner 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/TriggeredAnalyticsRuleRunOperationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsClientImpl.java new file mode 100644 index 000000000000..18cc209582e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsClientImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.TriggeredAnalyticsRuleRunOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TriggeredAnalyticsRuleRunOperationsClient. + */ +public final class TriggeredAnalyticsRuleRunOperationsClientImpl implements TriggeredAnalyticsRuleRunOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final TriggeredAnalyticsRuleRunOperationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of TriggeredAnalyticsRuleRunOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TriggeredAnalyticsRuleRunOperationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(TriggeredAnalyticsRuleRunOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientTriggeredAnalyticsRuleRunOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientTriggeredAnalyticsRuleRunOperations") + public interface TriggeredAnalyticsRuleRunOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/triggeredAnalyticsRuleRuns/{ruleRunId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleRunId") String ruleRunId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/triggeredAnalyticsRuleRuns/{ruleRunId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("ruleRunId") String ruleRunId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String ruleRunId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, ruleRunId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String ruleRunId) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleRunId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String ruleRunId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, ruleRunId, accept, context); + } + + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TriggeredAnalyticsRuleRunInner get(String resourceGroupName, String workspaceName, String ruleRunId) { + return getWithResponse(resourceGroupName, workspaceName, ruleRunId, Context.NONE).getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsImpl.java new file mode 100644 index 000000000000..a7218ba3176e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TriggeredAnalyticsRuleRunOperationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRun; +import com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRunOperations; + +public final class TriggeredAnalyticsRuleRunOperationsImpl implements TriggeredAnalyticsRuleRunOperations { + private static final ClientLogger LOGGER = new ClientLogger(TriggeredAnalyticsRuleRunOperationsImpl.class); + + private final TriggeredAnalyticsRuleRunOperationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public TriggeredAnalyticsRuleRunOperationsImpl(TriggeredAnalyticsRuleRunOperationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String ruleRunId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleRunId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TriggeredAnalyticsRuleRunImpl(inner.getValue(), this.manager())); + } + + public TriggeredAnalyticsRuleRun get(String resourceGroupName, String workspaceName, String ruleRunId) { + TriggeredAnalyticsRuleRunInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleRunId); + if (inner != null) { + return new TriggeredAnalyticsRuleRunImpl(inner, this.manager()); + } else { + return null; + } + } + + private TriggeredAnalyticsRuleRunOperationsClient 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/UpdatesClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesClientImpl.java new file mode 100644 index 000000000000..54b6483fd149 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesClientImpl.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +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.resourcemanager.securityinsights.fluent.UpdatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in UpdatesClient. + */ +public final class UpdatesClientImpl implements UpdatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final UpdatesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of UpdatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdatesClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(UpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientUpdates to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientUpdates") + public interface UpdatesService { + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> recommendation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") String recommendationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RecommendationPatch recommendationPatch, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/recommendations/{recommendationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response recommendationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("recommendationId") String recommendationId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RecommendationPatch recommendationPatch, Context context); + } + + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> recommendationWithResponseAsync(String resourceGroupName, + String workspaceName, String recommendationId, RecommendationPatch recommendationPatch) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.recommendation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, contentType, + accept, recommendationPatch, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recommendationAsync(String resourceGroupName, String workspaceName, + String recommendationId, RecommendationPatch recommendationPatch) { + return recommendationWithResponseAsync(resourceGroupName, workspaceName, recommendationId, recommendationPatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, RecommendationPatch recommendationPatch, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.recommendationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, recommendationId, contentType, accept, + recommendationPatch, context); + } + + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecommendationInner recommendation(String resourceGroupName, String workspaceName, String recommendationId, + RecommendationPatch recommendationPatch) { + return recommendationWithResponse(resourceGroupName, workspaceName, recommendationId, recommendationPatch, + Context.NONE).getValue(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesImpl.java new file mode 100644 index 000000000000..d2fcaf5556e6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.UpdatesClient; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.models.Recommendation; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import com.azure.resourcemanager.securityinsights.models.Updates; + +public final class UpdatesImpl implements Updates { + private static final ClientLogger LOGGER = new ClientLogger(UpdatesImpl.class); + + private final UpdatesClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public UpdatesImpl(UpdatesClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, RecommendationPatch recommendationPatch, Context context) { + Response inner = this.serviceClient() + .recommendationWithResponse(resourceGroupName, workspaceName, recommendationId, recommendationPatch, + context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecommendationImpl(inner.getValue(), this.manager())); + } + + public Recommendation recommendation(String resourceGroupName, String workspaceName, String recommendationId, + RecommendationPatch recommendationPatch) { + RecommendationInner inner = this.serviceClient() + .recommendation(resourceGroupName, workspaceName, recommendationId, recommendationPatch); + if (inner != null) { + return new RecommendationImpl(inner, this.manager()); + } else { + return null; + } + } + + private UpdatesClient 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/WarningImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WarningImpl.java new file mode 100644 index 000000000000..b05c69820d20 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WarningImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation; + +import com.azure.resourcemanager.securityinsights.fluent.models.WarningInner; +import com.azure.resourcemanager.securityinsights.models.Warning; +import com.azure.resourcemanager.securityinsights.models.WarningBody; + +public final class WarningImpl implements Warning { + private WarningInner innerObject; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + WarningImpl(WarningInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public WarningBody warning() { + return this.innerModel().warning(); + } + + public WarningInner 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/WatchlistImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistImpl.java index 20323d728268..a0df608f3fa9 100644 --- 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 @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.SourceType; import com.azure.resourcemanager.securityinsights.models.UserInfo; import com.azure.resourcemanager.securityinsights.models.Watchlist; +import com.azure.resourcemanager.securityinsights.models.WatchlistProvisioningState; import java.time.Duration; import java.time.OffsetDateTime; import java.util.Collections; @@ -52,10 +53,14 @@ public String provider() { return this.innerModel().provider(); } - public Source source() { + public String source() { return this.innerModel().source(); } + public SourceType sourceType() { + return this.innerModel().sourceType(); + } + public OffsetDateTime created() { return this.innerModel().created(); } @@ -125,6 +130,10 @@ public String uploadStatus() { return this.innerModel().uploadStatus(); } + public WatchlistProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + public String resourceGroupName() { return resourceGroupName; } @@ -152,17 +161,14 @@ public WatchlistImpl withExistingWorkspace(String resourceGroupName, String work public Watchlist create() { this.innerObject = serviceManager.serviceClient() .getWatchlists() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), - Context.NONE) - .getValue(); + .createOrUpdate(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), Context.NONE); return this; } public Watchlist create(Context context) { this.innerObject = serviceManager.serviceClient() .getWatchlists() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) - .getValue(); + .createOrUpdate(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context); return this; } @@ -179,17 +185,14 @@ public WatchlistImpl update() { public Watchlist apply() { this.innerObject = serviceManager.serviceClient() .getWatchlists() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), - Context.NONE) - .getValue(); + .createOrUpdate(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), Context.NONE); return this; } public Watchlist apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWatchlists() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context) - .getValue(); + .createOrUpdate(resourceGroupName, workspaceName, watchlistAlias, this.innerModel(), context); return this; } @@ -238,11 +241,16 @@ public WatchlistImpl withProvider(String provider) { return this; } - public WatchlistImpl withSource(Source source) { + public WatchlistImpl withSource(String source) { this.innerModel().withSource(source); return this; } + public WatchlistImpl withSourceType(SourceType sourceType) { + this.innerModel().withSourceType(sourceType); + return this; + } + public WatchlistImpl withCreated(OffsetDateTime created) { this.innerModel().withCreated(created); 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 index 494dfccdee39..3f66bf0405b1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; 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 index a56a0dfd5984..3f02cb3df07f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient; import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner; -import com.azure.resourcemanager.securityinsights.models.WatchlistItemList; +import com.azure.resourcemanager.securityinsights.implementation.models.WatchlistItemList; import reactor.core.publisher.Mono; /** @@ -45,418 +45,298 @@ public final class WatchlistItemsClientImpl implements WatchlistItemsClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of WatchlistItemsClientImpl. * * @param client the instance of the service client containing this operation class. */ - WatchlistItemsClientImpl(SecurityInsightsImpl client) { + WatchlistItemsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientWatchlistItems to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsWatc") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientWatchlistItems") public interface WatchlistItemsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @PathParam("watchlistAlias") String watchlistAlias, @QueryParam("$skipToken") String skipToken, + @PathParam("watchlistAlias") String watchlistAlias, @PathParam("watchlistItemId") String watchlistItemId, @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, + Response getSync(@HostParam("endpoint") 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("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WatchlistItemInner watchlistItem, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") 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("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WatchlistItemInner watchlistItem, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") 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, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "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, + Response deleteSync(@HostParam("endpoint") 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, + Context context); + + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, @QueryParam("$skipToken") String skipToken, @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 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}/watchlistItems") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") 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); + @PathParam("watchlistAlias") String watchlistAlias, @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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get all watchlist Items. + * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @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 watchlistItemId The 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 all watchlist Items along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a watchlist item along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, - String watchlistAlias, 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 (watchlistAlias == null) { - return Mono.error(new IllegalArgumentException("Parameter watchlistAlias is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, skipToken, accept, - context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .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())); } /** - * Get all watchlist Items. + * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @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. + * @param watchlistItemId The 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 all watchlist Items along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a watchlist item on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, - String watchlistAlias, 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 (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, skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get 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 The watchlist alias. - * @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 watchlist Items as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, - String watchlistAlias, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get 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 The 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, - String watchlistAlias) { - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get 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 The watchlist alias. - * @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 watchlist Items as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, - String watchlistAlias, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get 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 The 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, - String watchlistAlias) { - final String skipToken = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken)); + private Mono getAsync(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get all watchlist Items. + * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @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 watchlistItemId The 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 all watchlist Items as paginated response with {@link PagedIterable}. + * @return a watchlist item along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, - String skipToken, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, accept, context); } /** * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 item along with {@link Response} on successful completion of {@link Mono}. + * @return a watchlist item. */ @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())); + public WatchlistItemInner get(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId) { + return getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) + .getValue(); } /** - * Get a watchlist item. + * Create or update a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The watchlist item id (GUID). - * @param context The context to associate with this operation. + * @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 a watchlist item along with {@link Response} on successful completion of {@link Mono}. + * @return represents a Watchlist Item in Azure Security Insights along with {@link Response} on successful + * completion of {@link Mono}. */ @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.")); - } + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String watchlistAlias, String watchlistItemId, WatchlistItemInner watchlistItem) { + final String contentType = "application/json"; 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); + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + contentType, accept, watchlistItem, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get a watchlist item. + * Create or update a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 a watchlist item on successful completion of {@link Mono}. + * @return represents a Watchlist Item in Azure Security Insights on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String workspaceName, String watchlistAlias, - String watchlistItemId) { - return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId, WatchlistItemInner watchlistItem) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + watchlistItem).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get a watchlist item. + * Create or update a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 a watchlist item along with {@link Response}. + * @return represents a Watchlist Item in Azure Security Insights along with {@link Response}. */ @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(); + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, String watchlistItemId, WatchlistItemInner watchlistItem, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + contentType, accept, watchlistItem, context); } /** - * Get a watchlist item. + * Create or update a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 a watchlist item. + * @return represents a Watchlist Item in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistItemInner get(String resourceGroupName, String workspaceName, String watchlistAlias, - String watchlistItemId) { - return getWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, Context.NONE) - .getValue(); + public WatchlistItemInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, WatchlistItemInner watchlistItem) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + watchlistItem, Context.NONE).getValue(); } /** * 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The watchlist item id (GUID). * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -467,33 +347,10 @@ public WatchlistItemInner get(String resourceGroupName, String workspaceName, St @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)) + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -501,51 +358,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * 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 The watchlist alias. - * @param watchlistItemId The 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 {@link Response} on successful completion of {@link Mono}. - */ - @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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The watchlist item id (GUID). * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -564,7 +377,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S * 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The watchlist item id (GUID). * @param context The context to associate with this operation. @@ -576,15 +389,16 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @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(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, + 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The watchlist item id (GUID). * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -597,169 +411,163 @@ public void delete(String resourceGroupName, String workspaceName, String watchl } /** - * Create or update a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The watchlist item id (GUID). - * @param watchlistItem The watchlist item. + * @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 represents a Watchlist Item in Azure Security Insights along with {@link Response} on successful - * completion of {@link Mono}. + * @return all watchlist Items along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, String skipToken) { 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)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, 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())); } /** - * Create or update a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The watchlist item id (GUID). - * @param watchlistItem The watchlist item. - * @param context The context to associate with this operation. + * @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 represents a Watchlist Item in Azure Security Insights along with {@link Response} on successful - * completion of {@link Mono}. + * @return all watchlist Items as paginated response with {@link PagedFlux}. */ - @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); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Create or update a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The 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 on successful completion of {@link Mono}. + * @return all watchlist Items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String watchlistAlias) { + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, watchlistAlias, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The watchlist alias. + * @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 watchlist Items along with {@link PagedResponse}. */ @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(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String watchlistAlias, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The watchlist item id (GUID). - * @param watchlistItem The watchlist item. + * @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 represents a Watchlist Item in Azure Security Insights along with {@link Response}. + * @return all watchlist Items along with {@link PagedResponse}. */ @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(); + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String watchlistAlias, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The 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. + * @return all watchlist Items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistItemInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, - String watchlistItemId, WatchlistItemInner watchlistItem) { - return createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, - watchlistItem, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String watchlistAlias) { + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, watchlistAlias, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get all watchlist Items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The watchlist alias. + * @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 watchlist Items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, + String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, watchlistAlias, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -769,17 +577,10 @@ public WatchlistItemInner createOrUpdate(String resourceGroupName, String worksp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all watchlist Items along with {@link PagedResponse} on successful completion of {@link Mono}. */ @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(), @@ -787,6 +588,24 @@ private Mono> listNextSinglePageAsync(String n .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -795,21 +614,13 @@ private Mono> listNextSinglePageAsync(String n * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all watchlist Items along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index dcb2ecf24fa9..0287ddd8a6b5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,29 +27,12 @@ public WatchlistItemsImpl(WatchlistItemsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, workspaceName, watchlistAlias); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistItemImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, - String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, workspaceName, watchlistAlias, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistItemImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WatchlistItemImpl(inner.getValue(), this.manager())); } public WatchlistItem get(String resourceGroupName, String workspaceName, String watchlistAlias, @@ -73,6 +56,19 @@ public void delete(String resourceGroupName, String workspaceName, String watchl this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId); } + public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, watchlistAlias); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistItemImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, + String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, watchlistAlias, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistItemImpl(inner1, this.manager())); + } + public WatchlistItem getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 index e64ae3003dbc..7683707d34d2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -26,11 +26,17 @@ 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.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient; import com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner; -import com.azure.resourcemanager.securityinsights.models.WatchlistList; +import com.azure.resourcemanager.securityinsights.implementation.models.WatchlistList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -45,383 +51,395 @@ public final class WatchlistsClientImpl implements WatchlistsClient { /** * The service client containing this operation class. */ - private final SecurityInsightsImpl client; + private final SecurityInsightsManagementClientImpl client; /** * Initializes an instance of WatchlistsClientImpl. * * @param client the instance of the service client containing this operation class. */ - WatchlistsClientImpl(SecurityInsightsImpl client) { + WatchlistsClientImpl(SecurityInsightsManagementClientImpl 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. + * The interface defining all the services for SecurityInsightsManagementClientWatchlists to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "SecurityInsightsWatc") + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientWatchlists") public interface WatchlistsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + @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}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") 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 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") 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); + @PathParam("watchlistAlias") String watchlistAlias, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WatchlistInner watchlist, + 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, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WatchlistInner watchlist, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/watchlists/{watchlistAlias}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("watchlistAlias") String watchlistAlias, Context context); + + @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("endpoint") 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); + @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/watchlists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get all watchlists, without watchlist items. + * Get 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 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 workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 watchlists, without watchlist items along with {@link PagedResponse} on successful completion of + * @return a watchlist, without its watchlist items along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, - 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.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String watchlistAlias) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, workspaceName, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .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())); } /** - * Get all watchlists, without watchlist items. + * Get 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 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 workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String watchlistAlias) { + return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get 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 monitor workspace. + * @param watchlistAlias The 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 watchlists, without watchlist items along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a watchlist, without its watchlist items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, - 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.")); - } + public Response getWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, watchlistAlias, accept, context); } /** - * Get all watchlists, without watchlist items. + * Get 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 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 workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 watchlists, without watchlist items as paginated response with {@link PagedFlux}. + * @return a watchlist, without its watchlist items. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias) { + return getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE).getValue(); } /** - * Get all watchlists, without watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 all watchlists, without watchlist items as paginated response with {@link PagedFlux}. + * @return represents a Watchlist in Azure Security Insights along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, contentType, accept, + watchlist, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get all watchlists, without watchlist items. + * Create or update 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 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. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 all watchlists, without watchlist items as paginated response with {@link PagedFlux}. + * @return represents a Watchlist in Azure Security Insights along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skipToken, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, WatchlistInner watchlist) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, contentType, accept, + watchlist, Context.NONE); } /** - * Get all watchlists, without watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 all watchlists, without watchlist items as paginated response with {@link PagedIterable}. + * @return represents a Watchlist in Azure Security Insights along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName) { - final String skipToken = null; - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skipToken)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias, WatchlistInner watchlist, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, contentType, accept, + watchlist, context); } /** - * Get all watchlists, without watchlist items. + * Create or update 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 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. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 all watchlists, without watchlist items as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of represents a Watchlist in Azure Security Insights. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, skipToken, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WatchlistInner> beginCreateOrUpdateAsync(String resourceGroupName, + String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + WatchlistInner.class, WatchlistInner.class, this.client.getContext()); } /** - * Get a watchlist, without its watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 a watchlist, without its watchlist items along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of represents a Watchlist in Azure Security Insights. */ - @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())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WatchlistInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String watchlistAlias, WatchlistInner watchlist) { + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlist); + return this.client.getLroResult(response, WatchlistInner.class, + WatchlistInner.class, Context.NONE); } /** - * Get a watchlist, without its watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 a watchlist, without its watchlist items along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of represents a Watchlist in Azure Security Insights. */ - @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); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WatchlistInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String watchlistAlias, WatchlistInner watchlist, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlist, context); + return this.client.getLroResult(response, WatchlistInner.class, + WatchlistInner.class, context); } /** - * Get a watchlist, without its watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 a watchlist, without its watchlist items on successful completion of {@link Mono}. + * @return represents a Watchlist in Azure Security Insights on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String workspaceName, String watchlistAlias) { - return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String watchlistAlias, WatchlistInner watchlist) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get a watchlist, without its watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param context The context to associate with this operation. + * @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 a watchlist, without its watchlist items along with {@link Response}. + * @return represents a Watchlist in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String workspaceName, - String watchlistAlias, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); + public WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + WatchlistInner watchlist) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, watchlistAlias, watchlist).getFinalResult(); } /** - * Get a watchlist, without its watchlist items. + * Create or update 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 a watchlist, without its watchlist items. + * @return represents a Watchlist in Azure Security Insights. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistInner get(String resourceGroupName, String workspaceName, String watchlistAlias) { - return getWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE).getValue(); + public WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, + WatchlistInner watchlist, Context context) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, watchlistAlias, watchlist, context) + .getFinalResult(); } /** * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -429,30 +447,11 @@ public WatchlistInner get(String resourceGroupName, String workspaceName, String * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + 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)) + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -460,81 +459,118 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String watchlistAlias) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, Context.NONE); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + private Response deleteWithResponse(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); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, watchlistAlias, 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 {@link Mono} that completes when a successful response is received. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String watchlistAlias) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias) - .flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, + String watchlistAlias) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String watchlistAlias) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + String watchlistAlias, Context context) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a watchlist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, context).block(); + private Mono deleteAsync(String resourceGroupName, String workspaceName, String watchlistAlias) { + return beginDeleteAsync(resourceGroupName, workspaceName, watchlistAlias).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -542,164 +578,170 @@ public Response deleteWithResponse(String resourceGroupName, String worksp */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, String watchlistAlias) { - deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, Context.NONE); + beginDelete(resourceGroupName, workspaceName, watchlistAlias).getFinalResult(); } /** - * Create or update 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. + * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 along with {@link Response} on successful completion of + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + beginDelete(resourceGroupName, workspaceName, watchlistAlias, context).getFinalResult(); + } + + /** + * Get all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @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 watchlists, without watchlist items along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @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(); - } + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String skipToken) { 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)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, 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())); } /** - * Create or update 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. + * Get 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 watchlistAlias The watchlist alias. - * @param watchlist The watchlist. - * @param context The context to associate with this operation. + * @param workspaceName The name of the monitor workspace. + * @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 represents a Watchlist in Azure Security Insights along with {@link Response} on successful completion of - * {@link Mono}. + * @return all watchlists, without watchlist items as paginated response with {@link PagedFlux}. */ - @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); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Create or update 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. + * Get 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 watchlistAlias The watchlist alias. - * @param watchlist The watchlist. + * @param workspaceName The name of the monitor 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 represents a Watchlist in Azure Security Insights on successful completion of {@link Mono}. + * @return all watchlists, without watchlist items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @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 watchlists, without watchlist items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - String watchlistAlias, WatchlistInner watchlist) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String skipToken) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update 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. + * Get 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 watchlistAlias The watchlist alias. - * @param watchlist The watchlist. + * @param workspaceName The name of the monitor workspace. + * @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 represents a Watchlist in Azure Security Insights along with {@link Response}. + * @return all watchlists, without watchlist items along with {@link PagedResponse}. */ @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(); + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String skipToken, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update 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. + * Get 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 watchlistAlias The watchlist alias. - * @param watchlist The watchlist. + * @param workspaceName The name of the monitor 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 represents a Watchlist in Azure Security Insights. + * @return all watchlists, without watchlist items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WatchlistInner createOrUpdate(String resourceGroupName, String workspaceName, String watchlistAlias, - WatchlistInner watchlist) { - return createOrUpdateWithResponse(resourceGroupName, workspaceName, watchlistAlias, watchlist, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get all watchlists, without watchlist items. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @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 watchlists, without watchlist items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -709,17 +751,11 @@ public WatchlistInner createOrUpdate(String resourceGroupName, String workspaceN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all watchlists, without watchlist items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @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(), @@ -727,6 +763,23 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -735,21 +788,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all watchlists, without watchlist items along with {@link PagedResponse}. */ @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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 index 0bbd9efd655f..7e2e149718af 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.implementation; @@ -27,28 +27,12 @@ public WatchlistsImpl(WatchlistsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String workspaceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, workspaceName, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistImpl(inner1, this.manager())); - } - 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; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WatchlistImpl(inner.getValue(), this.manager())); } public Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias) { @@ -60,15 +44,26 @@ public Watchlist get(String resourceGroupName, String workspaceName, String watc } } - public Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, watchlistAlias, context); - } - public void delete(String resourceGroupName, String workspaceName, String watchlistAlias) { this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias); } + public void delete(String resourceGroupName, String workspaceName, String watchlistAlias, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, watchlistAlias, context); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WatchlistImpl(inner1, this.manager())); + } + public Watchlist getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -123,10 +118,10 @@ public void deleteById(String id) { 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); + this.delete(resourceGroupName, workspaceName, watchlistAlias, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -142,7 +137,7 @@ public Response deleteByIdWithResponse(String id, Context context) { 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); + this.delete(resourceGroupName, workspaceName, watchlistAlias, context); } private WatchlistsClient serviceClient() { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentImpl.java new file mode 100644 index 000000000000..87abe4768e2d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerAssignmentInner; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import com.azure.resourcemanager.securityinsights.models.JobProvisioningState; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignment; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class WorkspaceManagerAssignmentImpl + implements WorkspaceManagerAssignment, WorkspaceManagerAssignment.Definition, WorkspaceManagerAssignment.Update { + private WorkspaceManagerAssignmentInner 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 targetResourceName() { + return this.innerModel().targetResourceName(); + } + + public OffsetDateTime lastJobEndTime() { + return this.innerModel().lastJobEndTime(); + } + + public JobProvisioningState lastJobProvisioningState() { + return this.innerModel().lastJobProvisioningState(); + } + + public List items() { + List inner = this.innerModel().items(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public WorkspaceManagerAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String workspaceManagerAssignmentName; + + public WorkspaceManagerAssignmentImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public WorkspaceManagerAssignment create() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerAssignments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerAssignment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerAssignments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, + this.innerModel(), context) + .getValue(); + return this; + } + + WorkspaceManagerAssignmentImpl(String name, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new WorkspaceManagerAssignmentInner(); + this.serviceManager = serviceManager; + this.workspaceManagerAssignmentName = name; + } + + public WorkspaceManagerAssignmentImpl update() { + return this; + } + + public WorkspaceManagerAssignment apply() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerAssignments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerAssignment apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerAssignments() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, + this.innerModel(), context) + .getValue(); + return this; + } + + WorkspaceManagerAssignmentImpl(WorkspaceManagerAssignmentInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.workspaceManagerAssignmentName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaceManagerAssignments"); + } + + public WorkspaceManagerAssignment refresh() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerAssignments() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerAssignment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerAssignments() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context) + .getValue(); + return this; + } + + public WorkspaceManagerAssignmentImpl withTargetResourceName(String targetResourceName) { + this.innerModel().withTargetResourceName(targetResourceName); + return this; + } + + public WorkspaceManagerAssignmentImpl withItems(List items) { + this.innerModel().withItems(items); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsClientImpl.java new file mode 100644 index 000000000000..02b2a03565a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsClientImpl.java @@ -0,0 +1,631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; +import com.azure.resourcemanager.securityinsights.implementation.models.JobList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerAssignmentJobsClient. + */ +public final class WorkspaceManagerAssignmentJobsClientImpl implements WorkspaceManagerAssignmentJobsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WorkspaceManagerAssignmentJobsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagerAssignmentJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerAssignmentJobsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(WorkspaceManagerAssignmentJobsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientWorkspaceManagerAssignmentJobs to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientWorkspaceManagerAssignmentJobs") + public interface WorkspaceManagerAssignmentJobsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @PathParam("jobName") String jobName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs/{jobName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @PathParam("jobName") String jobName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @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/workspaceManagerAssignments/{workspaceManagerAssignmentName}/jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 assignment job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 assignment job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + return createWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 assignment job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, accept, + context); + } + + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 assignment job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner create(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName) { + return createWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, Context.NONE) + .getValue(); + } + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, accept, context); + } + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner get(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, + String jobName) { + return getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, Context.NONE) + .getValue(); + } + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + jobName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, + context); + } + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 workspaceManagerAssignmentName, + String jobName) { + deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, Context.NONE); + } + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 jobs for the specified workspace manager assignment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + 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 jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 jobs for the specified workspace manager assignment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String orderby, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, + workspaceManagerAssignmentName, orderby, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 jobs for the specified workspace manager assignment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, + workspaceManagerAssignmentName, orderby, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 jobs for the specified workspace manager assignment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, orderby, + top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 jobs for the specified workspace manager assignment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, orderby, + top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 jobs for the specified workspace manager assignment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, + workspaceManagerAssignmentName, orderby, top, skipToken), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 jobs for the specified workspace manager assignment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, + workspaceManagerAssignmentName, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 jobs for the specified workspace manager assignment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 jobs for the specified workspace manager assignment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 jobs for the specified workspace manager assignment along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/WorkspaceManagerAssignmentJobsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsImpl.java new file mode 100644 index 000000000000..a6f6a59994d8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsImpl.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerAssignmentJobsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; +import com.azure.resourcemanager.securityinsights.models.Job; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignmentJobs; + +public final class WorkspaceManagerAssignmentJobsImpl implements WorkspaceManagerAssignmentJobs { + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerAssignmentJobsImpl.class); + + private final WorkspaceManagerAssignmentJobsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public WorkspaceManagerAssignmentJobsImpl(WorkspaceManagerAssignmentJobsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response createWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + Response inner = this.serviceClient() + .createWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } + + public Job create(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName) { + JobInner inner = this.serviceClient().create(resourceGroupName, workspaceName, workspaceManagerAssignmentName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } + + public Job get(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, + String jobName) { + JobInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, + String jobName) { + this.serviceClient().delete(resourceGroupName, workspaceName, workspaceManagerAssignmentName, jobName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, workspaceManagerAssignmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, workspaceName, workspaceManagerAssignmentName, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + private WorkspaceManagerAssignmentJobsClient 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/WorkspaceManagerAssignmentsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsClientImpl.java new file mode 100644 index 000000000000..4784c4c38978 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsClientImpl.java @@ -0,0 +1,624 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerAssignmentList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerAssignmentsClient. + */ +public final class WorkspaceManagerAssignmentsClientImpl implements WorkspaceManagerAssignmentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WorkspaceManagerAssignmentsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagerAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerAssignmentsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(WorkspaceManagerAssignmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientWorkspaceManagerAssignments to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientWorkspaceManagerAssignments") + public interface WorkspaceManagerAssignmentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerAssignmentInner workspaceManagerAssignment, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerAssignmentInner workspaceManagerAssignment, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments/{workspaceManagerAssignmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerAssignmentName") String workspaceManagerAssignmentName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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/workspaceManagerAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerAssignmentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 workspace manager assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, workspaceManagerAssignmentName, accept, context); + } + + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerAssignmentInner get(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + return getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param workspaceManagerAssignment The workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerAssignmentName, + WorkspaceManagerAssignmentInner workspaceManagerAssignment) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + contentType, accept, workspaceManagerAssignment, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param workspaceManagerAssignment The workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, WorkspaceManagerAssignmentInner workspaceManagerAssignment) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName, + workspaceManagerAssignment).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param workspaceManagerAssignment The workspace manager assignment. + * @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 workspace manager assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String workspaceManagerAssignmentName, + WorkspaceManagerAssignmentInner workspaceManagerAssignment, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, + contentType, accept, workspaceManagerAssignment, context); + } + + /** + * Creates or updates a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param workspaceManagerAssignment The workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerAssignmentInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, WorkspaceManagerAssignmentInner workspaceManagerAssignment) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, + workspaceManagerAssignment, Context.NONE).getValue(); + } + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerAssignmentName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + } + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceManagerAssignmentName) { + deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, Context.NONE); + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager assignments for the Sentinel workspace manager along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, 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 workspace manager assignments for the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager assignments for the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager assignments for the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignments for the Sentinel workspace manager along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager assignments for the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 workspace manager assignments for the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/WorkspaceManagerAssignmentsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsImpl.java new file mode 100644 index 000000000000..f8268bad9b83 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerAssignmentsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignment; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignments; + +public final class WorkspaceManagerAssignmentsImpl implements WorkspaceManagerAssignments { + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerAssignmentsImpl.class); + + private final WorkspaceManagerAssignmentsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public WorkspaceManagerAssignmentsImpl(WorkspaceManagerAssignmentsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerAssignmentImpl(inner.getValue(), this.manager())); + } + + public WorkspaceManagerAssignment get(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName) { + WorkspaceManagerAssignmentInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, workspaceManagerAssignmentName); + if (inner != null) { + return new WorkspaceManagerAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName) { + this.serviceClient().delete(resourceGroupName, workspaceName, workspaceManagerAssignmentName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WorkspaceManagerAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WorkspaceManagerAssignmentImpl(inner1, this.manager())); + } + + public WorkspaceManagerAssignment getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerAssignments"); + if (workspaceManagerAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerAssignments'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerAssignments"); + if (workspaceManagerAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerAssignments'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerAssignments"); + if (workspaceManagerAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerAssignments'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerAssignments"); + if (workspaceManagerAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerAssignments'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerAssignmentName, context); + } + + private WorkspaceManagerAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public WorkspaceManagerAssignmentImpl define(String name) { + return new WorkspaceManagerAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationImpl.java new file mode 100644 index 000000000000..aa3799e4c891 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerConfigurationInner; +import com.azure.resourcemanager.securityinsights.models.Mode; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfiguration; + +public final class WorkspaceManagerConfigurationImpl implements WorkspaceManagerConfiguration, + WorkspaceManagerConfiguration.Definition, WorkspaceManagerConfiguration.Update { + private WorkspaceManagerConfigurationInner 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 Mode mode() { + return this.innerModel().mode(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public WorkspaceManagerConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String workspaceManagerConfigurationName; + + public WorkspaceManagerConfigurationImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public WorkspaceManagerConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerConfigurations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerConfigurations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, + this.innerModel(), context) + .getValue(); + return this; + } + + WorkspaceManagerConfigurationImpl(String name, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new WorkspaceManagerConfigurationInner(); + this.serviceManager = serviceManager; + this.workspaceManagerConfigurationName = name; + } + + public WorkspaceManagerConfigurationImpl update() { + return this; + } + + public WorkspaceManagerConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerConfigurations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerConfigurations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, + this.innerModel(), context) + .getValue(); + return this; + } + + WorkspaceManagerConfigurationImpl(WorkspaceManagerConfigurationInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.workspaceManagerConfigurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaceManagerConfigurations"); + } + + public WorkspaceManagerConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerConfigurations() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerConfigurations() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context) + .getValue(); + return this; + } + + public WorkspaceManagerConfigurationImpl withMode(Mode mode) { + this.innerModel().withMode(mode); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsClientImpl.java new file mode 100644 index 000000000000..febf856578cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsClientImpl.java @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerConfigurationList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerConfigurationsClient. + */ +public final class WorkspaceManagerConfigurationsClientImpl implements WorkspaceManagerConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WorkspaceManagerConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagerConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerConfigurationsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(WorkspaceManagerConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientWorkspaceManagerConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientWorkspaceManagerConfigurations") + public interface WorkspaceManagerConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerConfigurationInner workspaceManagerConfiguration, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerConfigurationInner workspaceManagerConfiguration, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations/{workspaceManagerConfigurationName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerConfigurationName") String workspaceManagerConfigurationName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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/workspaceManagerConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerConfigurationName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerConfigurationName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @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 workspace manager configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, workspaceManagerConfigurationName, accept, context); + } + + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerConfigurationInner get(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName) { + return getWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @param workspaceManagerConfiguration The workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerConfigurationName, + WorkspaceManagerConfigurationInner workspaceManagerConfiguration) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerConfigurationName, + contentType, accept, workspaceManagerConfiguration, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @param workspaceManagerConfiguration The workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, WorkspaceManagerConfigurationInner workspaceManagerConfiguration) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerConfigurationName, + workspaceManagerConfiguration).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @param workspaceManagerConfiguration The workspace manager configuration. + * @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 workspace manager configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String workspaceManagerConfigurationName, + WorkspaceManagerConfigurationInner workspaceManagerConfiguration, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerConfigurationName, + contentType, accept, workspaceManagerConfiguration, context); + } + + /** + * Creates or updates a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @param workspaceManagerConfiguration The workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerConfigurationInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, WorkspaceManagerConfigurationInner workspaceManagerConfiguration) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, + workspaceManagerConfiguration, Context.NONE).getValue(); + } + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerConfigurationName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerConfigurationName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerConfigurationName, + context); + } + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceManagerConfigurationName) { + deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, Context.NONE); + } + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager configurations for a Sentinel workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, 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 workspace manager configurations for a Sentinel workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager configurations for a Sentinel workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager configurations for a Sentinel workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configurations for a Sentinel workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager configurations for a Sentinel workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 workspace manager configurations for a Sentinel workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/WorkspaceManagerConfigurationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsImpl.java new file mode 100644 index 000000000000..f736a6bbebca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerConfigurationsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfiguration; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfigurations; + +public final class WorkspaceManagerConfigurationsImpl implements WorkspaceManagerConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerConfigurationsImpl.class); + + private final WorkspaceManagerConfigurationsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public WorkspaceManagerConfigurationsImpl(WorkspaceManagerConfigurationsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerConfigurationImpl(inner.getValue(), this.manager())); + } + + public WorkspaceManagerConfiguration get(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName) { + WorkspaceManagerConfigurationInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, workspaceManagerConfigurationName); + if (inner != null) { + return new WorkspaceManagerConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String workspaceManagerConfigurationName) { + this.serviceClient().delete(resourceGroupName, workspaceName, workspaceManagerConfigurationName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WorkspaceManagerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WorkspaceManagerConfigurationImpl(inner1, this.manager())); + } + + public WorkspaceManagerConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerConfigurations"); + if (workspaceManagerConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'workspaceManagerConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerConfigurations"); + if (workspaceManagerConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'workspaceManagerConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerConfigurations"); + if (workspaceManagerConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'workspaceManagerConfigurations'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerConfigurations"); + if (workspaceManagerConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'workspaceManagerConfigurations'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerConfigurationName, context); + } + + private WorkspaceManagerConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public WorkspaceManagerConfigurationImpl define(String name) { + return new WorkspaceManagerConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupImpl.java new file mode 100644 index 000000000000..2aa623423f88 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerGroupInner; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroup; +import java.util.Collections; +import java.util.List; + +public final class WorkspaceManagerGroupImpl + implements WorkspaceManagerGroup, WorkspaceManagerGroup.Definition, WorkspaceManagerGroup.Update { + private WorkspaceManagerGroupInner 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 description() { + return this.innerModel().description(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List memberResourceNames() { + List inner = this.innerModel().memberResourceNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public WorkspaceManagerGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String workspaceManagerGroupName; + + public WorkspaceManagerGroupImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public WorkspaceManagerGroup create() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerGroups() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerGroups() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, this.innerModel(), + context) + .getValue(); + return this; + } + + WorkspaceManagerGroupImpl(String name, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new WorkspaceManagerGroupInner(); + this.serviceManager = serviceManager; + this.workspaceManagerGroupName = name; + } + + public WorkspaceManagerGroupImpl update() { + return this; + } + + public WorkspaceManagerGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerGroups() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerGroups() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, this.innerModel(), + context) + .getValue(); + return this; + } + + WorkspaceManagerGroupImpl(WorkspaceManagerGroupInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.workspaceManagerGroupName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaceManagerGroups"); + } + + public WorkspaceManagerGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerGroups() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerGroups() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, context) + .getValue(); + return this; + } + + public WorkspaceManagerGroupImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public WorkspaceManagerGroupImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkspaceManagerGroupImpl withMemberResourceNames(List memberResourceNames) { + this.innerModel().withMemberResourceNames(memberResourceNames); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsClientImpl.java new file mode 100644 index 000000000000..0e5216add86a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsClientImpl.java @@ -0,0 +1,621 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerGroupList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerGroupsClient. + */ +public final class WorkspaceManagerGroupsClientImpl implements WorkspaceManagerGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final WorkspaceManagerGroupsService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagerGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerGroupsClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(WorkspaceManagerGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientWorkspaceManagerGroups to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientWorkspaceManagerGroups") + public interface WorkspaceManagerGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerGroupInner workspaceManagerGroup, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerGroupInner workspaceManagerGroup, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerGroupName") String workspaceManagerGroupName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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/workspaceManagerGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerGroupName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @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 workspace manager group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, workspaceManagerGroupName, accept, context); + } + + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerGroupInner get(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName) { + return getWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, Context.NONE).getValue(); + } + + /** + * Creates or updates a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @param workspaceManagerGroup The workspace manager group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerGroupName, WorkspaceManagerGroupInner workspaceManagerGroup) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerGroupName, + contentType, accept, workspaceManagerGroup, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @param workspaceManagerGroup The workspace manager group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, WorkspaceManagerGroupInner workspaceManagerGroup) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, + workspaceManagerGroup).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @param workspaceManagerGroup The workspace manager group object. + * @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 workspace manager group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String workspaceManagerGroupName, WorkspaceManagerGroupInner workspaceManagerGroup, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerGroupName, contentType, + accept, workspaceManagerGroup, context); + } + + /** + * Creates or updates a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @param workspaceManagerGroup The workspace manager group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerGroupInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, WorkspaceManagerGroupInner workspaceManagerGroup) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, + workspaceManagerGroup, Context.NONE).getValue(); + } + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerGroupName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String workspaceManagerGroupName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerGroupName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerGroupName, context); + } + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceManagerGroupName) { + deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, Context.NONE); + } + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager groups in the Sentinel workspace manager along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, 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 workspace manager groups in the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager groups in the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager groups in the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager groups in the Sentinel workspace manager along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager groups in the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 workspace manager groups in the Sentinel workspace manager along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/WorkspaceManagerGroupsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsImpl.java new file mode 100644 index 000000000000..ce65e934ebfc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerGroupsClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroup; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroups; + +public final class WorkspaceManagerGroupsImpl implements WorkspaceManagerGroups { + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerGroupsImpl.class); + + private final WorkspaceManagerGroupsClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public WorkspaceManagerGroupsImpl(WorkspaceManagerGroupsClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerGroupImpl(inner.getValue(), this.manager())); + } + + public WorkspaceManagerGroup get(String resourceGroupName, String workspaceName, String workspaceManagerGroupName) { + WorkspaceManagerGroupInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, workspaceManagerGroupName); + if (inner != null) { + return new WorkspaceManagerGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String workspaceManagerGroupName) { + this.serviceClient().delete(resourceGroupName, workspaceName, workspaceManagerGroupName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceManagerGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceManagerGroupImpl(inner1, this.manager())); + } + + public WorkspaceManagerGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerGroups"); + if (workspaceManagerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerGroups"); + if (workspaceManagerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerGroups"); + if (workspaceManagerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerGroups'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerGroupName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerGroups"); + if (workspaceManagerGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerGroups'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerGroupName, context); + } + + private WorkspaceManagerGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public WorkspaceManagerGroupImpl define(String name) { + return new WorkspaceManagerGroupImpl(name, this.manager()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMemberImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMemberImpl.java new file mode 100644 index 000000000000..d03ff3cf94e6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMemberImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerMemberInner; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMember; + +public final class WorkspaceManagerMemberImpl + implements WorkspaceManagerMember, WorkspaceManagerMember.Definition, WorkspaceManagerMember.Update { + private WorkspaceManagerMemberInner 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 targetWorkspaceResourceId() { + return this.innerModel().targetWorkspaceResourceId(); + } + + public String targetWorkspaceTenantId() { + return this.innerModel().targetWorkspaceTenantId(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public WorkspaceManagerMemberInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String workspaceManagerMemberName; + + public WorkspaceManagerMemberImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public WorkspaceManagerMember create() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerMembers() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerMember create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerMembers() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, this.innerModel(), + context) + .getValue(); + return this; + } + + WorkspaceManagerMemberImpl(String name, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = new WorkspaceManagerMemberInner(); + this.serviceManager = serviceManager; + this.workspaceManagerMemberName = name; + } + + public WorkspaceManagerMemberImpl update() { + return this; + } + + public WorkspaceManagerMember apply() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerMembers() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerMember apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerMembers() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, this.innerModel(), + context) + .getValue(); + return this; + } + + WorkspaceManagerMemberImpl(WorkspaceManagerMemberInner innerObject, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.workspaceManagerMemberName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaceManagerMembers"); + } + + public WorkspaceManagerMember refresh() { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerMembers() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, Context.NONE) + .getValue(); + return this; + } + + public WorkspaceManagerMember refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWorkspaceManagerMembers() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, context) + .getValue(); + return this; + } + + public WorkspaceManagerMemberImpl withTargetWorkspaceResourceId(String targetWorkspaceResourceId) { + this.innerModel().withTargetWorkspaceResourceId(targetWorkspaceResourceId); + return this; + } + + public WorkspaceManagerMemberImpl withTargetWorkspaceTenantId(String targetWorkspaceTenantId) { + this.innerModel().withTargetWorkspaceTenantId(targetWorkspaceTenantId); + return this; + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersClientImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersClientImpl.java new file mode 100644 index 000000000000..c68ff8e70624 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersClientImpl.java @@ -0,0 +1,626 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerMembersList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WorkspaceManagerMembersClient. + */ +public final class WorkspaceManagerMembersClientImpl implements WorkspaceManagerMembersClient { + /** + * The proxy service used to perform REST calls. + */ + private final WorkspaceManagerMembersService service; + + /** + * The service client containing this operation class. + */ + private final SecurityInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagerMembersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagerMembersClientImpl(SecurityInsightsManagementClientImpl client) { + this.service = RestProxy.create(WorkspaceManagerMembersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityInsightsManagementClientWorkspaceManagerMembers to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityInsightsManagementClientWorkspaceManagerMembers") + public interface WorkspaceManagerMembersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{workspaceManagerMemberName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{workspaceManagerMemberName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{workspaceManagerMemberName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerMemberInner workspaceManagerMember, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{workspaceManagerMemberName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceManagerMemberInner workspaceManagerMember, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{workspaceManagerMemberName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers/{workspaceManagerMemberName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("workspaceManagerMemberName") String workspaceManagerMemberName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerMembers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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/workspaceManagerMembers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager member along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerMemberName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerMemberName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager member on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName) { + return getWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerMemberName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @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 workspace manager member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, workspaceManagerMemberName, accept, context); + } + + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerMemberInner get(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName) { + return getWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, Context.NONE).getValue(); + } + + /** + * Creates or updates a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @param workspaceManagerMember The workspace manager member object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager member along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String workspaceManagerMemberName, WorkspaceManagerMemberInner workspaceManagerMember) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerMemberName, + contentType, accept, workspaceManagerMember, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @param workspaceManagerMember The workspace manager member object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager member on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, WorkspaceManagerMemberInner workspaceManagerMember) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerMemberName, + workspaceManagerMember).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @param workspaceManagerMember The workspace manager member object. + * @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 workspace manager member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String workspaceName, String workspaceManagerMemberName, WorkspaceManagerMemberInner workspaceManagerMember, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerMemberName, contentType, + accept, workspaceManagerMember, context); + } + + /** + * Creates or updates a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @param workspaceManagerMember The workspace manager member object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceManagerMemberInner createOrUpdate(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, WorkspaceManagerMemberInner workspaceManagerMember) { + return createOrUpdateWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, + workspaceManagerMember, Context.NONE).getValue(); + } + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerMemberName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String workspaceManagerMemberName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, workspaceManagerMemberName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, workspaceManagerMemberName, context); + } + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceManagerMemberName) { + deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, Context.NONE); + } + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager members that exist for the given Sentinel workspace manager along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String workspaceName, String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, workspaceName, 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 workspace manager members that exist for the given Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager members that exist for the given Sentinel workspace manager along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager members that exist for the given Sentinel workspace manager along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, orderby, top, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + final String orderby = null; + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, + String orderby, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, workspaceName, orderby, top, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager members that exist for the given Sentinel workspace manager along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspace manager members that exist for the given Sentinel workspace manager along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 workspace manager members that exist for the given Sentinel workspace manager along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/WorkspaceManagerMembersImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersImpl.java new file mode 100644 index 000000000000..5943ae2b8007 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerMembersClient; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMember; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMembers; + +public final class WorkspaceManagerMembersImpl implements WorkspaceManagerMembers { + private static final ClientLogger LOGGER = new ClientLogger(WorkspaceManagerMembersImpl.class); + + private final WorkspaceManagerMembersClient innerClient; + + private final com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager; + + public WorkspaceManagerMembersImpl(WorkspaceManagerMembersClient innerClient, + com.azure.resourcemanager.securityinsights.SecurityInsightsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WorkspaceManagerMemberImpl(inner.getValue(), this.manager())); + } + + public WorkspaceManagerMember get(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName) { + WorkspaceManagerMemberInner inner + = this.serviceClient().get(resourceGroupName, workspaceName, workspaceManagerMemberName); + if (inner != null) { + return new WorkspaceManagerMemberImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, context); + } + + public void delete(String resourceGroupName, String workspaceName, String workspaceManagerMemberName) { + this.serviceClient().delete(resourceGroupName, workspaceName, workspaceManagerMemberName); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceManagerMemberImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, workspaceName, orderby, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceManagerMemberImpl(inner1, this.manager())); + } + + public WorkspaceManagerMember getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerMemberName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerMembers"); + if (workspaceManagerMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerMembers'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerMemberName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerMembers"); + if (workspaceManagerMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerMembers'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerMemberName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerMembers"); + if (workspaceManagerMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerMembers'.", id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 workspaceManagerMemberName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceManagerMembers"); + if (workspaceManagerMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'workspaceManagerMembers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, workspaceManagerMemberName, context); + } + + private WorkspaceManagerMembersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager() { + return this.serviceManager; + } + + public WorkspaceManagerMemberImpl define(String name) { + return new WorkspaceManagerMemberImpl(name, this.manager()); + } +} 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/implementation/models/ActionsList.java similarity index 68% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionsList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ActionsList.java index d034e6e4ac91..e0f1793da2de 100644 --- 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/implementation/models/ActionsList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the actions. */ -@Fluent +@Immutable public final class ActionsList implements JsonSerializable { /* - * URL to fetch the next set of actions. + * The ActionResponse items on this page */ - private String nextLink; + private List value; /* - * Array of actions. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of ActionsList class. */ - public ActionsList() { + private ActionsList() { } /** - * 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. + * Get the value property: The ActionResponse items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model ActionsList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(ActionsList.class); - /** * {@inheritDoc} */ 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/implementation/models/AlertRuleTemplatesList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatesList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/AlertRuleTemplatesList.java index 3126b04fc0e3..e85915dae878 100644 --- 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/implementation/models/AlertRuleTemplatesList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the alert rule templates. */ -@Fluent +@Immutable public final class AlertRuleTemplatesList implements JsonSerializable { /* - * URL to fetch the next set of alert rule templates. + * The AlertRuleTemplate items on this page */ - private String nextLink; + private List value; /* - * Array of alert rule templates. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of AlertRuleTemplatesList class. */ - public AlertRuleTemplatesList() { + private AlertRuleTemplatesList() { } /** - * 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. + * Get the value property: The AlertRuleTemplate items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model AlertRuleTemplatesList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(AlertRuleTemplatesList.class); - /** * {@inheritDoc} */ 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/implementation/models/AlertRulesList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRulesList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/AlertRulesList.java index 7b637189f4c1..cddc1920cfdb 100644 --- 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/implementation/models/AlertRulesList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the alert rules. */ -@Fluent +@Immutable public final class AlertRulesList implements JsonSerializable { /* - * URL to fetch the next set of alert rules. + * The AlertRule items on this page */ - private String nextLink; + private List value; /* - * Array of alert rules. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of AlertRulesList class. */ - public AlertRulesList() { + private AlertRulesList() { } /** - * 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. + * Get the value property: The AlertRule items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model AlertRulesList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(AlertRulesList.class); - /** * {@inheritDoc} */ 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/implementation/models/AutomationRulesList.java similarity index 68% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulesList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/AutomationRulesList.java index fe351c189846..7756fef85dde 100644 --- 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/implementation/models/AutomationRulesList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +16,26 @@ /** * The AutomationRulesList model. */ -@Fluent +@Immutable public final class AutomationRulesList implements JsonSerializable { /* - * The value property. + * List of automation rules. */ private List value; /* - * The nextLink property. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of AutomationRulesList class. */ - public AutomationRulesList() { + private AutomationRulesList() { } /** - * Get the value property: The value property. + * Get the value property: List of automation rules. * * @return the value value. */ @@ -44,18 +44,7 @@ public List value() { } /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the AutomationRulesList object itself. - */ - public AutomationRulesList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The nextLink property. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The nextLink property. - * - * @param nextLink the nextLink value to set. - * @return the AutomationRulesList object itself. - */ - public AutomationRulesList withNextLink(String nextLink) { - this.nextLink = nextLink; - 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()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/BillingStatisticList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/BillingStatisticList.java new file mode 100644 index 000000000000..5b6fbfef4498 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/BillingStatisticList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all Microsoft Sentinel billing statistics. + */ +@Immutable +public final class BillingStatisticList implements JsonSerializable { + /* + * The BillingStatistic items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of BillingStatisticList class. + */ + private BillingStatisticList() { + } + + /** + * Get the value property: The BillingStatistic items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingStatisticList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingStatisticList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BillingStatisticList. + */ + public static BillingStatisticList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingStatisticList deserializedBillingStatisticList = new BillingStatisticList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BillingStatisticInner.fromJson(reader1)); + deserializedBillingStatisticList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBillingStatisticList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingStatisticList; + }); + } +} 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/implementation/models/BookmarkList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/BookmarkList.java index 36723c3b84f6..d435d5ef319c 100644 --- 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/implementation/models/BookmarkList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the bookmarks. */ -@Fluent +@Immutable public final class BookmarkList implements JsonSerializable { /* - * URL to fetch the next set of cases. + * The Bookmark items on this page */ - private String nextLink; + private List value; /* - * Array of bookmarks. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of BookmarkList class. */ - public BookmarkList() { + private BookmarkList() { } /** - * 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. + * Get the value property: The Bookmark items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model BookmarkList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(BookmarkList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/DataConnectorDefinitionArmCollectionWrapper.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/DataConnectorDefinitionArmCollectionWrapper.java new file mode 100644 index 000000000000..89b509021cc8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/DataConnectorDefinitionArmCollectionWrapper.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import java.io.IOException; +import java.util.List; + +/** + * Encapsulate the data connector definition object. + */ +@Immutable +public final class DataConnectorDefinitionArmCollectionWrapper + implements JsonSerializable { + /* + * List of data connector definitions. + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DataConnectorDefinitionArmCollectionWrapper class. + */ + private DataConnectorDefinitionArmCollectionWrapper() { + } + + /** + * Get the value property: List of data connector definitions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorDefinitionArmCollectionWrapper from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorDefinitionArmCollectionWrapper if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataConnectorDefinitionArmCollectionWrapper. + */ + public static DataConnectorDefinitionArmCollectionWrapper fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorDefinitionArmCollectionWrapper deserializedDataConnectorDefinitionArmCollectionWrapper + = new DataConnectorDefinitionArmCollectionWrapper(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataConnectorDefinitionInner.fromJson(reader1)); + deserializedDataConnectorDefinitionArmCollectionWrapper.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataConnectorDefinitionArmCollectionWrapper.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorDefinitionArmCollectionWrapper; + }); + } +} 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/implementation/models/DataConnectorList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/DataConnectorList.java index 4b206fb37e59..37325d9263bd 100644 --- 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/implementation/models/DataConnectorList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the data connectors. */ -@Fluent +@Immutable public final class DataConnectorList implements JsonSerializable { /* - * URL to fetch the next set of data connectors. + * The DataConnector items on this page */ - private String nextLink; + private List value; /* - * Array of data connectors. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of DataConnectorList class. */ - public DataConnectorList() { + private DataConnectorList() { } /** - * 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. + * Get the value property: The DataConnector items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model DataConnectorList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(DataConnectorList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityList.java new file mode 100644 index 000000000000..85dc4be4862a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.models.Entity; +import java.io.IOException; +import java.util.List; + +/** + * List of all the entities. + */ +@Immutable +public final class EntityList implements JsonSerializable { + /* + * The Entity items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EntityList class. + */ + private EntityList() { + } + + /** + * Get the value property: The Entity items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityList. + */ + public static EntityList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityList deserializedEntityList = new EntityList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Entity.fromJson(reader1)); + deserializedEntityList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEntityList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryList.java new file mode 100644 index 000000000000..b9b74f4f999f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the entity queries. + */ +@Immutable +public final class EntityQueryList implements JsonSerializable { + /* + * The EntityQuery items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EntityQueryList class. + */ + private EntityQueryList() { + } + + /** + * Get the value property: The EntityQuery items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityQueryList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityQueryList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityQueryList. + */ + public static EntityQueryList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityQueryList deserializedEntityQueryList = new EntityQueryList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EntityQueryInner.fromJson(reader1)); + deserializedEntityQueryList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEntityQueryList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityQueryList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryTemplateList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryTemplateList.java new file mode 100644 index 000000000000..175874d2019d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryTemplateList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the entity query templates. + */ +@Immutable +public final class EntityQueryTemplateList implements JsonSerializable { + /* + * The EntityQueryTemplate items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EntityQueryTemplateList class. + */ + private EntityQueryTemplateList() { + } + + /** + * Get the value property: The EntityQueryTemplate items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityQueryTemplateList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityQueryTemplateList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityQueryTemplateList. + */ + public static EntityQueryTemplateList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityQueryTemplateList deserializedEntityQueryTemplateList = new EntityQueryTemplateList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EntityQueryTemplateInner.fromJson(reader1)); + deserializedEntityQueryTemplateList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEntityQueryTemplateList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityQueryTemplateList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/FileImportList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/FileImportList.java new file mode 100644 index 000000000000..293fd4566ed5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/FileImportList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner; +import java.io.IOException; +import java.util.List; + +/** + * List all the file imports. + */ +@Immutable +public final class FileImportList implements JsonSerializable { + /* + * The FileImport items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FileImportList class. + */ + private FileImportList() { + } + + /** + * Get the value property: The FileImport items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileImportList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileImportList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileImportList. + */ + public static FileImportList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileImportList deserializedFileImportList = new FileImportList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FileImportInner.fromJson(reader1)); + deserializedFileImportList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFileImportList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileImportList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/GetQueriesResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/GetQueriesResponse.java new file mode 100644 index 000000000000..4b9e83acf696 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/GetQueriesResponse.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryItemInner; +import java.io.IOException; +import java.util.List; + +/** + * Retrieve queries for entity result operation response. + */ +@Immutable +public final class GetQueriesResponse implements JsonSerializable { + /* + * The query result values. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of GetQueriesResponse class. + */ + private GetQueriesResponse() { + } + + /** + * Get the value property: The query result values. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetQueriesResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetQueriesResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GetQueriesResponse. + */ + public static GetQueriesResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetQueriesResponse deserializedGetQueriesResponse = new GetQueriesResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EntityQueryItemInner.fromJson(reader1)); + deserializedGetQueriesResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGetQueriesResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetQueriesResponse; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntCommentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntCommentList.java new file mode 100644 index 000000000000..3542e51fccf8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntCommentList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all hunt comments. + */ +@Immutable +public final class HuntCommentList implements JsonSerializable { + /* + * The HuntComment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HuntCommentList class. + */ + private HuntCommentList() { + } + + /** + * Get the value property: The HuntComment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntCommentList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntCommentList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntCommentList. + */ + public static HuntCommentList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntCommentList deserializedHuntCommentList = new HuntCommentList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HuntCommentInner.fromJson(reader1)); + deserializedHuntCommentList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHuntCommentList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntCommentList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntList.java new file mode 100644 index 000000000000..aaf8b553ad12 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntInner; +import java.io.IOException; +import java.util.List; + +/** + * List all the hunts. + */ +@Immutable +public final class HuntList implements JsonSerializable { + /* + * The Hunt items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HuntList class. + */ + private HuntList() { + } + + /** + * Get the value property: The Hunt items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntList. + */ + public static HuntList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntList deserializedHuntList = new HuntList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HuntInner.fromJson(reader1)); + deserializedHuntList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHuntList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntRelationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntRelationList.java new file mode 100644 index 000000000000..f6e92250def6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntRelationList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the hunt relations. + */ +@Immutable +public final class HuntRelationList implements JsonSerializable { + /* + * The HuntRelation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of HuntRelationList class. + */ + private HuntRelationList() { + } + + /** + * Get the value property: The HuntRelation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntRelationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntRelationList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HuntRelationList. + */ + public static HuntRelationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntRelationList deserializedHuntRelationList = new HuntRelationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HuntRelationInner.fromJson(reader1)); + deserializedHuntRelationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedHuntRelationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntRelationList; + }); + } +} 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/implementation/models/IncidentCommentList.java similarity index 68% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentCommentList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentCommentList.java index 35b1a08f5d39..332d032eb616 100644 --- 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/implementation/models/IncidentCommentList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List of incident comments. */ -@Fluent +@Immutable public final class IncidentCommentList implements JsonSerializable { /* - * URL to fetch the next set of comments. + * The IncidentComment items on this page */ - private String nextLink; + private List value; /* - * Array of comments. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of IncidentCommentList class. */ - public IncidentCommentList() { + private IncidentCommentList() { } /** - * 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. + * Get the value property: The IncidentComment items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model IncidentCommentList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(IncidentCommentList.class); - /** * {@inheritDoc} */ 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/implementation/models/IncidentList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentList.java index 56f7130a4788..6b0079ea63b0 100644 --- 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/implementation/models/IncidentList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the incidents. */ -@Fluent +@Immutable public final class IncidentList implements JsonSerializable { /* - * URL to fetch the next set of incidents. + * The Incident items on this page */ - private String nextLink; + private List value; /* - * Array of incidents. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of IncidentList class. */ - public IncidentList() { + private IncidentList() { } /** - * 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. + * Get the value property: The Incident items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model IncidentList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(IncidentList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentTaskList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentTaskList.java new file mode 100644 index 000000000000..a9bff754afbb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentTaskList.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner; +import java.io.IOException; +import java.util.List; + +/** + * List of incident tasks. + */ +@Immutable +public final class IncidentTaskList implements JsonSerializable { + /* + * List of incident tasks. + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IncidentTaskList class. + */ + private IncidentTaskList() { + } + + /** + * Get the value property: List of incident tasks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncidentTaskList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncidentTaskList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IncidentTaskList. + */ + public static IncidentTaskList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncidentTaskList deserializedIncidentTaskList = new IncidentTaskList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> IncidentTaskInner.fromJson(reader1)); + deserializedIncidentTaskList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIncidentTaskList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIncidentTaskList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/JobList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/JobList.java new file mode 100644 index 000000000000..6f8fd320452c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/JobList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the jobs. + */ +@Immutable +public final class JobList implements JsonSerializable { + /* + * The Job items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of JobList class. + */ + private JobList() { + } + + /** + * Get the value property: The Job items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobList if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JobList. + */ + public static JobList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobList deserializedJobList = new JobList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JobInner.fromJson(reader1)); + deserializedJobList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedJobList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedJobList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/MetadataList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/MetadataList.java new file mode 100644 index 000000000000..7b7f752c3c0b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/MetadataList.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the metadata. + */ +@Immutable +public final class MetadataList implements JsonSerializable { + /* + * The MetadataModel items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MetadataList class. + */ + private MetadataList() { + } + + /** + * Get the value property: The MetadataModel items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetadataList. + */ + public static MetadataList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataList deserializedMetadataList = new MetadataList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MetadataModelInner.fromJson(reader1)); + deserializedMetadataList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMetadataList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/OfficeConsentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/OfficeConsentList.java new file mode 100644 index 000000000000..d42e2e7868e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/OfficeConsentList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the office365 consents. + */ +@Immutable +public final class OfficeConsentList implements JsonSerializable { + /* + * The OfficeConsent items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OfficeConsentList class. + */ + private OfficeConsentList() { + } + + /** + * Get the value property: The OfficeConsent items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeConsentList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeConsentList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficeConsentList. + */ + public static OfficeConsentList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeConsentList deserializedOfficeConsentList = new OfficeConsentList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OfficeConsentInner.fromJson(reader1)); + deserializedOfficeConsentList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOfficeConsentList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeConsentList; + }); + } +} 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/implementation/models/OperationsList.java similarity index 73% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OperationsList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/OperationsList.java index 1268852424c9..025c41e78031 100644 --- 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/implementation/models/OperationsList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +16,7 @@ /** * Lists the operations available in the SecurityInsights RP. */ -@Fluent +@Immutable public final class OperationsList implements JsonSerializable { /* * URL to fetch the next set of operations. @@ -32,7 +31,7 @@ public final class OperationsList implements JsonSerializable { /** * Creates an instance of OperationsList class. */ - public OperationsList() { + private OperationsList() { } /** @@ -53,33 +52,6 @@ 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.atError() - .log(new IllegalArgumentException("Missing required property value in model OperationsList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/PackageList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/PackageList.java new file mode 100644 index 000000000000..8dc8fac27e74 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/PackageList.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; +import java.io.IOException; +import java.util.List; + +/** + * List available packages. + */ +@Immutable +public final class PackageList implements JsonSerializable { + /* + * The PackageModel items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PackageList class. + */ + private PackageList() { + } + + /** + * Get the value property: The PackageModel items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PackageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PackageList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PackageList. + */ + public static PackageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PackageList deserializedPackageList = new PackageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> PackageModelInner.fromJson(reader1)); + deserializedPackageList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPackageList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPackageList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductPackageList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductPackageList.java new file mode 100644 index 000000000000..903b747ffe7a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductPackageList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import java.io.IOException; +import java.util.List; + +/** + * List available packages. + */ +@Immutable +public final class ProductPackageList implements JsonSerializable { + /* + * The ProductPackageModel items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ProductPackageList class. + */ + private ProductPackageList() { + } + + /** + * Get the value property: The ProductPackageModel items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductPackageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductPackageList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProductPackageList. + */ + public static ProductPackageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductPackageList deserializedProductPackageList = new ProductPackageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ProductPackageModelInner.fromJson(reader1)); + deserializedProductPackageList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedProductPackageList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProductPackageList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductTemplateList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductTemplateList.java new file mode 100644 index 000000000000..85830ad96c9d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductTemplateList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the template. + */ +@Immutable +public final class ProductTemplateList implements JsonSerializable { + /* + * The ProductTemplateModel items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ProductTemplateList class. + */ + private ProductTemplateList() { + } + + /** + * Get the value property: The ProductTemplateModel items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProductTemplateList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProductTemplateList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProductTemplateList. + */ + public static ProductTemplateList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProductTemplateList deserializedProductTemplateList = new ProductTemplateList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ProductTemplateModelInner.fromJson(reader1)); + deserializedProductTemplateList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedProductTemplateList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProductTemplateList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RecommendationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RecommendationList.java new file mode 100644 index 000000000000..53fca2a70e9f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RecommendationList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of recommendations. + */ +@Immutable +public final class RecommendationList implements JsonSerializable { + /* + * The Recommendation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RecommendationList class. + */ + private RecommendationList() { + } + + /** + * Get the value property: The Recommendation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecommendationList. + */ + public static RecommendationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationList deserializedRecommendationList = new RecommendationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RecommendationInner.fromJson(reader1)); + deserializedRecommendationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRecommendationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationList; + }); + } +} 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/implementation/models/RelationList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RelationList.java index 94f634086d6e..586d70a2af8b 100644 --- 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/implementation/models/RelationList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List of relations. */ -@Fluent +@Immutable public final class RelationList implements JsonSerializable { /* - * URL to fetch the next set of relations. + * The Relation items on this page */ - private String nextLink; + private List value; /* - * Array of relations. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of RelationList class. */ - public RelationList() { + private RelationList() { } /** - * 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. + * Get the value property: The Relation items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model RelationList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(RelationList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RepoList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RepoList.java new file mode 100644 index 000000000000..e6ba208605d0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RepoList.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import java.io.IOException; +import java.util.List; + +/** + * List all the source controls. + */ +@Immutable +public final class RepoList implements JsonSerializable { + /* + * The Repo items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of RepoList class. + */ + private RepoList() { + } + + /** + * Get the value property: The Repo items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepoList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepoList if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RepoList. + */ + public static RepoList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepoList deserializedRepoList = new RepoList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RepoInner.fromJson(reader1)); + deserializedRepoList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRepoList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRepoList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SecurityMLAnalyticsSettingsList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SecurityMLAnalyticsSettingsList.java index abfa8e1ce87e..db363297441b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsList.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SecurityMLAnalyticsSettingsList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the SecurityMLAnalyticsSettings. */ -@Fluent +@Immutable public final class SecurityMLAnalyticsSettingsList implements JsonSerializable { /* - * URL to fetch the next set of SecurityMLAnalyticsSettings. + * The SecurityMLAnalyticsSetting items on this page */ - private String nextLink; + private List value; /* - * Array of SecurityMLAnalyticsSettings + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of SecurityMLAnalyticsSettingsList class. */ - public SecurityMLAnalyticsSettingsList() { + private SecurityMLAnalyticsSettingsList() { } /** - * Get the nextLink property: URL to fetch the next set of SecurityMLAnalyticsSettings. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Array of SecurityMLAnalyticsSettings. + * Get the value property: The SecurityMLAnalyticsSetting items on this page. * * @return the value value. */ @@ -54,33 +44,14 @@ public List value() { } /** - * Set the value property: Array of SecurityMLAnalyticsSettings. - * - * @param value the value value to set. - * @return the SecurityMLAnalyticsSettingsList object itself. - */ - public SecurityMLAnalyticsSettingsList withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model SecurityMLAnalyticsSettingsList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(SecurityMLAnalyticsSettingsList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SettingList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SettingList.java new file mode 100644 index 000000000000..9a3e069a9799 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SettingList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the settings. + */ +@Immutable +public final class SettingList implements JsonSerializable { + /* + * The Settings items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SettingList class. + */ + private SettingList() { + } + + /** + * Get the value property: The Settings items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SettingList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SettingList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SettingList. + */ + public static SettingList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SettingList deserializedSettingList = new SettingList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SettingsInner.fromJson(reader1)); + deserializedSettingList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSettingList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSettingList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SourceControlList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SourceControlList.java new file mode 100644 index 000000000000..977335ef866b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SourceControlList.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner; +import java.io.IOException; +import java.util.List; + +/** + * List all the source controls. + */ +@Immutable +public final class SourceControlList implements JsonSerializable { + /* + * The SourceControl items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SourceControlList class. + */ + private SourceControlList() { + } + + /** + * Get the value property: The SourceControl items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SourceControlList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SourceControlList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SourceControlList. + */ + public static SourceControlList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SourceControlList deserializedSourceControlList = new SourceControlList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SourceControlInner.fromJson(reader1)); + deserializedSourceControlList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSourceControlList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSourceControlList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TemplateList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TemplateList.java new file mode 100644 index 000000000000..c0ce1e12597e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TemplateList.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the template. + */ +@Immutable +public final class TemplateList implements JsonSerializable { + /* + * The TemplateModel items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TemplateList class. + */ + private TemplateList() { + } + + /** + * Get the value property: The TemplateModel items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TemplateList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TemplateList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TemplateList. + */ + public static TemplateList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TemplateList deserializedTemplateList = new TemplateList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> TemplateModelInner.fromJson(reader1)); + deserializedTemplateList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTemplateList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTemplateList; + }); + } +} 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/implementation/models/ThreatIntelligenceInformationList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformationList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ThreatIntelligenceInformationList.java index c3a443eca01e..76fcd3837f65 100644 --- 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/implementation/models/ThreatIntelligenceInformationList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List of all the threat intelligence information objects. */ -@Fluent +@Immutable public final class ThreatIntelligenceInformationList implements JsonSerializable { /* - * URL to fetch the next set of information objects. + * The ThreatIntelligenceInformation items on this page */ - private String nextLink; + private List value; /* - * Array of threat intelligence information objects. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of ThreatIntelligenceInformationList class. */ - public ThreatIntelligenceInformationList() { + private ThreatIntelligenceInformationList() { } /** - * 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. + * Get the value property: The ThreatIntelligenceInformation items on this page. * * @return the value value. */ @@ -54,33 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model ThreatIntelligenceInformationList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(ThreatIntelligenceInformationList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ThreatIntelligenceList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ThreatIntelligenceList.java new file mode 100644 index 000000000000..8f2bf08ef64d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ThreatIntelligenceList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.io.IOException; +import java.util.List; + +/** + * List all the threat intelligence objects on the workspace that match the provided query. + */ +@Immutable +public final class ThreatIntelligenceList implements JsonSerializable { + /* + * The TIObject items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ThreatIntelligenceList class. + */ + private ThreatIntelligenceList() { + } + + /** + * Get the value property: The TIObject items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreatIntelligenceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreatIntelligenceList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreatIntelligenceList. + */ + public static ThreatIntelligenceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreatIntelligenceList deserializedThreatIntelligenceList = new ThreatIntelligenceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> TIObjectInner.fromJson(reader1)); + deserializedThreatIntelligenceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedThreatIntelligenceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedThreatIntelligenceList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TriggeredAnalyticsRuleRuns.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TriggeredAnalyticsRuleRuns.java new file mode 100644 index 000000000000..57caf599ee00 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TriggeredAnalyticsRuleRuns.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import java.io.IOException; +import java.util.List; + +/** + * The triggered analytics rule run array. + */ +@Immutable +public final class TriggeredAnalyticsRuleRuns implements JsonSerializable { + /* + * The TriggeredAnalyticsRuleRun items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TriggeredAnalyticsRuleRuns class. + */ + private TriggeredAnalyticsRuleRuns() { + } + + /** + * Get the value property: The TriggeredAnalyticsRuleRun items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggeredAnalyticsRuleRuns from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggeredAnalyticsRuleRuns if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TriggeredAnalyticsRuleRuns. + */ + public static TriggeredAnalyticsRuleRuns fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggeredAnalyticsRuleRuns deserializedTriggeredAnalyticsRuleRuns = new TriggeredAnalyticsRuleRuns(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TriggeredAnalyticsRuleRunInner.fromJson(reader1)); + deserializedTriggeredAnalyticsRuleRuns.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTriggeredAnalyticsRuleRuns.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggeredAnalyticsRuleRuns; + }); + } +} 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/implementation/models/WatchlistItemList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItemList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WatchlistItemList.java index b10c9382e8c2..e3d4a3278157 100644 --- 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/implementation/models/WatchlistItemList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the watchlist items. */ -@Fluent +@Immutable public final class WatchlistItemList implements JsonSerializable { /* - * URL to fetch the next set of watchlist items. + * The WatchlistItem items on this page */ - private String nextLink; + private List value; /* - * Array of watchlist items. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of WatchlistItemList class. */ - public WatchlistItemList() { + private WatchlistItemList() { } /** - * Get the nextLink property: URL to fetch the next set of watchlist items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Array of watchlist items. + * Get the value property: The WatchlistItem items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model WatchlistItemList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(WatchlistItemList.class); - /** * {@inheritDoc} */ 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/implementation/models/WatchlistList.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistList.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WatchlistList.java index f36743cb9db4..91f6df16da2c 100644 --- 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/implementation/models/WatchlistList.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.securityinsights.models; +package com.azure.resourcemanager.securityinsights.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,35 +16,26 @@ /** * List all the watchlists. */ -@Fluent +@Immutable public final class WatchlistList implements JsonSerializable { /* - * URL to fetch the next set of watchlists. + * The Watchlist items on this page */ - private String nextLink; + private List value; /* - * Array of watchlist. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of WatchlistList class. */ - public WatchlistList() { + private WatchlistList() { } /** - * 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. + * Get the value property: The Watchlist items on this page. * * @return the value value. */ @@ -54,32 +44,14 @@ public List 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. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model WatchlistList")); - } else { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } - private static final ClientLogger LOGGER = new ClientLogger(WatchlistList.class); - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerAssignmentList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerAssignmentList.java new file mode 100644 index 000000000000..bc4c930a9852 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerAssignmentList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the workspace manager assignments. + */ +@Immutable +public final class WorkspaceManagerAssignmentList implements JsonSerializable { + /* + * The WorkspaceManagerAssignment items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WorkspaceManagerAssignmentList class. + */ + private WorkspaceManagerAssignmentList() { + } + + /** + * Get the value property: The WorkspaceManagerAssignment items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerAssignmentList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerAssignmentList if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerAssignmentList. + */ + public static WorkspaceManagerAssignmentList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerAssignmentList deserializedWorkspaceManagerAssignmentList + = new WorkspaceManagerAssignmentList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WorkspaceManagerAssignmentInner.fromJson(reader1)); + deserializedWorkspaceManagerAssignmentList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceManagerAssignmentList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerAssignmentList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerConfigurationList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerConfigurationList.java new file mode 100644 index 000000000000..3ca73b3a8625 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerConfigurationList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * List all the workspace manager configurations for the workspace. + */ +@Immutable +public final class WorkspaceManagerConfigurationList implements JsonSerializable { + /* + * The WorkspaceManagerConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WorkspaceManagerConfigurationList class. + */ + private WorkspaceManagerConfigurationList() { + } + + /** + * Get the value property: The WorkspaceManagerConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerConfigurationList if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerConfigurationList. + */ + public static WorkspaceManagerConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerConfigurationList deserializedWorkspaceManagerConfigurationList + = new WorkspaceManagerConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WorkspaceManagerConfigurationInner.fromJson(reader1)); + deserializedWorkspaceManagerConfigurationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceManagerConfigurationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerConfigurationList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerGroupList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerGroupList.java new file mode 100644 index 000000000000..2de233f66cec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerGroupList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * List of all the workspace manager groups. + */ +@Immutable +public final class WorkspaceManagerGroupList implements JsonSerializable { + /* + * The WorkspaceManagerGroup items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WorkspaceManagerGroupList class. + */ + private WorkspaceManagerGroupList() { + } + + /** + * Get the value property: The WorkspaceManagerGroup items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerGroupList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerGroupList if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerGroupList. + */ + public static WorkspaceManagerGroupList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerGroupList deserializedWorkspaceManagerGroupList = new WorkspaceManagerGroupList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WorkspaceManagerGroupInner.fromJson(reader1)); + deserializedWorkspaceManagerGroupList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceManagerGroupList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerGroupList; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerMembersList.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerMembersList.java new file mode 100644 index 000000000000..4f2025ca1e74 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerMembersList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner; +import java.io.IOException; +import java.util.List; + +/** + * List of workspace manager members. + */ +@Immutable +public final class WorkspaceManagerMembersList implements JsonSerializable { + /* + * The WorkspaceManagerMember items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of WorkspaceManagerMembersList class. + */ + private WorkspaceManagerMembersList() { + } + + /** + * Get the value property: The WorkspaceManagerMember items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceManagerMembersList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceManagerMembersList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WorkspaceManagerMembersList. + */ + public static WorkspaceManagerMembersList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceManagerMembersList deserializedWorkspaceManagerMembersList = new WorkspaceManagerMembersList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WorkspaceManagerMemberInner.fromJson(reader1)); + deserializedWorkspaceManagerMembersList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWorkspaceManagerMembersList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceManagerMembersList; + }); + } +} 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 index ec083204691e..2af38455745d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the implementations for SecurityInsights. 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..ff87b6e4eccc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AADCheckRequirements.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AADCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents AADIP (Azure Active Directory Identity Protection) requirements check request. + */ +@Fluent +public final class AADCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.AZURE_ACTIVE_DIRECTORY; + + /* + * AADIP (Azure Active Directory Identity Protection) requirements check properties. + */ + private AADCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of AADCheckRequirements class. + */ + public AADCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: AADIP (Azure Active Directory Identity Protection) requirements check + * properties. + * + * @return the innerProperties value. + */ + AADCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 AADCheckRequirements object itself. + */ + public AADCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new AADCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AADCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AADCheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AADCheckRequirements. + */ + public static AADCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AADCheckRequirements deserializedAADCheckRequirements = new AADCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAADCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAADCheckRequirements.innerProperties = AADCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAADCheckRequirements; + }); + } +} 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..23584ba88d85 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AATPCheckRequirements.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AATPCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents AATP (Azure Advanced Threat Protection) requirements check request. + */ +@Fluent +public final class AATPCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.AZURE_ADVANCED_THREAT_PROTECTION; + + /* + * AATP (Azure Advanced Threat Protection) requirements check properties. + */ + private AATPCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of AATPCheckRequirements class. + */ + public AATPCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: AATP (Azure Advanced Threat Protection) requirements check properties. + * + * @return the innerProperties value. + */ + AATPCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 AATPCheckRequirements object itself. + */ + public AATPCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new AATPCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AATPCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AATPCheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AATPCheckRequirements. + */ + public static AATPCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AATPCheckRequirements deserializedAATPCheckRequirements = new AATPCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAATPCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAATPCheckRequirements.innerProperties + = AATPCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAATPCheckRequirements; + }); + } +} 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..8f947180be4b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ASCCheckRequirements.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.ASCCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents ASC (Azure Security Center) requirements check request. + */ +@Fluent +public final class ASCCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.AZURE_SECURITY_CENTER; + + /* + * ASC (Azure Security Center) requirements check properties. + */ + private ASCCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of ASCCheckRequirements class. + */ + public ASCCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: ASC (Azure Security Center) requirements check properties. + * + * @return the innerProperties value. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ASCCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ASCCheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ASCCheckRequirements. + */ + public static ASCCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ASCCheckRequirements deserializedASCCheckRequirements = new ASCCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedASCCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedASCCheckRequirements.innerProperties = ASCCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedASCCheckRequirements; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AWSAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AWSAuthModel.java new file mode 100644 index 000000000000..81a282bd71a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AWSAuthModel.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for API authentication with AWS. + */ +@Fluent +public final class AWSAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.AWS; + + /* + * AWS STS assume role ARN + */ + private String roleArn; + + /* + * AWS STS assume role external ID. This is used to prevent the confused deputy problem: + * 'https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html' + */ + private String externalId; + + /** + * Creates an instance of AWSAuthModel class. + */ + public AWSAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the roleArn property: AWS STS assume role ARN. + * + * @return the roleArn value. + */ + public String roleArn() { + return this.roleArn; + } + + /** + * Set the roleArn property: AWS STS assume role ARN. + * + * @param roleArn the roleArn value to set. + * @return the AWSAuthModel object itself. + */ + public AWSAuthModel withRoleArn(String roleArn) { + this.roleArn = roleArn; + return this; + } + + /** + * Get the externalId property: AWS STS assume role external ID. This is used to prevent the confused deputy + * problem: 'https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html'. + * + * @return the externalId value. + */ + public String externalId() { + return this.externalId; + } + + /** + * Set the externalId property: AWS STS assume role external ID. This is used to prevent the confused deputy + * problem: 'https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html'. + * + * @param externalId the externalId value to set. + * @return the AWSAuthModel object itself. + */ + public AWSAuthModel withExternalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleArn", this.roleArn); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("externalId", this.externalId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AWSAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AWSAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AWSAuthModel. + */ + public static AWSAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AWSAuthModel deserializedAWSAuthModel = new AWSAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleArn".equals(fieldName)) { + deserializedAWSAuthModel.roleArn = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAWSAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else if ("externalId".equals(fieldName)) { + deserializedAWSAuthModel.externalId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAWSAuthModel; + }); + } +} 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 index d2a5df252233..013f12c18552 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,24 +9,26 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.fluent.models.AadDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.AADDataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import java.io.IOException; /** - * Represents AAD (Azure Active Directory) data connector. + * Represents AADIP (Azure Active Directory Identity Protection) data connector. */ @Fluent public final class AadDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.AZURE_ACTIVE_DIRECTORY; /* - * AAD (Azure Active Directory) data connector properties. + * AADIP (Azure Active Directory Identity Protection) data connector properties. */ - private AadDataConnectorProperties innerProperties; + private AADDataConnectorProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -55,7 +57,9 @@ public AadDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -65,11 +69,11 @@ public DataConnectorKind kind() { } /** - * Get the innerProperties property: AAD (Azure Active Directory) data connector properties. + * Get the innerProperties property: AADIP (Azure Active Directory Identity Protection) data connector properties. * * @return the innerProperties value. */ - private AadDataConnectorProperties innerProperties() { + private AADDataConnectorProperties innerProperties() { return this.innerProperties; } @@ -139,7 +143,7 @@ public String tenantId() { */ public AadDataConnector withTenantId(String tenantId) { if (this.innerProperties() == null) { - this.innerProperties = new AadDataConnectorProperties(); + this.innerProperties = new AADDataConnectorProperties(); } this.innerProperties().withTenantId(tenantId); return this; @@ -162,24 +166,12 @@ public AlertsDataTypeOfDataConnector dataTypes() { */ public AadDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { if (this.innerProperties() == null) { - this.innerProperties = new AadDataConnectorProperties(); + this.innerProperties = new AADDataConnectorProperties(); } this.innerProperties().withDataTypes(dataTypes); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -221,7 +213,7 @@ public static AadDataConnector fromJson(JsonReader jsonReader) throws IOExceptio } else if ("kind".equals(fieldName)) { deserializedAadDataConnector.kind = DataConnectorKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { - deserializedAadDataConnector.innerProperties = AadDataConnectorProperties.fromJson(reader); + deserializedAadDataConnector.innerProperties = AADDataConnectorProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index 6122859e044f..cf660ca0349c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,7 +9,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.fluent.models.AatpDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.AATPDataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import java.io.IOException; @@ -19,14 +19,16 @@ @Fluent public final class AatpDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.AZURE_ADVANCED_THREAT_PROTECTION; /* * AATP (Azure Advanced Threat Protection) data connector properties. */ - private AatpDataConnectorProperties innerProperties; + private AATPDataConnectorProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -55,7 +57,9 @@ public AatpDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -69,7 +73,7 @@ public DataConnectorKind kind() { * * @return the innerProperties value. */ - private AatpDataConnectorProperties innerProperties() { + private AATPDataConnectorProperties innerProperties() { return this.innerProperties; } @@ -139,7 +143,7 @@ public String tenantId() { */ public AatpDataConnector withTenantId(String tenantId) { if (this.innerProperties() == null) { - this.innerProperties = new AatpDataConnectorProperties(); + this.innerProperties = new AATPDataConnectorProperties(); } this.innerProperties().withTenantId(tenantId); return this; @@ -162,24 +166,12 @@ public AlertsDataTypeOfDataConnector dataTypes() { */ public AatpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { if (this.innerProperties() == null) { - this.innerProperties = new AatpDataConnectorProperties(); + this.innerProperties = new AATPDataConnectorProperties(); } this.innerProperties().withDataTypes(dataTypes); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -221,7 +213,7 @@ public static AatpDataConnector fromJson(JsonReader jsonReader) throws IOExcepti } else if ("kind".equals(fieldName)) { deserializedAatpDataConnector.kind = DataConnectorKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { - deserializedAatpDataConnector.innerProperties = AatpDataConnectorProperties.fromJson(reader); + deserializedAatpDataConnector.innerProperties = AATPDataConnectorProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index 2d9037942489..1a86e6f10562 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,7 +12,6 @@ import com.azure.resourcemanager.securityinsights.fluent.models.AccountEntityProperties; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Represents an account entity. @@ -20,7 +19,9 @@ @Immutable public final class AccountEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.ACCOUNT; @@ -52,11 +53,13 @@ public final class AccountEntity extends Entity { /** * Creates an instance of AccountEntity class. */ - public AccountEntity() { + private AccountEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -171,7 +174,7 @@ public Boolean isDomainJoined() { } /** - * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format - domain/username. Examples: + * Get the ntDomain property: The NetBIOS domain name as it appears in the alert format domain/username. Examples: * NT AUTHORITY. * * @return the ntDomain value. @@ -186,7 +189,7 @@ public String ntDomain() { * * @return the objectGuid value. */ - public UUID objectGuid() { + public String objectGuid() { return this.innerProperties() == null ? null : this.innerProperties().objectGuid(); } @@ -247,18 +250,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index a314eeff2587..2279fadb7083 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,21 +51,6 @@ public ActionPropertiesBase withLogicAppResourceId(String logicAppResourceId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logicAppResourceId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property logicAppResourceId in model ActionPropertiesBase")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ActionPropertiesBase.class); - /** * {@inheritDoc} */ 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 index 5a661128ca38..f76dab8405a1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -154,18 +154,6 @@ public ActionRequest withLogicAppResourceId(String logicAppResourceId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index f111337d1bbe..b05dfe32dbfd 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -101,7 +101,7 @@ 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @return the next definition stage. */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionType.java index b63e7a614700..bd4ce8531027 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionType.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,15 +12,20 @@ */ public final class ActionType extends ExpandableStringEnum { /** - * Static value ModifyProperties for ActionType. + * Modify an object's properties. */ public static final ActionType MODIFY_PROPERTIES = fromString("ModifyProperties"); /** - * Static value RunPlaybook for ActionType. + * Run a playbook on an object. */ public static final ActionType RUN_PLAYBOOK = fromString("RunPlaybook"); + /** + * Add a task to an incident object. + */ + public static final ActionType ADD_INCIDENT_TASK = fromString("AddIncidentTask"); + /** * Creates a new instance of ActionType value. * 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 index 534faa4366b0..f5ea29deb95c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,91 +13,91 @@ */ public interface Actions { /** - * Gets all actions of alert rule. + * 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 workspaceName The name of the monitor 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 all actions of alert rule as paginated response with {@link PagedIterable}. + * @return the action of alert rule along with {@link Response}. */ - PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId); + Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, + String actionId, Context context); /** - * Gets all actions of alert rule. + * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. - * @param context The context to associate with this operation. + * @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 all actions of alert rule as paginated response with {@link PagedIterable}. + * @return the action of alert rule. */ - PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId, - Context context); + ActionResponse get(String resourceGroupName, String workspaceName, String ruleId, String actionId); /** - * Gets the action of alert rule. + * 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 workspaceName The name of the monitor 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 along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String ruleId, - String actionId, Context context); + Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, String actionId, + Context context); /** - * Gets the action of alert rule. + * 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 workspaceName The name of the monitor 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); + void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); /** - * Delete the action of alert rule. + * 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 workspaceName The name of the monitor 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 {@link Response}. + * @return all actions of alert rule as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String workspaceName, String ruleId, String actionId, - Context context); + PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId); /** - * Delete the action of alert rule. + * 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 workspaceName The name of the monitor 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 all actions of alert rule as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String workspaceName, String ruleId, String actionId); + PagedIterable listByAlertRule(String resourceGroupName, String workspaceName, String ruleId, + Context context); /** * Gets the action of alert rule. 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..1433c8ed6004 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents Activity entity query. + */ +@Fluent +public final class ActivityCustomEntityQuery extends CustomEntityQuery { + /* + * the entity query kind + */ + private CustomEntityQueryKind kind = CustomEntityQueryKind.ACTIVITY; + + /* + * Activity entity query properties + */ + private ActivityEntityQueriesProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ActivityCustomEntityQuery class. + */ + public ActivityCustomEntityQuery() { + } + + /** + * Get the kind property: the entity query kind. + * + * @return the kind value. + */ + @Override + public CustomEntityQueryKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Activity entity query properties. + * + * @return the innerProperties value. + */ + private ActivityEntityQueriesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityCustomEntityQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityCustomEntityQuery if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ActivityCustomEntityQuery. + */ + public static ActivityCustomEntityQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivityCustomEntityQuery deserializedActivityCustomEntityQuery = new ActivityCustomEntityQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActivityCustomEntityQuery.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedActivityCustomEntityQuery.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedActivityCustomEntityQuery.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedActivityCustomEntityQuery.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedActivityCustomEntityQuery.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedActivityCustomEntityQuery.kind = CustomEntityQueryKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedActivityCustomEntityQuery.innerProperties + = ActivityEntityQueriesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActivityCustomEntityQuery; + }); + } +} 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..687c424178ec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueriesPropertiesQueryDefinitions.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Activity query definitions. + */ +@Fluent +public final class ActivityEntityQueriesPropertiesQueryDefinitions + implements JsonSerializable { + /* + * The Activity query to run on a given entity + */ + private String query; + + /** + * Creates an instance of ActivityEntityQueriesPropertiesQueryDefinitions class. + */ + public ActivityEntityQueriesPropertiesQueryDefinitions() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("query", this.query); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityEntityQueriesPropertiesQueryDefinitions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityEntityQueriesPropertiesQueryDefinitions if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActivityEntityQueriesPropertiesQueryDefinitions. + */ + public static ActivityEntityQueriesPropertiesQueryDefinitions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivityEntityQueriesPropertiesQueryDefinitions deserializedActivityEntityQueriesPropertiesQueryDefinitions + = new ActivityEntityQueriesPropertiesQueryDefinitions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("query".equals(fieldName)) { + deserializedActivityEntityQueriesPropertiesQueryDefinitions.query = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActivityEntityQueriesPropertiesQueryDefinitions; + }); + } +} 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..082720278d52 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents Activity entity query. + */ +@Immutable +public final class ActivityEntityQuery extends EntityQueryInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private EntityQueryKind kind = EntityQueryKind.ACTIVITY; + + /* + * Activity entity query properties + */ + private ActivityEntityQueriesProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ActivityEntityQuery class. + */ + private ActivityEntityQuery() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public EntityQueryKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Activity entity query properties. + * + * @return the innerProperties value. + */ + private ActivityEntityQueriesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * 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(); + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions() { + return this.innerProperties() == null ? null : this.innerProperties().queryDefinitions(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityEntityQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityEntityQuery if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ActivityEntityQuery. + */ + public static ActivityEntityQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivityEntityQuery deserializedActivityEntityQuery = new ActivityEntityQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActivityEntityQuery.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedActivityEntityQuery.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedActivityEntityQuery.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedActivityEntityQuery.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedActivityEntityQuery.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedActivityEntityQuery.kind = EntityQueryKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedActivityEntityQuery.innerProperties = ActivityEntityQueriesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActivityEntityQuery; + }); + } +} 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..ff154a224d66 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplate.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueryTemplateProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Represents Activity entity query. + */ +@Immutable +public final class ActivityEntityQueryTemplate extends EntityQueryTemplateInner { + /* + * The kind of the entity query template. + */ + private EntityQueryTemplateKind kind = EntityQueryTemplateKind.ACTIVITY; + + /* + * Activity entity query properties + */ + private ActivityEntityQueryTemplateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ActivityEntityQueryTemplate class. + */ + private ActivityEntityQueryTemplate() { + } + + /** + * Get the kind property: The kind of the entity query template. + * + * @return the kind value. + */ + @Override + public EntityQueryTemplateKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Activity entity query properties. + * + * @return the innerProperties value. + */ + private ActivityEntityQueryTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the title property: The entity query title. + * + * @return the title value. + */ + public String title() { + return this.innerProperties() == null ? null : this.innerProperties().title(); + } + + /** + * 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(); + } + + /** + * Get the description property: The entity query description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the queryDefinitions property: The Activity query definitions. + * + * @return the queryDefinitions value. + */ + public ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions() { + return this.innerProperties() == null ? null : this.innerProperties().queryDefinitions(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityEntityQueryTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityEntityQueryTemplate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ActivityEntityQueryTemplate. + */ + public static ActivityEntityQueryTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivityEntityQueryTemplate deserializedActivityEntityQueryTemplate = new ActivityEntityQueryTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActivityEntityQueryTemplate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedActivityEntityQueryTemplate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedActivityEntityQueryTemplate.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedActivityEntityQueryTemplate.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedActivityEntityQueryTemplate.kind + = EntityQueryTemplateKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedActivityEntityQueryTemplate.innerProperties + = ActivityEntityQueryTemplateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActivityEntityQueryTemplate; + }); + } +} 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..337c282be2cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Activity query definitions. + */ +@Immutable +public final class ActivityEntityQueryTemplatePropertiesQueryDefinitions + implements JsonSerializable { + /* + * The Activity query to run on a given entity + */ + private String query; + + /* + * The dimensions we want to summarize the timeline results on, this is comma separated list + */ + private String summarizeBy; + + /** + * Creates an instance of ActivityEntityQueryTemplatePropertiesQueryDefinitions class. + */ + private ActivityEntityQueryTemplatePropertiesQueryDefinitions() { + } + + /** + * Get the query property: The Activity query to run on a given entity. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeStringField("summarizeBy", this.summarizeBy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityEntityQueryTemplatePropertiesQueryDefinitions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityEntityQueryTemplatePropertiesQueryDefinitions if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActivityEntityQueryTemplatePropertiesQueryDefinitions. + */ + public static ActivityEntityQueryTemplatePropertiesQueryDefinitions fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ActivityEntityQueryTemplatePropertiesQueryDefinitions deserializedActivityEntityQueryTemplatePropertiesQueryDefinitions + = new ActivityEntityQueryTemplatePropertiesQueryDefinitions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("query".equals(fieldName)) { + deserializedActivityEntityQueryTemplatePropertiesQueryDefinitions.query = reader.getString(); + } else if ("summarizeBy".equals(fieldName)) { + deserializedActivityEntityQueryTemplatePropertiesQueryDefinitions.summarizeBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActivityEntityQueryTemplatePropertiesQueryDefinitions; + }); + } +} 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..8bed5fcb4307 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents Activity timeline item. + */ +@Immutable +public final class ActivityTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + private EntityTimelineKind kind = EntityTimelineKind.ACTIVITY; + + /* + * The activity query id. + */ + private String queryId; + + /* + * The grouping bucket start time. + */ + private OffsetDateTime bucketStartTimeUTC; + + /* + * The grouping bucket end time. + */ + private OffsetDateTime bucketEndTimeUTC; + + /* + * The time of the first activity in the grouping bucket. + */ + private OffsetDateTime firstActivityTimeUTC; + + /* + * The time of the last activity in the grouping bucket. + */ + private OffsetDateTime lastActivityTimeUTC; + + /* + * The activity timeline content. + */ + private String content; + + /* + * The activity timeline title. + */ + private String title; + + /** + * Creates an instance of ActivityTimelineItem class. + */ + private ActivityTimelineItem() { + } + + /** + * Get the kind property: The entity query kind type. + * + * @return the kind value. + */ + @Override + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * Get the queryId property: The activity query id. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Get the bucketStartTimeUTC property: The grouping bucket start time. + * + * @return the bucketStartTimeUTC value. + */ + public OffsetDateTime bucketStartTimeUTC() { + return this.bucketStartTimeUTC; + } + + /** + * Get the bucketEndTimeUTC property: The grouping bucket end time. + * + * @return the bucketEndTimeUTC value. + */ + public OffsetDateTime bucketEndTimeUTC() { + return this.bucketEndTimeUTC; + } + + /** + * Get the firstActivityTimeUTC property: The time of the first activity in the grouping bucket. + * + * @return the firstActivityTimeUTC value. + */ + public OffsetDateTime firstActivityTimeUTC() { + return this.firstActivityTimeUTC; + } + + /** + * Get the lastActivityTimeUTC property: The time of the last activity in the grouping bucket. + * + * @return the lastActivityTimeUTC value. + */ + public OffsetDateTime lastActivityTimeUTC() { + return this.lastActivityTimeUTC; + } + + /** + * Get the content property: The activity timeline content. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Get the title property: The activity timeline title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queryId", this.queryId); + jsonWriter.writeStringField("bucketStartTimeUTC", + this.bucketStartTimeUTC == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.bucketStartTimeUTC)); + jsonWriter.writeStringField("bucketEndTimeUTC", + this.bucketEndTimeUTC == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.bucketEndTimeUTC)); + jsonWriter.writeStringField("firstActivityTimeUTC", + this.firstActivityTimeUTC == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.firstActivityTimeUTC)); + jsonWriter.writeStringField("lastActivityTimeUTC", + this.lastActivityTimeUTC == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActivityTimeUTC)); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivityTimelineItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivityTimelineItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ActivityTimelineItem. + */ + public static ActivityTimelineItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivityTimelineItem deserializedActivityTimelineItem = new ActivityTimelineItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("queryId".equals(fieldName)) { + deserializedActivityTimelineItem.queryId = reader.getString(); + } else if ("bucketStartTimeUTC".equals(fieldName)) { + deserializedActivityTimelineItem.bucketStartTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("bucketEndTimeUTC".equals(fieldName)) { + deserializedActivityTimelineItem.bucketEndTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("firstActivityTimeUTC".equals(fieldName)) { + deserializedActivityTimelineItem.firstActivityTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastActivityTimeUTC".equals(fieldName)) { + deserializedActivityTimelineItem.lastActivityTimeUTC = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("content".equals(fieldName)) { + deserializedActivityTimelineItem.content = reader.getString(); + } else if ("title".equals(fieldName)) { + deserializedActivityTimelineItem.title = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedActivityTimelineItem.kind = EntityTimelineKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedActivityTimelineItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AddIncidentTaskActionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AddIncidentTaskActionProperties.java new file mode 100644 index 000000000000..4ae6408b3a01 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AddIncidentTaskActionProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AddIncidentTaskActionProperties model. + */ +@Fluent +public final class AddIncidentTaskActionProperties implements JsonSerializable { + /* + * The title of the task. + */ + private String title; + + /* + * The description of the task. + */ + private String description; + + /** + * Creates an instance of AddIncidentTaskActionProperties class. + */ + public AddIncidentTaskActionProperties() { + } + + /** + * Get the title property: The title of the task. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: The title of the task. + * + * @param title the title value to set. + * @return the AddIncidentTaskActionProperties object itself. + */ + public AddIncidentTaskActionProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: The description of the task. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the task. + * + * @param description the description value to set. + * @return the AddIncidentTaskActionProperties object itself. + */ + public AddIncidentTaskActionProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddIncidentTaskActionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddIncidentTaskActionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AddIncidentTaskActionProperties. + */ + public static AddIncidentTaskActionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddIncidentTaskActionProperties deserializedAddIncidentTaskActionProperties + = new AddIncidentTaskActionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedAddIncidentTaskActionProperties.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAddIncidentTaskActionProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAddIncidentTaskActionProperties; + }); + } +} 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 index 95a56fd8b8da..33a4757c611c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,12 +12,12 @@ */ public final class AlertDetail extends ExpandableStringEnum { /** - * Static value DisplayName for AlertDetail. + * Alert display name. */ public static final AlertDetail DISPLAY_NAME = fromString("DisplayName"); /** - * Static value Severity for AlertDetail. + * Alert severity. */ public static final AlertDetail SEVERITY = fromString("Severity"); 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 index 66c9ba224248..3e3d382b1b3f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * Settings for how to dynamically override alert static details. @@ -36,6 +37,11 @@ public final class AlertDetailsOverride implements JsonSerializable alertDynamicProperties; + /** * Creates an instance of AlertDetailsOverride class. */ @@ -123,11 +129,23 @@ public AlertDetailsOverride withAlertSeverityColumnName(String alertSeverityColu } /** - * Validates the instance. + * Get the alertDynamicProperties property: List of additional dynamic properties to override. + * + * @return the alertDynamicProperties value. + */ + public List alertDynamicProperties() { + return this.alertDynamicProperties; + } + + /** + * Set the alertDynamicProperties property: List of additional dynamic properties to override. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param alertDynamicProperties the alertDynamicProperties value to set. + * @return the AlertDetailsOverride object itself. */ - public void validate() { + public AlertDetailsOverride withAlertDynamicProperties(List alertDynamicProperties) { + this.alertDynamicProperties = alertDynamicProperties; + return this; } /** @@ -140,6 +158,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("alertDescriptionFormat", this.alertDescriptionFormat); jsonWriter.writeStringField("alertTacticsColumnName", this.alertTacticsColumnName); jsonWriter.writeStringField("alertSeverityColumnName", this.alertSeverityColumnName); + jsonWriter.writeArrayField("alertDynamicProperties", this.alertDynamicProperties, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -166,6 +186,10 @@ public static AlertDetailsOverride fromJson(JsonReader jsonReader) throws IOExce deserializedAlertDetailsOverride.alertTacticsColumnName = reader.getString(); } else if ("alertSeverityColumnName".equals(fieldName)) { deserializedAlertDetailsOverride.alertSeverityColumnName = reader.getString(); + } else if ("alertDynamicProperties".equals(fieldName)) { + List alertDynamicProperties + = reader.readArray(reader1 -> AlertPropertyMapping.fromJson(reader1)); + deserializedAlertDetailsOverride.alertDynamicProperties = alertDynamicProperties; } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertProperty.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertProperty.java new file mode 100644 index 000000000000..224cd78cfebf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertProperty.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The V3 alert property. + */ +public final class AlertProperty extends ExpandableStringEnum { + /** + * Alert's link. + */ + public static final AlertProperty ALERT_LINK = fromString("AlertLink"); + + /** + * Confidence level property. + */ + public static final AlertProperty CONFIDENCE_LEVEL = fromString("ConfidenceLevel"); + + /** + * Confidence score. + */ + public static final AlertProperty CONFIDENCE_SCORE = fromString("ConfidenceScore"); + + /** + * Extended links to the alert. + */ + public static final AlertProperty EXTENDED_LINKS = fromString("ExtendedLinks"); + + /** + * Product name alert property. + */ + public static final AlertProperty PRODUCT_NAME = fromString("ProductName"); + + /** + * Provider name alert property. + */ + public static final AlertProperty PROVIDER_NAME = fromString("ProviderName"); + + /** + * Product component name alert property. + */ + public static final AlertProperty PRODUCT_COMPONENT_NAME = fromString("ProductComponentName"); + + /** + * Remediation steps alert property. + */ + public static final AlertProperty REMEDIATION_STEPS = fromString("RemediationSteps"); + + /** + * Techniques alert property. + */ + public static final AlertProperty TECHNIQUES = fromString("Techniques"); + + /** + * SubTechniques alert property. + */ + public static final AlertProperty SUB_TECHNIQUES = fromString("SubTechniques"); + + /** + * Creates a new instance of AlertProperty value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AlertProperty() { + } + + /** + * Creates or finds a AlertProperty from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlertProperty. + */ + public static AlertProperty fromString(String name) { + return fromString(name, AlertProperty.class); + } + + /** + * Gets known AlertProperty values. + * + * @return known AlertProperty values. + */ + public static Collection values() { + return values(AlertProperty.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertPropertyMapping.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertPropertyMapping.java new file mode 100644 index 000000000000..8b81a0ce6f85 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertPropertyMapping.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A single alert property mapping to override. + */ +@Fluent +public final class AlertPropertyMapping implements JsonSerializable { + /* + * The V3 alert property + */ + private AlertProperty alertProperty; + + /* + * the column name to use to override this property + */ + private String value; + + /** + * Creates an instance of AlertPropertyMapping class. + */ + public AlertPropertyMapping() { + } + + /** + * Get the alertProperty property: The V3 alert property. + * + * @return the alertProperty value. + */ + public AlertProperty alertProperty() { + return this.alertProperty; + } + + /** + * Set the alertProperty property: The V3 alert property. + * + * @param alertProperty the alertProperty value to set. + * @return the AlertPropertyMapping object itself. + */ + public AlertPropertyMapping withAlertProperty(AlertProperty alertProperty) { + this.alertProperty = alertProperty; + return this; + } + + /** + * Get the value property: the column name to use to override this property. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: the column name to use to override this property. + * + * @param value the value value to set. + * @return the AlertPropertyMapping object itself. + */ + public AlertPropertyMapping withValue(String value) { + this.value = value; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("alertProperty", this.alertProperty == null ? null : this.alertProperty.toString()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AlertPropertyMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AlertPropertyMapping if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AlertPropertyMapping. + */ + public static AlertPropertyMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AlertPropertyMapping deserializedAlertPropertyMapping = new AlertPropertyMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertProperty".equals(fieldName)) { + deserializedAlertPropertyMapping.alertProperty = AlertProperty.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedAlertPropertyMapping.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAlertPropertyMapping; + }); + } +} 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 index 85d614bb2a70..e5cc2d994494 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -32,6 +32,15 @@ public interface AlertRule { */ String type(); + /** + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + AlertRuleKind kind(); + /** * Gets the etag property: Etag of the azure resource. * @@ -46,13 +55,6 @@ public interface AlertRule { */ SystemData systemData(); - /** - * Gets the kind property: The alert rule kind. - * - * @return the kind value. - */ - AlertRuleKind kind(); - /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner object. * 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 index c0f073dc9d89..d27b37eb5207 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,21 +12,36 @@ */ public final class AlertRuleKind extends ExpandableStringEnum { /** - * Static value Scheduled for AlertRuleKind. + * Scheduled. */ public static final AlertRuleKind SCHEDULED = fromString("Scheduled"); /** - * Static value MicrosoftSecurityIncidentCreation for AlertRuleKind. + * MicrosoftSecurityIncidentCreation. */ public static final AlertRuleKind MICROSOFT_SECURITY_INCIDENT_CREATION = fromString("MicrosoftSecurityIncidentCreation"); /** - * Static value Fusion for AlertRuleKind. + * Fusion. */ public static final AlertRuleKind FUSION = fromString("Fusion"); + /** + * MLBehaviorAnalytics. + */ + public static final AlertRuleKind MLBEHAVIOR_ANALYTICS = fromString("MLBehaviorAnalytics"); + + /** + * ThreatIntelligence. + */ + public static final AlertRuleKind THREAT_INTELLIGENCE = fromString("ThreatIntelligence"); + + /** + * NRT. + */ + public static final AlertRuleKind NRT = fromString("NRT"); + /** * Creates a new instance of AlertRuleKind value. * diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleOperations.java new file mode 100644 index 000000000000..3300492eb91d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleOperations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of AlertRuleOperations. + */ +public interface AlertRuleOperations { + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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. + */ + void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter); + + /** + * triggers analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param ruleId Alert rule ID. + * @param analyticsRuleRunTriggerParameter The content of the action 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. + */ + void triggerRuleRun(String resourceGroupName, String workspaceName, String ruleId, + AnalyticsRuleRunTrigger analyticsRuleRunTriggerParameter, Context context); +} 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 index 5c19bf607f6a..b995f912ac76 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -33,7 +33,9 @@ public interface AlertRuleTemplate { String type(); /** - * Gets the kind property: The alert rule kind. + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ 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 index d907c0627180..c34e9ebec39a 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * alert rule template data sources. */ -@Fluent +@Immutable public final class AlertRuleTemplateDataSource implements JsonSerializable { /* * The connector id that provides the following data types @@ -30,7 +30,7 @@ public final class AlertRuleTemplateDataSource implements JsonSerializable 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() { - } - /** * {@inheritDoc} */ 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..5df8218e31a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Base alert rule template property bag. + */ +@Immutable +public class AlertRuleTemplatePropertiesBase implements JsonSerializable { + /* + * The number of alert rules that were created by this template + */ + private Integer alertRulesCreatedByTemplateCount; + + /* + * The last time that this alert rule template has been updated. + */ + private OffsetDateTime lastUpdatedDateUtc; + + /* + * The time that this alert rule template has been added. + */ + private OffsetDateTime createdDateUtc; + + /* + * The description of the alert rule template. + */ + private String description; + + /* + * The display name for alert rule template. + */ + private String displayName; + + /* + * The required data sources for this template + */ + private List requiredDataConnectors; + + /* + * The alert rule template status. + */ + private TemplateStatus status; + + /** + * Creates an instance of AlertRuleTemplatePropertiesBase class. + */ + protected AlertRuleTemplatePropertiesBase() { + } + + /** + * 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. + */ + 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; + } + + /** + * Set the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @param lastUpdatedDateUtc the lastUpdatedDateUtc value to set. + * @return the AlertRuleTemplatePropertiesBase object itself. + */ + AlertRuleTemplatePropertiesBase withLastUpdatedDateUtc(OffsetDateTime lastUpdatedDateUtc) { + this.lastUpdatedDateUtc = lastUpdatedDateUtc; + return this; + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + public OffsetDateTime createdDateUtc() { + return this.createdDateUtc; + } + + /** + * Set the createdDateUtc property: The time that this alert rule template has been added. + * + * @param createdDateUtc the createdDateUtc value to set. + * @return the AlertRuleTemplatePropertiesBase object itself. + */ + AlertRuleTemplatePropertiesBase withCreatedDateUtc(OffsetDateTime createdDateUtc) { + this.createdDateUtc = createdDateUtc; + return this; + } + + /** + * 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. + */ + 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. + */ + 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. + */ + 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. + */ + AlertRuleTemplatePropertiesBase withStatus(TemplateStatus status) { + this.status = status; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("alertRulesCreatedByTemplateCount", this.alertRulesCreatedByTemplateCount); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("requiredDataConnectors", this.requiredDataConnectors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AlertRuleTemplatePropertiesBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AlertRuleTemplatePropertiesBase if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AlertRuleTemplatePropertiesBase. + */ + public static AlertRuleTemplatePropertiesBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AlertRuleTemplatePropertiesBase deserializedAlertRuleTemplatePropertiesBase + = new AlertRuleTemplatePropertiesBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertRulesCreatedByTemplateCount".equals(fieldName)) { + deserializedAlertRuleTemplatePropertiesBase.alertRulesCreatedByTemplateCount + = reader.getNullable(JsonReader::getInt); + } else if ("lastUpdatedDateUTC".equals(fieldName)) { + deserializedAlertRuleTemplatePropertiesBase.lastUpdatedDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateUTC".equals(fieldName)) { + deserializedAlertRuleTemplatePropertiesBase.createdDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedAlertRuleTemplatePropertiesBase.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAlertRuleTemplatePropertiesBase.displayName = reader.getString(); + } else if ("requiredDataConnectors".equals(fieldName)) { + List requiredDataConnectors + = reader.readArray(reader1 -> AlertRuleTemplateDataSource.fromJson(reader1)); + deserializedAlertRuleTemplatePropertiesBase.requiredDataConnectors = requiredDataConnectors; + } else if ("status".equals(fieldName)) { + deserializedAlertRuleTemplatePropertiesBase.status = TemplateStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAlertRuleTemplatePropertiesBase; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateWithMitreProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateWithMitreProperties.java new file mode 100644 index 000000000000..d0ba5096885a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateWithMitreProperties.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Alert rule template with MITRE property bag. + */ +@Immutable +public class AlertRuleTemplateWithMitreProperties extends AlertRuleTemplatePropertiesBase { + /* + * The tactics of the alert rule + */ + private List tactics; + + /* + * The techniques of the alert rule + */ + private List techniques; + + /* + * The alert rule template status. + */ + private TemplateStatus status; + + /* + * The required data sources for this template + */ + private List requiredDataConnectors; + + /* + * The display name for alert rule template. + */ + private String displayName; + + /* + * The description of the alert rule template. + */ + private String description; + + /* + * The time that this alert rule template has been added. + */ + private OffsetDateTime createdDateUtc; + + /* + * The last time that this alert rule template has been updated. + */ + private OffsetDateTime lastUpdatedDateUtc; + + /* + * The number of alert rules that were created by this template + */ + private Integer alertRulesCreatedByTemplateCount; + + /** + * Creates an instance of AlertRuleTemplateWithMitreProperties class. + */ + protected AlertRuleTemplateWithMitreProperties() { + } + + /** + * 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 AlertRuleTemplateWithMitreProperties object itself. + */ + AlertRuleTemplateWithMitreProperties withTactics(List tactics) { + this.tactics = tactics; + return this; + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Set the techniques property: The techniques of the alert rule. + * + * @param techniques the techniques value to set. + * @return the AlertRuleTemplateWithMitreProperties object itself. + */ + AlertRuleTemplateWithMitreProperties withTechniques(List techniques) { + this.techniques = techniques; + return this; + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + @Override + public TemplateStatus status() { + return this.status; + } + + /** + * Get the requiredDataConnectors property: The required data sources for this template. + * + * @return the requiredDataConnectors value. + */ + @Override + public List requiredDataConnectors() { + return this.requiredDataConnectors; + } + + /** + * Get the displayName property: The display name for alert rule template. + * + * @return the displayName value. + */ + @Override + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description of the alert rule template. + * + * @return the description value. + */ + @Override + public String description() { + return this.description; + } + + /** + * Get the createdDateUtc property: The time that this alert rule template has been added. + * + * @return the createdDateUtc value. + */ + @Override + public OffsetDateTime createdDateUtc() { + return this.createdDateUtc; + } + + /** + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. + * + * @return the lastUpdatedDateUtc value. + */ + @Override + public OffsetDateTime lastUpdatedDateUtc() { + return this.lastUpdatedDateUtc; + } + + /** + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. + * + * @return the alertRulesCreatedByTemplateCount value. + */ + @Override + public Integer alertRulesCreatedByTemplateCount() { + return this.alertRulesCreatedByTemplateCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("alertRulesCreatedByTemplateCount", alertRulesCreatedByTemplateCount()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeArrayField("requiredDataConnectors", requiredDataConnectors(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeArrayField("tactics", this.tactics, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AlertRuleTemplateWithMitreProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AlertRuleTemplateWithMitreProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AlertRuleTemplateWithMitreProperties. + */ + public static AlertRuleTemplateWithMitreProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AlertRuleTemplateWithMitreProperties deserializedAlertRuleTemplateWithMitreProperties + = new AlertRuleTemplateWithMitreProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alertRulesCreatedByTemplateCount".equals(fieldName)) { + deserializedAlertRuleTemplateWithMitreProperties.alertRulesCreatedByTemplateCount + = reader.getNullable(JsonReader::getInt); + } else if ("lastUpdatedDateUTC".equals(fieldName)) { + deserializedAlertRuleTemplateWithMitreProperties.lastUpdatedDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateUTC".equals(fieldName)) { + deserializedAlertRuleTemplateWithMitreProperties.createdDateUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedAlertRuleTemplateWithMitreProperties.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAlertRuleTemplateWithMitreProperties.displayName = reader.getString(); + } else if ("requiredDataConnectors".equals(fieldName)) { + List requiredDataConnectors + = reader.readArray(reader1 -> AlertRuleTemplateDataSource.fromJson(reader1)); + deserializedAlertRuleTemplateWithMitreProperties.requiredDataConnectors = requiredDataConnectors; + } else if ("status".equals(fieldName)) { + deserializedAlertRuleTemplateWithMitreProperties.status + = TemplateStatus.fromString(reader.getString()); + } else if ("tactics".equals(fieldName)) { + List tactics + = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); + deserializedAlertRuleTemplateWithMitreProperties.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedAlertRuleTemplateWithMitreProperties.techniques = techniques; + } else { + reader.skipChildren(); + } + } + + return deserializedAlertRuleTemplateWithMitreProperties; + }); + } +} 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 index 83a51918b249..ad3847d48907 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,55 +13,55 @@ */ public interface AlertRuleTemplates { /** - * Gets all alert rule templates. + * 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 workspaceName The name of the monitor 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 all alert rule templates as paginated response with {@link PagedIterable}. + * @return the alert rule template along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName); + Response getWithResponse(String resourceGroupName, String workspaceName, + String alertRuleTemplateId, Context context); /** - * Gets all alert rule templates. + * 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 context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 all alert rule templates as paginated response with {@link PagedIterable}. + * @return the alert rule template. */ - PagedIterable list(String resourceGroupName, String workspaceName, Context context); + AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. - * @param context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 the alert rule template along with {@link Response}. + * @return all alert rule templates as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, - String alertRuleTemplateId, Context context); + PagedIterable list(String resourceGroupName, String workspaceName); /** - * Gets the alert rule template. + * 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 alertRuleTemplateId Alert rule template ID. + * @param workspaceName The name of the monitor 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 the alert rule template. + * @return all alert rule templates as paginated response with {@link PagedIterable}. */ - AlertRuleTemplate get(String resourceGroupName, String workspaceName, String alertRuleTemplateId); + PagedIterable list(String resourceGroupName, String workspaceName, Context context); } 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 index 19061f989059..885c385ec89e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,36 +13,11 @@ * 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -56,7 +31,7 @@ public interface AlertRules { * 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 workspaceName The name of the monitor 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. @@ -69,7 +44,7 @@ public interface AlertRules { * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @param context The context to associate with this operation. @@ -85,7 +60,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, String * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param alertRule The alert rule. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -99,7 +74,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, String * 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 workspaceName The name of the monitor workspace. * @param ruleId Alert rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,11 +88,36 @@ Response createOrUpdateWithResponse(String resourceGroupName, String * 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 workspaceName The name of the monitor 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); + + /** + * Gets all alert rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); } 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 index b78f4588fbc2..544590ec6652 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,22 +12,22 @@ */ public final class AlertSeverity extends ExpandableStringEnum { /** - * Static value High for AlertSeverity. + * High severity. */ public static final AlertSeverity HIGH = fromString("High"); /** - * Static value Medium for AlertSeverity. + * Medium severity. */ public static final AlertSeverity MEDIUM = fromString("Medium"); /** - * Static value Low for AlertSeverity. + * Low severity. */ public static final AlertSeverity LOW = fromString("Low"); /** - * Static value Informational for AlertSeverity. + * Informational severity. */ public static final AlertSeverity INFORMATIONAL = fromString("Informational"); 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 index d81ae4777204..05a59deb3787 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,27 +12,27 @@ */ public final class AlertStatus extends ExpandableStringEnum { /** - * Static value Unknown for AlertStatus. + * Unknown value. */ public static final AlertStatus UNKNOWN = fromString("Unknown"); /** - * Static value New for AlertStatus. + * New alert. */ public static final AlertStatus NEW = fromString("New"); /** - * Static value Resolved for AlertStatus. + * Alert closed after handling. */ public static final AlertStatus RESOLVED = fromString("Resolved"); /** - * Static value Dismissed for AlertStatus. + * Alert dismissed as false positive. */ public static final AlertStatus DISMISSED = fromString("Dismissed"); /** - * Static value InProgress for AlertStatus. + * Alert is being handled. */ public static final AlertStatus IN_PROGRESS = fromString("InProgress"); 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 index dc8fd6623891..6bb98e6ad1c3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -47,17 +47,6 @@ public AlertsDataTypeOfDataConnector withAlerts(DataConnectorDataTypeCommon aler return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (alerts() != null) { - alerts().validate(); - } - } - /** * {@inheritDoc} */ @@ -74,6 +63,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AlertsDataTypeOfDataConnector if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the AlertsDataTypeOfDataConnector. */ public static AlertsDataTypeOfDataConnector fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.java new file mode 100644 index 000000000000..549a8e36db9e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AnalyticsRuleRunTriggerProperties; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Analytics Rule Run Trigger request. + */ +@Fluent +public final class AnalyticsRuleRunTrigger implements JsonSerializable { + /* + * The analytics Rule Run Trigger request + */ + private AnalyticsRuleRunTriggerProperties innerProperties = new AnalyticsRuleRunTriggerProperties(); + + /** + * Creates an instance of AnalyticsRuleRunTrigger class. + */ + public AnalyticsRuleRunTrigger() { + } + + /** + * Get the innerProperties property: The analytics Rule Run Trigger request. + * + * @return the innerProperties value. + */ + private AnalyticsRuleRunTriggerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the executionTimeUtc property: The executionTimeUtc property. + * + * @return the executionTimeUtc value. + */ + public OffsetDateTime executionTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().executionTimeUtc(); + } + + /** + * Set the executionTimeUtc property: The executionTimeUtc property. + * + * @param executionTimeUtc the executionTimeUtc value to set. + * @return the AnalyticsRuleRunTrigger object itself. + */ + public AnalyticsRuleRunTrigger withExecutionTimeUtc(OffsetDateTime executionTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new AnalyticsRuleRunTriggerProperties(); + } + this.innerProperties().withExecutionTimeUtc(executionTimeUtc); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalyticsRuleRunTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalyticsRuleRunTrigger if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AnalyticsRuleRunTrigger. + */ + public static AnalyticsRuleRunTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalyticsRuleRunTrigger deserializedAnalyticsRuleRunTrigger = new AnalyticsRuleRunTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAnalyticsRuleRunTrigger.innerProperties + = AnalyticsRuleRunTriggerProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalyticsRuleRunTrigger; + }); + } +} 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..5a337677c18c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Anomalies.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AnomaliesSettingsProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import java.io.IOException; + +/** + * Settings with single toggle. + */ +@Fluent +public final class Anomalies extends SettingsInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private SettingKind kind = SettingKind.ANOMALIES; + + /* + * Anomalies properties + */ + private AnomaliesSettingsProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Anomalies class. + */ + public Anomalies() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public SettingKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Anomalies properties. + * + * @return the innerProperties value. + */ + private AnomaliesSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Anomalies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Anomalies if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Anomalies. + */ + public static Anomalies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Anomalies deserializedAnomalies = new Anomalies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAnomalies.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAnomalies.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAnomalies.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAnomalies.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedAnomalies.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedAnomalies.kind = SettingKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAnomalies.innerProperties = AnomaliesSettingsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAnomalies; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalySecurityMLAnalyticsSettings.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalySecurityMLAnalyticsSettings.java index b5249057e84d..c5f67c149216 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalySecurityMLAnalyticsSettings.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalySecurityMLAnalyticsSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -15,7 +15,6 @@ import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; -import java.util.UUID; /** * Represents Anomaly Security ML Analytics Settings. @@ -23,7 +22,9 @@ @Fluent public final class AnomalySecurityMLAnalyticsSettings extends SecurityMLAnalyticsSettingInner { /* - * The kind of security ML Analytics Settings + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private SecurityMLAnalyticsSettingsKind kind = SecurityMLAnalyticsSettingsKind.ANOMALY; @@ -59,7 +60,9 @@ public AnomalySecurityMLAnalyticsSettings() { } /** - * Get the kind property: The kind of security ML Analytics Settings. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -423,7 +426,7 @@ public AnomalySecurityMLAnalyticsSettings withAnomalySettingsVersion(Integer ano * * @return the settingsDefinitionId value. */ - public UUID settingsDefinitionId() { + public String settingsDefinitionId() { return this.innerProperties() == null ? null : this.innerProperties().settingsDefinitionId(); } @@ -433,7 +436,7 @@ public UUID settingsDefinitionId() { * @param settingsDefinitionId the settingsDefinitionId value to set. * @return the AnomalySecurityMLAnalyticsSettings object itself. */ - public AnomalySecurityMLAnalyticsSettings withSettingsDefinitionId(UUID settingsDefinitionId) { + public AnomalySecurityMLAnalyticsSettings withSettingsDefinitionId(String settingsDefinitionId) { if (this.innerProperties() == null) { this.innerProperties = new AnomalySecurityMLAnalyticsSettingsProperties(); } @@ -441,18 +444,6 @@ public AnomalySecurityMLAnalyticsSettings withSettingsDefinitionId(UUID settings return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalyTimelineItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalyTimelineItem.java new file mode 100644 index 000000000000..d93146da9ddd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalyTimelineItem.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents anomaly timeline item. + */ +@Immutable +public final class AnomalyTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + private EntityTimelineKind kind = EntityTimelineKind.ANOMALY; + + /* + * The anomaly azure resource id. + */ + private String azureResourceId; + + /* + * The anomaly product name. + */ + private String productName; + + /* + * The anomaly description. + */ + private String description; + + /* + * The anomaly name. + */ + private String displayName; + + /* + * The anomaly end time. + */ + private OffsetDateTime endTimeUtc; + + /* + * The anomaly start time. + */ + private OffsetDateTime startTimeUtc; + + /* + * The anomaly generated time. + */ + private OffsetDateTime timeGenerated; + + /* + * The name of the anomaly vendor. + */ + private String vendor; + + /* + * The intent of the anomaly. + */ + private String intent; + + /* + * The techniques of the anomaly. + */ + private List techniques; + + /* + * The reasons that cause the anomaly. + */ + private List reasons; + + /** + * Creates an instance of AnomalyTimelineItem class. + */ + private AnomalyTimelineItem() { + } + + /** + * Get the kind property: The entity query kind type. + * + * @return the kind value. + */ + @Override + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * Get the azureResourceId property: The anomaly azure resource id. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Get the productName property: The anomaly product name. + * + * @return the productName value. + */ + public String productName() { + return this.productName; + } + + /** + * Get the description property: The anomaly description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the displayName property: The anomaly name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the endTimeUtc property: The anomaly end time. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the startTimeUtc property: The anomaly start time. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the timeGenerated property: The anomaly generated time. + * + * @return the timeGenerated value. + */ + public OffsetDateTime timeGenerated() { + return this.timeGenerated; + } + + /** + * Get the vendor property: The name of the anomaly vendor. + * + * @return the vendor value. + */ + public String vendor() { + return this.vendor; + } + + /** + * Get the intent property: The intent of the anomaly. + * + * @return the intent value. + */ + public String intent() { + return this.intent; + } + + /** + * Get the techniques property: The techniques of the anomaly. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Get the reasons property: The reasons that cause the anomaly. + * + * @return the reasons value. + */ + public List reasons() { + return this.reasons; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("endTimeUtc", + this.endTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTimeUtc)); + jsonWriter.writeStringField("startTimeUtc", + this.startTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimeUtc)); + jsonWriter.writeStringField("timeGenerated", + this.timeGenerated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timeGenerated)); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("productName", this.productName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("vendor", this.vendor); + jsonWriter.writeStringField("intent", this.intent); + jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("reasons", this.reasons, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnomalyTimelineItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnomalyTimelineItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AnomalyTimelineItem. + */ + public static AnomalyTimelineItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnomalyTimelineItem deserializedAnomalyTimelineItem = new AnomalyTimelineItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureResourceId".equals(fieldName)) { + deserializedAnomalyTimelineItem.azureResourceId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAnomalyTimelineItem.displayName = reader.getString(); + } else if ("endTimeUtc".equals(fieldName)) { + deserializedAnomalyTimelineItem.endTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startTimeUtc".equals(fieldName)) { + deserializedAnomalyTimelineItem.startTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("timeGenerated".equals(fieldName)) { + deserializedAnomalyTimelineItem.timeGenerated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("kind".equals(fieldName)) { + deserializedAnomalyTimelineItem.kind = EntityTimelineKind.fromString(reader.getString()); + } else if ("productName".equals(fieldName)) { + deserializedAnomalyTimelineItem.productName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAnomalyTimelineItem.description = reader.getString(); + } else if ("vendor".equals(fieldName)) { + deserializedAnomalyTimelineItem.vendor = reader.getString(); + } else if ("intent".equals(fieldName)) { + deserializedAnomalyTimelineItem.intent = reader.getString(); + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedAnomalyTimelineItem.techniques = techniques; + } else if ("reasons".equals(fieldName)) { + List reasons = reader.readArray(reader1 -> reader1.getString()); + deserializedAnomalyTimelineItem.reasons = reasons; + } else { + reader.skipChildren(); + } + } + + return deserializedAnomalyTimelineItem; + }); + } +} 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 index 6acffb438d2e..bdf01035aac9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,22 +12,22 @@ */ public final class AntispamMailDirection extends ExpandableStringEnum { /** - * Static value Unknown for AntispamMailDirection. + * Unknown. */ public static final AntispamMailDirection UNKNOWN = fromString("Unknown"); /** - * Static value Inbound for AntispamMailDirection. + * Inbound. */ public static final AntispamMailDirection INBOUND = fromString("Inbound"); /** - * Static value Outbound for AntispamMailDirection. + * Outbound. */ public static final AntispamMailDirection OUTBOUND = fromString("Outbound"); /** - * Static value Intraorg for AntispamMailDirection. + * Intraorg. */ public static final AntispamMailDirection INTRAORG = fromString("Intraorg"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ApiKeyAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ApiKeyAuthModel.java new file mode 100644 index 000000000000..f9bd74086c4b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ApiKeyAuthModel.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for authentication with the API Key. Will result in additional header on the request (default behavior) to the + * remote server: 'ApiKeyName: ApiKeyIdentifier ApiKey'. If 'IsApiKeyInPostPayload' is true it will send it in the body + * of the request and not the header. + */ +@Fluent +public final class ApiKeyAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.APIKEY; + + /* + * API Key for the user secret key credential + */ + private String apiKey; + + /* + * API Key name + */ + private String apiKeyName; + + /* + * API Key Identifier + */ + private String apiKeyIdentifier; + + /* + * Flag to indicate if API key is set in HTTP POST payload + */ + private Boolean isApiKeyInPostPayload; + + /** + * Creates an instance of ApiKeyAuthModel class. + */ + public ApiKeyAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the apiKey property: API Key for the user secret key credential. + * + * @return the apiKey value. + */ + public String apiKey() { + return this.apiKey; + } + + /** + * Set the apiKey property: API Key for the user secret key credential. + * + * @param apiKey the apiKey value to set. + * @return the ApiKeyAuthModel object itself. + */ + public ApiKeyAuthModel withApiKey(String apiKey) { + this.apiKey = apiKey; + return this; + } + + /** + * Get the apiKeyName property: API Key name. + * + * @return the apiKeyName value. + */ + public String apiKeyName() { + return this.apiKeyName; + } + + /** + * Set the apiKeyName property: API Key name. + * + * @param apiKeyName the apiKeyName value to set. + * @return the ApiKeyAuthModel object itself. + */ + public ApiKeyAuthModel withApiKeyName(String apiKeyName) { + this.apiKeyName = apiKeyName; + return this; + } + + /** + * Get the apiKeyIdentifier property: API Key Identifier. + * + * @return the apiKeyIdentifier value. + */ + public String apiKeyIdentifier() { + return this.apiKeyIdentifier; + } + + /** + * Set the apiKeyIdentifier property: API Key Identifier. + * + * @param apiKeyIdentifier the apiKeyIdentifier value to set. + * @return the ApiKeyAuthModel object itself. + */ + public ApiKeyAuthModel withApiKeyIdentifier(String apiKeyIdentifier) { + this.apiKeyIdentifier = apiKeyIdentifier; + return this; + } + + /** + * Get the isApiKeyInPostPayload property: Flag to indicate if API key is set in HTTP POST payload. + * + * @return the isApiKeyInPostPayload value. + */ + public Boolean isApiKeyInPostPayload() { + return this.isApiKeyInPostPayload; + } + + /** + * Set the isApiKeyInPostPayload property: Flag to indicate if API key is set in HTTP POST payload. + * + * @param isApiKeyInPostPayload the isApiKeyInPostPayload value to set. + * @return the ApiKeyAuthModel object itself. + */ + public ApiKeyAuthModel withIsApiKeyInPostPayload(Boolean isApiKeyInPostPayload) { + this.isApiKeyInPostPayload = isApiKeyInPostPayload; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("apiKey", this.apiKey); + jsonWriter.writeStringField("apiKeyName", this.apiKeyName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("apiKeyIdentifier", this.apiKeyIdentifier); + jsonWriter.writeBooleanField("isApiKeyInPostPayload", this.isApiKeyInPostPayload); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiKeyAuthModel. + */ + public static ApiKeyAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyAuthModel deserializedApiKeyAuthModel = new ApiKeyAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("apiKey".equals(fieldName)) { + deserializedApiKeyAuthModel.apiKey = reader.getString(); + } else if ("apiKeyName".equals(fieldName)) { + deserializedApiKeyAuthModel.apiKeyName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApiKeyAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else if ("apiKeyIdentifier".equals(fieldName)) { + deserializedApiKeyAuthModel.apiKeyIdentifier = reader.getString(); + } else if ("isApiKeyInPostPayload".equals(fieldName)) { + deserializedApiKeyAuthModel.isApiKeyInPostPayload = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyAuthModel; + }); + } +} 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 index 37d0c4306998..4f5eee15e9fe 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,7 +9,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.securityinsights.fluent.models.AscDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.ASCDataConnectorProperties; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; import java.io.IOException; @@ -19,14 +19,16 @@ @Fluent public final class AscDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.AZURE_SECURITY_CENTER; /* * ASC (Azure Security Center) data connector properties. */ - private AscDataConnectorProperties innerProperties; + private ASCDataConnectorProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -55,7 +57,9 @@ public AscDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -69,7 +73,7 @@ public DataConnectorKind kind() { * * @return the innerProperties value. */ - private AscDataConnectorProperties innerProperties() { + private ASCDataConnectorProperties innerProperties() { return this.innerProperties; } @@ -139,7 +143,7 @@ public String subscriptionId() { */ public AscDataConnector withSubscriptionId(String subscriptionId) { if (this.innerProperties() == null) { - this.innerProperties = new AscDataConnectorProperties(); + this.innerProperties = new ASCDataConnectorProperties(); } this.innerProperties().withSubscriptionId(subscriptionId); return this; @@ -162,24 +166,12 @@ public AlertsDataTypeOfDataConnector dataTypes() { */ public AscDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { if (this.innerProperties() == null) { - this.innerProperties = new AscDataConnectorProperties(); + 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -221,7 +213,7 @@ public static AscDataConnector fromJson(JsonReader jsonReader) throws IOExceptio } else if ("kind".equals(fieldName)) { deserializedAscDataConnector.kind = DataConnectorKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { - deserializedAscDataConnector.innerProperties = AscDataConnectorProperties.fromJson(reader); + deserializedAscDataConnector.innerProperties = ASCDataConnectorProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AssignmentItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AssignmentItem.java new file mode 100644 index 000000000000..deb6218a3322 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AssignmentItem.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An entity describing a content item. + */ +@Fluent +public final class AssignmentItem implements JsonSerializable { + /* + * The resource id of the content item + */ + private String resourceId; + + /** + * Creates an instance of AssignmentItem class. + */ + public AssignmentItem() { + } + + /** + * Get the resourceId property: The resource id of the content item. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource id of the content item. + * + * @param resourceId the resourceId value to set. + * @return the AssignmentItem object itself. + */ + public AssignmentItem withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssignmentItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssignmentItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AssignmentItem. + */ + public static AssignmentItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssignmentItem deserializedAssignmentItem = new AssignmentItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedAssignmentItem.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAssignmentItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java new file mode 100644 index 000000000000..783c03487487 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents an attack pattern in Azure Security Insights. + */ +@Immutable +public final class AttackPattern extends TIObjectInner { + /* + * The kind of the TI object + */ + private TIObjectKind kind = TIObjectKind.ATTACK_PATTERN; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The properties of the TI object + */ + private TIObjectCommonProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AttackPattern class. + */ + private AttackPattern() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: The properties of the TI object. + * + * @return the innerProperties value. + */ + private TIObjectCommonProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + public Map data() { + return this.innerProperties() == null ? null : this.innerProperties().data(); + } + + /** + * Get the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the source property: The source name for this TI object. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + public OffsetDateTime firstIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstIngestedTimeUtc(); + } + + /** + * Get the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + public OffsetDateTime lastIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastIngestedTimeUtc(); + } + + /** + * Get the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + public String ingestionRulesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionRulesVersion(); + } + + /** + * Get the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + public String lastUpdateMethod() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdateMethod(); + } + + /** + * Get the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + public UserInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateTimeUtc(); + } + + /** + * Get the relationshipHints property: A dictionary used to help follow relationships from this object to other STIX + * objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of sources + * that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + public List relationshipHints() { + return this.innerProperties() == null ? null : this.innerProperties().relationshipHints(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AttackPattern from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AttackPattern if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AttackPattern. + */ + public static AttackPattern fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AttackPattern deserializedAttackPattern = new AttackPattern(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAttackPattern.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAttackPattern.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAttackPattern.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAttackPattern.innerProperties = TIObjectCommonProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAttackPattern.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedAttackPattern.kind = TIObjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAttackPattern; + }); + } +} 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 index 1661adadf632..ca7fe6ec2971 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,87 +12,87 @@ */ public final class AttackTactic extends ExpandableStringEnum { /** - * Static value Reconnaissance for AttackTactic. + * Reconnaissance. */ public static final AttackTactic RECONNAISSANCE = fromString("Reconnaissance"); /** - * Static value ResourceDevelopment for AttackTactic. + * ResourceDevelopment. */ public static final AttackTactic RESOURCE_DEVELOPMENT = fromString("ResourceDevelopment"); /** - * Static value InitialAccess for AttackTactic. + * InitialAccess. */ public static final AttackTactic INITIAL_ACCESS = fromString("InitialAccess"); /** - * Static value Execution for AttackTactic. + * Execution. */ public static final AttackTactic EXECUTION = fromString("Execution"); /** - * Static value Persistence for AttackTactic. + * Persistence. */ public static final AttackTactic PERSISTENCE = fromString("Persistence"); /** - * Static value PrivilegeEscalation for AttackTactic. + * PrivilegeEscalation. */ public static final AttackTactic PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); /** - * Static value DefenseEvasion for AttackTactic. + * DefenseEvasion. */ public static final AttackTactic DEFENSE_EVASION = fromString("DefenseEvasion"); /** - * Static value CredentialAccess for AttackTactic. + * CredentialAccess. */ public static final AttackTactic CREDENTIAL_ACCESS = fromString("CredentialAccess"); /** - * Static value Discovery for AttackTactic. + * Discovery. */ public static final AttackTactic DISCOVERY = fromString("Discovery"); /** - * Static value LateralMovement for AttackTactic. + * LateralMovement. */ public static final AttackTactic LATERAL_MOVEMENT = fromString("LateralMovement"); /** - * Static value Collection for AttackTactic. + * Collection. */ public static final AttackTactic COLLECTION = fromString("Collection"); /** - * Static value Exfiltration for AttackTactic. + * Exfiltration. */ public static final AttackTactic EXFILTRATION = fromString("Exfiltration"); /** - * Static value CommandAndControl for AttackTactic. + * CommandAndControl. */ public static final AttackTactic COMMAND_AND_CONTROL = fromString("CommandAndControl"); /** - * Static value Impact for AttackTactic. + * Impact. */ public static final AttackTactic IMPACT = fromString("Impact"); /** - * Static value PreAttack for AttackTactic. + * PreAttack. */ public static final AttackTactic PRE_ATTACK = fromString("PreAttack"); /** - * Static value ImpairProcessControl for AttackTactic. + * ImpairProcessControl. */ public static final AttackTactic IMPAIR_PROCESS_CONTROL = fromString("ImpairProcessControl"); /** - * Static value InhibitResponseFunction for AttackTactic. + * InhibitResponseFunction. */ public static final AttackTactic INHIBIT_RESPONSE_FUNCTION = fromString("InhibitResponseFunction"); 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 index a6cc4484cf7d..a11b278df763 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; 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 index 00ef7f0be3b2..f57bd4ed441a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -61,14 +61,6 @@ public AutomationRuleAction withOrder(int order) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -105,7 +97,9 @@ public static AutomationRuleAction fromJson(JsonReader jsonReader) throws IOExce } } // Use the discriminator value to determine which subtype should be deserialized. - if ("ModifyProperties".equals(discriminatorValue)) { + if ("AddIncidentTask".equals(discriminatorValue)) { + return AutomationRuleAddIncidentTaskAction.fromJson(readerToUse.reset()); + } else if ("ModifyProperties".equals(discriminatorValue)) { return AutomationRuleModifyPropertiesAction.fromJson(readerToUse.reset()); } else if ("RunPlaybook".equals(discriminatorValue)) { return AutomationRuleRunPlaybookAction.fromJson(readerToUse.reset()); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java new file mode 100644 index 000000000000..5ce53313602f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes an automation rule action to add a task to an incident. + */ +@Fluent +public final class AutomationRuleAddIncidentTaskAction extends AutomationRuleAction { + /* + * The type of the automation rule action. + */ + private ActionType actionType = ActionType.ADD_INCIDENT_TASK; + + /* + * The actionConfiguration property. + */ + private AddIncidentTaskActionProperties actionConfiguration; + + /** + * Creates an instance of AutomationRuleAddIncidentTaskAction class. + */ + public AutomationRuleAddIncidentTaskAction() { + } + + /** + * Get the actionType property: The type of the automation rule action. + * + * @return the actionType value. + */ + @Override + public ActionType actionType() { + return this.actionType; + } + + /** + * Get the actionConfiguration property: The actionConfiguration property. + * + * @return the actionConfiguration value. + */ + public AddIncidentTaskActionProperties actionConfiguration() { + return this.actionConfiguration; + } + + /** + * Set the actionConfiguration property: The actionConfiguration property. + * + * @param actionConfiguration the actionConfiguration value to set. + * @return the AutomationRuleAddIncidentTaskAction object itself. + */ + public AutomationRuleAddIncidentTaskAction + withActionConfiguration(AddIncidentTaskActionProperties actionConfiguration) { + this.actionConfiguration = actionConfiguration; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AutomationRuleAddIncidentTaskAction withOrder(int order) { + super.withOrder(order); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("order", order()); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + jsonWriter.writeJsonField("actionConfiguration", this.actionConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutomationRuleAddIncidentTaskAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutomationRuleAddIncidentTaskAction if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AutomationRuleAddIncidentTaskAction. + */ + public static AutomationRuleAddIncidentTaskAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutomationRuleAddIncidentTaskAction deserializedAutomationRuleAddIncidentTaskAction + = new AutomationRuleAddIncidentTaskAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("order".equals(fieldName)) { + deserializedAutomationRuleAddIncidentTaskAction.withOrder(reader.getInt()); + } else if ("actionType".equals(fieldName)) { + deserializedAutomationRuleAddIncidentTaskAction.actionType + = ActionType.fromString(reader.getString()); + } else if ("actionConfiguration".equals(fieldName)) { + deserializedAutomationRuleAddIncidentTaskAction.actionConfiguration + = AddIncidentTaskActionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAutomationRuleAddIncidentTaskAction; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanCondition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanCondition.java new file mode 100644 index 000000000000..fb69da9bb33a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanCondition.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The AutomationRuleBooleanCondition model. + */ +@Fluent +public final class AutomationRuleBooleanCondition implements JsonSerializable { + /* + * The operator property. + */ + private AutomationRuleBooleanConditionSupportedOperator operator; + + /* + * The innerConditions property. + */ + private List innerConditions; + + /** + * Creates an instance of AutomationRuleBooleanCondition class. + */ + public AutomationRuleBooleanCondition() { + } + + /** + * Get the operator property: The operator property. + * + * @return the operator value. + */ + public AutomationRuleBooleanConditionSupportedOperator operator() { + return this.operator; + } + + /** + * Set the operator property: The operator property. + * + * @param operator the operator value to set. + * @return the AutomationRuleBooleanCondition object itself. + */ + public AutomationRuleBooleanCondition withOperator(AutomationRuleBooleanConditionSupportedOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the innerConditions property: The innerConditions property. + * + * @return the innerConditions value. + */ + public List innerConditions() { + return this.innerConditions; + } + + /** + * Set the innerConditions property: The innerConditions property. + * + * @param innerConditions the innerConditions value to set. + * @return the AutomationRuleBooleanCondition object itself. + */ + public AutomationRuleBooleanCondition withInnerConditions(List innerConditions) { + this.innerConditions = innerConditions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeArrayField("innerConditions", this.innerConditions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutomationRuleBooleanCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutomationRuleBooleanCondition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutomationRuleBooleanCondition. + */ + public static AutomationRuleBooleanCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutomationRuleBooleanCondition deserializedAutomationRuleBooleanCondition + = new AutomationRuleBooleanCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operator".equals(fieldName)) { + deserializedAutomationRuleBooleanCondition.operator + = AutomationRuleBooleanConditionSupportedOperator.fromString(reader.getString()); + } else if ("innerConditions".equals(fieldName)) { + List innerConditions + = reader.readArray(reader1 -> AutomationRuleCondition.fromJson(reader1)); + deserializedAutomationRuleBooleanCondition.innerConditions = innerConditions; + } else { + reader.skipChildren(); + } + } + + return deserializedAutomationRuleBooleanCondition; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanConditionSupportedOperator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanConditionSupportedOperator.java new file mode 100644 index 000000000000..9265dc1a216d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanConditionSupportedOperator.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for AutomationRuleBooleanConditionSupportedOperator. + */ +public final class AutomationRuleBooleanConditionSupportedOperator + extends ExpandableStringEnum { + /** + * Evaluates as true if all the item conditions are evaluated as true. + */ + public static final AutomationRuleBooleanConditionSupportedOperator AND = fromString("And"); + + /** + * Evaluates as true if at least one of the item conditions are evaluated as true. + */ + public static final AutomationRuleBooleanConditionSupportedOperator OR = fromString("Or"); + + /** + * Creates a new instance of AutomationRuleBooleanConditionSupportedOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRuleBooleanConditionSupportedOperator() { + } + + /** + * Creates or finds a AutomationRuleBooleanConditionSupportedOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutomationRuleBooleanConditionSupportedOperator. + */ + public static AutomationRuleBooleanConditionSupportedOperator fromString(String name) { + return fromString(name, AutomationRuleBooleanConditionSupportedOperator.class); + } + + /** + * Gets known AutomationRuleBooleanConditionSupportedOperator values. + * + * @return known AutomationRuleBooleanConditionSupportedOperator values. + */ + public static Collection values() { + return values(AutomationRuleBooleanConditionSupportedOperator.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 index fecdd611b9cf..eaf2fe469f55 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -36,14 +36,6 @@ public ConditionType conditionType() { return this.conditionType; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -78,8 +70,12 @@ public static AutomationRuleCondition fromJson(JsonReader jsonReader) throws IOE } } // Use the discriminator value to determine which subtype should be deserialized. - if ("PropertyArrayChanged".equals(discriminatorValue)) { + if ("Boolean".equals(discriminatorValue)) { + return BooleanConditionProperties.fromJson(readerToUse.reset()); + } else if ("PropertyArrayChanged".equals(discriminatorValue)) { return PropertyArrayChangedConditionProperties.fromJson(readerToUse.reset()); + } else if ("PropertyArray".equals(discriminatorValue)) { + return PropertyArrayConditionProperties.fromJson(readerToUse.reset()); } else if ("PropertyChanged".equals(discriminatorValue)) { return PropertyChangedConditionProperties.fromJson(readerToUse.reset()); } else if ("Property".equals(discriminatorValue)) { 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 index 1f1226df6d40..bcb6b74cba26 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -70,18 +70,6 @@ public AutomationRuleModifyPropertiesAction withOrder(int order) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (actionConfiguration() != null) { - actionConfiguration().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.java index 4d0859ab45c6..8c0a6f2318ff 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,22 +13,22 @@ public final class AutomationRulePropertyArrayChangedConditionSupportedArrayType extends ExpandableStringEnum { /** - * Static value Alerts for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + * Evaluate the condition on the alerts. */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType ALERTS = fromString("Alerts"); /** - * Static value Labels for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + * Evaluate the condition on the labels. */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType LABELS = fromString("Labels"); /** - * Static value Tactics for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + * Evaluate the condition on the tactics. */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType TACTICS = fromString("Tactics"); /** - * Static value Comments for AutomationRulePropertyArrayChangedConditionSupportedArrayType. + * Evaluate the condition on the comments. */ public static final AutomationRulePropertyArrayChangedConditionSupportedArrayType COMMENTS = fromString("Comments"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.java index 59ce49a11fb9..29191321ec65 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,7 +13,7 @@ public final class AutomationRulePropertyArrayChangedConditionSupportedChangeType extends ExpandableStringEnum { /** - * Static value Added for AutomationRulePropertyArrayChangedConditionSupportedChangeType. + * Evaluate the condition on items added to the array. */ public static final AutomationRulePropertyArrayChangedConditionSupportedChangeType ADDED = fromString("Added"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedValuesCondition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedValuesCondition.java index 1f929e9af298..18f7cadaf2ee 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedValuesCondition.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedValuesCondition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -75,14 +75,6 @@ public AutomationRulePropertyArrayChangedConditionSupportedChangeType changeType return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.java new file mode 100644 index 000000000000..87989d6e9f16 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for AutomationRulePropertyArrayConditionSupportedArrayConditionType. + */ +public final class AutomationRulePropertyArrayConditionSupportedArrayConditionType + extends ExpandableStringEnum { + /** + * Evaluate the condition as true if any item fulfills it. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayConditionType ANY_ITEM + = fromString("AnyItem"); + + /** + * Evaluate the condition as true if all the items fulfill it. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayConditionType ALL_ITEMS + = fromString("AllItems"); + + /** + * Creates a new instance of AutomationRulePropertyArrayConditionSupportedArrayConditionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyArrayConditionSupportedArrayConditionType() { + } + + /** + * Creates or finds a AutomationRulePropertyArrayConditionSupportedArrayConditionType from its string + * representation. + * + * @param name a name to look for. + * @return the corresponding AutomationRulePropertyArrayConditionSupportedArrayConditionType. + */ + public static AutomationRulePropertyArrayConditionSupportedArrayConditionType fromString(String name) { + return fromString(name, AutomationRulePropertyArrayConditionSupportedArrayConditionType.class); + } + + /** + * Gets known AutomationRulePropertyArrayConditionSupportedArrayConditionType values. + * + * @return known AutomationRulePropertyArrayConditionSupportedArrayConditionType values. + */ + public static Collection values() { + return values(AutomationRulePropertyArrayConditionSupportedArrayConditionType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayType.java new file mode 100644 index 000000000000..e6b27cc0ca44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayType.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for AutomationRulePropertyArrayConditionSupportedArrayType. + */ +public final class AutomationRulePropertyArrayConditionSupportedArrayType + extends ExpandableStringEnum { + /** + * Evaluate the condition on the custom detail keys. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayType CUSTOM_DETAILS + = fromString("CustomDetails"); + + /** + * Evaluate the condition on a custom detail's values. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayType CUSTOM_DETAIL_VALUES + = fromString("CustomDetailValues"); + + /** + * Evaluate the condition on the incident labels. + */ + public static final AutomationRulePropertyArrayConditionSupportedArrayType INCIDENT_LABELS + = fromString("IncidentLabels"); + + /** + * Creates a new instance of AutomationRulePropertyArrayConditionSupportedArrayType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutomationRulePropertyArrayConditionSupportedArrayType() { + } + + /** + * Creates or finds a AutomationRulePropertyArrayConditionSupportedArrayType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutomationRulePropertyArrayConditionSupportedArrayType. + */ + public static AutomationRulePropertyArrayConditionSupportedArrayType fromString(String name) { + return fromString(name, AutomationRulePropertyArrayConditionSupportedArrayType.class); + } + + /** + * Gets known AutomationRulePropertyArrayConditionSupportedArrayType values. + * + * @return known AutomationRulePropertyArrayConditionSupportedArrayType values. + */ + public static Collection values() { + return values(AutomationRulePropertyArrayConditionSupportedArrayType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayValuesCondition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayValuesCondition.java new file mode 100644 index 000000000000..134fcf5e5106 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayValuesCondition.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The AutomationRulePropertyArrayValuesCondition model. + */ +@Fluent +public final class AutomationRulePropertyArrayValuesCondition + implements JsonSerializable { + /* + * The arrayType property. + */ + private AutomationRulePropertyArrayConditionSupportedArrayType arrayType; + + /* + * The arrayConditionType property. + */ + private AutomationRulePropertyArrayConditionSupportedArrayConditionType arrayConditionType; + + /* + * The itemConditions property. + */ + private List itemConditions; + + /** + * Creates an instance of AutomationRulePropertyArrayValuesCondition class. + */ + public AutomationRulePropertyArrayValuesCondition() { + } + + /** + * Get the arrayType property: The arrayType property. + * + * @return the arrayType value. + */ + public AutomationRulePropertyArrayConditionSupportedArrayType arrayType() { + return this.arrayType; + } + + /** + * Set the arrayType property: The arrayType property. + * + * @param arrayType the arrayType value to set. + * @return the AutomationRulePropertyArrayValuesCondition object itself. + */ + public AutomationRulePropertyArrayValuesCondition + withArrayType(AutomationRulePropertyArrayConditionSupportedArrayType arrayType) { + this.arrayType = arrayType; + return this; + } + + /** + * Get the arrayConditionType property: The arrayConditionType property. + * + * @return the arrayConditionType value. + */ + public AutomationRulePropertyArrayConditionSupportedArrayConditionType arrayConditionType() { + return this.arrayConditionType; + } + + /** + * Set the arrayConditionType property: The arrayConditionType property. + * + * @param arrayConditionType the arrayConditionType value to set. + * @return the AutomationRulePropertyArrayValuesCondition object itself. + */ + public AutomationRulePropertyArrayValuesCondition + withArrayConditionType(AutomationRulePropertyArrayConditionSupportedArrayConditionType arrayConditionType) { + this.arrayConditionType = arrayConditionType; + return this; + } + + /** + * Get the itemConditions property: The itemConditions property. + * + * @return the itemConditions value. + */ + public List itemConditions() { + return this.itemConditions; + } + + /** + * Set the itemConditions property: The itemConditions property. + * + * @param itemConditions the itemConditions value to set. + * @return the AutomationRulePropertyArrayValuesCondition object itself. + */ + public AutomationRulePropertyArrayValuesCondition withItemConditions(List itemConditions) { + this.itemConditions = itemConditions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("arrayType", this.arrayType == null ? null : this.arrayType.toString()); + jsonWriter.writeStringField("arrayConditionType", + this.arrayConditionType == null ? null : this.arrayConditionType.toString()); + jsonWriter.writeArrayField("itemConditions", this.itemConditions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutomationRulePropertyArrayValuesCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutomationRulePropertyArrayValuesCondition if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutomationRulePropertyArrayValuesCondition. + */ + public static AutomationRulePropertyArrayValuesCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutomationRulePropertyArrayValuesCondition deserializedAutomationRulePropertyArrayValuesCondition + = new AutomationRulePropertyArrayValuesCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("arrayType".equals(fieldName)) { + deserializedAutomationRulePropertyArrayValuesCondition.arrayType + = AutomationRulePropertyArrayConditionSupportedArrayType.fromString(reader.getString()); + } else if ("arrayConditionType".equals(fieldName)) { + deserializedAutomationRulePropertyArrayValuesCondition.arrayConditionType + = AutomationRulePropertyArrayConditionSupportedArrayConditionType + .fromString(reader.getString()); + } else if ("itemConditions".equals(fieldName)) { + List itemConditions + = reader.readArray(reader1 -> AutomationRuleCondition.fromJson(reader1)); + deserializedAutomationRulePropertyArrayValuesCondition.itemConditions = itemConditions; + } else { + reader.skipChildren(); + } + } + + return deserializedAutomationRulePropertyArrayValuesCondition; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedChangedType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedChangedType.java index 0fea26ca5709..b9f236c62fc1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedChangedType.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedChangedType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,13 +13,13 @@ public final class AutomationRulePropertyChangedConditionSupportedChangedType extends ExpandableStringEnum { /** - * Static value ChangedFrom for AutomationRulePropertyChangedConditionSupportedChangedType. + * Evaluate the condition on the previous value of the property. */ public static final AutomationRulePropertyChangedConditionSupportedChangedType CHANGED_FROM = fromString("ChangedFrom"); /** - * Static value ChangedTo for AutomationRulePropertyChangedConditionSupportedChangedType. + * Evaluate the condition on the updated value of the property. */ public static final AutomationRulePropertyChangedConditionSupportedChangedType CHANGED_TO = fromString("ChangedTo"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedPropertyType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedPropertyType.java index fb1057304001..115a99204b3d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedPropertyType.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedPropertyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,19 +13,19 @@ public final class AutomationRulePropertyChangedConditionSupportedPropertyType extends ExpandableStringEnum { /** - * Static value IncidentSeverity for AutomationRulePropertyChangedConditionSupportedPropertyType. + * Evaluate the condition on the incident severity. */ public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_SEVERITY = fromString("IncidentSeverity"); /** - * Static value IncidentStatus for AutomationRulePropertyChangedConditionSupportedPropertyType. + * Evaluate the condition on the incident status. */ public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_STATUS = fromString("IncidentStatus"); /** - * Static value IncidentOwner for AutomationRulePropertyChangedConditionSupportedPropertyType. + * Evaluate the condition on the incident owner. */ public static final AutomationRulePropertyChangedConditionSupportedPropertyType INCIDENT_OWNER = fromString("IncidentOwner"); 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 index 28ef9712abca..475df849ae7d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,42 +13,42 @@ public final class AutomationRulePropertyConditionSupportedOperator extends ExpandableStringEnum { /** - * Static value Equals for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property equals at least one of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator EQUALS = fromString("Equals"); /** - * Static value NotEquals for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property does not equal any of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator NOT_EQUALS = fromString("NotEquals"); /** - * Static value Contains for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property contains at least one of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator CONTAINS = fromString("Contains"); /** - * Static value NotContains for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property does not contain any of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator NOT_CONTAINS = fromString("NotContains"); /** - * Static value StartsWith for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property starts with any of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator STARTS_WITH = fromString("StartsWith"); /** - * Static value NotStartsWith for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property does not start with any of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator NOT_STARTS_WITH = fromString("NotStartsWith"); /** - * Static value EndsWith for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property ends with any of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator ENDS_WITH = fromString("EndsWith"); /** - * Static value NotEndsWith for AutomationRulePropertyConditionSupportedOperator. + * Evaluates if the property does not end with any of the condition values. */ public static final AutomationRulePropertyConditionSupportedOperator NOT_ENDS_WITH = fromString("NotEndsWith"); 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 index 83afff51af25..4253d1872d8b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,315 +13,339 @@ public final class AutomationRulePropertyConditionSupportedProperty extends ExpandableStringEnum { /** - * Static value IncidentTitle for AutomationRulePropertyConditionSupportedProperty. + * The title of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_TITLE = fromString("IncidentTitle"); /** - * Static value IncidentDescription for AutomationRulePropertyConditionSupportedProperty. + * The description of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_DESCRIPTION = fromString("IncidentDescription"); /** - * Static value IncidentSeverity for AutomationRulePropertyConditionSupportedProperty. + * The severity of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_SEVERITY = fromString("IncidentSeverity"); /** - * Static value IncidentStatus for AutomationRulePropertyConditionSupportedProperty. + * The status of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_STATUS = fromString("IncidentStatus"); /** - * Static value IncidentRelatedAnalyticRuleIds for AutomationRulePropertyConditionSupportedProperty. + * The related Analytic rule ids of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_RELATED_ANALYTIC_RULE_IDS = fromString("IncidentRelatedAnalyticRuleIds"); /** - * Static value IncidentTactics for AutomationRulePropertyConditionSupportedProperty. + * The tactics of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_TACTICS = fromString("IncidentTactics"); /** - * Static value IncidentLabel for AutomationRulePropertyConditionSupportedProperty. + * The labels of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_LABEL = fromString("IncidentLabel"); /** - * Static value IncidentProviderName for AutomationRulePropertyConditionSupportedProperty. + * The provider name of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_PROVIDER_NAME = fromString("IncidentProviderName"); /** - * Static value IncidentUpdatedBySource for AutomationRulePropertyConditionSupportedProperty. + * The update source of the incident. */ public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_UPDATED_BY_SOURCE = fromString("IncidentUpdatedBySource"); /** - * Static value AccountAadTenantId for AutomationRulePropertyConditionSupportedProperty. + * The incident custom detail key. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_CUSTOM_DETAILS_KEY + = fromString("IncidentCustomDetailsKey"); + + /** + * The incident custom detail value. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_CUSTOM_DETAILS_VALUE + = fromString("IncidentCustomDetailsValue"); + + /** + * The Custom-Detection rule ids associated with any of the incident alerts. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_CUSTOM_DETECTION_RULE_IDS + = fromString("IncidentCustomDetectionRuleIds"); + + /** + * The alert title associated with any of the incident alerts. + */ + public static final AutomationRulePropertyConditionSupportedProperty INCIDENT_ALERT_TITLE + = fromString("IncidentAlertTitle"); + + /** + * The account Azure Active Directory tenant id. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_TENANT_ID = fromString("AccountAadTenantId"); /** - * Static value AccountAadUserId for AutomationRulePropertyConditionSupportedProperty. + * The account Azure Active Directory user id. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_AAD_USER_ID = fromString("AccountAadUserId"); /** - * Static value AccountName for AutomationRulePropertyConditionSupportedProperty. + * The account name. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_NAME = fromString("AccountName"); /** - * Static value AccountNTDomain for AutomationRulePropertyConditionSupportedProperty. + * The account NetBIOS domain name. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_NTDOMAIN = fromString("AccountNTDomain"); /** - * Static value AccountPUID for AutomationRulePropertyConditionSupportedProperty. + * The account Azure Active Directory Passport User ID. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_PUID = fromString("AccountPUID"); /** - * Static value AccountSid for AutomationRulePropertyConditionSupportedProperty. + * The account security identifier. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_SID = fromString("AccountSid"); /** - * Static value AccountObjectGuid for AutomationRulePropertyConditionSupportedProperty. + * The account unique identifier. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_OBJECT_GUID = fromString("AccountObjectGuid"); /** - * Static value AccountUPNSuffix for AutomationRulePropertyConditionSupportedProperty. + * The account user principal name suffix. */ public static final AutomationRulePropertyConditionSupportedProperty ACCOUNT_UPNSUFFIX = fromString("AccountUPNSuffix"); /** - * Static value AlertProductNames for AutomationRulePropertyConditionSupportedProperty. + * The name of the product of the alert. */ public static final AutomationRulePropertyConditionSupportedProperty ALERT_PRODUCT_NAMES = fromString("AlertProductNames"); /** - * Static value AlertAnalyticRuleIds for AutomationRulePropertyConditionSupportedProperty. + * The analytic rule ids of the alert. */ public static final AutomationRulePropertyConditionSupportedProperty ALERT_ANALYTIC_RULE_IDS = fromString("AlertAnalyticRuleIds"); /** - * Static value AzureResourceResourceId for AutomationRulePropertyConditionSupportedProperty. + * The Azure resource id. */ public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_RESOURCE_ID = fromString("AzureResourceResourceId"); /** - * Static value AzureResourceSubscriptionId for AutomationRulePropertyConditionSupportedProperty. + * The Azure resource subscription id. */ public static final AutomationRulePropertyConditionSupportedProperty AZURE_RESOURCE_SUBSCRIPTION_ID = fromString("AzureResourceSubscriptionId"); /** - * Static value CloudApplicationAppId for AutomationRulePropertyConditionSupportedProperty. + * The cloud application identifier. */ public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_ID = fromString("CloudApplicationAppId"); /** - * Static value CloudApplicationAppName for AutomationRulePropertyConditionSupportedProperty. + * The cloud application name. */ public static final AutomationRulePropertyConditionSupportedProperty CLOUD_APPLICATION_APP_NAME = fromString("CloudApplicationAppName"); /** - * Static value DNSDomainName for AutomationRulePropertyConditionSupportedProperty. + * The dns record domain name. */ public static final AutomationRulePropertyConditionSupportedProperty DNSDOMAIN_NAME = fromString("DNSDomainName"); /** - * Static value FileDirectory for AutomationRulePropertyConditionSupportedProperty. + * The file directory full path. */ public static final AutomationRulePropertyConditionSupportedProperty FILE_DIRECTORY = fromString("FileDirectory"); /** - * Static value FileName for AutomationRulePropertyConditionSupportedProperty. + * The file name without path. */ public static final AutomationRulePropertyConditionSupportedProperty FILE_NAME = fromString("FileName"); /** - * Static value FileHashValue for AutomationRulePropertyConditionSupportedProperty. + * The file hash value. */ public static final AutomationRulePropertyConditionSupportedProperty FILE_HASH_VALUE = fromString("FileHashValue"); /** - * Static value HostAzureID for AutomationRulePropertyConditionSupportedProperty. + * The host Azure resource id. */ public static final AutomationRulePropertyConditionSupportedProperty HOST_AZURE_ID = fromString("HostAzureID"); /** - * Static value HostName for AutomationRulePropertyConditionSupportedProperty. + * The host name without domain. */ public static final AutomationRulePropertyConditionSupportedProperty HOST_NAME = fromString("HostName"); /** - * Static value HostNetBiosName for AutomationRulePropertyConditionSupportedProperty. + * The host NetBIOS name. */ public static final AutomationRulePropertyConditionSupportedProperty HOST_NET_BIOS_NAME = fromString("HostNetBiosName"); /** - * Static value HostNTDomain for AutomationRulePropertyConditionSupportedProperty. + * The host NT domain. */ public static final AutomationRulePropertyConditionSupportedProperty HOST_NTDOMAIN = fromString("HostNTDomain"); /** - * Static value HostOSVersion for AutomationRulePropertyConditionSupportedProperty. + * The host operating system. */ public static final AutomationRulePropertyConditionSupportedProperty HOST_OSVERSION = fromString("HostOSVersion"); /** - * Static value IoTDeviceId for AutomationRulePropertyConditionSupportedProperty. + * "The IoT device id. */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_ID = fromString("IoTDeviceId"); /** - * Static value IoTDeviceName for AutomationRulePropertyConditionSupportedProperty. + * The IoT device name. */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_NAME = fromString("IoTDeviceName"); /** - * Static value IoTDeviceType for AutomationRulePropertyConditionSupportedProperty. + * The IoT device type. */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_TYPE = fromString("IoTDeviceType"); /** - * Static value IoTDeviceVendor for AutomationRulePropertyConditionSupportedProperty. + * The IoT device vendor. */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_VENDOR = fromString("IoTDeviceVendor"); /** - * Static value IoTDeviceModel for AutomationRulePropertyConditionSupportedProperty. + * The IoT device model. */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_MODEL = fromString("IoTDeviceModel"); /** - * Static value IoTDeviceOperatingSystem for AutomationRulePropertyConditionSupportedProperty. + * The IoT device operating system. */ public static final AutomationRulePropertyConditionSupportedProperty IO_TDEVICE_OPERATING_SYSTEM = fromString("IoTDeviceOperatingSystem"); /** - * Static value IPAddress for AutomationRulePropertyConditionSupportedProperty. + * The IP address. */ public static final AutomationRulePropertyConditionSupportedProperty IPADDRESS = fromString("IPAddress"); /** - * Static value MailboxDisplayName for AutomationRulePropertyConditionSupportedProperty. + * The mailbox display name. */ public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_DISPLAY_NAME = fromString("MailboxDisplayName"); /** - * Static value MailboxPrimaryAddress for AutomationRulePropertyConditionSupportedProperty. + * The mailbox primary address. */ public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_PRIMARY_ADDRESS = fromString("MailboxPrimaryAddress"); /** - * Static value MailboxUPN for AutomationRulePropertyConditionSupportedProperty. + * The mailbox user principal name. */ public static final AutomationRulePropertyConditionSupportedProperty MAILBOX_UPN = fromString("MailboxUPN"); /** - * Static value MailMessageDeliveryAction for AutomationRulePropertyConditionSupportedProperty. + * The mail message delivery action. */ public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_ACTION = fromString("MailMessageDeliveryAction"); /** - * Static value MailMessageDeliveryLocation for AutomationRulePropertyConditionSupportedProperty. + * The mail message delivery location. */ public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_DELIVERY_LOCATION = fromString("MailMessageDeliveryLocation"); /** - * Static value MailMessageRecipient for AutomationRulePropertyConditionSupportedProperty. + * The mail message recipient. */ public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_RECIPIENT = fromString("MailMessageRecipient"); /** - * Static value MailMessageSenderIP for AutomationRulePropertyConditionSupportedProperty. + * The mail message sender IP address. */ public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SENDER_IP = fromString("MailMessageSenderIP"); /** - * Static value MailMessageSubject for AutomationRulePropertyConditionSupportedProperty. + * The mail message subject. */ public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_SUBJECT = fromString("MailMessageSubject"); /** - * Static value MailMessageP1Sender for AutomationRulePropertyConditionSupportedProperty. + * The mail message P1 sender. */ public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P1SENDER = fromString("MailMessageP1Sender"); /** - * Static value MailMessageP2Sender for AutomationRulePropertyConditionSupportedProperty. + * The mail message P2 sender. */ public static final AutomationRulePropertyConditionSupportedProperty MAIL_MESSAGE_P2SENDER = fromString("MailMessageP2Sender"); /** - * Static value MalwareCategory for AutomationRulePropertyConditionSupportedProperty. + * The malware category. */ public static final AutomationRulePropertyConditionSupportedProperty MALWARE_CATEGORY = fromString("MalwareCategory"); /** - * Static value MalwareName for AutomationRulePropertyConditionSupportedProperty. + * The malware name. */ public static final AutomationRulePropertyConditionSupportedProperty MALWARE_NAME = fromString("MalwareName"); /** - * Static value ProcessCommandLine for AutomationRulePropertyConditionSupportedProperty. + * The process execution command line. */ public static final AutomationRulePropertyConditionSupportedProperty PROCESS_COMMAND_LINE = fromString("ProcessCommandLine"); /** - * Static value ProcessId for AutomationRulePropertyConditionSupportedProperty. + * The process id. */ public static final AutomationRulePropertyConditionSupportedProperty PROCESS_ID = fromString("ProcessId"); /** - * Static value RegistryKey for AutomationRulePropertyConditionSupportedProperty. + * The registry key path. */ public static final AutomationRulePropertyConditionSupportedProperty REGISTRY_KEY = fromString("RegistryKey"); /** - * Static value RegistryValueData for AutomationRulePropertyConditionSupportedProperty. + * The registry key value in string formatted representation. */ public static final AutomationRulePropertyConditionSupportedProperty REGISTRY_VALUE_DATA = fromString("RegistryValueData"); /** - * Static value Url for AutomationRulePropertyConditionSupportedProperty. + * The url. */ public static final AutomationRulePropertyConditionSupportedProperty URL = fromString("Url"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesChangedCondition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesChangedCondition.java index e29b693ac05e..963f487dd314 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesChangedCondition.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesChangedCondition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -127,14 +127,6 @@ public AutomationRulePropertyValuesChangedCondition withPropertyValues(List pro return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 53494d543202..243b577a1276 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -70,18 +70,6 @@ public AutomationRuleRunPlaybookAction withOrder(int order) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (actionConfiguration() != null) { - actionConfiguration().validate(); - } - } - /** * {@inheritDoc} */ 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 index f38391fb8b39..b87418881eda 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -156,29 +155,6 @@ public AutomationRuleTriggeringLogic withConditions(List e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutomationRuleTriggeringLogic.class); - /** * {@inheritDoc} */ 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 index ccedb6a317b4..3a42239b442d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -16,7 +16,7 @@ public interface AutomationRules { * 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 workspaceName The name of the monitor workspace. * @param automationRuleId Automation rule ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +31,7 @@ Response getWithResponse(String resourceGroupName, String worksp * 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 workspaceName The name of the monitor 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. @@ -44,13 +44,13 @@ Response getWithResponse(String resourceGroupName, String worksp * 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 workspaceName The name of the monitor 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 any object along with {@link Response}. + * @return anything along with {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String workspaceName, String automationRuleId, Context context); @@ -59,12 +59,12 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * 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 workspaceName The name of the monitor 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 any object. + * @return anything. */ Object delete(String resourceGroupName, String workspaceName, String automationRuleId); @@ -72,7 +72,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * 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 workspaceName The name of the monitor 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. @@ -84,7 +84,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * 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 workspaceName The name of the monitor 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. @@ -123,7 +123,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response}. + * @return anything along with {@link Response}. */ Object deleteById(String id); @@ -135,7 +135,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object along with {@link Response}. + * @return anything along with {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); 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..1f491e36974f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Connector Availability Status. + */ +@Fluent +public final class Availability implements JsonSerializable { + /* + * The connector Availability Status + */ + private AvailabilityStatus status; + + /* + * Set connector as preview + */ + private Boolean isPreview; + + /** + * Creates an instance of Availability class. + */ + public Availability() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("status", this.status == null ? null : this.status.toInt()); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Availability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Availability if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Availability. + */ + public static Availability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Availability deserializedAvailability = new Availability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedAvailability.status = AvailabilityStatus.fromInt(reader.getInt()); + } else if ("isPreview".equals(fieldName)) { + deserializedAvailability.isPreview = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailability; + }); + } +} 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..e4b8eea0d9c9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +/** + * 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. + */ + 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. + */ + 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..7cf351f58395 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailCheckRequirements.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Amazon Web Services CloudTrail requirements check request. + */ +@Immutable +public final class AwsCloudTrailCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.AMAZON_WEB_SERVICES_CLOUD_TRAIL; + + /** + * Creates an instance of AwsCloudTrailCheckRequirements class. + */ + public AwsCloudTrailCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCloudTrailCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCloudTrailCheckRequirements if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsCloudTrailCheckRequirements. + */ + public static AwsCloudTrailCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCloudTrailCheckRequirements deserializedAwsCloudTrailCheckRequirements + = new AwsCloudTrailCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAwsCloudTrailCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCloudTrailCheckRequirements; + }); + } +} 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 index e2ef88ca595f..f50bd86fadc9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Fluent public final class AwsCloudTrailDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.AMAZON_WEB_SERVICES_CLOUD_TRAIL; @@ -55,7 +57,9 @@ public AwsCloudTrailDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -170,18 +174,6 @@ public AwsCloudTrailDataConnector withDataTypes(AwsCloudTrailDataConnectorDataTy return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index a526e01a3a68..78a320e856f6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -48,17 +48,6 @@ public AwsCloudTrailDataConnectorDataTypes withLogs(AwsCloudTrailDataConnectorDa return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (logs() != null) { - logs().validate(); - } - } - /** * {@inheritDoc} */ @@ -75,6 +64,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AwsCloudTrailDataConnectorDataTypes if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the AwsCloudTrailDataConnectorDataTypes. */ public static AwsCloudTrailDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { 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 index c9b23f963d5f..9bcf2f41f8b0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -30,15 +30,6 @@ public AwsCloudTrailDataConnectorDataTypesLogs withState(DataTypeState state) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -55,6 +46,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AwsCloudTrailDataConnectorDataTypesLogs if the JsonReader was pointing to an instance of * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the AwsCloudTrailDataConnectorDataTypesLogs. */ public static AwsCloudTrailDataConnectorDataTypesLogs fromJson(JsonReader jsonReader) throws IOException { 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..83b7e54d5432 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3CheckRequirements.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Amazon Web Services S3 requirements check request. + */ +@Immutable +public final class AwsS3CheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.AMAZON_WEB_SERVICES_S3; + + /** + * Creates an instance of AwsS3CheckRequirements class. + */ + public AwsS3CheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3CheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3CheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AwsS3CheckRequirements. + */ + public static AwsS3CheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3CheckRequirements deserializedAwsS3CheckRequirements = new AwsS3CheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAwsS3CheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3CheckRequirements; + }); + } +} 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..d681300c91be --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnector.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AwsS3DataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import java.io.IOException; +import java.util.List; + +/** + * Represents Amazon Web Services S3 data connector. + */ +@Fluent +public final class AwsS3DataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.AMAZON_WEB_SERVICES_S3; + + /* + * Amazon Web Services S3 data connector properties. + */ + private AwsS3DataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AwsS3DataConnector class. + */ + public AwsS3DataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Amazon Web Services S3 data connector properties. + * + * @return the innerProperties value. + */ + private AwsS3DataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3DataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3DataConnector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AwsS3DataConnector. + */ + public static AwsS3DataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3DataConnector deserializedAwsS3DataConnector = new AwsS3DataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAwsS3DataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAwsS3DataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAwsS3DataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAwsS3DataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedAwsS3DataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedAwsS3DataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAwsS3DataConnector.innerProperties = AwsS3DataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3DataConnector; + }); + } +} 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..ee04743ca83f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypes.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Amazon Web Services S3 data connector. + */ +@Fluent +public final class AwsS3DataConnectorDataTypes implements JsonSerializable { + /* + * Logs data type. + */ + private AwsS3DataConnectorDataTypesLogs logs; + + /** + * Creates an instance of AwsS3DataConnectorDataTypes class. + */ + public AwsS3DataConnectorDataTypes() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logs", this.logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3DataConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3DataConnectorDataTypes if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AwsS3DataConnectorDataTypes. + */ + public static AwsS3DataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3DataConnectorDataTypes deserializedAwsS3DataConnectorDataTypes = new AwsS3DataConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + deserializedAwsS3DataConnectorDataTypes.logs = AwsS3DataConnectorDataTypesLogs.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3DataConnectorDataTypes; + }); + } +} 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..c634b5638402 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Logs data type. + */ +@Fluent +public final class AwsS3DataConnectorDataTypesLogs extends DataConnectorDataTypeCommon { + /** + * Creates an instance of AwsS3DataConnectorDataTypesLogs class. + */ + public AwsS3DataConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ + @Override + public AwsS3DataConnectorDataTypesLogs withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsS3DataConnectorDataTypesLogs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsS3DataConnectorDataTypesLogs if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AwsS3DataConnectorDataTypesLogs. + */ + public static AwsS3DataConnectorDataTypesLogs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsS3DataConnectorDataTypesLogs deserializedAwsS3DataConnectorDataTypesLogs + = new AwsS3DataConnectorDataTypesLogs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedAwsS3DataConnectorDataTypesLogs.withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsS3DataConnectorDataTypesLogs; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureDevOpsResourceInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureDevOpsResourceInfo.java new file mode 100644 index 000000000000..0909f7bdf90f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/AzureDevOpsResourceInfo.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resources created in Azure DevOps repository. + */ +@Immutable +public final class AzureDevOpsResourceInfo implements JsonSerializable { + /* + * Id of the pipeline created for the source-control. + */ + private String pipelineId; + + /* + * Id of the service-connection created for the source-control. + */ + private String serviceConnectionId; + + /** + * Creates an instance of AzureDevOpsResourceInfo class. + */ + private AzureDevOpsResourceInfo() { + } + + /** + * Get the pipelineId property: Id of the pipeline created for the source-control. + * + * @return the pipelineId value. + */ + public String pipelineId() { + return this.pipelineId; + } + + /** + * Get the serviceConnectionId property: Id of the service-connection created for the source-control. + * + * @return the serviceConnectionId value. + */ + public String serviceConnectionId() { + return this.serviceConnectionId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pipelineId", this.pipelineId); + jsonWriter.writeStringField("serviceConnectionId", this.serviceConnectionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureDevOpsResourceInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureDevOpsResourceInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureDevOpsResourceInfo. + */ + public static AzureDevOpsResourceInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureDevOpsResourceInfo deserializedAzureDevOpsResourceInfo = new AzureDevOpsResourceInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pipelineId".equals(fieldName)) { + deserializedAzureDevOpsResourceInfo.pipelineId = reader.getString(); + } else if ("serviceConnectionId".equals(fieldName)) { + deserializedAzureDevOpsResourceInfo.serviceConnectionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureDevOpsResourceInfo; + }); + } +} 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 index e1aff5c1a493..3d14d86bf02f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Immutable public final class AzureResourceEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.AZURE_RESOURCE; @@ -51,11 +53,13 @@ public final class AzureResourceEntity extends Entity { /** * Creates an instance of AzureResourceEntity class. */ - public AzureResourceEntity() { + private AzureResourceEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -151,18 +155,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BasicAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BasicAuthModel.java new file mode 100644 index 000000000000..d3755f12645b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BasicAuthModel.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for API authentication with basic flow - user name + password. + */ +@Fluent +public final class BasicAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.BASIC; + + /* + * The user name. + */ + private String userName; + + /* + * The password + */ + private String password; + + /** + * Creates an instance of BasicAuthModel class. + */ + public BasicAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the userName property: The user name. + * + * @return the userName value. + */ + public String userName() { + return this.userName; + } + + /** + * Set the userName property: The user name. + * + * @param userName the userName value to set. + * @return the BasicAuthModel object itself. + */ + public BasicAuthModel withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get the password property: The password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password. + * + * @param password the password value to set. + * @return the BasicAuthModel object itself. + */ + public BasicAuthModel withPassword(String password) { + this.password = password; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userName", this.userName); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BasicAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BasicAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BasicAuthModel. + */ + public static BasicAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BasicAuthModel deserializedBasicAuthModel = new BasicAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userName".equals(fieldName)) { + deserializedBasicAuthModel.userName = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedBasicAuthModel.password = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBasicAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBasicAuthModel; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistic.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistic.java new file mode 100644 index 000000000000..1ddbb99fc8f6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistic.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; + +/** + * An immutable client-side representation of BillingStatistic. + */ +public interface BillingStatistic { + /** + * 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 kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + BillingStatisticKind kind(); + + /** + * Gets the etag property: Resource Etag. + * + * @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.BillingStatisticInner object. + * + * @return the inner object. + */ + BillingStatisticInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticKind.java new file mode 100644 index 000000000000..40895179b08e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the billing statistic. + */ +public final class BillingStatisticKind extends ExpandableStringEnum { + /** + * SapSolutionUsage. + */ + public static final BillingStatisticKind SAP_SOLUTION_USAGE = fromString("SapSolutionUsage"); + + /** + * Creates a new instance of BillingStatisticKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BillingStatisticKind() { + } + + /** + * Creates or finds a BillingStatisticKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding BillingStatisticKind. + */ + public static BillingStatisticKind fromString(String name) { + return fromString(name, BillingStatisticKind.class); + } + + /** + * Gets known BillingStatisticKind values. + * + * @return known BillingStatisticKind values. + */ + public static Collection values() { + return values(BillingStatisticKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistics.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistics.java new file mode 100644 index 000000000000..03875bd0491f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistics.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 BillingStatistics. + */ +public interface BillingStatistics { + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @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 billing statistic along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String billingStatisticName, Context context); + + /** + * Gets a billing statistic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param billingStatisticName The name of the billing statistic. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 billing statistic. + */ + BillingStatistic get(String resourceGroupName, String workspaceName, String billingStatisticName); + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all Microsoft Sentinel billing statistics. + * + * @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 Microsoft Sentinel billing statistics as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} 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 index 2eb8151af00d..3108c1a68119 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -140,6 +140,27 @@ public interface Bookmark { */ IncidentInfo incidentInfo(); + /** + * Gets the entityMappings property: Describes the entity mappings of the bookmark. + * + * @return the entityMappings value. + */ + List entityMappings(); + + /** + * Gets the tactics property: A list of relevant mitre attacks. + * + * @return the tactics value. + */ + List tactics(); + + /** + * Gets the techniques property: A list of relevant mitre techniques. + * + * @return the techniques value. + */ + List techniques(); + /** * Gets the name of the resource group. * @@ -179,7 +200,7 @@ 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. + * @param workspaceName The name of the monitor workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); @@ -193,7 +214,8 @@ interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithCre DefinitionStages.WithCreatedBy, DefinitionStages.WithDisplayName, DefinitionStages.WithLabels, DefinitionStages.WithNotes, DefinitionStages.WithQuery, DefinitionStages.WithQueryResult, DefinitionStages.WithUpdated, DefinitionStages.WithUpdatedBy, DefinitionStages.WithEventTime, - DefinitionStages.WithQueryStartTime, DefinitionStages.WithQueryEndTime, DefinitionStages.WithIncidentInfo { + DefinitionStages.WithQueryStartTime, DefinitionStages.WithQueryEndTime, DefinitionStages.WithIncidentInfo, + DefinitionStages.WithEntityMappings, DefinitionStages.WithTactics, DefinitionStages.WithTechniques { /** * Executes the create request. * @@ -391,6 +413,45 @@ interface WithIncidentInfo { */ WithCreate withIncidentInfo(IncidentInfo incidentInfo); } + + /** + * The stage of the Bookmark definition allowing to specify entityMappings. + */ + interface WithEntityMappings { + /** + * Specifies the entityMappings property: Describes the entity mappings of the bookmark. + * + * @param entityMappings Describes the entity mappings of the bookmark. + * @return the next definition stage. + */ + WithCreate withEntityMappings(List entityMappings); + } + + /** + * The stage of the Bookmark definition allowing to specify tactics. + */ + interface WithTactics { + /** + * Specifies the tactics property: A list of relevant mitre attacks. + * + * @param tactics A list of relevant mitre attacks. + * @return the next definition stage. + */ + WithCreate withTactics(List tactics); + } + + /** + * The stage of the Bookmark definition allowing to specify techniques. + */ + interface WithTechniques { + /** + * Specifies the techniques property: A list of relevant mitre techniques. + * + * @param techniques A list of relevant mitre techniques. + * @return the next definition stage. + */ + WithCreate withTechniques(List techniques); + } } /** @@ -406,7 +467,8 @@ interface WithIncidentInfo { 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 { + UpdateStages.WithQueryStartTime, UpdateStages.WithQueryEndTime, UpdateStages.WithIncidentInfo, + UpdateStages.WithEntityMappings, UpdateStages.WithTactics, UpdateStages.WithTechniques { /** * Executes the update request. * @@ -608,6 +670,45 @@ interface WithIncidentInfo { */ Update withIncidentInfo(IncidentInfo incidentInfo); } + + /** + * The stage of the Bookmark update allowing to specify entityMappings. + */ + interface WithEntityMappings { + /** + * Specifies the entityMappings property: Describes the entity mappings of the bookmark. + * + * @param entityMappings Describes the entity mappings of the bookmark. + * @return the next definition stage. + */ + Update withEntityMappings(List entityMappings); + } + + /** + * The stage of the Bookmark update allowing to specify tactics. + */ + interface WithTactics { + /** + * Specifies the tactics property: A list of relevant mitre attacks. + * + * @param tactics A list of relevant mitre attacks. + * @return the next definition stage. + */ + Update withTactics(List tactics); + } + + /** + * The stage of the Bookmark update allowing to specify techniques. + */ + interface WithTechniques { + /** + * Specifies the techniques property: A list of relevant mitre techniques. + * + * @param techniques A list of relevant mitre techniques. + * @return the next definition stage. + */ + Update withTechniques(List techniques); + } } /** diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkEntityMappings.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkEntityMappings.java new file mode 100644 index 000000000000..e6fd9f6e46c6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkEntityMappings.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the entity mappings of a single entity. + */ +@Fluent +public final class BookmarkEntityMappings implements JsonSerializable { + /* + * The entity type + */ + private String entityType; + + /* + * Array of fields mapping for that entity type + */ + private List fieldMappings; + + /** + * Creates an instance of BookmarkEntityMappings class. + */ + public BookmarkEntityMappings() { + } + + /** + * Get the entityType property: The entity type. + * + * @return the entityType value. + */ + public String entityType() { + return this.entityType; + } + + /** + * Set the entityType property: The entity type. + * + * @param entityType the entityType value to set. + * @return the BookmarkEntityMappings object itself. + */ + public BookmarkEntityMappings withEntityType(String entityType) { + this.entityType = entityType; + return this; + } + + /** + * Get the fieldMappings property: Array of fields mapping for that entity type. + * + * @return the fieldMappings value. + */ + public List fieldMappings() { + return this.fieldMappings; + } + + /** + * Set the fieldMappings property: Array of fields mapping for that entity type. + * + * @param fieldMappings the fieldMappings value to set. + * @return the BookmarkEntityMappings object itself. + */ + public BookmarkEntityMappings withFieldMappings(List fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("entityType", this.entityType); + jsonWriter.writeArrayField("fieldMappings", this.fieldMappings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BookmarkEntityMappings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BookmarkEntityMappings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BookmarkEntityMappings. + */ + public static BookmarkEntityMappings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BookmarkEntityMappings deserializedBookmarkEntityMappings = new BookmarkEntityMappings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entityType".equals(fieldName)) { + deserializedBookmarkEntityMappings.entityType = reader.getString(); + } else if ("fieldMappings".equals(fieldName)) { + List fieldMappings + = reader.readArray(reader1 -> EntityFieldMapping.fromJson(reader1)); + deserializedBookmarkEntityMappings.fieldMappings = fieldMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedBookmarkEntityMappings; + }); + } +} 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..698d95e6c3ef --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The parameters required to execute an expand operation on the given bookmark. + */ +@Fluent +public final class BookmarkExpandParameters implements JsonSerializable { + /* + * The end date filter, so the only expansion results returned are before this date. + */ + private OffsetDateTime endTime; + + /* + * The Id of the expansion to perform. + */ + private String expansionId; + + /* + * The start date filter, so the only expansion results returned are after this date. + */ + private OffsetDateTime startTime; + + /** + * Creates an instance of BookmarkExpandParameters class. + */ + public BookmarkExpandParameters() { + } + + /** + * 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 String 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(String 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeStringField("expansionId", this.expansionId); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BookmarkExpandParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BookmarkExpandParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BookmarkExpandParameters. + */ + public static BookmarkExpandParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BookmarkExpandParameters deserializedBookmarkExpandParameters = new BookmarkExpandParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endTime".equals(fieldName)) { + deserializedBookmarkExpandParameters.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expansionId".equals(fieldName)) { + deserializedBookmarkExpandParameters.expansionId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedBookmarkExpandParameters.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBookmarkExpandParameters; + }); + } +} 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..d42ffe71ebe9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..ece19a462dea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponseValue.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The expansion result values. + */ +@Immutable +public final class BookmarkExpandResponseValue implements JsonSerializable { + /* + * Array of the expansion result entities. + */ + private List entities; + + /* + * Array of expansion result connected entities + */ + private List edges; + + /** + * Creates an instance of BookmarkExpandResponseValue class. + */ + private BookmarkExpandResponseValue() { + } + + /** + * Get the entities property: Array of the expansion result entities. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * Get the edges property: Array of expansion result connected entities. + * + * @return the edges value. + */ + public List edges() { + return this.edges; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("edges", this.edges, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BookmarkExpandResponseValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BookmarkExpandResponseValue if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BookmarkExpandResponseValue. + */ + public static BookmarkExpandResponseValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BookmarkExpandResponseValue deserializedBookmarkExpandResponseValue = new BookmarkExpandResponseValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entities".equals(fieldName)) { + List entities = reader.readArray(reader1 -> Entity.fromJson(reader1)); + deserializedBookmarkExpandResponseValue.entities = entities; + } else if ("edges".equals(fieldName)) { + List edges = reader.readArray(reader1 -> ConnectedEntity.fromJson(reader1)); + deserializedBookmarkExpandResponseValue.edges = edges; + } else { + reader.skipChildren(); + } + } + + return deserializedBookmarkExpandResponseValue; + }); + } +} 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..9d43f1b41fc3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response along with {@link Response}. + */ + Response expandWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, BookmarkExpandParameters parameters, Context context); + + /** + * Expand an bookmark. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param bookmarkId Bookmark ID. + * @param parameters The content of the action 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 the entity expansion result operation response. + */ + BookmarkExpandResponse expand(String resourceGroupName, String workspaceName, String bookmarkId, + BookmarkExpandParameters parameters); +} 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..e69c775a2796 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkRelations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, 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); + + /** + * 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 {@link Response}. + */ + Response deleteWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId, String filter, + String orderby, Integer top, String skipToken, 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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..cfed7e0b7176 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkTimelineItem.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents bookmark timeline item. + */ +@Immutable +public final class BookmarkTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + private EntityTimelineKind kind = EntityTimelineKind.BOOKMARK; + + /* + * The bookmark azure resource id. + */ + private String azureResourceId; + + /* + * The bookmark display name. + */ + private String displayName; + + /* + * The notes of the bookmark + */ + private String notes; + + /* + * The bookmark end time. + */ + private OffsetDateTime endTimeUtc; + + /* + * The bookmark start time. + */ + private OffsetDateTime startTimeUtc; + + /* + * The bookmark event time. + */ + private OffsetDateTime eventTime; + + /* + * Describes a user that created the bookmark + */ + private UserInfo createdBy; + + /* + * List of labels relevant to this bookmark + */ + private List labels; + + /** + * Creates an instance of BookmarkTimelineItem class. + */ + private BookmarkTimelineItem() { + } + + /** + * Get the kind property: The entity query kind type. + * + * @return the kind value. + */ + @Override + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * Get the azureResourceId property: The bookmark azure resource id. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Get the displayName property: The bookmark display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the notes property: The notes of the bookmark. + * + * @return the notes value. + */ + public String notes() { + return this.notes; + } + + /** + * Get the endTimeUtc property: The bookmark end time. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the startTimeUtc property: The bookmark start time. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the eventTime property: The bookmark event time. + * + * @return the eventTime value. + */ + public OffsetDateTime eventTime() { + return this.eventTime; + } + + /** + * Get the createdBy property: Describes a user that created the bookmark. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.createdBy; + } + + /** + * Get the labels property: List of labels relevant to this bookmark. + * + * @return the labels value. + */ + public List labels() { + return this.labels; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("notes", this.notes); + jsonWriter.writeStringField("endTimeUtc", + this.endTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTimeUtc)); + jsonWriter.writeStringField("startTimeUtc", + this.startTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimeUtc)); + jsonWriter.writeStringField("eventTime", + this.eventTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.eventTime)); + jsonWriter.writeJsonField("createdBy", this.createdBy); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BookmarkTimelineItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BookmarkTimelineItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BookmarkTimelineItem. + */ + public static BookmarkTimelineItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BookmarkTimelineItem deserializedBookmarkTimelineItem = new BookmarkTimelineItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureResourceId".equals(fieldName)) { + deserializedBookmarkTimelineItem.azureResourceId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedBookmarkTimelineItem.kind = EntityTimelineKind.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedBookmarkTimelineItem.displayName = reader.getString(); + } else if ("notes".equals(fieldName)) { + deserializedBookmarkTimelineItem.notes = reader.getString(); + } else if ("endTimeUtc".equals(fieldName)) { + deserializedBookmarkTimelineItem.endTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startTimeUtc".equals(fieldName)) { + deserializedBookmarkTimelineItem.startTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("eventTime".equals(fieldName)) { + deserializedBookmarkTimelineItem.eventTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedBookmarkTimelineItem.createdBy = UserInfo.fromJson(reader); + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> reader1.getString()); + deserializedBookmarkTimelineItem.labels = labels; + } else { + reader.skipChildren(); + } + } + + return deserializedBookmarkTimelineItem; + }); + } +} 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 index 4aaa14eec43d..01fe70828509 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,84 +13,84 @@ */ public interface Bookmarks { /** - * Gets all bookmarks. + * Gets a bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 all bookmarks as paginated response with {@link PagedIterable}. + * @return a bookmark along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName); + Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Context context); /** - * Gets all bookmarks. + * Gets a bookmark. * * @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. + * @param workspaceName The name of the monitor 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 bookmarks as paginated response with {@link PagedIterable}. + * @return a bookmark. */ - PagedIterable list(String resourceGroupName, String workspaceName, Context context); + Bookmark get(String resourceGroupName, String workspaceName, String bookmarkId); /** - * Gets a bookmark. + * Delete the bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, Context context); /** - * Gets a bookmark. + * Delete the bookmark. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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); + void delete(String resourceGroupName, String workspaceName, String bookmarkId); /** - * Delete the bookmark. + * Gets all bookmarks. * * @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. + * @param workspaceName The name of the monitor 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 the {@link Response}. + * @return all bookmarks as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName); /** - * Delete the bookmark. + * Gets all bookmarks. * * @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 workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String workspaceName, String bookmarkId); + PagedIterable list(String resourceGroupName, String workspaceName, Context context); /** * Gets a bookmark. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BooleanConditionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BooleanConditionProperties.java new file mode 100644 index 000000000000..a2b794c5b6e5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/BooleanConditionProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes an automation rule condition that applies a boolean operator (e.g AND, OR) to conditions. + */ +@Fluent +public final class BooleanConditionProperties extends AutomationRuleCondition { + /* + * The conditionType property. + */ + private ConditionType conditionType = ConditionType.BOOLEAN; + + /* + * The conditionProperties property. + */ + private AutomationRuleBooleanCondition conditionProperties; + + /** + * Creates an instance of BooleanConditionProperties class. + */ + public BooleanConditionProperties() { + } + + /** + * Get the conditionType property: The conditionType property. + * + * @return the conditionType value. + */ + @Override + public ConditionType conditionType() { + return this.conditionType; + } + + /** + * Get the conditionProperties property: The conditionProperties property. + * + * @return the conditionProperties value. + */ + public AutomationRuleBooleanCondition conditionProperties() { + return this.conditionProperties; + } + + /** + * Set the conditionProperties property: The conditionProperties property. + * + * @param conditionProperties the conditionProperties value to set. + * @return the BooleanConditionProperties object itself. + */ + public BooleanConditionProperties withConditionProperties(AutomationRuleBooleanCondition conditionProperties) { + this.conditionProperties = conditionProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("conditionType", this.conditionType == null ? null : this.conditionType.toString()); + jsonWriter.writeJsonField("conditionProperties", this.conditionProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BooleanConditionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BooleanConditionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BooleanConditionProperties. + */ + public static BooleanConditionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BooleanConditionProperties deserializedBooleanConditionProperties = new BooleanConditionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("conditionType".equals(fieldName)) { + deserializedBooleanConditionProperties.conditionType = ConditionType.fromString(reader.getString()); + } else if ("conditionProperties".equals(fieldName)) { + deserializedBooleanConditionProperties.conditionProperties + = AutomationRuleBooleanCondition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBooleanConditionProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthConfig.java new file mode 100644 index 000000000000..e9e1179523c0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthConfig.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base Model for API authentication. + */ +@Immutable +public class CcpAuthConfig implements JsonSerializable { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.fromString("CcpAuthConfig"); + + /** + * Creates an instance of CcpAuthConfig class. + */ + public CcpAuthConfig() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + public CcpAuthType type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CcpAuthConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CcpAuthConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CcpAuthConfig. + */ + public static CcpAuthConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("APIKey".equals(discriminatorValue)) { + return ApiKeyAuthModel.fromJson(readerToUse.reset()); + } else if ("AWS".equals(discriminatorValue)) { + return AWSAuthModel.fromJson(readerToUse.reset()); + } else if ("Basic".equals(discriminatorValue)) { + return BasicAuthModel.fromJson(readerToUse.reset()); + } else if ("GCP".equals(discriminatorValue)) { + return GCPAuthModel.fromJson(readerToUse.reset()); + } else if ("ServiceBus".equals(discriminatorValue)) { + return GenericBlobSbsAuthModel.fromJson(readerToUse.reset()); + } else if ("GitHub".equals(discriminatorValue)) { + return GitHubAuthModel.fromJson(readerToUse.reset()); + } else if ("None".equals(discriminatorValue)) { + return NoneAuthModel.fromJson(readerToUse.reset()); + } else if ("JwtToken".equals(discriminatorValue)) { + return JwtAuthModel.fromJson(readerToUse.reset()); + } else if ("OAuth2".equals(discriminatorValue)) { + return OAuthModel.fromJson(readerToUse.reset()); + } else if ("Oracle".equals(discriminatorValue)) { + return OracleAuthModel.fromJson(readerToUse.reset()); + } else if ("Session".equals(discriminatorValue)) { + return SessionAuthModel.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static CcpAuthConfig fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CcpAuthConfig deserializedCcpAuthConfig = new CcpAuthConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCcpAuthConfig.type = CcpAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCcpAuthConfig; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java new file mode 100644 index 000000000000..4254e89900a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of paging. + */ +public final class CcpAuthType extends ExpandableStringEnum { + /** + * Basic. + */ + public static final CcpAuthType BASIC = fromString("Basic"); + + /** + * APIKey. + */ + public static final CcpAuthType APIKEY = fromString("APIKey"); + + /** + * OAuth2. + */ + public static final CcpAuthType OAUTH2 = fromString("OAuth2"); + + /** + * AWS. + */ + public static final CcpAuthType AWS = fromString("AWS"); + + /** + * GCP. + */ + public static final CcpAuthType GCP = fromString("GCP"); + + /** + * Session. + */ + public static final CcpAuthType SESSION = fromString("Session"); + + /** + * JwtToken. + */ + public static final CcpAuthType JWT_TOKEN = fromString("JwtToken"); + + /** + * GitHub. + */ + public static final CcpAuthType GIT_HUB = fromString("GitHub"); + + /** + * ServiceBus. + */ + public static final CcpAuthType SERVICE_BUS = fromString("ServiceBus"); + + /** + * Oracle. + */ + public static final CcpAuthType ORACLE = fromString("Oracle"); + + /** + * None. + */ + public static final CcpAuthType NONE = fromString("None"); + + /** + * Creates a new instance of CcpAuthType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CcpAuthType() { + } + + /** + * Creates or finds a CcpAuthType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CcpAuthType. + */ + public static CcpAuthType fromString(String name) { + return fromString(name, CcpAuthType.class); + } + + /** + * Gets known CcpAuthType values. + * + * @return known CcpAuthType values. + */ + public static Collection values() { + return values(CcpAuthType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpResponseConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpResponseConfig.java new file mode 100644 index 000000000000..8c0f66ea9d47 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CcpResponseConfig.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A custom response configuration for a rule. + */ +@Fluent +public final class CcpResponseConfig implements JsonSerializable { + /* + * The json paths, '$' char is the json root. + */ + private List eventsJsonPaths; + + /* + * The value where the status message/code should appear in the response. + */ + private String successStatusJsonPath; + + /* + * The status value. + */ + private String successStatusValue; + + /* + * The value indicating whether the remote server support Gzip and we should expect Gzip response. + */ + private Boolean isGzipCompressed; + + /* + * The compression algorithm. For Example: 'gzip', 'multi-gzip', 'deflate'. + */ + private String compressionAlgo; + + /* + * The response format. possible values are json,csv,xml + */ + private String format; + + /* + * The csv delimiter, in case the response format is CSV. + */ + private String csvDelimiter; + + /* + * The value indicating whether the response has CSV boundary in case the response in CSV format. + */ + private Boolean hasCsvBoundary; + + /* + * The value indicating whether the response has headers in case the response in CSV format. + */ + private Boolean hasCsvHeader; + + /* + * The value indicating whether the response isn't an array of events / logs. By setting this flag to true it means + * the remote server will response with an object which each property has as a value an array of events / logs. + */ + private Boolean convertChildPropertiesToArray; + + /* + * The character used to escape characters in CSV. + */ + private String csvEscape; + + /** + * Creates an instance of CcpResponseConfig class. + */ + public CcpResponseConfig() { + } + + /** + * Get the eventsJsonPaths property: The json paths, '$' char is the json root. + * + * @return the eventsJsonPaths value. + */ + public List eventsJsonPaths() { + return this.eventsJsonPaths; + } + + /** + * Set the eventsJsonPaths property: The json paths, '$' char is the json root. + * + * @param eventsJsonPaths the eventsJsonPaths value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withEventsJsonPaths(List eventsJsonPaths) { + this.eventsJsonPaths = eventsJsonPaths; + return this; + } + + /** + * Get the successStatusJsonPath property: The value where the status message/code should appear in the response. + * + * @return the successStatusJsonPath value. + */ + public String successStatusJsonPath() { + return this.successStatusJsonPath; + } + + /** + * Set the successStatusJsonPath property: The value where the status message/code should appear in the response. + * + * @param successStatusJsonPath the successStatusJsonPath value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withSuccessStatusJsonPath(String successStatusJsonPath) { + this.successStatusJsonPath = successStatusJsonPath; + return this; + } + + /** + * Get the successStatusValue property: The status value. + * + * @return the successStatusValue value. + */ + public String successStatusValue() { + return this.successStatusValue; + } + + /** + * Set the successStatusValue property: The status value. + * + * @param successStatusValue the successStatusValue value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withSuccessStatusValue(String successStatusValue) { + this.successStatusValue = successStatusValue; + return this; + } + + /** + * Get the isGzipCompressed property: The value indicating whether the remote server support Gzip and we should + * expect Gzip response. + * + * @return the isGzipCompressed value. + */ + public Boolean isGzipCompressed() { + return this.isGzipCompressed; + } + + /** + * Set the isGzipCompressed property: The value indicating whether the remote server support Gzip and we should + * expect Gzip response. + * + * @param isGzipCompressed the isGzipCompressed value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withIsGzipCompressed(Boolean isGzipCompressed) { + this.isGzipCompressed = isGzipCompressed; + return this; + } + + /** + * Get the compressionAlgo property: The compression algorithm. For Example: 'gzip', 'multi-gzip', 'deflate'. + * + * @return the compressionAlgo value. + */ + public String compressionAlgo() { + return this.compressionAlgo; + } + + /** + * Set the compressionAlgo property: The compression algorithm. For Example: 'gzip', 'multi-gzip', 'deflate'. + * + * @param compressionAlgo the compressionAlgo value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withCompressionAlgo(String compressionAlgo) { + this.compressionAlgo = compressionAlgo; + return this; + } + + /** + * Get the format property: The response format. possible values are json,csv,xml. + * + * @return the format value. + */ + public String format() { + return this.format; + } + + /** + * Set the format property: The response format. possible values are json,csv,xml. + * + * @param format the format value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withFormat(String format) { + this.format = format; + return this; + } + + /** + * Get the csvDelimiter property: The csv delimiter, in case the response format is CSV. + * + * @return the csvDelimiter value. + */ + public String csvDelimiter() { + return this.csvDelimiter; + } + + /** + * Set the csvDelimiter property: The csv delimiter, in case the response format is CSV. + * + * @param csvDelimiter the csvDelimiter value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withCsvDelimiter(String csvDelimiter) { + this.csvDelimiter = csvDelimiter; + return this; + } + + /** + * Get the hasCsvBoundary property: The value indicating whether the response has CSV boundary in case the response + * in CSV format. + * + * @return the hasCsvBoundary value. + */ + public Boolean hasCsvBoundary() { + return this.hasCsvBoundary; + } + + /** + * Set the hasCsvBoundary property: The value indicating whether the response has CSV boundary in case the response + * in CSV format. + * + * @param hasCsvBoundary the hasCsvBoundary value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withHasCsvBoundary(Boolean hasCsvBoundary) { + this.hasCsvBoundary = hasCsvBoundary; + return this; + } + + /** + * Get the hasCsvHeader property: The value indicating whether the response has headers in case the response in CSV + * format. + * + * @return the hasCsvHeader value. + */ + public Boolean hasCsvHeader() { + return this.hasCsvHeader; + } + + /** + * Set the hasCsvHeader property: The value indicating whether the response has headers in case the response in CSV + * format. + * + * @param hasCsvHeader the hasCsvHeader value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withHasCsvHeader(Boolean hasCsvHeader) { + this.hasCsvHeader = hasCsvHeader; + return this; + } + + /** + * Get the convertChildPropertiesToArray property: The value indicating whether the response isn't an array of + * events / logs. By setting this flag to true it means the remote server will response with an object which each + * property has as a value an array of events / logs. + * + * @return the convertChildPropertiesToArray value. + */ + public Boolean convertChildPropertiesToArray() { + return this.convertChildPropertiesToArray; + } + + /** + * Set the convertChildPropertiesToArray property: The value indicating whether the response isn't an array of + * events / logs. By setting this flag to true it means the remote server will response with an object which each + * property has as a value an array of events / logs. + * + * @param convertChildPropertiesToArray the convertChildPropertiesToArray value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withConvertChildPropertiesToArray(Boolean convertChildPropertiesToArray) { + this.convertChildPropertiesToArray = convertChildPropertiesToArray; + return this; + } + + /** + * Get the csvEscape property: The character used to escape characters in CSV. + * + * @return the csvEscape value. + */ + public String csvEscape() { + return this.csvEscape; + } + + /** + * Set the csvEscape property: The character used to escape characters in CSV. + * + * @param csvEscape the csvEscape value to set. + * @return the CcpResponseConfig object itself. + */ + public CcpResponseConfig withCsvEscape(String csvEscape) { + this.csvEscape = csvEscape; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("eventsJsonPaths", this.eventsJsonPaths, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("successStatusJsonPath", this.successStatusJsonPath); + jsonWriter.writeStringField("successStatusValue", this.successStatusValue); + jsonWriter.writeBooleanField("isGzipCompressed", this.isGzipCompressed); + jsonWriter.writeStringField("compressionAlgo", this.compressionAlgo); + jsonWriter.writeStringField("format", this.format); + jsonWriter.writeStringField("csvDelimiter", this.csvDelimiter); + jsonWriter.writeBooleanField("hasCsvBoundary", this.hasCsvBoundary); + jsonWriter.writeBooleanField("hasCsvHeader", this.hasCsvHeader); + jsonWriter.writeBooleanField("convertChildPropertiesToArray", this.convertChildPropertiesToArray); + jsonWriter.writeStringField("csvEscape", this.csvEscape); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CcpResponseConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CcpResponseConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CcpResponseConfig. + */ + public static CcpResponseConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CcpResponseConfig deserializedCcpResponseConfig = new CcpResponseConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventsJsonPaths".equals(fieldName)) { + List eventsJsonPaths = reader.readArray(reader1 -> reader1.getString()); + deserializedCcpResponseConfig.eventsJsonPaths = eventsJsonPaths; + } else if ("successStatusJsonPath".equals(fieldName)) { + deserializedCcpResponseConfig.successStatusJsonPath = reader.getString(); + } else if ("successStatusValue".equals(fieldName)) { + deserializedCcpResponseConfig.successStatusValue = reader.getString(); + } else if ("isGzipCompressed".equals(fieldName)) { + deserializedCcpResponseConfig.isGzipCompressed = reader.getNullable(JsonReader::getBoolean); + } else if ("compressionAlgo".equals(fieldName)) { + deserializedCcpResponseConfig.compressionAlgo = reader.getString(); + } else if ("format".equals(fieldName)) { + deserializedCcpResponseConfig.format = reader.getString(); + } else if ("csvDelimiter".equals(fieldName)) { + deserializedCcpResponseConfig.csvDelimiter = reader.getString(); + } else if ("hasCsvBoundary".equals(fieldName)) { + deserializedCcpResponseConfig.hasCsvBoundary = reader.getNullable(JsonReader::getBoolean); + } else if ("hasCsvHeader".equals(fieldName)) { + deserializedCcpResponseConfig.hasCsvHeader = reader.getNullable(JsonReader::getBoolean); + } else if ("convertChildPropertiesToArray".equals(fieldName)) { + deserializedCcpResponseConfig.convertChildPropertiesToArray + = reader.getNullable(JsonReader::getBoolean); + } else if ("csvEscape".equals(fieldName)) { + deserializedCcpResponseConfig.csvEscape = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCcpResponseConfig; + }); + } +} 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 index 454594dfde37..70b7c80f78d4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -10,8 +10,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Objects; -import java.util.UUID; /** * Information on the client (user or application) that made some action. @@ -31,7 +29,7 @@ public final class ClientInfo implements JsonSerializable { /* * The object id of the client. */ - private UUID objectId; + private String objectId; /* * The user principal name of the client. @@ -89,7 +87,7 @@ public ClientInfo withName(String name) { * * @return the objectId value. */ - public UUID objectId() { + public String objectId() { return this.objectId; } @@ -99,7 +97,7 @@ public UUID objectId() { * @param objectId the objectId value to set. * @return the ClientInfo object itself. */ - public ClientInfo withObjectId(UUID objectId) { + public ClientInfo withObjectId(String objectId) { this.objectId = objectId; return this; } @@ -124,14 +122,6 @@ public ClientInfo withUserPrincipalName(String userPrincipalName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -140,7 +130,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("email", this.email); jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("objectId", Objects.toString(this.objectId, null)); + jsonWriter.writeStringField("objectId", this.objectId); jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); return jsonWriter.writeEndObject(); } @@ -165,8 +155,7 @@ public static ClientInfo fromJson(JsonReader jsonReader) throws IOException { } else if ("name".equals(fieldName)) { deserializedClientInfo.name = reader.getString(); } else if ("objectId".equals(fieldName)) { - deserializedClientInfo.objectId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedClientInfo.objectId = reader.getString(); } else if ("userPrincipalName".equals(fieldName)) { deserializedClientInfo.userPrincipalName = reader.getString(); } else { 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 index f39f6f099e50..2ac04147f20f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Immutable public final class CloudApplicationEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.CLOUD_APPLICATION; @@ -51,11 +53,13 @@ public final class CloudApplicationEntity extends Entity { /** * Creates an instance of CloudApplicationEntity class. */ - public CloudApplicationEntity() { + private CloudApplicationEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -161,18 +165,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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..c95c591460dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessApiPollingDataConnector.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.ApiPollingParameters; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import java.io.IOException; + +/** + * Represents Codeless API Polling data connector. + */ +@Fluent +public final class CodelessApiPollingDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.APIPOLLING; + + /* + * Codeless poling data connector properties + */ + private ApiPollingParameters innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CodelessApiPollingDataConnector class. + */ + public CodelessApiPollingDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Codeless poling data connector properties. + * + * @return the innerProperties value. + */ + private ApiPollingParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessApiPollingDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessApiPollingDataConnector if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessApiPollingDataConnector. + */ + public static CodelessApiPollingDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessApiPollingDataConnector deserializedCodelessApiPollingDataConnector + = new CodelessApiPollingDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCodelessApiPollingDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCodelessApiPollingDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCodelessApiPollingDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedCodelessApiPollingDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedCodelessApiPollingDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedCodelessApiPollingDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedCodelessApiPollingDataConnector.innerProperties = ApiPollingParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessApiPollingDataConnector; + }); + } +} 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..c49dcbd6f19d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingAuthProperties.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describe the authentication properties needed to successfully authenticate with the server. + */ +@Fluent +public final class CodelessConnectorPollingAuthProperties + implements JsonSerializable { + /* + * The authentication type + */ + private String authType; + + /* + * The header name which the token is sent with + */ + private String apiKeyName; + + /* + * A prefix send in the header before the actual token + */ + private String apiKeyIdentifier; + + /* + * Marks if the key should sent in header + */ + private String isApiKeyInPostPayload; + + /* + * Describes the flow name, for example 'AuthCode' for Oauth 2.0 + */ + private String flowName; + + /* + * The endpoint used to issue a token, used in Oauth 2.0 flow + */ + private String tokenEndpoint; + + /* + * The endpoint used to authorize the user, used in Oauth 2.0 flow + */ + private String authorizationEndpoint; + + /* + * The query parameters used in authorization request, used in Oauth 2.0 flow + */ + private Object authorizationEndpointQueryParameters; + + /* + * The redirect endpoint where we will get the authorization code, used in Oauth 2.0 flow + */ + private String redirectionEndpoint; + + /* + * The query headers used in token request, used in Oauth 2.0 flow + */ + private Object tokenEndpointHeaders; + + /* + * The query parameters used in token request, used in Oauth 2.0 flow + */ + private Object tokenEndpointQueryParameters; + + /* + * Marks if we should send the client secret in header or payload, used in Oauth 2.0 flow + */ + private Boolean isClientSecretInHeader; + + /* + * The OAuth token scope + */ + private String scope; + + /** + * Creates an instance of CodelessConnectorPollingAuthProperties class. + */ + public CodelessConnectorPollingAuthProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authType", this.authType); + jsonWriter.writeStringField("apiKeyName", this.apiKeyName); + jsonWriter.writeStringField("apiKeyIdentifier", this.apiKeyIdentifier); + jsonWriter.writeStringField("isApiKeyInPostPayload", this.isApiKeyInPostPayload); + jsonWriter.writeStringField("flowName", this.flowName); + jsonWriter.writeStringField("tokenEndpoint", this.tokenEndpoint); + jsonWriter.writeStringField("authorizationEndpoint", this.authorizationEndpoint); + if (this.authorizationEndpointQueryParameters != null) { + jsonWriter.writeUntypedField("authorizationEndpointQueryParameters", + this.authorizationEndpointQueryParameters); + } + jsonWriter.writeStringField("redirectionEndpoint", this.redirectionEndpoint); + if (this.tokenEndpointHeaders != null) { + jsonWriter.writeUntypedField("tokenEndpointHeaders", this.tokenEndpointHeaders); + } + if (this.tokenEndpointQueryParameters != null) { + jsonWriter.writeUntypedField("tokenEndpointQueryParameters", this.tokenEndpointQueryParameters); + } + jsonWriter.writeBooleanField("isClientSecretInHeader", this.isClientSecretInHeader); + jsonWriter.writeStringField("scope", this.scope); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessConnectorPollingAuthProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessConnectorPollingAuthProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessConnectorPollingAuthProperties. + */ + public static CodelessConnectorPollingAuthProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessConnectorPollingAuthProperties deserializedCodelessConnectorPollingAuthProperties + = new CodelessConnectorPollingAuthProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authType".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.authType = reader.getString(); + } else if ("apiKeyName".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.apiKeyName = reader.getString(); + } else if ("apiKeyIdentifier".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.apiKeyIdentifier = reader.getString(); + } else if ("isApiKeyInPostPayload".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.isApiKeyInPostPayload = reader.getString(); + } else if ("flowName".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.flowName = reader.getString(); + } else if ("tokenEndpoint".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.tokenEndpoint = reader.getString(); + } else if ("authorizationEndpoint".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.authorizationEndpoint = reader.getString(); + } else if ("authorizationEndpointQueryParameters".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.authorizationEndpointQueryParameters + = reader.readUntyped(); + } else if ("redirectionEndpoint".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.redirectionEndpoint = reader.getString(); + } else if ("tokenEndpointHeaders".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.tokenEndpointHeaders = reader.readUntyped(); + } else if ("tokenEndpointQueryParameters".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.tokenEndpointQueryParameters + = reader.readUntyped(); + } else if ("isClientSecretInHeader".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.isClientSecretInHeader + = reader.getNullable(JsonReader::getBoolean); + } else if ("scope".equals(fieldName)) { + deserializedCodelessConnectorPollingAuthProperties.scope = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessConnectorPollingAuthProperties; + }); + } +} 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..c4015988bc63 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Config to describe the polling config for API poller connector. + */ +@Fluent +public final class CodelessConnectorPollingConfigProperties + implements JsonSerializable { + /* + * The poller active status + */ + private Boolean isActive; + + /* + * Describe the authentication type of the poller + */ + private CodelessConnectorPollingAuthProperties auth; + + /* + * Describe the poll request config parameters of the poller + */ + private CodelessConnectorPollingRequestProperties request; + + /* + * Describe the poll request paging config of the poller + */ + private CodelessConnectorPollingPagingProperties paging; + + /* + * Describe the response config parameters of the poller + */ + private CodelessConnectorPollingResponseProperties response; + + /** + * Creates an instance of CodelessConnectorPollingConfigProperties class. + */ + public CodelessConnectorPollingConfigProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("auth", this.auth); + jsonWriter.writeJsonField("request", this.request); + jsonWriter.writeBooleanField("isActive", this.isActive); + jsonWriter.writeJsonField("paging", this.paging); + jsonWriter.writeJsonField("response", this.response); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessConnectorPollingConfigProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessConnectorPollingConfigProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessConnectorPollingConfigProperties. + */ + public static CodelessConnectorPollingConfigProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessConnectorPollingConfigProperties deserializedCodelessConnectorPollingConfigProperties + = new CodelessConnectorPollingConfigProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("auth".equals(fieldName)) { + deserializedCodelessConnectorPollingConfigProperties.auth + = CodelessConnectorPollingAuthProperties.fromJson(reader); + } else if ("request".equals(fieldName)) { + deserializedCodelessConnectorPollingConfigProperties.request + = CodelessConnectorPollingRequestProperties.fromJson(reader); + } else if ("isActive".equals(fieldName)) { + deserializedCodelessConnectorPollingConfigProperties.isActive + = reader.getNullable(JsonReader::getBoolean); + } else if ("paging".equals(fieldName)) { + deserializedCodelessConnectorPollingConfigProperties.paging + = CodelessConnectorPollingPagingProperties.fromJson(reader); + } else if ("response".equals(fieldName)) { + deserializedCodelessConnectorPollingConfigProperties.response + = CodelessConnectorPollingResponseProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessConnectorPollingConfigProperties; + }); + } +} 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..edddb2353c9f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describe the properties needed to make a pagination call. + */ +@Fluent +public final class CodelessConnectorPollingPagingProperties + implements JsonSerializable { + /* + * Describes the type. could be 'None', 'PageToken', 'PageCount', 'TimeStamp' + */ + private String pagingType; + + /* + * Defines the name of a next page attribute + */ + private String nextPageParaName; + + /* + * Defines the path to a next page token JSON + */ + private String nextPageTokenJsonPath; + + /* + * Defines the path to a page count attribute + */ + private String pageCountAttributePath; + + /* + * Defines the path to a page total count attribute + */ + private String pageTotalCountAttributePath; + + /* + * Defines the path to a paging time stamp attribute + */ + private String pageTimeStampAttributePath; + + /* + * Determines whether to search for the latest time stamp in the events list + */ + private String searchTheLatestTimeStampFromEventsList; + + /* + * Defines the name of the page size parameter + */ + private String pageSizeParaName; + + /* + * Defines the paging size + */ + private Integer pageSize; + + /** + * Creates an instance of CodelessConnectorPollingPagingProperties class. + */ + public CodelessConnectorPollingPagingProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pagingType", this.pagingType); + jsonWriter.writeStringField("nextPageParaName", this.nextPageParaName); + jsonWriter.writeStringField("nextPageTokenJsonPath", this.nextPageTokenJsonPath); + jsonWriter.writeStringField("pageCountAttributePath", this.pageCountAttributePath); + jsonWriter.writeStringField("pageTotalCountAttributePath", this.pageTotalCountAttributePath); + jsonWriter.writeStringField("pageTimeStampAttributePath", this.pageTimeStampAttributePath); + jsonWriter.writeStringField("searchTheLatestTimeStampFromEventsList", + this.searchTheLatestTimeStampFromEventsList); + jsonWriter.writeStringField("pageSizeParaName", this.pageSizeParaName); + jsonWriter.writeNumberField("pageSize", this.pageSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessConnectorPollingPagingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessConnectorPollingPagingProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessConnectorPollingPagingProperties. + */ + public static CodelessConnectorPollingPagingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessConnectorPollingPagingProperties deserializedCodelessConnectorPollingPagingProperties + = new CodelessConnectorPollingPagingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pagingType".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.pagingType = reader.getString(); + } else if ("nextPageParaName".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.nextPageParaName = reader.getString(); + } else if ("nextPageTokenJsonPath".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.nextPageTokenJsonPath = reader.getString(); + } else if ("pageCountAttributePath".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.pageCountAttributePath = reader.getString(); + } else if ("pageTotalCountAttributePath".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.pageTotalCountAttributePath + = reader.getString(); + } else if ("pageTimeStampAttributePath".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.pageTimeStampAttributePath + = reader.getString(); + } else if ("searchTheLatestTimeStampFromEventsList".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.searchTheLatestTimeStampFromEventsList + = reader.getString(); + } else if ("pageSizeParaName".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.pageSizeParaName = reader.getString(); + } else if ("pageSize".equals(fieldName)) { + deserializedCodelessConnectorPollingPagingProperties.pageSize + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessConnectorPollingPagingProperties; + }); + } +} 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..893ac01be804 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describe the request properties needed to successfully pull from the server. + */ +@Fluent +public final class CodelessConnectorPollingRequestProperties + implements JsonSerializable { + /* + * Describe the endpoint we should pull the data from + */ + private String apiEndpoint; + + /* + * Defines the rate limit QPS + */ + private Integer rateLimitQps; + + /* + * The window interval we will use the pull the data + */ + private int queryWindowInMin; + + /* + * The http method type we will use in the poll request, GET or POST + */ + private String httpMethod; + + /* + * The time format will be used the query events in a specific window + */ + private String queryTimeFormat; + + /* + * Describe the amount of time we should try and poll the data in case of failure + */ + private Integer retryCount; + + /* + * The number of seconds we will consider as a request timeout + */ + private Integer timeoutInSeconds; + + /* + * Describe the headers sent in the poll request + */ + private Object headers; + + /* + * Describe the query parameters sent in the poll request + */ + private Object queryParameters; + + /* + * For advanced scenarios for example user name/password embedded in nested JSON payload + */ + private String queryParametersTemplate; + + /* + * This will be used the query events from a start of the time window + */ + private String startTimeAttributeName; + + /* + * This will be used the query events from the end of the time window + */ + private String endTimeAttributeName; + + /** + * Creates an instance of CodelessConnectorPollingRequestProperties class. + */ + public CodelessConnectorPollingRequestProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("apiEndpoint", this.apiEndpoint); + jsonWriter.writeIntField("queryWindowInMin", this.queryWindowInMin); + jsonWriter.writeStringField("httpMethod", this.httpMethod); + jsonWriter.writeStringField("queryTimeFormat", this.queryTimeFormat); + jsonWriter.writeNumberField("rateLimitQps", this.rateLimitQps); + jsonWriter.writeNumberField("retryCount", this.retryCount); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + if (this.headers != null) { + jsonWriter.writeUntypedField("headers", this.headers); + } + if (this.queryParameters != null) { + jsonWriter.writeUntypedField("queryParameters", this.queryParameters); + } + jsonWriter.writeStringField("queryParametersTemplate", this.queryParametersTemplate); + jsonWriter.writeStringField("startTimeAttributeName", this.startTimeAttributeName); + jsonWriter.writeStringField("endTimeAttributeName", this.endTimeAttributeName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessConnectorPollingRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessConnectorPollingRequestProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessConnectorPollingRequestProperties. + */ + public static CodelessConnectorPollingRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessConnectorPollingRequestProperties deserializedCodelessConnectorPollingRequestProperties + = new CodelessConnectorPollingRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("apiEndpoint".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.apiEndpoint = reader.getString(); + } else if ("queryWindowInMin".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.queryWindowInMin = reader.getInt(); + } else if ("httpMethod".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.httpMethod = reader.getString(); + } else if ("queryTimeFormat".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.queryTimeFormat = reader.getString(); + } else if ("rateLimitQps".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.rateLimitQps + = reader.getNullable(JsonReader::getInt); + } else if ("retryCount".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.retryCount + = reader.getNullable(JsonReader::getInt); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.timeoutInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("headers".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.headers = reader.readUntyped(); + } else if ("queryParameters".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.queryParameters = reader.readUntyped(); + } else if ("queryParametersTemplate".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.queryParametersTemplate = reader.getString(); + } else if ("startTimeAttributeName".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.startTimeAttributeName = reader.getString(); + } else if ("endTimeAttributeName".equals(fieldName)) { + deserializedCodelessConnectorPollingRequestProperties.endTimeAttributeName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessConnectorPollingRequestProperties; + }); + } +} 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..ab7fc1a3d69b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the response from the external server. + */ +@Fluent +public final class CodelessConnectorPollingResponseProperties + implements JsonSerializable { + /* + * Describes the path we should extract the data in the response + */ + private List eventsJsonPaths; + + /* + * Describes the path we should extract the status code in the response + */ + private String successStatusJsonPath; + + /* + * Describes the path we should extract the status value in the response + */ + private String successStatusValue; + + /* + * Describes if the data in the response is Gzip + */ + private Boolean isGzipCompressed; + + /** + * Creates an instance of CodelessConnectorPollingResponseProperties class. + */ + public CodelessConnectorPollingResponseProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("eventsJsonPaths", this.eventsJsonPaths, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("successStatusJsonPath", this.successStatusJsonPath); + jsonWriter.writeStringField("successStatusValue", this.successStatusValue); + jsonWriter.writeBooleanField("isGzipCompressed", this.isGzipCompressed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessConnectorPollingResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessConnectorPollingResponseProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessConnectorPollingResponseProperties. + */ + public static CodelessConnectorPollingResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessConnectorPollingResponseProperties deserializedCodelessConnectorPollingResponseProperties + = new CodelessConnectorPollingResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventsJsonPaths".equals(fieldName)) { + List eventsJsonPaths = reader.readArray(reader1 -> reader1.getString()); + deserializedCodelessConnectorPollingResponseProperties.eventsJsonPaths = eventsJsonPaths; + } else if ("successStatusJsonPath".equals(fieldName)) { + deserializedCodelessConnectorPollingResponseProperties.successStatusJsonPath = reader.getString(); + } else if ("successStatusValue".equals(fieldName)) { + deserializedCodelessConnectorPollingResponseProperties.successStatusValue = reader.getString(); + } else if ("isGzipCompressed".equals(fieldName)) { + deserializedCodelessConnectorPollingResponseProperties.isGzipCompressed + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessConnectorPollingResponseProperties; + }); + } +} 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..ca2b4bfc9b24 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigProperties.java @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Config to describe the instructions blade. + */ +@Fluent +public final class CodelessUiConnectorConfigProperties + implements JsonSerializable { + /* + * Connector blade title + */ + private String title; + + /* + * Connector publisher name + */ + private String publisher; + + /* + * Connector description + */ + private String descriptionMarkdown; + + /* + * An optional custom image to be used when displaying the connector within Azure Sentinel's connector's gallery + */ + private String customImage; + + /* + * Name of the table the connector will insert the data to + */ + private String graphQueriesTableName; + + /* + * The graph query to show the current data status + */ + private List graphQueries; + + /* + * The sample queries for the connector + */ + private List sampleQueries; + + /* + * Data types to check for last data received + */ + private List dataTypes; + + /* + * Define the way the connector check connectivity + */ + private List connectivityCriteria; + + /* + * Connector Availability Status + */ + private Availability availability; + + /* + * Permissions required for the connector + */ + private Permissions permissions; + + /* + * Instruction steps to enable the connector + */ + private List instructionSteps; + + /** + * Creates an instance of CodelessUiConnectorConfigProperties class. + */ + public CodelessUiConnectorConfigProperties() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("descriptionMarkdown", this.descriptionMarkdown); + jsonWriter.writeStringField("graphQueriesTableName", this.graphQueriesTableName); + jsonWriter.writeArrayField("graphQueries", this.graphQueries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sampleQueries", this.sampleQueries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dataTypes", this.dataTypes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("connectivityCriteria", this.connectivityCriteria, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("availability", this.availability); + jsonWriter.writeJsonField("permissions", this.permissions); + jsonWriter.writeArrayField("instructionSteps", this.instructionSteps, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("customImage", this.customImage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessUiConnectorConfigProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessUiConnectorConfigProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessUiConnectorConfigProperties. + */ + public static CodelessUiConnectorConfigProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessUiConnectorConfigProperties deserializedCodelessUiConnectorConfigProperties + = new CodelessUiConnectorConfigProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedCodelessUiConnectorConfigProperties.title = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedCodelessUiConnectorConfigProperties.publisher = reader.getString(); + } else if ("descriptionMarkdown".equals(fieldName)) { + deserializedCodelessUiConnectorConfigProperties.descriptionMarkdown = reader.getString(); + } else if ("graphQueriesTableName".equals(fieldName)) { + deserializedCodelessUiConnectorConfigProperties.graphQueriesTableName = reader.getString(); + } else if ("graphQueries".equals(fieldName)) { + List graphQueries = reader + .readArray(reader1 -> CodelessUiConnectorConfigPropertiesGraphQueriesItem.fromJson(reader1)); + deserializedCodelessUiConnectorConfigProperties.graphQueries = graphQueries; + } else if ("sampleQueries".equals(fieldName)) { + List sampleQueries = reader + .readArray(reader1 -> CodelessUiConnectorConfigPropertiesSampleQueriesItem.fromJson(reader1)); + deserializedCodelessUiConnectorConfigProperties.sampleQueries = sampleQueries; + } else if ("dataTypes".equals(fieldName)) { + List dataTypes = reader + .readArray(reader1 -> CodelessUiConnectorConfigPropertiesDataTypesItem.fromJson(reader1)); + deserializedCodelessUiConnectorConfigProperties.dataTypes = dataTypes; + } else if ("connectivityCriteria".equals(fieldName)) { + List connectivityCriteria + = reader.readArray( + reader1 -> CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.fromJson(reader1)); + deserializedCodelessUiConnectorConfigProperties.connectivityCriteria = connectivityCriteria; + } else if ("availability".equals(fieldName)) { + deserializedCodelessUiConnectorConfigProperties.availability = Availability.fromJson(reader); + } else if ("permissions".equals(fieldName)) { + deserializedCodelessUiConnectorConfigProperties.permissions = Permissions.fromJson(reader); + } else if ("instructionSteps".equals(fieldName)) { + List instructionSteps = reader.readArray( + reader1 -> CodelessUiConnectorConfigPropertiesInstructionStepsItem.fromJson(reader1)); + deserializedCodelessUiConnectorConfigProperties.instructionSteps = instructionSteps; + } else if ("customImage".equals(fieldName)) { + deserializedCodelessUiConnectorConfigProperties.customImage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessUiConnectorConfigProperties; + }); + } +} 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..e3b6c1cebaf8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem model. + */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem extends ConnectivityCriteria { + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem class. + */ + public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() { + } + + /** + * {@inheritDoc} + */ + @Override + public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem withType(ConnectivityType type) { + super.withType(type); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem withValue(List value) { + super.withValue(value); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeArrayField("value", value(), (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem. + */ + public static CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem deserializedCodelessUiConnectorConfigPropertiesConnectivityCriteriaItem + = new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesConnectivityCriteriaItem + .withType(ConnectivityType.fromString(reader.getString())); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedCodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.withValue(value); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessUiConnectorConfigPropertiesConnectivityCriteriaItem; + }); + } +} 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..1b43b97b29cc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesDataTypesItem.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CodelessUiConnectorConfigPropertiesDataTypesItem model. + */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesDataTypesItem extends LastDataReceivedDataType { + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesDataTypesItem class. + */ + public CodelessUiConnectorConfigPropertiesDataTypesItem() { + } + + /** + * {@inheritDoc} + */ + @Override + public CodelessUiConnectorConfigPropertiesDataTypesItem withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CodelessUiConnectorConfigPropertiesDataTypesItem withLastDataReceivedQuery(String lastDataReceivedQuery) { + super.withLastDataReceivedQuery(lastDataReceivedQuery); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("lastDataReceivedQuery", lastDataReceivedQuery()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessUiConnectorConfigPropertiesDataTypesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessUiConnectorConfigPropertiesDataTypesItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodelessUiConnectorConfigPropertiesDataTypesItem. + */ + public static CodelessUiConnectorConfigPropertiesDataTypesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessUiConnectorConfigPropertiesDataTypesItem deserializedCodelessUiConnectorConfigPropertiesDataTypesItem + = new CodelessUiConnectorConfigPropertiesDataTypesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesDataTypesItem.withName(reader.getString()); + } else if ("lastDataReceivedQuery".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesDataTypesItem + .withLastDataReceivedQuery(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessUiConnectorConfigPropertiesDataTypesItem; + }); + } +} 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..32387de5141b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CodelessUiConnectorConfigPropertiesGraphQueriesItem model. + */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesGraphQueriesItem extends GraphQueries { + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesGraphQueriesItem class. + */ + public CodelessUiConnectorConfigPropertiesGraphQueriesItem() { + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metricName", metricName()); + jsonWriter.writeStringField("legend", legend()); + jsonWriter.writeStringField("baseQuery", baseQuery()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessUiConnectorConfigPropertiesGraphQueriesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessUiConnectorConfigPropertiesGraphQueriesItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodelessUiConnectorConfigPropertiesGraphQueriesItem. + */ + public static CodelessUiConnectorConfigPropertiesGraphQueriesItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + CodelessUiConnectorConfigPropertiesGraphQueriesItem deserializedCodelessUiConnectorConfigPropertiesGraphQueriesItem + = new CodelessUiConnectorConfigPropertiesGraphQueriesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricName".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesGraphQueriesItem.withMetricName(reader.getString()); + } else if ("legend".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesGraphQueriesItem.withLegend(reader.getString()); + } else if ("baseQuery".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesGraphQueriesItem.withBaseQuery(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessUiConnectorConfigPropertiesGraphQueriesItem; + }); + } +} 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..420e47ac8ba3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The CodelessUiConnectorConfigPropertiesInstructionStepsItem model. + */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesInstructionStepsItem extends InstructionSteps { + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesInstructionStepsItem class. + */ + public CodelessUiConnectorConfigPropertiesInstructionStepsItem() { + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", title()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeArrayField("instructions", instructions(), (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessUiConnectorConfigPropertiesInstructionStepsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessUiConnectorConfigPropertiesInstructionStepsItem if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodelessUiConnectorConfigPropertiesInstructionStepsItem. + */ + public static CodelessUiConnectorConfigPropertiesInstructionStepsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + CodelessUiConnectorConfigPropertiesInstructionStepsItem deserializedCodelessUiConnectorConfigPropertiesInstructionStepsItem + = new CodelessUiConnectorConfigPropertiesInstructionStepsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesInstructionStepsItem.withTitle(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesInstructionStepsItem + .withDescription(reader.getString()); + } else if ("instructions".equals(fieldName)) { + List instructions + = reader.readArray(reader1 -> InstructionStepsInstructionsItem.fromJson(reader1)); + deserializedCodelessUiConnectorConfigPropertiesInstructionStepsItem.withInstructions(instructions); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessUiConnectorConfigPropertiesInstructionStepsItem; + }); + } +} 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..bf4f7d00873c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CodelessUiConnectorConfigPropertiesSampleQueriesItem model. + */ +@Fluent +public final class CodelessUiConnectorConfigPropertiesSampleQueriesItem extends SampleQueries { + /** + * Creates an instance of CodelessUiConnectorConfigPropertiesSampleQueriesItem class. + */ + public CodelessUiConnectorConfigPropertiesSampleQueriesItem() { + } + + /** + * {@inheritDoc} + */ + @Override + public CodelessUiConnectorConfigPropertiesSampleQueriesItem withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CodelessUiConnectorConfigPropertiesSampleQueriesItem withQuery(String query) { + super.withQuery(query); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("query", query()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessUiConnectorConfigPropertiesSampleQueriesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessUiConnectorConfigPropertiesSampleQueriesItem if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CodelessUiConnectorConfigPropertiesSampleQueriesItem. + */ + public static CodelessUiConnectorConfigPropertiesSampleQueriesItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + CodelessUiConnectorConfigPropertiesSampleQueriesItem deserializedCodelessUiConnectorConfigPropertiesSampleQueriesItem + = new CodelessUiConnectorConfigPropertiesSampleQueriesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesSampleQueriesItem + .withDescription(reader.getString()); + } else if ("query".equals(fieldName)) { + deserializedCodelessUiConnectorConfigPropertiesSampleQueriesItem.withQuery(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessUiConnectorConfigPropertiesSampleQueriesItem; + }); + } +} 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..d5cc53fcacee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiDataConnector.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.CodelessParameters; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import java.io.IOException; + +/** + * Represents Codeless UI data connector. + */ +@Fluent +public final class CodelessUiDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.GENERIC_UI; + + /* + * Codeless UI data connector properties + */ + private CodelessParameters innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CodelessUiDataConnector class. + */ + public CodelessUiDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Codeless UI data connector properties. + * + * @return the innerProperties value. + */ + private CodelessParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CodelessUiDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CodelessUiDataConnector if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CodelessUiDataConnector. + */ + public static CodelessUiDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CodelessUiDataConnector deserializedCodelessUiDataConnector = new CodelessUiDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCodelessUiDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCodelessUiDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCodelessUiDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedCodelessUiDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedCodelessUiDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedCodelessUiDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedCodelessUiDataConnector.innerProperties = CodelessParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCodelessUiDataConnector; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionClause.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionClause.java new file mode 100644 index 000000000000..b578fe43c0f9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionClause.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a single clause to be evaluated by a NormalizedCondition. + */ +@Fluent +public final class ConditionClause implements JsonSerializable { + /* + * The connective used to join all values in this ConditionClause + */ + private Connective clauseConnective; + + /* + * The name of the field that is evaluated. + */ + private String field; + + /* + * Represents an operator in a ConditionClause. + */ + private Operator operator; + + /* + * The top level connective operator for this condition. + */ + private List values; + + /** + * Creates an instance of ConditionClause class. + */ + public ConditionClause() { + } + + /** + * Get the clauseConnective property: The connective used to join all values in this ConditionClause. + * + * @return the clauseConnective value. + */ + public Connective clauseConnective() { + return this.clauseConnective; + } + + /** + * Get the field property: The name of the field that is evaluated. + * + * @return the field value. + */ + public String field() { + return this.field; + } + + /** + * Set the field property: The name of the field that is evaluated. + * + * @param field the field value to set. + * @return the ConditionClause object itself. + */ + public ConditionClause withField(String field) { + this.field = field; + return this; + } + + /** + * Get the operator property: Represents an operator in a ConditionClause. + * + * @return the operator value. + */ + public Operator operator() { + return this.operator; + } + + /** + * Set the operator property: Represents an operator in a ConditionClause. + * + * @param operator the operator value to set. + * @return the ConditionClause object itself. + */ + public ConditionClause withOperator(Operator operator) { + this.operator = operator; + return this; + } + + /** + * Get the values property: The top level connective operator for this condition. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The top level connective operator for this condition. + * + * @param values the values value to set. + * @return the ConditionClause object itself. + */ + public ConditionClause withValues(List values) { + this.values = values; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConditionClause from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConditionClause if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConditionClause. + */ + public static ConditionClause fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConditionClause deserializedConditionClause = new ConditionClause(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("field".equals(fieldName)) { + deserializedConditionClause.field = reader.getString(); + } else if ("operator".equals(fieldName)) { + deserializedConditionClause.operator = Operator.fromString(reader.getString()); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedConditionClause.values = values; + } else if ("clauseConnective".equals(fieldName)) { + deserializedConditionClause.clauseConnective = Connective.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConditionClause; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionProperties.java new file mode 100644 index 000000000000..5df3c2309d1d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a condition used to query for TI objects. + */ +@Fluent +public final class ConditionProperties implements JsonSerializable { + /* + * The STIX type for the objects returned by this query. + */ + private String stixObjectType; + + /* + * The list of clauses to be evaluated in disjunction or conjunction base on the specified top level connective + * operator. + */ + private List clauses; + + /* + * The top level connective operator for this condition. + */ + private Connective conditionConnective; + + /** + * Creates an instance of ConditionProperties class. + */ + public ConditionProperties() { + } + + /** + * Get the stixObjectType property: The STIX type for the objects returned by this query. + * + * @return the stixObjectType value. + */ + public String stixObjectType() { + return this.stixObjectType; + } + + /** + * Get the clauses property: The list of clauses to be evaluated in disjunction or conjunction base on the specified + * top level connective operator. + * + * @return the clauses value. + */ + public List clauses() { + return this.clauses; + } + + /** + * Set the clauses property: The list of clauses to be evaluated in disjunction or conjunction base on the specified + * top level connective operator. + * + * @param clauses the clauses value to set. + * @return the ConditionProperties object itself. + */ + public ConditionProperties withClauses(List clauses) { + this.clauses = clauses; + return this; + } + + /** + * Get the conditionConnective property: The top level connective operator for this condition. + * + * @return the conditionConnective value. + */ + public Connective conditionConnective() { + return this.conditionConnective; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("clauses", this.clauses, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConditionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConditionProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConditionProperties. + */ + public static ConditionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConditionProperties deserializedConditionProperties = new ConditionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clauses".equals(fieldName)) { + List clauses = reader.readArray(reader1 -> ConditionClause.fromJson(reader1)); + deserializedConditionProperties.clauses = clauses; + } else if ("stixObjectType".equals(fieldName)) { + deserializedConditionProperties.stixObjectType = reader.getString(); + } else if ("conditionConnective".equals(fieldName)) { + deserializedConditionProperties.conditionConnective = Connective.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConditionProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionType.java index 0a3e8189a76f..deadc6f0289a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionType.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,20 +12,30 @@ */ public final class ConditionType extends ExpandableStringEnum { /** - * Static value Property for ConditionType. + * Evaluate an object property value. */ public static final ConditionType PROPERTY = fromString("Property"); /** - * Static value PropertyChanged for ConditionType. + * Evaluate an object array property value. + */ + public static final ConditionType PROPERTY_ARRAY = fromString("PropertyArray"); + + /** + * Evaluate an object property changed value. */ public static final ConditionType PROPERTY_CHANGED = fromString("PropertyChanged"); /** - * Static value PropertyArrayChanged for ConditionType. + * Evaluate an object array property changed value. */ public static final ConditionType PROPERTY_ARRAY_CHANGED = fromString("PropertyArrayChanged"); + /** + * Apply a boolean operator (e.g AND, OR) to conditions. + */ + public static final ConditionType BOOLEAN = fromString("Boolean"); + /** * Creates a new instance of ConditionType value. * 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 index 0c99ff3c6f20..09c5d135bbb7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,17 +12,17 @@ */ public final class ConfidenceLevel extends ExpandableStringEnum { /** - * Static value Unknown for ConfidenceLevel. + * Unknown confidence, the is the default value. */ public static final ConfidenceLevel UNKNOWN = fromString("Unknown"); /** - * Static value Low for ConfidenceLevel. + * Low confidence, meaning we have some doubts this is indeed malicious or part of an attack. */ public static final ConfidenceLevel LOW = fromString("Low"); /** - * Static value High for ConfidenceLevel. + * High confidence that the alert is true positive malicious. */ public static final ConfidenceLevel HIGH = fromString("High"); 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 index 2147de54bf6b..0ec57ebac1e0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,22 +13,23 @@ */ public final class ConfidenceScoreStatus extends ExpandableStringEnum { /** - * Static value NotApplicable for ConfidenceScoreStatus. + * Score will not be calculated for this alert as it is not supported by virtual analyst. */ public static final ConfidenceScoreStatus NOT_APPLICABLE = fromString("NotApplicable"); /** - * Static value InProcess for ConfidenceScoreStatus. + * No score was set yet and calculation is in progress. */ public static final ConfidenceScoreStatus IN_PROCESS = fromString("InProcess"); /** - * Static value NotFinal for ConfidenceScoreStatus. + * Score is calculated and shown as part of the alert, but may be updated again at a later time following the + * processing of additional data. */ public static final ConfidenceScoreStatus NOT_FINAL = fromString("NotFinal"); /** - * Static value Final for ConfidenceScoreStatus. + * Final score was calculated and available. */ public static final ConfidenceScoreStatus FINAL = fromString("Final"); 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..12648f6a83a7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The authentication kind used to poll the data. + */ +public final class ConnectAuthKind extends ExpandableStringEnum { + /** + * Basic. + */ + public static final ConnectAuthKind BASIC = fromString("Basic"); + + /** + * OAuth2. + */ + public static final ConnectAuthKind OAUTH2 = fromString("OAuth2"); + + /** + * APIKey. + */ + public static final ConnectAuthKind APIKEY = fromString("APIKey"); + + /** + * Creates a new instance of ConnectAuthKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectAuthKind() { + } + + /** + * Creates or finds a ConnectAuthKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectAuthKind. + */ + public static ConnectAuthKind fromString(String name) { + return fromString(name, ConnectAuthKind.class); + } + + /** + * Gets known ConnectAuthKind values. + * + * @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..712ae8bed8c2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectedEntity.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Expansion result connected entities. + */ +@Immutable +public final class ConnectedEntity implements JsonSerializable { + /* + * Entity Id of the connected entity + */ + private String targetEntityId; + + /* + * key-value pairs for a connected entity mapping + */ + private Object additionalData; + + /** + * Creates an instance of ConnectedEntity class. + */ + private ConnectedEntity() { + } + + /** + * Get the targetEntityId property: Entity Id of the connected entity. + * + * @return the targetEntityId value. + */ + public String targetEntityId() { + return this.targetEntityId; + } + + /** + * Get the additionalData property: key-value pairs for a connected entity mapping. + * + * @return the additionalData value. + */ + public Object additionalData() { + return this.additionalData; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetEntityId", this.targetEntityId); + if (this.additionalData != null) { + jsonWriter.writeUntypedField("additionalData", this.additionalData); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedEntity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectedEntity. + */ + public static ConnectedEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedEntity deserializedConnectedEntity = new ConnectedEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetEntityId".equals(fieldName)) { + deserializedConnectedEntity.targetEntityId = reader.getString(); + } else if ("additionalData".equals(fieldName)) { + deserializedConnectedEntity.additionalData = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedEntity; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Connective.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Connective.java new file mode 100644 index 000000000000..3dca74381939 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Connective.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents boolean connectives used to join clauses in conditions. + */ +public final class Connective extends ExpandableStringEnum { + /** + * 'And' connective. + */ + public static final Connective AND = fromString("And"); + + /** + * 'Or' connective. + */ + public static final Connective OR = fromString("Or"); + + /** + * Creates a new instance of Connective value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Connective() { + } + + /** + * Creates or finds a Connective from its string representation. + * + * @param name a name to look for. + * @return the corresponding Connective. + */ + public static Connective fromString(String name) { + return fromString(name, Connective.class); + } + + /** + * Gets known Connective values. + * + * @return known Connective values. + */ + public static Collection values() { + return values(Connective.class); + } +} 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..60dd8cd77796 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriteria.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Setting for the connector check connectivity. + */ +@Fluent +public class ConnectivityCriteria implements JsonSerializable { + /* + * type of connectivity + */ + private ConnectivityType type; + + /* + * Queries for checking connectivity + */ + private List value; + + /** + * Creates an instance of ConnectivityCriteria class. + */ + public ConnectivityCriteria() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityCriteria from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityCriteria if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectivityCriteria. + */ + public static ConnectivityCriteria fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityCriteria deserializedConnectivityCriteria = new ConnectivityCriteria(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedConnectivityCriteria.type = ConnectivityType.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectivityCriteria.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityCriteria; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriterion.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriterion.java new file mode 100644 index 000000000000..f445ac2400a4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriterion.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The criteria by which we determine whether the connector is connected or not. + * For Example, use a KQL query to check if the expected data type is flowing). + */ +@Fluent +public final class ConnectivityCriterion implements JsonSerializable { + /* + * Gets or sets the type of connectivity. + */ + private String type; + + /* + * Gets or sets the queries for checking connectivity. + */ + private List value; + + /** + * Creates an instance of ConnectivityCriterion class. + */ + public ConnectivityCriterion() { + } + + /** + * Get the type property: Gets or sets the type of connectivity. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Gets or sets the type of connectivity. + * + * @param type the type value to set. + * @return the ConnectivityCriterion object itself. + */ + public ConnectivityCriterion withType(String type) { + this.type = type; + return this; + } + + /** + * Get the value property: Gets or sets the queries for checking connectivity. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the queries for checking connectivity. + * + * @param value the value value to set. + * @return the ConnectivityCriterion object itself. + */ + public ConnectivityCriterion withValue(List value) { + this.value = value; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityCriterion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityCriterion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivityCriterion. + */ + public static ConnectivityCriterion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityCriterion deserializedConnectivityCriterion = new ConnectivityCriterion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedConnectivityCriterion.type = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectivityCriterion.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityCriterion; + }); + } +} 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..a154bc9384a5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * type of connectivity. + */ +public final class ConnectivityType extends ExpandableStringEnum { + /** + * IsConnectedQuery. + */ + public static final ConnectivityType IS_CONNECTED_QUERY = fromString("IsConnectedQuery"); + + /** + * Creates a new instance of ConnectivityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectivityType() { + } + + /** + * Creates or finds a ConnectivityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectivityType. + */ + public static ConnectivityType fromString(String name) { + return fromString(name, ConnectivityType.class); + } + + /** + * Gets known ConnectivityType values. + * + * @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/ConnectorDataType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDataType.java new file mode 100644 index 000000000000..bdb7371eaf96 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDataType.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The data type which is created by the connector, + * including a query indicated when was the last time that data type was received in the workspace. + */ +@Fluent +public final class ConnectorDataType implements JsonSerializable { + /* + * Gets or sets the name of the data type to show in the graph. + */ + private String name; + + /* + * Gets or sets the query to indicate when relevant data was last received in the workspace. + */ + private String lastDataReceivedQuery; + + /** + * Creates an instance of ConnectorDataType class. + */ + public ConnectorDataType() { + } + + /** + * Get the name property: Gets or sets the name of the data type to show in the graph. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the name of the data type to show in the graph. + * + * @param name the name value to set. + * @return the ConnectorDataType object itself. + */ + public ConnectorDataType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the lastDataReceivedQuery property: Gets or sets the query to indicate when relevant data was last received + * in the workspace. + * + * @return the lastDataReceivedQuery value. + */ + public String lastDataReceivedQuery() { + return this.lastDataReceivedQuery; + } + + /** + * Set the lastDataReceivedQuery property: Gets or sets the query to indicate when relevant data was last received + * in the workspace. + * + * @param lastDataReceivedQuery the lastDataReceivedQuery value to set. + * @return the ConnectorDataType object itself. + */ + public ConnectorDataType withLastDataReceivedQuery(String lastDataReceivedQuery) { + this.lastDataReceivedQuery = lastDataReceivedQuery; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("lastDataReceivedQuery", this.lastDataReceivedQuery); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectorDataType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectorDataType if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectorDataType. + */ + public static ConnectorDataType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectorDataType deserializedConnectorDataType = new ConnectorDataType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedConnectorDataType.name = reader.getString(); + } else if ("lastDataReceivedQuery".equals(fieldName)) { + deserializedConnectorDataType.lastDataReceivedQuery = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectorDataType; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsAvailability.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsAvailability.java new file mode 100644 index 000000000000..a88da12056b8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsAvailability.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The exposure status of the connector to the customers. + */ +@Fluent +public final class ConnectorDefinitionsAvailability implements JsonSerializable { + /* + * The exposure status of the connector to the customers. Available values are 0-4 (0=None, 1=Available, + * 2=FeatureFlag, 3=Internal). + */ + private Integer status; + + /* + * Gets or sets a value indicating whether the connector is preview. + */ + private Boolean isPreview; + + /** + * Creates an instance of ConnectorDefinitionsAvailability class. + */ + public ConnectorDefinitionsAvailability() { + } + + /** + * Get the status property: The exposure status of the connector to the customers. Available values are 0-4 (0=None, + * 1=Available, 2=FeatureFlag, 3=Internal). + * + * @return the status value. + */ + public Integer status() { + return this.status; + } + + /** + * Set the status property: The exposure status of the connector to the customers. Available values are 0-4 (0=None, + * 1=Available, 2=FeatureFlag, 3=Internal). + * + * @param status the status value to set. + * @return the ConnectorDefinitionsAvailability object itself. + */ + public ConnectorDefinitionsAvailability withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the isPreview property: Gets or sets a value indicating whether the connector is preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Gets or sets a value indicating whether the connector is preview. + * + * @param isPreview the isPreview value to set. + * @return the ConnectorDefinitionsAvailability object itself. + */ + public ConnectorDefinitionsAvailability withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("status", this.status); + jsonWriter.writeBooleanField("isPreview", this.isPreview); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectorDefinitionsAvailability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectorDefinitionsAvailability if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectorDefinitionsAvailability. + */ + public static ConnectorDefinitionsAvailability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectorDefinitionsAvailability deserializedConnectorDefinitionsAvailability + = new ConnectorDefinitionsAvailability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedConnectorDefinitionsAvailability.status = reader.getNullable(JsonReader::getInt); + } else if ("isPreview".equals(fieldName)) { + deserializedConnectorDefinitionsAvailability.isPreview = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectorDefinitionsAvailability; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java new file mode 100644 index 000000000000..6a7cd9a13461 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The required Permissions for the connector. + */ +@Fluent +public final class ConnectorDefinitionsPermissions implements JsonSerializable { + /* + * Gets or sets the required tenant permissions for the connector. + */ + private List tenant; + + /* + * Gets or sets the required licenses for the user to create connections. + */ + private List licenses; + + /* + * Gets or sets the resource provider permissions required for the user to create connections. + */ + private List resourceProvider; + + /* + * Gets or sets the customs permissions required for the user to create connections. + */ + private List customs; + + /** + * Creates an instance of ConnectorDefinitionsPermissions class. + */ + public ConnectorDefinitionsPermissions() { + } + + /** + * Get the tenant property: Gets or sets the required tenant permissions for the connector. + * + * @return the tenant value. + */ + public List tenant() { + return this.tenant; + } + + /** + * Set the tenant property: Gets or sets the required tenant permissions for the connector. + * + * @param tenant the tenant value to set. + * @return the ConnectorDefinitionsPermissions object itself. + */ + public ConnectorDefinitionsPermissions withTenant(List tenant) { + this.tenant = tenant; + return this; + } + + /** + * Get the licenses property: Gets or sets the required licenses for the user to create connections. + * + * @return the licenses value. + */ + public List licenses() { + return this.licenses; + } + + /** + * Set the licenses property: Gets or sets the required licenses for the user to create connections. + * + * @param licenses the licenses value to set. + * @return the ConnectorDefinitionsPermissions object itself. + */ + public ConnectorDefinitionsPermissions withLicenses(List licenses) { + this.licenses = licenses; + return this; + } + + /** + * Get the resourceProvider property: Gets or sets the resource provider permissions required for the user to create + * connections. + * + * @return the resourceProvider value. + */ + public List resourceProvider() { + return this.resourceProvider; + } + + /** + * Set the resourceProvider property: Gets or sets the resource provider permissions required for the user to create + * connections. + * + * @param resourceProvider the resourceProvider value to set. + * @return the ConnectorDefinitionsPermissions object itself. + */ + public ConnectorDefinitionsPermissions + withResourceProvider(List resourceProvider) { + this.resourceProvider = resourceProvider; + return this; + } + + /** + * Get the customs property: Gets or sets the customs permissions required for the user to create connections. + * + * @return the customs value. + */ + public List customs() { + return this.customs; + } + + /** + * Set the customs property: Gets or sets the customs permissions required for the user to create connections. + * + * @param customs the customs value to set. + * @return the ConnectorDefinitionsPermissions object itself. + */ + public ConnectorDefinitionsPermissions withCustoms(List customs) { + this.customs = customs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tenant", this.tenant, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("licenses", this.licenses, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("resourceProvider", this.resourceProvider, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("customs", this.customs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectorDefinitionsPermissions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectorDefinitionsPermissions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectorDefinitionsPermissions. + */ + public static ConnectorDefinitionsPermissions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectorDefinitionsPermissions deserializedConnectorDefinitionsPermissions + = new ConnectorDefinitionsPermissions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenant".equals(fieldName)) { + List tenant = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectorDefinitionsPermissions.tenant = tenant; + } else if ("licenses".equals(fieldName)) { + List licenses = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectorDefinitionsPermissions.licenses = licenses; + } else if ("resourceProvider".equals(fieldName)) { + List resourceProvider + = reader.readArray(reader1 -> ConnectorDefinitionsResourceProvider.fromJson(reader1)); + deserializedConnectorDefinitionsPermissions.resourceProvider = resourceProvider; + } else if ("customs".equals(fieldName)) { + List customs + = reader.readArray(reader1 -> CustomPermissionDetails.fromJson(reader1)); + deserializedConnectorDefinitionsPermissions.customs = customs; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectorDefinitionsPermissions; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.java new file mode 100644 index 000000000000..b2f33622697e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource provider details include the required permissions for the user to create connections. + * The user should have the required permissions(Read\Write, ..) in the specified scope ProviderPermissionsScope against + * the specified resource provider. + */ +@Fluent +public final class ConnectorDefinitionsResourceProvider + implements JsonSerializable { + /* + * Gets or sets the provider name. + */ + private String provider; + + /* + * Gets or sets the permissions description text. + */ + private String permissionsDisplayText; + + /* + * Gets or sets the permissions provider display name. + */ + private String providerDisplayName; + + /* + * The scope on which the user should have permissions, in order to be able to create connections. + */ + private ProviderPermissionsScope scope; + + /* + * Required permissions for the connector resource provider that define in ResourceProviders. + * For more information about the permissions see here. + */ + private ResourceProviderRequiredPermissions requiredPermissions; + + /** + * Creates an instance of ConnectorDefinitionsResourceProvider class. + */ + public ConnectorDefinitionsResourceProvider() { + } + + /** + * Get the provider property: Gets or sets the provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Gets or sets the provider name. + * + * @param provider the provider value to set. + * @return the ConnectorDefinitionsResourceProvider object itself. + */ + public ConnectorDefinitionsResourceProvider withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the permissionsDisplayText property: Gets or sets the permissions description text. + * + * @return the permissionsDisplayText value. + */ + public String permissionsDisplayText() { + return this.permissionsDisplayText; + } + + /** + * Set the permissionsDisplayText property: Gets or sets the permissions description text. + * + * @param permissionsDisplayText the permissionsDisplayText value to set. + * @return the ConnectorDefinitionsResourceProvider object itself. + */ + public ConnectorDefinitionsResourceProvider withPermissionsDisplayText(String permissionsDisplayText) { + this.permissionsDisplayText = permissionsDisplayText; + return this; + } + + /** + * Get the providerDisplayName property: Gets or sets the permissions provider display name. + * + * @return the providerDisplayName value. + */ + public String providerDisplayName() { + return this.providerDisplayName; + } + + /** + * Set the providerDisplayName property: Gets or sets the permissions provider display name. + * + * @param providerDisplayName the providerDisplayName value to set. + * @return the ConnectorDefinitionsResourceProvider object itself. + */ + public ConnectorDefinitionsResourceProvider withProviderDisplayName(String providerDisplayName) { + this.providerDisplayName = providerDisplayName; + return this; + } + + /** + * Get the scope property: The scope on which the user should have permissions, in order to be able to create + * connections. + * + * @return the scope value. + */ + public ProviderPermissionsScope scope() { + return this.scope; + } + + /** + * Set the scope property: The scope on which the user should have permissions, in order to be able to create + * connections. + * + * @param scope the scope value to set. + * @return the ConnectorDefinitionsResourceProvider object itself. + */ + public ConnectorDefinitionsResourceProvider withScope(ProviderPermissionsScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the requiredPermissions property: Required permissions for the connector resource provider that define in + * ResourceProviders. + * For more information about the permissions see <see + * href="https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#actions-format">here</see>. + * + * @return the requiredPermissions value. + */ + public ResourceProviderRequiredPermissions requiredPermissions() { + return this.requiredPermissions; + } + + /** + * Set the requiredPermissions property: Required permissions for the connector resource provider that define in + * ResourceProviders. + * For more information about the permissions see <see + * href="https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#actions-format">here</see>. + * + * @param requiredPermissions the requiredPermissions value to set. + * @return the ConnectorDefinitionsResourceProvider object itself. + */ + public ConnectorDefinitionsResourceProvider + withRequiredPermissions(ResourceProviderRequiredPermissions requiredPermissions) { + this.requiredPermissions = requiredPermissions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("permissionsDisplayText", this.permissionsDisplayText); + jsonWriter.writeStringField("providerDisplayName", this.providerDisplayName); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeJsonField("requiredPermissions", this.requiredPermissions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectorDefinitionsResourceProvider from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectorDefinitionsResourceProvider if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectorDefinitionsResourceProvider. + */ + public static ConnectorDefinitionsResourceProvider fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectorDefinitionsResourceProvider deserializedConnectorDefinitionsResourceProvider + = new ConnectorDefinitionsResourceProvider(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedConnectorDefinitionsResourceProvider.provider = reader.getString(); + } else if ("permissionsDisplayText".equals(fieldName)) { + deserializedConnectorDefinitionsResourceProvider.permissionsDisplayText = reader.getString(); + } else if ("providerDisplayName".equals(fieldName)) { + deserializedConnectorDefinitionsResourceProvider.providerDisplayName = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedConnectorDefinitionsResourceProvider.scope + = ProviderPermissionsScope.fromString(reader.getString()); + } else if ("requiredPermissions".equals(fieldName)) { + deserializedConnectorDefinitionsResourceProvider.requiredPermissions + = ResourceProviderRequiredPermissions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectorDefinitionsResourceProvider; + }); + } +} 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..509dccb63544 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Instruction step details. + */ +@Fluent +public class ConnectorInstructionModelBase implements JsonSerializable { + /* + * The parameters for the setting + */ + private Object parameters; + + /* + * The kind of the setting + */ + private SettingType type; + + /** + * Creates an instance of ConnectorInstructionModelBase class. + */ + public ConnectorInstructionModelBase() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + if (this.parameters != null) { + jsonWriter.writeUntypedField("parameters", this.parameters); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectorInstructionModelBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectorInstructionModelBase if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectorInstructionModelBase. + */ + public static ConnectorInstructionModelBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectorInstructionModelBase deserializedConnectorInstructionModelBase + = new ConnectorInstructionModelBase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedConnectorInstructionModelBase.type = SettingType.fromString(reader.getString()); + } else if ("parameters".equals(fieldName)) { + deserializedConnectorInstructionModelBase.parameters = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectorInstructionModelBase; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackageOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackageOperations.java new file mode 100644 index 000000000000..b0269da6939f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackageOperations.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContentPackageOperations. + */ +public interface ContentPackageOperations { + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 {@link Response}. + */ + Response uninstallWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context); + + /** + * Uninstall a package from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 uninstall(String resourceGroupName, String workspaceName, String packageId); + + /** + * Begins definition for a new PackageModel resource. + * + * @param name resource name. + * @return the first stage of the new PackageModel definition. + */ + PackageModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackages.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackages.java new file mode 100644 index 000000000000..59c39131a2ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackages.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContentPackages. + */ +public interface ContentPackages { + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context); + + /** + * Gets an installed packages by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 installed packages by its id. + */ + PackageModel get(String resourceGroupName, String workspaceName, String packageId); + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed packages as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all installed packages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed packages as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + String search, Boolean count, Integer top, Integer skip, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplates.java new file mode 100644 index 000000000000..a65b87d6b819 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplates.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContentTemplates. + */ +public interface ContentTemplates { + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context); + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + */ + TemplateModel get(String resourceGroupName, String workspaceName, String templateId); + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context); + + /** + * Delete an installed template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param templateId 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. + */ + void delete(String resourceGroupName, String workspaceName, String templateId); + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @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 template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link Response}. + */ + TemplateModel getById(String id); + + /** + * Gets a template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @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 template byt its identifier. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an installed template. + * + * @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 an installed template. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TemplateModel resource. + * + * @param name resource name. + * @return the first stage of the new TemplateModel definition. + */ + TemplateModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplatesOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplatesOperations.java new file mode 100644 index 000000000000..aa944d7817cc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplatesOperations.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ContentTemplatesOperations. + */ +public interface ContentTemplatesOperations { + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param expand Expands the object with optional fiends that are not included by default. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 installed templates. + * Expandable properties: + * - properties/mainTemplate + * - properties/dependantTemplates as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + String expand, String search, Boolean count, Integer top, Integer skip, String skipToken, Context context); +} 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..5fab1cfb77c8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ContentType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The content type of a source control path. + */ +public final class ContentType extends ExpandableStringEnum { + /** + * AnalyticsRule. + */ + public static final ContentType ANALYTICS_RULE = fromString("AnalyticsRule"); + + /** + * AutomationRule. + */ + public static final ContentType AUTOMATION_RULE = fromString("AutomationRule"); + + /** + * HuntingQuery. + */ + public static final ContentType HUNTING_QUERY = fromString("HuntingQuery"); + + /** + * Parser. + */ + public static final ContentType PARSER = fromString("Parser"); + + /** + * Playbook. + */ + public static final ContentType PLAYBOOK = fromString("Playbook"); + + /** + * Workbook. + */ + public static final ContentType WORKBOOK = fromString("Workbook"); + + /** + * Creates a new instance of ContentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContentType() { + } + + /** + * Creates or finds a ContentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentType. + */ + public static ContentType fromString(String name) { + return fromString(name, ContentType.class); + } + + /** + * Gets known ContentType values. + * + * @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/CountQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CountQuery.java new file mode 100644 index 000000000000..31f5934bc467 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CountQuery.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.QueryProperties; +import java.io.IOException; + +/** + * Represents a query to run on the TI objects in the workspace. + */ +@Fluent +public final class CountQuery implements JsonSerializable { + /* + * Query properties + */ + private QueryProperties innerProperties; + + /** + * Creates an instance of CountQuery class. + */ + public CountQuery() { + } + + /** + * Get the innerProperties property: Query properties. + * + * @return the innerProperties value. + */ + private QueryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the condition property: Represents a condition used to query for TI objects. + * + * @return the condition value. + */ + public ConditionProperties condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: Represents a condition used to query for TI objects. + * + * @param condition the condition value to set. + * @return the CountQuery object itself. + */ + public CountQuery withCondition(ConditionProperties condition) { + if (this.innerProperties() == null) { + this.innerProperties = new QueryProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CountQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CountQuery if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the CountQuery. + */ + public static CountQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CountQuery deserializedCountQuery = new CountQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedCountQuery.innerProperties = QueryProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCountQuery; + }); + } +} 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..a6eac578f48b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQuery.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specific entity query that supports put requests. + */ +@Fluent +public class CustomEntityQuery extends ResourceWithEtag { + /* + * the entity query kind + */ + private CustomEntityQueryKind kind = CustomEntityQueryKind.fromString("CustomEntityQuery"); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CustomEntityQuery class. + */ + public CustomEntityQuery() { + } + + /** + * Get the kind property: the entity query kind. + * + * @return the kind value. + */ + public CustomEntityQueryKind kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomEntityQuery withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomEntityQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomEntityQuery if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomEntityQuery. + */ + public static CustomEntityQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Activity".equals(discriminatorValue)) { + return ActivityCustomEntityQuery.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static CustomEntityQuery fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomEntityQuery deserializedCustomEntityQuery = new CustomEntityQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCustomEntityQuery.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCustomEntityQuery.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCustomEntityQuery.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedCustomEntityQuery.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedCustomEntityQuery.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedCustomEntityQuery.kind = CustomEntityQueryKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomEntityQuery; + }); + } +} 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..25aec4431d8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQueryKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the entity query that supports put request. + */ +public final class CustomEntityQueryKind extends ExpandableStringEnum { + /** + * Activity. + */ + public static final CustomEntityQueryKind ACTIVITY = fromString("Activity"); + + /** + * Creates a new instance of CustomEntityQueryKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomEntityQueryKind() { + } + + /** + * Creates or finds a CustomEntityQueryKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomEntityQueryKind. + */ + public static CustomEntityQueryKind fromString(String name) { + return fromString(name, CustomEntityQueryKind.class); + } + + /** + * Gets known CustomEntityQueryKind values. + * + * @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/CustomPermissionDetails.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomPermissionDetails.java new file mode 100644 index 000000000000..63192add88fe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomPermissionDetails.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Custom permissions required for the connector. + */ +@Fluent +public final class CustomPermissionDetails implements JsonSerializable { + /* + * Gets or sets the custom permissions name. + */ + private String name; + + /* + * Gets or sets the custom permissions description. + */ + private String description; + + /** + * Creates an instance of CustomPermissionDetails class. + */ + public CustomPermissionDetails() { + } + + /** + * Get the name property: Gets or sets the custom permissions name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the custom permissions name. + * + * @param name the name value to set. + * @return the CustomPermissionDetails object itself. + */ + public CustomPermissionDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Gets or sets the custom permissions description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets the custom permissions description. + * + * @param description the description value to set. + * @return the CustomPermissionDetails object itself. + */ + public CustomPermissionDetails withDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomPermissionDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomPermissionDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomPermissionDetails. + */ + public static CustomPermissionDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomPermissionDetails deserializedCustomPermissionDetails = new CustomPermissionDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomPermissionDetails.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedCustomPermissionDetails.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomPermissionDetails; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectionsConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectionsConfig.java new file mode 100644 index 000000000000..ce0d5a657cf1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectionsConfig.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The UiConfig for 'Customizable' connector definition kind. + */ +@Fluent +public final class CustomizableConnectionsConfig implements JsonSerializable { + /* + * Gets or sets the template name. The template includes ARM templates that can be created by the connector, usually + * it will be the dataConnectors ARM templates. + */ + private String templateSpecName; + + /* + * Gets or sets the template version. + */ + private String templateSpecVersion; + + /** + * Creates an instance of CustomizableConnectionsConfig class. + */ + public CustomizableConnectionsConfig() { + } + + /** + * Get the templateSpecName property: Gets or sets the template name. The template includes ARM templates that can + * be created by the connector, usually it will be the dataConnectors ARM templates. + * + * @return the templateSpecName value. + */ + public String templateSpecName() { + return this.templateSpecName; + } + + /** + * Set the templateSpecName property: Gets or sets the template name. The template includes ARM templates that can + * be created by the connector, usually it will be the dataConnectors ARM templates. + * + * @param templateSpecName the templateSpecName value to set. + * @return the CustomizableConnectionsConfig object itself. + */ + public CustomizableConnectionsConfig withTemplateSpecName(String templateSpecName) { + this.templateSpecName = templateSpecName; + return this; + } + + /** + * Get the templateSpecVersion property: Gets or sets the template version. + * + * @return the templateSpecVersion value. + */ + public String templateSpecVersion() { + return this.templateSpecVersion; + } + + /** + * Set the templateSpecVersion property: Gets or sets the template version. + * + * @param templateSpecVersion the templateSpecVersion value to set. + * @return the CustomizableConnectionsConfig object itself. + */ + public CustomizableConnectionsConfig withTemplateSpecVersion(String templateSpecVersion) { + this.templateSpecVersion = templateSpecVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("templateSpecName", this.templateSpecName); + jsonWriter.writeStringField("templateSpecVersion", this.templateSpecVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizableConnectionsConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizableConnectionsConfig if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomizableConnectionsConfig. + */ + public static CustomizableConnectionsConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizableConnectionsConfig deserializedCustomizableConnectionsConfig + = new CustomizableConnectionsConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("templateSpecName".equals(fieldName)) { + deserializedCustomizableConnectionsConfig.templateSpecName = reader.getString(); + } else if ("templateSpecVersion".equals(fieldName)) { + deserializedCustomizableConnectionsConfig.templateSpecVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizableConnectionsConfig; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorDefinition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorDefinition.java new file mode 100644 index 000000000000..e18d7f4b35c4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorDefinition.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.CustomizableConnectorDefinitionProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Connector definition for kind 'Customizable'. + */ +@Fluent +public final class CustomizableConnectorDefinition extends DataConnectorDefinitionInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorDefinitionKind kind = DataConnectorDefinitionKind.CUSTOMIZABLE; + + /* + * Customizable properties. + */ + private CustomizableConnectorDefinitionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CustomizableConnectorDefinition class. + */ + public CustomizableConnectorDefinition() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorDefinitionKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Customizable properties. + * + * @return the innerProperties value. + */ + private CustomizableConnectorDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomizableConnectorDefinition withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the createdTimeUtc property: Gets or sets the connector definition created date in UTC format. + * + * @return the createdTimeUtc value. + */ + public OffsetDateTime createdTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimeUtc(); + } + + /** + * Set the createdTimeUtc property: Gets or sets the connector definition created date in UTC format. + * + * @param createdTimeUtc the createdTimeUtc value to set. + * @return the CustomizableConnectorDefinition object itself. + */ + public CustomizableConnectorDefinition withCreatedTimeUtc(OffsetDateTime createdTimeUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomizableConnectorDefinitionProperties(); + } + this.innerProperties().withCreatedTimeUtc(createdTimeUtc); + return this; + } + + /** + * Get the lastModifiedUtc property: Gets or sets the connector definition last modified date in UTC format. + * + * @return the lastModifiedUtc value. + */ + public OffsetDateTime lastModifiedUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); + } + + /** + * Set the lastModifiedUtc property: Gets or sets the connector definition last modified date in UTC format. + * + * @param lastModifiedUtc the lastModifiedUtc value to set. + * @return the CustomizableConnectorDefinition object itself. + */ + public CustomizableConnectorDefinition withLastModifiedUtc(OffsetDateTime lastModifiedUtc) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomizableConnectorDefinitionProperties(); + } + this.innerProperties().withLastModifiedUtc(lastModifiedUtc); + return this; + } + + /** + * Get the connectorUiConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @return the connectorUiConfig value. + */ + public CustomizableConnectorUiConfig connectorUiConfig() { + return this.innerProperties() == null ? null : this.innerProperties().connectorUiConfig(); + } + + /** + * Set the connectorUiConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @param connectorUiConfig the connectorUiConfig value to set. + * @return the CustomizableConnectorDefinition object itself. + */ + public CustomizableConnectorDefinition withConnectorUiConfig(CustomizableConnectorUiConfig connectorUiConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomizableConnectorDefinitionProperties(); + } + this.innerProperties().withConnectorUiConfig(connectorUiConfig); + return this; + } + + /** + * Get the connectionsConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @return the connectionsConfig value. + */ + public CustomizableConnectionsConfig connectionsConfig() { + return this.innerProperties() == null ? null : this.innerProperties().connectionsConfig(); + } + + /** + * Set the connectionsConfig property: The UiConfig for 'Customizable' connector definition kind. + * + * @param connectionsConfig the connectionsConfig value to set. + * @return the CustomizableConnectorDefinition object itself. + */ + public CustomizableConnectorDefinition withConnectionsConfig(CustomizableConnectionsConfig connectionsConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomizableConnectorDefinitionProperties(); + } + this.innerProperties().withConnectionsConfig(connectionsConfig); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizableConnectorDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizableConnectorDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomizableConnectorDefinition. + */ + public static CustomizableConnectorDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizableConnectorDefinition deserializedCustomizableConnectorDefinition + = new CustomizableConnectorDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCustomizableConnectorDefinition.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCustomizableConnectorDefinition.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCustomizableConnectorDefinition.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedCustomizableConnectorDefinition.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedCustomizableConnectorDefinition.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedCustomizableConnectorDefinition.kind + = DataConnectorDefinitionKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedCustomizableConnectorDefinition.innerProperties + = CustomizableConnectorDefinitionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizableConnectorDefinition; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.java new file mode 100644 index 000000000000..64c8b38d6be1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The UiConfig for 'Customizable' connector definition kind. + */ +@Fluent +public final class CustomizableConnectorUiConfig implements JsonSerializable { + /* + * Gets or sets custom connector id. optional field. + */ + private String id; + + /* + * Gets or sets the connector blade title. + */ + private String title; + + /* + * Gets or sets the connector publisher name. + */ + private String publisher; + + /* + * Gets or sets the connector description in markdown format. + */ + private String descriptionMarkdown; + + /* + * Gets or sets the graph queries to show the current data volume over time. + */ + private List graphQueries; + + /* + * Gets or sets the data types to check for last data received. + */ + private List dataTypes; + + /* + * Gets or sets the way the connector checks whether the connector is connected. + */ + private List connectivityCriteria; + + /* + * The exposure status of the connector to the customers. + */ + private ConnectorDefinitionsAvailability availability; + + /* + * The required Permissions for the connector. + */ + private ConnectorDefinitionsPermissions permissions; + + /* + * Gets or sets the instruction steps to enable the connector. + */ + private List instructionSteps; + + /* + * Gets or sets the connector logo to be used when displaying the connector within Azure Sentinel's connector's + * gallery. + * The logo value should be in SVG format. + */ + private String logo; + + /* + * Gets or sets a value indicating whether to use 'OR'(SOME) or 'AND' between ConnectivityCriteria items. + */ + private Boolean isConnectivityCriteriasMatchSome; + + /** + * Creates an instance of CustomizableConnectorUiConfig class. + */ + public CustomizableConnectorUiConfig() { + } + + /** + * Get the id property: Gets or sets custom connector id. optional field. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Gets or sets custom connector id. optional field. + * + * @param id the id value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withId(String id) { + this.id = id; + return this; + } + + /** + * Get the title property: Gets or sets the connector blade title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Gets or sets the connector blade title. + * + * @param title the title value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the publisher property: Gets or sets the connector publisher name. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Gets or sets the connector publisher name. + * + * @param publisher the publisher value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the descriptionMarkdown property: Gets or sets the connector description in markdown format. + * + * @return the descriptionMarkdown value. + */ + public String descriptionMarkdown() { + return this.descriptionMarkdown; + } + + /** + * Set the descriptionMarkdown property: Gets or sets the connector description in markdown format. + * + * @param descriptionMarkdown the descriptionMarkdown value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withDescriptionMarkdown(String descriptionMarkdown) { + this.descriptionMarkdown = descriptionMarkdown; + return this; + } + + /** + * Get the graphQueries property: Gets or sets the graph queries to show the current data volume over time. + * + * @return the graphQueries value. + */ + public List graphQueries() { + return this.graphQueries; + } + + /** + * Set the graphQueries property: Gets or sets the graph queries to show the current data volume over time. + * + * @param graphQueries the graphQueries value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withGraphQueries(List graphQueries) { + this.graphQueries = graphQueries; + return this; + } + + /** + * Get the dataTypes property: Gets or sets the data types to check for last data received. + * + * @return the dataTypes value. + */ + public List dataTypes() { + return this.dataTypes; + } + + /** + * Set the dataTypes property: Gets or sets the data types to check for last data received. + * + * @param dataTypes the dataTypes value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withDataTypes(List dataTypes) { + this.dataTypes = dataTypes; + return this; + } + + /** + * Get the connectivityCriteria property: Gets or sets the way the connector checks whether the connector is + * connected. + * + * @return the connectivityCriteria value. + */ + public List connectivityCriteria() { + return this.connectivityCriteria; + } + + /** + * Set the connectivityCriteria property: Gets or sets the way the connector checks whether the connector is + * connected. + * + * @param connectivityCriteria the connectivityCriteria value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withConnectivityCriteria(List connectivityCriteria) { + this.connectivityCriteria = connectivityCriteria; + return this; + } + + /** + * Get the availability property: The exposure status of the connector to the customers. + * + * @return the availability value. + */ + public ConnectorDefinitionsAvailability availability() { + return this.availability; + } + + /** + * Set the availability property: The exposure status of the connector to the customers. + * + * @param availability the availability value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withAvailability(ConnectorDefinitionsAvailability availability) { + this.availability = availability; + return this; + } + + /** + * Get the permissions property: The required Permissions for the connector. + * + * @return the permissions value. + */ + public ConnectorDefinitionsPermissions permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The required Permissions for the connector. + * + * @param permissions the permissions value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withPermissions(ConnectorDefinitionsPermissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the instructionSteps property: Gets or sets the instruction steps to enable the connector. + * + * @return the instructionSteps value. + */ + public List instructionSteps() { + return this.instructionSteps; + } + + /** + * Set the instructionSteps property: Gets or sets the instruction steps to enable the connector. + * + * @param instructionSteps the instructionSteps value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withInstructionSteps(List instructionSteps) { + this.instructionSteps = instructionSteps; + return this; + } + + /** + * Get the logo property: Gets or sets the connector logo to be used when displaying the connector within Azure + * Sentinel's connector's gallery. + * The logo value should be in SVG format. + * + * @return the logo value. + */ + public String logo() { + return this.logo; + } + + /** + * Set the logo property: Gets or sets the connector logo to be used when displaying the connector within Azure + * Sentinel's connector's gallery. + * The logo value should be in SVG format. + * + * @param logo the logo value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig withLogo(String logo) { + this.logo = logo; + return this; + } + + /** + * Get the isConnectivityCriteriasMatchSome property: Gets or sets a value indicating whether to use 'OR'(SOME) or + * 'AND' between ConnectivityCriteria items. + * + * @return the isConnectivityCriteriasMatchSome value. + */ + public Boolean isConnectivityCriteriasMatchSome() { + return this.isConnectivityCriteriasMatchSome; + } + + /** + * Set the isConnectivityCriteriasMatchSome property: Gets or sets a value indicating whether to use 'OR'(SOME) or + * 'AND' between ConnectivityCriteria items. + * + * @param isConnectivityCriteriasMatchSome the isConnectivityCriteriasMatchSome value to set. + * @return the CustomizableConnectorUiConfig object itself. + */ + public CustomizableConnectorUiConfig + withIsConnectivityCriteriasMatchSome(Boolean isConnectivityCriteriasMatchSome) { + this.isConnectivityCriteriasMatchSome = isConnectivityCriteriasMatchSome; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("descriptionMarkdown", this.descriptionMarkdown); + jsonWriter.writeArrayField("graphQueries", this.graphQueries, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dataTypes", this.dataTypes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("connectivityCriteria", this.connectivityCriteria, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("permissions", this.permissions); + jsonWriter.writeArrayField("instructionSteps", this.instructionSteps, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("availability", this.availability); + jsonWriter.writeStringField("logo", this.logo); + jsonWriter.writeBooleanField("isConnectivityCriteriasMatchSome", this.isConnectivityCriteriasMatchSome); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomizableConnectorUiConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomizableConnectorUiConfig if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomizableConnectorUiConfig. + */ + public static CustomizableConnectorUiConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomizableConnectorUiConfig deserializedCustomizableConnectorUiConfig + = new CustomizableConnectorUiConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.title = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.publisher = reader.getString(); + } else if ("descriptionMarkdown".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.descriptionMarkdown = reader.getString(); + } else if ("graphQueries".equals(fieldName)) { + List graphQueries = reader.readArray(reader1 -> GraphQuery.fromJson(reader1)); + deserializedCustomizableConnectorUiConfig.graphQueries = graphQueries; + } else if ("dataTypes".equals(fieldName)) { + List dataTypes + = reader.readArray(reader1 -> ConnectorDataType.fromJson(reader1)); + deserializedCustomizableConnectorUiConfig.dataTypes = dataTypes; + } else if ("connectivityCriteria".equals(fieldName)) { + List connectivityCriteria + = reader.readArray(reader1 -> ConnectivityCriterion.fromJson(reader1)); + deserializedCustomizableConnectorUiConfig.connectivityCriteria = connectivityCriteria; + } else if ("permissions".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.permissions + = ConnectorDefinitionsPermissions.fromJson(reader); + } else if ("instructionSteps".equals(fieldName)) { + List instructionSteps + = reader.readArray(reader1 -> InstructionStep.fromJson(reader1)); + deserializedCustomizableConnectorUiConfig.instructionSteps = instructionSteps; + } else if ("id".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.id = reader.getString(); + } else if ("availability".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.availability + = ConnectorDefinitionsAvailability.fromJson(reader); + } else if ("logo".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.logo = reader.getString(); + } else if ("isConnectivityCriteriasMatchSome".equals(fieldName)) { + deserializedCustomizableConnectorUiConfig.isConnectivityCriteriasMatchSome + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomizableConnectorUiConfig; + }); + } +} 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..c45e9ee601b8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Customs permissions required for the connector. + */ +@Fluent +public class Customs extends CustomsPermission { + /** + * Creates an instance of Customs class. + */ + public Customs() { + } + + /** + * {@inheritDoc} + */ + @Override + public Customs withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public Customs withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("description", description()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Customs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Customs if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Customs. + */ + public static Customs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Customs deserializedCustoms = new Customs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustoms.withName(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedCustoms.withDescription(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustoms; + }); + } +} 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..2638e2a4ead0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/CustomsPermission.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Customs permissions required for the connector. + */ +@Fluent +public class CustomsPermission implements JsonSerializable { + /* + * Customs permissions name + */ + private String name; + + /* + * Customs permissions description + */ + private String description; + + /** + * Creates an instance of CustomsPermission class. + */ + public CustomsPermission() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomsPermission from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomsPermission if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomsPermission. + */ + public static CustomsPermission fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomsPermission deserializedCustomsPermission = new CustomsPermission(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomsPermission.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedCustomsPermission.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomsPermission; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DCRConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DCRConfiguration.java new file mode 100644 index 000000000000..11701efa004c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DCRConfiguration.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The configuration of the destination of the data. + */ +@Fluent +public final class DCRConfiguration implements JsonSerializable { + /* + * Represents the data collection ingestion endpoint in log analytics. + */ + private String dataCollectionEndpoint; + + /* + * The data collection rule immutable id, the rule defines the transformation and data destination. + */ + private String dataCollectionRuleImmutableId; + + /* + * The stream we are sending the data to. + */ + private String streamName; + + /** + * Creates an instance of DCRConfiguration class. + */ + public DCRConfiguration() { + } + + /** + * Get the dataCollectionEndpoint property: Represents the data collection ingestion endpoint in log analytics. + * + * @return the dataCollectionEndpoint value. + */ + public String dataCollectionEndpoint() { + return this.dataCollectionEndpoint; + } + + /** + * Set the dataCollectionEndpoint property: Represents the data collection ingestion endpoint in log analytics. + * + * @param dataCollectionEndpoint the dataCollectionEndpoint value to set. + * @return the DCRConfiguration object itself. + */ + public DCRConfiguration withDataCollectionEndpoint(String dataCollectionEndpoint) { + this.dataCollectionEndpoint = dataCollectionEndpoint; + return this; + } + + /** + * Get the dataCollectionRuleImmutableId property: The data collection rule immutable id, the rule defines the + * transformation and data destination. + * + * @return the dataCollectionRuleImmutableId value. + */ + public String dataCollectionRuleImmutableId() { + return this.dataCollectionRuleImmutableId; + } + + /** + * Set the dataCollectionRuleImmutableId property: The data collection rule immutable id, the rule defines the + * transformation and data destination. + * + * @param dataCollectionRuleImmutableId the dataCollectionRuleImmutableId value to set. + * @return the DCRConfiguration object itself. + */ + public DCRConfiguration withDataCollectionRuleImmutableId(String dataCollectionRuleImmutableId) { + this.dataCollectionRuleImmutableId = dataCollectionRuleImmutableId; + return this; + } + + /** + * Get the streamName property: The stream we are sending the data to. + * + * @return the streamName value. + */ + public String streamName() { + return this.streamName; + } + + /** + * Set the streamName property: The stream we are sending the data to. + * + * @param streamName the streamName value to set. + * @return the DCRConfiguration object itself. + */ + public DCRConfiguration withStreamName(String streamName) { + this.streamName = streamName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataCollectionEndpoint", this.dataCollectionEndpoint); + jsonWriter.writeStringField("dataCollectionRuleImmutableId", this.dataCollectionRuleImmutableId); + jsonWriter.writeStringField("streamName", this.streamName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DCRConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DCRConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DCRConfiguration. + */ + public static DCRConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DCRConfiguration deserializedDCRConfiguration = new DCRConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataCollectionEndpoint".equals(fieldName)) { + deserializedDCRConfiguration.dataCollectionEndpoint = reader.getString(); + } else if ("dataCollectionRuleImmutableId".equals(fieldName)) { + deserializedDCRConfiguration.dataCollectionRuleImmutableId = reader.getString(); + } else if ("streamName".equals(fieldName)) { + deserializedDCRConfiguration.streamName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDCRConfiguration; + }); + } +} 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 index 867136cff206..415984582f08 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -32,6 +32,15 @@ public interface DataConnector { */ String type(); + /** + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + DataConnectorKind kind(); + /** * Gets the etag property: Etag of the azure resource. * @@ -46,13 +55,6 @@ public interface DataConnector { */ SystemData systemData(); - /** - * Gets the kind property: The data connector kind. - * - * @return the kind value. - */ - DataConnectorKind kind(); - /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner object. * 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..7e1309c9381d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes the state of user's authorization for a connector kind. + */ +public final class DataConnectorAuthorizationState extends ExpandableStringEnum { + /** + * Valid. + */ + public static final DataConnectorAuthorizationState VALID = fromString("Valid"); + + /** + * Invalid. + */ + public static final DataConnectorAuthorizationState INVALID = fromString("Invalid"); + + /** + * Creates a new instance of DataConnectorAuthorizationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataConnectorAuthorizationState() { + } + + /** + * Creates or finds a DataConnectorAuthorizationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectorAuthorizationState. + */ + public static DataConnectorAuthorizationState fromString(String name) { + return fromString(name, DataConnectorAuthorizationState.class); + } + + /** + * Gets known DataConnectorAuthorizationState values. + * + * @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..3cb472800bd7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorConnectBody.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents Codeless API Polling data connector. + */ +@Fluent +public final class DataConnectorConnectBody implements JsonSerializable { + /* + * The authentication kind used to poll the data + */ + private ConnectAuthKind kind; + + /* + * The API key of the audit server. + */ + private String apiKey; + + /* + * Used in v2 logs connector. Represents the data collection ingestion endpoint in log analytics. + */ + private String dataCollectionEndpoint; + + /* + * Used in v2 logs connector. The data collection rule immutable id, the rule defines the transformation and data + * destination. + */ + private String dataCollectionRuleImmutableId; + + /* + * Used in v2 logs connector. The stream we are sending the data to, this is the name of the streamDeclarations + * defined in the DCR. + */ + private String outputStream; + + /* + * The client secret of the OAuth 2.0 application. + */ + private String clientSecret; + + /* + * The client id of the OAuth 2.0 application. + */ + private String clientId; + + /* + * The authorization code used in OAuth 2.0 code flow to issue a token. + */ + private String authorizationCode; + + /* + * The user name in the audit log server. + */ + private String userName; + + /* + * The user password in the audit log server. + */ + private String password; + + /* + * The requestConfigUserInputValues property. + */ + private List requestConfigUserInputValues; + + /** + * Creates an instance of DataConnectorConnectBody class. + */ + public DataConnectorConnectBody() { + } + + /** + * 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 dataCollectionEndpoint property: Used in v2 logs connector. Represents the data collection ingestion + * endpoint in log analytics. + * + * @return the dataCollectionEndpoint value. + */ + public String dataCollectionEndpoint() { + return this.dataCollectionEndpoint; + } + + /** + * Set the dataCollectionEndpoint property: Used in v2 logs connector. Represents the data collection ingestion + * endpoint in log analytics. + * + * @param dataCollectionEndpoint the dataCollectionEndpoint value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withDataCollectionEndpoint(String dataCollectionEndpoint) { + this.dataCollectionEndpoint = dataCollectionEndpoint; + return this; + } + + /** + * Get the dataCollectionRuleImmutableId property: Used in v2 logs connector. The data collection rule immutable id, + * the rule defines the transformation and data destination. + * + * @return the dataCollectionRuleImmutableId value. + */ + public String dataCollectionRuleImmutableId() { + return this.dataCollectionRuleImmutableId; + } + + /** + * Set the dataCollectionRuleImmutableId property: Used in v2 logs connector. The data collection rule immutable id, + * the rule defines the transformation and data destination. + * + * @param dataCollectionRuleImmutableId the dataCollectionRuleImmutableId value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withDataCollectionRuleImmutableId(String dataCollectionRuleImmutableId) { + this.dataCollectionRuleImmutableId = dataCollectionRuleImmutableId; + return this; + } + + /** + * Get the outputStream property: Used in v2 logs connector. The stream we are sending the data to, this is the name + * of the streamDeclarations defined in the DCR. + * + * @return the outputStream value. + */ + public String outputStream() { + return this.outputStream; + } + + /** + * Set the outputStream property: Used in v2 logs connector. The stream we are sending the data to, this is the name + * of the streamDeclarations defined in the DCR. + * + * @param outputStream the outputStream value to set. + * @return the DataConnectorConnectBody object itself. + */ + public DataConnectorConnectBody withOutputStream(String outputStream) { + this.outputStream = outputStream; + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("apiKey", this.apiKey); + jsonWriter.writeStringField("dataCollectionEndpoint", this.dataCollectionEndpoint); + jsonWriter.writeStringField("dataCollectionRuleImmutableId", this.dataCollectionRuleImmutableId); + jsonWriter.writeStringField("outputStream", this.outputStream); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("authorizationCode", this.authorizationCode); + jsonWriter.writeStringField("userName", this.userName); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeArrayField("requestConfigUserInputValues", this.requestConfigUserInputValues, + (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorConnectBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorConnectBody if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataConnectorConnectBody. + */ + public static DataConnectorConnectBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorConnectBody deserializedDataConnectorConnectBody = new DataConnectorConnectBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedDataConnectorConnectBody.kind = ConnectAuthKind.fromString(reader.getString()); + } else if ("apiKey".equals(fieldName)) { + deserializedDataConnectorConnectBody.apiKey = reader.getString(); + } else if ("dataCollectionEndpoint".equals(fieldName)) { + deserializedDataConnectorConnectBody.dataCollectionEndpoint = reader.getString(); + } else if ("dataCollectionRuleImmutableId".equals(fieldName)) { + deserializedDataConnectorConnectBody.dataCollectionRuleImmutableId = reader.getString(); + } else if ("outputStream".equals(fieldName)) { + deserializedDataConnectorConnectBody.outputStream = reader.getString(); + } else if ("clientSecret".equals(fieldName)) { + deserializedDataConnectorConnectBody.clientSecret = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedDataConnectorConnectBody.clientId = reader.getString(); + } else if ("authorizationCode".equals(fieldName)) { + deserializedDataConnectorConnectBody.authorizationCode = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedDataConnectorConnectBody.userName = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedDataConnectorConnectBody.password = reader.getString(); + } else if ("requestConfigUserInputValues".equals(fieldName)) { + List requestConfigUserInputValues = reader.readArray(reader1 -> reader1.readUntyped()); + deserializedDataConnectorConnectBody.requestConfigUserInputValues = requestConfigUserInputValues; + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorConnectBody; + }); + } +} 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 index ebdff8a38efb..4d685a8eccf6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -47,14 +47,6 @@ public DataConnectorDataTypeCommon withState(DataTypeState state) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -71,6 +63,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DataConnectorDataTypeCommon if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the DataConnectorDataTypeCommon. */ public static DataConnectorDataTypeCommon fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinition.java new file mode 100644 index 000000000000..3ebe17b0634f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinition.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; + +/** + * An immutable client-side representation of DataConnectorDefinition. + */ +public interface DataConnectorDefinition { + /** + * 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 kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + DataConnectorDefinitionKind kind(); + + /** + * 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.DataConnectorDefinitionInner object. + * + * @return the inner object. + */ + DataConnectorDefinitionInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionKind.java new file mode 100644 index 000000000000..2787472245e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the data connector definitions. + */ +public final class DataConnectorDefinitionKind extends ExpandableStringEnum { + /** + * Customizable. + */ + public static final DataConnectorDefinitionKind CUSTOMIZABLE = fromString("Customizable"); + + /** + * Creates a new instance of DataConnectorDefinitionKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataConnectorDefinitionKind() { + } + + /** + * Creates or finds a DataConnectorDefinitionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectorDefinitionKind. + */ + public static DataConnectorDefinitionKind fromString(String name) { + return fromString(name, DataConnectorDefinitionKind.class); + } + + /** + * Gets known DataConnectorDefinitionKind values. + * + * @return known DataConnectorDefinitionKind values. + */ + public static Collection values() { + return values(DataConnectorDefinitionKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitions.java new file mode 100644 index 000000000000..eab43a2d8a52 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitions.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.DataConnectorDefinitionInner; + +/** + * Resource collection API of DataConnectorDefinitions. + */ +public interface DataConnectorDefinitions { + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context); + + /** + * Gets a data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 data connector definition. + */ + DataConnectorDefinition get(String resourceGroupName, String workspaceName, String dataConnectorDefinitionName); + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput, Context context); + + /** + * Creates or updates the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition name. + * @param connectorDefinitionInput The data connector definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure resource, which encapsulate the entire info requires to display a data connector page in Azure + * portal, + * and the info required to define data connections. + */ + DataConnectorDefinition createOrUpdate(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, DataConnectorDefinitionInner connectorDefinitionInput); + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String dataConnectorDefinitionName, Context context); + + /** + * Delete the data connector definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param dataConnectorDefinitionName The data connector definition 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 dataConnectorDefinitionName); + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all data connector definitions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 connector definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} 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 index db1f66cb50f9..cb148a39aa0d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,47 +12,134 @@ */ public final class DataConnectorKind extends ExpandableStringEnum { /** - * Static value AzureActiveDirectory for DataConnectorKind. + * AzureActiveDirectory. */ public static final DataConnectorKind AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); /** - * Static value AzureSecurityCenter for DataConnectorKind. + * AzureSecurityCenter. */ public static final DataConnectorKind AZURE_SECURITY_CENTER = fromString("AzureSecurityCenter"); /** - * Static value MicrosoftCloudAppSecurity for DataConnectorKind. + * MicrosoftCloudAppSecurity. */ public static final DataConnectorKind MICROSOFT_CLOUD_APP_SECURITY = fromString("MicrosoftCloudAppSecurity"); /** - * Static value ThreatIntelligence for DataConnectorKind. + * ThreatIntelligence. */ public static final DataConnectorKind THREAT_INTELLIGENCE = fromString("ThreatIntelligence"); /** - * Static value Office365 for DataConnectorKind. + * ThreatIntelligenceTaxii. + */ + public static final DataConnectorKind THREAT_INTELLIGENCE_TAXII = fromString("ThreatIntelligenceTaxii"); + + /** + * Office365. */ public static final DataConnectorKind OFFICE365 = fromString("Office365"); /** - * Static value AmazonWebServicesCloudTrail for DataConnectorKind. + * OfficeATP. + */ + public static final DataConnectorKind OFFICE_ATP = fromString("OfficeATP"); + + /** + * OfficeIRM. + */ + public static final DataConnectorKind OFFICE_IRM = fromString("OfficeIRM"); + + /** + * Office365Project. + */ + public static final DataConnectorKind OFFICE365PROJECT = fromString("Office365Project"); + + /** + * MicrosoftPurviewInformationProtection. + */ + public static final DataConnectorKind MICROSOFT_PURVIEW_INFORMATION_PROTECTION + = fromString("MicrosoftPurviewInformationProtection"); + + /** + * OfficePowerBI. + */ + public static final DataConnectorKind OFFICE_POWER_BI = fromString("OfficePowerBI"); + + /** + * AmazonWebServicesCloudTrail. */ public static final DataConnectorKind AMAZON_WEB_SERVICES_CLOUD_TRAIL = fromString("AmazonWebServicesCloudTrail"); /** - * Static value AzureAdvancedThreatProtection for DataConnectorKind. + * AmazonWebServicesS3. + */ + public static final DataConnectorKind AMAZON_WEB_SERVICES_S3 = fromString("AmazonWebServicesS3"); + + /** + * AzureAdvancedThreatProtection. */ public static final DataConnectorKind AZURE_ADVANCED_THREAT_PROTECTION = fromString("AzureAdvancedThreatProtection"); /** - * Static value MicrosoftDefenderAdvancedThreatProtection for DataConnectorKind. + * MicrosoftDefenderAdvancedThreatProtection. */ public static final DataConnectorKind MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION = fromString("MicrosoftDefenderAdvancedThreatProtection"); + /** + * Dynamics365. + */ + public static final DataConnectorKind DYNAMICS365 = fromString("Dynamics365"); + + /** + * MicrosoftThreatProtection. + */ + public static final DataConnectorKind MICROSOFT_THREAT_PROTECTION = fromString("MicrosoftThreatProtection"); + + /** + * MicrosoftThreatIntelligence. + */ + public static final DataConnectorKind MICROSOFT_THREAT_INTELLIGENCE = fromString("MicrosoftThreatIntelligence"); + + /** + * PremiumMicrosoftDefenderForThreatIntelligence. + */ + public static final DataConnectorKind PREMIUM_MICROSOFT_DEFENDER_FOR_THREAT_INTELLIGENCE + = fromString("PremiumMicrosoftDefenderForThreatIntelligence"); + + /** + * GenericUI. + */ + public static final DataConnectorKind GENERIC_UI = fromString("GenericUI"); + + /** + * APIPolling. + */ + public static final DataConnectorKind APIPOLLING = fromString("APIPolling"); + + /** + * IOT. + */ + public static final DataConnectorKind IOT = fromString("IOT"); + + /** + * GCP. + */ + public static final DataConnectorKind GCP = fromString("GCP"); + + /** + * RestApiPoller. + */ + public static final DataConnectorKind REST_API_POLLER = fromString("RestApiPoller"); + + /** + * PurviewAudit. + */ + public static final DataConnectorKind PURVIEW_AUDIT = fromString("PurviewAudit"); + /** * Creates a new instance of DataConnectorKind value. * 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..64ba9da8dd26 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorLicenseState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes the state of user's license for a connector kind. + */ +public final class DataConnectorLicenseState extends ExpandableStringEnum { + /** + * Valid. + */ + public static final DataConnectorLicenseState VALID = fromString("Valid"); + + /** + * Invalid. + */ + public static final DataConnectorLicenseState INVALID = fromString("Invalid"); + + /** + * Unknown. + */ + public static final DataConnectorLicenseState UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of DataConnectorLicenseState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataConnectorLicenseState() { + } + + /** + * Creates or finds a DataConnectorLicenseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataConnectorLicenseState. + */ + public static DataConnectorLicenseState fromString(String name) { + return fromString(name, DataConnectorLicenseState.class); + } + + /** + * Gets known DataConnectorLicenseState values. + * + * @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/DataConnectorRequirementsState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java new file mode 100644 index 000000000000..54cf54e3f54e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..a04ea366b1ec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorTenantId.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties data connector on tenant level. + */ +@Fluent +public class DataConnectorTenantId implements JsonSerializable { + /* + * The tenant id to connect to, and get the data from. + */ + private String tenantId; + + /** + * Creates an instance of DataConnectorTenantId class. + */ + public DataConnectorTenantId() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorTenantId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorTenantId if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataConnectorTenantId. + */ + public static DataConnectorTenantId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorTenantId deserializedDataConnectorTenantId = new DataConnectorTenantId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedDataConnectorTenantId.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorTenantId; + }); + } +} 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 index bf6335049a45..926a492073b9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -47,17 +47,6 @@ public DataConnectorWithAlertsProperties withDataTypes(AlertsDataTypeOfDataConne return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dataTypes() != null) { - dataTypes().validate(); - } - } - /** * {@inheritDoc} */ 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 index da8a6da80a6f..2c8c3c05a40f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,36 +13,11 @@ * 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -57,7 +32,7 @@ Response getWithResponse(String resourceGroupName, String workspa * 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 workspaceName The name of the monitor 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. @@ -70,7 +45,7 @@ Response getWithResponse(String resourceGroupName, String workspa * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. * @param context The context to associate with this operation. @@ -86,7 +61,7 @@ Response createOrUpdateWithResponse(String resourceGroupName, Str * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param dataConnector The data connector. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -101,7 +76,7 @@ DataConnector createOrUpdate(String resourceGroupName, String workspaceName, Str * 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 workspaceName The name of the monitor workspace. * @param dataConnectorId Connector ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -116,11 +91,93 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * 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 workspaceName The name of the monitor 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); + + /** + * Gets all data connectors. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, 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 monitor workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The content of the action 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 the {@link Response}. + */ + Response connectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody, 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 monitor workspace. + * @param dataConnectorId Connector ID. + * @param connectBody The content of the action 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. + */ + void connect(String resourceGroupName, String workspaceName, String dataConnectorId, + DataConnectorConnectBody connectBody); + + /** + * Disconnect a data connector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 {@link Response}. + */ + Response disconnectWithResponse(String resourceGroupName, String workspaceName, String dataConnectorId, + 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 monitor 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); } 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..fc3f30948737 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirements.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Data connector requirements properties. + */ +@Immutable +public class DataConnectorsCheckRequirements implements JsonSerializable { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.fromString("DataConnectorsCheckRequirements"); + + /** + * Creates an instance of DataConnectorsCheckRequirements class. + */ + public DataConnectorsCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + public DataConnectorKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataConnectorsCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataConnectorsCheckRequirements if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataConnectorsCheckRequirements. + */ + public static DataConnectorsCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("AzureActiveDirectory".equals(discriminatorValue)) { + return AADCheckRequirements.fromJson(readerToUse.reset()); + } else if ("AzureAdvancedThreatProtection".equals(discriminatorValue)) { + return AATPCheckRequirements.fromJson(readerToUse.reset()); + } else if ("AzureSecurityCenter".equals(discriminatorValue)) { + return ASCCheckRequirements.fromJson(readerToUse.reset()); + } else if ("AmazonWebServicesCloudTrail".equals(discriminatorValue)) { + return AwsCloudTrailCheckRequirements.fromJson(readerToUse.reset()); + } else if ("AmazonWebServicesS3".equals(discriminatorValue)) { + return AwsS3CheckRequirements.fromJson(readerToUse.reset()); + } else if ("Dynamics365".equals(discriminatorValue)) { + return Dynamics365CheckRequirements.fromJson(readerToUse.reset()); + } else if ("MicrosoftCloudAppSecurity".equals(discriminatorValue)) { + return MCASCheckRequirements.fromJson(readerToUse.reset()); + } else if ("MicrosoftDefenderAdvancedThreatProtection".equals(discriminatorValue)) { + return MDATPCheckRequirements.fromJson(readerToUse.reset()); + } else if ("MicrosoftThreatIntelligence".equals(discriminatorValue)) { + return MSTICheckRequirements.fromJson(readerToUse.reset()); + } else if ("MicrosoftThreatProtection".equals(discriminatorValue)) { + return MtpCheckRequirements.fromJson(readerToUse.reset()); + } else if ("OfficeATP".equals(discriminatorValue)) { + return OfficeATPCheckRequirements.fromJson(readerToUse.reset()); + } else if ("OfficeIRM".equals(discriminatorValue)) { + return OfficeIRMCheckRequirements.fromJson(readerToUse.reset()); + } else if ("MicrosoftPurviewInformationProtection".equals(discriminatorValue)) { + return MicrosoftPurviewInformationProtectionCheckRequirements.fromJson(readerToUse.reset()); + } else if ("Office365Project".equals(discriminatorValue)) { + return Office365ProjectCheckRequirements.fromJson(readerToUse.reset()); + } else if ("OfficePowerBI".equals(discriminatorValue)) { + return OfficePowerBICheckRequirements.fromJson(readerToUse.reset()); + } else if ("PurviewAudit".equals(discriminatorValue)) { + return PurviewAuditCheckRequirements.fromJson(readerToUse.reset()); + } else if ("ThreatIntelligence".equals(discriminatorValue)) { + return TICheckRequirements.fromJson(readerToUse.reset()); + } else if ("ThreatIntelligenceTaxii".equals(discriminatorValue)) { + return TiTaxiiCheckRequirements.fromJson(readerToUse.reset()); + } else if ("IOT".equals(discriminatorValue)) { + return IoTCheckRequirements.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataConnectorsCheckRequirements fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataConnectorsCheckRequirements deserializedDataConnectorsCheckRequirements + = new DataConnectorsCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedDataConnectorsCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataConnectorsCheckRequirements; + }); + } +} 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..51f772380d90 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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. + * @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 along with {@link Response}. + */ + Response postWithResponse(String resourceGroupName, String workspaceName, + DataConnectorsCheckRequirements dataConnectorsCheckRequirements, 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 com.azure.core.management.exception.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); +} 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..1f7c82f7261a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeDefinitions.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The data type definition. + */ +@Immutable +public final class DataTypeDefinitions implements JsonSerializable { + /* + * The data type name + */ + private String dataType; + + /** + * Creates an instance of DataTypeDefinitions class. + */ + private DataTypeDefinitions() { + } + + /** + * Get the dataType property: The data type name. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataType", this.dataType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTypeDefinitions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTypeDefinitions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataTypeDefinitions. + */ + public static DataTypeDefinitions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTypeDefinitions deserializedDataTypeDefinitions = new DataTypeDefinitions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataType".equals(fieldName)) { + deserializedDataTypeDefinitions.dataType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTypeDefinitions; + }); + } +} 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 index 89690312ef19..d50f436c75ff 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,12 +12,12 @@ */ public final class DataTypeState extends ExpandableStringEnum { /** - * Static value Enabled for DataTypeState. + * Enabled. */ public static final DataTypeState ENABLED = fromString("Enabled"); /** - * Static value Disabled for DataTypeState. + * Disabled. */ public static final DataTypeState DISABLED = fromString("Disabled"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeleteStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeleteStatus.java new file mode 100644 index 000000000000..fe80610def6a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeleteStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether the file was deleted from the storage account. + */ +public final class DeleteStatus extends ExpandableStringEnum { + /** + * The file was deleted. + */ + public static final DeleteStatus DELETED = fromString("Deleted"); + + /** + * The file was not deleted. + */ + public static final DeleteStatus NOT_DELETED = fromString("NotDeleted"); + + /** + * Unspecified. + */ + public static final DeleteStatus UNSPECIFIED = fromString("Unspecified"); + + /** + * Creates a new instance of DeleteStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteStatus() { + } + + /** + * Creates or finds a DeleteStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteStatus. + */ + public static DeleteStatus fromString(String name) { + return fromString(name, DeleteStatus.class); + } + + /** + * Gets known DeleteStatus values. + * + * @return known DeleteStatus values. + */ + public static Collection values() { + return values(DeleteStatus.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 index 22ec2c31b28f..227870ea84ad 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,27 +9,27 @@ */ public enum DeliveryAction { /** - * Enum value Unknown. + * Unknown. */ UNKNOWN("Unknown"), /** - * Enum value DeliveredAsSpam. + * DeliveredAsSpam. */ DELIVERED_AS_SPAM("DeliveredAsSpam"), /** - * Enum value Delivered. + * Delivered. */ DELIVERED("Delivered"), /** - * Enum value Blocked. + * Blocked. */ BLOCKED("Blocked"), /** - * Enum value Replaced. + * Replaced. */ REPLACED("Replaced"); 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 index 788a60aa7510..8e5de0fa3c3c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,47 +9,47 @@ */ public enum DeliveryLocation { /** - * Enum value Unknown. + * Unknown. */ UNKNOWN("Unknown"), /** - * Enum value Inbox. + * Inbox. */ INBOX("Inbox"), /** - * Enum value JunkFolder. + * JunkFolder. */ JUNK_FOLDER("JunkFolder"), /** - * Enum value DeletedFolder. + * DeletedFolder. */ DELETED_FOLDER("DeletedFolder"), /** - * Enum value Quarantine. + * Quarantine. */ QUARANTINE("Quarantine"), /** - * Enum value External. + * External. */ EXTERNAL("External"), /** - * Enum value Failed. + * Failed. */ FAILED("Failed"), /** - * Enum value Dropped. + * Dropped. */ DROPPED("Dropped"), /** - * Enum value Forwarded. + * Forwarded. */ FORWARDED("Forwarded"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Deployment.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Deployment.java new file mode 100644 index 000000000000..a0d5c6cf3d1e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Deployment.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Description about a deployment. + */ +@Immutable +public final class Deployment implements JsonSerializable { + /* + * Deployment identifier. + */ + private String deploymentId; + + /* + * Current status of the deployment. + */ + private DeploymentState deploymentState; + + /* + * The outcome of the deployment. + */ + private DeploymentResult deploymentResult; + + /* + * The time when the deployment finished. + */ + private OffsetDateTime deploymentTime; + + /* + * Url to access repository action logs. + */ + private String deploymentLogsUrl; + + /** + * Creates an instance of Deployment class. + */ + private Deployment() { + } + + /** + * Get the deploymentId property: Deployment identifier. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Get the deploymentState property: Current status of the deployment. + * + * @return the deploymentState value. + */ + public DeploymentState deploymentState() { + return this.deploymentState; + } + + /** + * Get the deploymentResult property: The outcome of the deployment. + * + * @return the deploymentResult value. + */ + public DeploymentResult deploymentResult() { + return this.deploymentResult; + } + + /** + * Get the deploymentTime property: The time when the deployment finished. + * + * @return the deploymentTime value. + */ + public OffsetDateTime deploymentTime() { + return this.deploymentTime; + } + + /** + * Get the deploymentLogsUrl property: Url to access repository action logs. + * + * @return the deploymentLogsUrl value. + */ + public String deploymentLogsUrl() { + return this.deploymentLogsUrl; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + jsonWriter.writeStringField("deploymentState", + this.deploymentState == null ? null : this.deploymentState.toString()); + jsonWriter.writeStringField("deploymentResult", + this.deploymentResult == null ? null : this.deploymentResult.toString()); + jsonWriter.writeStringField("deploymentTime", + this.deploymentTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deploymentTime)); + jsonWriter.writeStringField("deploymentLogsUrl", this.deploymentLogsUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Deployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Deployment if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Deployment. + */ + public static Deployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Deployment deserializedDeployment = new Deployment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentId".equals(fieldName)) { + deserializedDeployment.deploymentId = reader.getString(); + } else if ("deploymentState".equals(fieldName)) { + deserializedDeployment.deploymentState = DeploymentState.fromString(reader.getString()); + } else if ("deploymentResult".equals(fieldName)) { + deserializedDeployment.deploymentResult = DeploymentResult.fromString(reader.getString()); + } else if ("deploymentTime".equals(fieldName)) { + deserializedDeployment.deploymentTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deploymentLogsUrl".equals(fieldName)) { + deserializedDeployment.deploymentLogsUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeployment; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentFetchStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentFetchStatus.java new file mode 100644 index 000000000000..aed4ceb20037 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentFetchStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status while trying to fetch the deployment information. + */ +public final class DeploymentFetchStatus extends ExpandableStringEnum { + /** + * Success. + */ + public static final DeploymentFetchStatus SUCCESS = fromString("Success"); + + /** + * Unauthorized. + */ + public static final DeploymentFetchStatus UNAUTHORIZED = fromString("Unauthorized"); + + /** + * NotFound. + */ + public static final DeploymentFetchStatus NOT_FOUND = fromString("NotFound"); + + /** + * Creates a new instance of DeploymentFetchStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentFetchStatus() { + } + + /** + * Creates or finds a DeploymentFetchStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentFetchStatus. + */ + public static DeploymentFetchStatus fromString(String name) { + return fromString(name, DeploymentFetchStatus.class); + } + + /** + * Gets known DeploymentFetchStatus values. + * + * @return known DeploymentFetchStatus values. + */ + public static Collection values() { + return values(DeploymentFetchStatus.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentInfo.java new file mode 100644 index 000000000000..a410c56c6c4f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentInfo.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information regarding a deployment. + */ +@Immutable +public final class DeploymentInfo implements JsonSerializable { + /* + * Status while fetching the last deployment. + */ + private DeploymentFetchStatus deploymentFetchStatus; + + /* + * Deployment information. + */ + private Deployment deployment; + + /* + * Additional details about the deployment that can be shown to the user. + */ + private String message; + + /** + * Creates an instance of DeploymentInfo class. + */ + private DeploymentInfo() { + } + + /** + * Get the deploymentFetchStatus property: Status while fetching the last deployment. + * + * @return the deploymentFetchStatus value. + */ + public DeploymentFetchStatus deploymentFetchStatus() { + return this.deploymentFetchStatus; + } + + /** + * Get the deployment property: Deployment information. + * + * @return the deployment value. + */ + public Deployment deployment() { + return this.deployment; + } + + /** + * Get the message property: Additional details about the deployment that can be shown to the user. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentFetchStatus", + this.deploymentFetchStatus == null ? null : this.deploymentFetchStatus.toString()); + jsonWriter.writeJsonField("deployment", this.deployment); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentInfo. + */ + public static DeploymentInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentInfo deserializedDeploymentInfo = new DeploymentInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentFetchStatus".equals(fieldName)) { + deserializedDeploymentInfo.deploymentFetchStatus + = DeploymentFetchStatus.fromString(reader.getString()); + } else if ("deployment".equals(fieldName)) { + deserializedDeploymentInfo.deployment = Deployment.fromJson(reader); + } else if ("message".equals(fieldName)) { + deserializedDeploymentInfo.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentInfo; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentResult.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentResult.java new file mode 100644 index 000000000000..f0a8025cbdc0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentResult.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status while trying to fetch the deployment information. + */ +public final class DeploymentResult extends ExpandableStringEnum { + /** + * Success. + */ + public static final DeploymentResult SUCCESS = fromString("Success"); + + /** + * Canceled. + */ + public static final DeploymentResult CANCELED = fromString("Canceled"); + + /** + * Failed. + */ + public static final DeploymentResult FAILED = fromString("Failed"); + + /** + * Creates a new instance of DeploymentResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentResult() { + } + + /** + * Creates or finds a DeploymentResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentResult. + */ + public static DeploymentResult fromString(String name) { + return fromString(name, DeploymentResult.class); + } + + /** + * Gets known DeploymentResult values. + * + * @return known DeploymentResult values. + */ + public static Collection values() { + return values(DeploymentResult.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentState.java new file mode 100644 index 000000000000..feaf482e9f3c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current state of the deployment. + */ +public final class DeploymentState extends ExpandableStringEnum { + /** + * In_Progress. + */ + public static final DeploymentState IN_PROGRESS = fromString("In_Progress"); + + /** + * Completed. + */ + public static final DeploymentState COMPLETED = fromString("Completed"); + + /** + * Queued. + */ + public static final DeploymentState QUEUED = fromString("Queued"); + + /** + * Canceling. + */ + public static final DeploymentState CANCELING = fromString("Canceling"); + + /** + * Creates a new instance of DeploymentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentState() { + } + + /** + * Creates or finds a DeploymentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentState. + */ + public static DeploymentState fromString(String name) { + return fromString(name, DeploymentState.class); + } + + /** + * Gets known DeploymentState values. + * + * @return known DeploymentState values. + */ + public static Collection values() { + return values(DeploymentState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeviceImportance.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeviceImportance.java new file mode 100644 index 000000000000..beb6bdbc8116 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/DeviceImportance.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Device importance, determines if the device classified as 'crown jewel'. + */ +public final class DeviceImportance extends ExpandableStringEnum { + /** + * Unknown - Default value. + */ + public static final DeviceImportance UNKNOWN = fromString("Unknown"); + + /** + * Low. + */ + public static final DeviceImportance LOW = fromString("Low"); + + /** + * Normal. + */ + public static final DeviceImportance NORMAL = fromString("Normal"); + + /** + * High. + */ + public static final DeviceImportance HIGH = fromString("High"); + + /** + * Creates a new instance of DeviceImportance value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeviceImportance() { + } + + /** + * Creates or finds a DeviceImportance from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceImportance. + */ + public static DeviceImportance fromString(String name) { + return fromString(name, DeviceImportance.class); + } + + /** + * Gets known DeviceImportance values. + * + * @return known DeviceImportance values. + */ + public static Collection values() { + return values(DeviceImportance.class); + } +} 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 index 18b93fa0c424..4a0c5c207ccb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -20,7 +20,9 @@ @Immutable public final class DnsEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.DNS_RESOLUTION; @@ -52,11 +54,13 @@ public final class DnsEntity extends Entity { /** * Creates an instance of DnsEntity class. */ - public DnsEntity() { + private DnsEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -170,18 +174,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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..659c50247115 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365CheckRequirements.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365CheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents Dynamics365 requirements check request. + */ +@Fluent +public final class Dynamics365CheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.DYNAMICS365; + + /* + * Dynamics365 requirements check properties. + */ + private Dynamics365CheckRequirementsProperties innerProperties; + + /** + * Creates an instance of Dynamics365CheckRequirements class. + */ + public Dynamics365CheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Dynamics365 requirements check properties. + * + * @return the innerProperties value. + */ + Dynamics365CheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 Dynamics365CheckRequirements object itself. + */ + public Dynamics365CheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new Dynamics365CheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dynamics365CheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dynamics365CheckRequirements if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Dynamics365CheckRequirements. + */ + public static Dynamics365CheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dynamics365CheckRequirements deserializedDynamics365CheckRequirements = new Dynamics365CheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedDynamics365CheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedDynamics365CheckRequirements.innerProperties + = Dynamics365CheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamics365CheckRequirements; + }); + } +} 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..590cd21b3e52 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnector.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365DataConnectorProperties; +import java.io.IOException; + +/** + * Represents Dynamics365 data connector. + */ +@Fluent +public final class Dynamics365DataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.DYNAMICS365; + + /* + * Dynamics365 data connector properties. + */ + private Dynamics365DataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Dynamics365DataConnector class. + */ + public Dynamics365DataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Dynamics365 data connector properties. + * + * @return the innerProperties value. + */ + private Dynamics365DataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dynamics365DataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dynamics365DataConnector if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Dynamics365DataConnector. + */ + public static Dynamics365DataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dynamics365DataConnector deserializedDynamics365DataConnector = new Dynamics365DataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDynamics365DataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDynamics365DataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDynamics365DataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedDynamics365DataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedDynamics365DataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedDynamics365DataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedDynamics365DataConnector.innerProperties + = Dynamics365DataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamics365DataConnector; + }); + } +} 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..c6ad5d311aec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypes.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Dynamics365 data connector. + */ +@Fluent +public final class Dynamics365DataConnectorDataTypes implements JsonSerializable { + /* + * Common Data Service data type connection. + */ + private Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities; + + /** + * Creates an instance of Dynamics365DataConnectorDataTypes class. + */ + public Dynamics365DataConnectorDataTypes() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dynamics365CdsActivities", this.dynamics365CdsActivities); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dynamics365DataConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dynamics365DataConnectorDataTypes if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Dynamics365DataConnectorDataTypes. + */ + public static Dynamics365DataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dynamics365DataConnectorDataTypes deserializedDynamics365DataConnectorDataTypes + = new Dynamics365DataConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dynamics365CdsActivities".equals(fieldName)) { + deserializedDynamics365DataConnectorDataTypes.dynamics365CdsActivities + = Dynamics365DataConnectorDataTypesDynamics365CdsActivities.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamics365DataConnectorDataTypes; + }); + } +} 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..f783de3aaead --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Common Data Service data type connection. + */ +@Fluent +public final class Dynamics365DataConnectorDataTypesDynamics365CdsActivities extends DataConnectorDataTypeCommon { + /** + * Creates an instance of Dynamics365DataConnectorDataTypesDynamics365CdsActivities class. + */ + public Dynamics365DataConnectorDataTypesDynamics365CdsActivities() { + } + + /** + * {@inheritDoc} + */ + @Override + public Dynamics365DataConnectorDataTypesDynamics365CdsActivities withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dynamics365DataConnectorDataTypesDynamics365CdsActivities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dynamics365DataConnectorDataTypesDynamics365CdsActivities if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * Dynamics365DataConnectorDataTypesDynamics365CdsActivities. + */ + public static Dynamics365DataConnectorDataTypesDynamics365CdsActivities fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + Dynamics365DataConnectorDataTypesDynamics365CdsActivities deserializedDynamics365DataConnectorDataTypesDynamics365CdsActivities + = new Dynamics365DataConnectorDataTypesDynamics365CdsActivities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedDynamics365DataConnectorDataTypesDynamics365CdsActivities + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedDynamics365DataConnectorDataTypesDynamics365CdsActivities; + }); + } +} 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 index ba10707fae63..78f8e352203b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,17 +9,17 @@ */ public enum ElevationToken { /** - * Enum value Default. + * Default elevation token. */ DEFAULT("Default"), /** - * Enum value Full. + * Full elevation token. */ FULL("Full"), /** - * Enum value Limited. + * Limited elevation token. */ LIMITED("Limited"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainBody.java new file mode 100644 index 000000000000..5cf8b55a3e5e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainBody.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Domain name to be enriched. + */ +@Fluent +public final class EnrichmentDomainBody implements JsonSerializable { + /* + * The domain name + */ + private String domain; + + /** + * Creates an instance of EnrichmentDomainBody class. + */ + public EnrichmentDomainBody() { + } + + /** + * Get the domain property: The domain name. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The domain name. + * + * @param domain the domain value to set. + * @return the EnrichmentDomainBody object itself. + */ + public EnrichmentDomainBody withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domain", this.domain); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentDomainBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentDomainBody if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentDomainBody. + */ + public static EnrichmentDomainBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentDomainBody deserializedEnrichmentDomainBody = new EnrichmentDomainBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domain".equals(fieldName)) { + deserializedEnrichmentDomainBody.domain = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentDomainBody; + }); + } +} 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..f75ef758b2a3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..fd67771aa9f2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContact.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An individual contact associated with this domain. + */ +@Immutable +public final class EnrichmentDomainWhoisContact implements JsonSerializable { + /* + * The name of this contact + */ + private String name; + + /* + * The organization for this contact + */ + private String org; + + /* + * A list describing the street address for this contact + */ + private List street; + + /* + * The city for this contact + */ + private String city; + + /* + * The state for this contact + */ + private String state; + + /* + * The postal code for this contact + */ + private String postal; + + /* + * The country for this contact + */ + private String country; + + /* + * The phone number for this contact + */ + private String phone; + + /* + * The fax number for this contact + */ + private String fax; + + /* + * The email address for this contact + */ + private String email; + + /** + * Creates an instance of EnrichmentDomainWhoisContact class. + */ + private EnrichmentDomainWhoisContact() { + } + + /** + * Get the name property: The name of this contact. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the org property: The organization for this contact. + * + * @return the org value. + */ + public String org() { + return this.org; + } + + /** + * Get the street property: A list describing the street address for this contact. + * + * @return the street value. + */ + public List street() { + return this.street; + } + + /** + * Get the city property: The city for this contact. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Get the state property: The state for this contact. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Get the postal property: The postal code for this contact. + * + * @return the postal value. + */ + public String postal() { + return this.postal; + } + + /** + * Get the country property: The country for this contact. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Get the phone property: The phone number for this contact. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Get the fax property: The fax number for this contact. + * + * @return the fax value. + */ + public String fax() { + return this.fax; + } + + /** + * Get the email property: The email address for this contact. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("org", this.org); + jsonWriter.writeArrayField("street", this.street, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("postal", this.postal); + jsonWriter.writeStringField("country", this.country); + jsonWriter.writeStringField("phone", this.phone); + jsonWriter.writeStringField("fax", this.fax); + jsonWriter.writeStringField("email", this.email); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentDomainWhoisContact from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentDomainWhoisContact if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentDomainWhoisContact. + */ + public static EnrichmentDomainWhoisContact fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentDomainWhoisContact deserializedEnrichmentDomainWhoisContact = new EnrichmentDomainWhoisContact(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.name = reader.getString(); + } else if ("org".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.org = reader.getString(); + } else if ("street".equals(fieldName)) { + List street = reader.readArray(reader1 -> reader1.getString()); + deserializedEnrichmentDomainWhoisContact.street = street; + } else if ("city".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.city = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.state = reader.getString(); + } else if ("postal".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.postal = reader.getString(); + } else if ("country".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.country = reader.getString(); + } else if ("phone".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.phone = reader.getString(); + } else if ("fax".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.fax = reader.getString(); + } else if ("email".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContact.email = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentDomainWhoisContact; + }); + } +} 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..c7525ca2f15d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The set of contacts associated with this domain. + */ +@Immutable +public final class EnrichmentDomainWhoisContacts implements JsonSerializable { + /* + * The admin contact for this whois record + */ + private EnrichmentDomainWhoisContact admin; + + /* + * The billing contact for this whois record + */ + private EnrichmentDomainWhoisContact billing; + + /* + * The registrant contact for this whois record + */ + private EnrichmentDomainWhoisContact registrant; + + /* + * The technical contact for this whois record + */ + private EnrichmentDomainWhoisContact tech; + + /** + * Creates an instance of EnrichmentDomainWhoisContacts class. + */ + private EnrichmentDomainWhoisContacts() { + } + + /** + * Get the admin property: The admin contact for this whois record. + * + * @return the admin value. + */ + public EnrichmentDomainWhoisContact admin() { + return this.admin; + } + + /** + * Get the billing property: The billing contact for this whois record. + * + * @return the billing value. + */ + public EnrichmentDomainWhoisContact billing() { + return this.billing; + } + + /** + * Get the registrant property: The registrant contact for this whois record. + * + * @return the registrant value. + */ + public EnrichmentDomainWhoisContact registrant() { + return this.registrant; + } + + /** + * Get the tech property: The technical contact for this whois record. + * + * @return the tech value. + */ + public EnrichmentDomainWhoisContact tech() { + return this.tech; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("admin", this.admin); + jsonWriter.writeJsonField("billing", this.billing); + jsonWriter.writeJsonField("registrant", this.registrant); + jsonWriter.writeJsonField("tech", this.tech); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentDomainWhoisContacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentDomainWhoisContacts if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentDomainWhoisContacts. + */ + public static EnrichmentDomainWhoisContacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentDomainWhoisContacts deserializedEnrichmentDomainWhoisContacts + = new EnrichmentDomainWhoisContacts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("admin".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContacts.admin = EnrichmentDomainWhoisContact.fromJson(reader); + } else if ("billing".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContacts.billing = EnrichmentDomainWhoisContact.fromJson(reader); + } else if ("registrant".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContacts.registrant + = EnrichmentDomainWhoisContact.fromJson(reader); + } else if ("tech".equals(fieldName)) { + deserializedEnrichmentDomainWhoisContacts.tech = EnrichmentDomainWhoisContact.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentDomainWhoisContacts; + }); + } +} 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..18dae7bfa5f4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The whois record for a given domain. + */ +@Immutable +public final class EnrichmentDomainWhoisDetails implements JsonSerializable { + /* + * The registrar associated with this domain + */ + private EnrichmentDomainWhoisRegistrarDetails registrar; + + /* + * The set of contacts associated with this domain + */ + private EnrichmentDomainWhoisContacts contacts; + + /* + * A list of name servers associated with this domain + */ + private List nameServers; + + /* + * The set of status flags for this whois record + */ + private List statuses; + + /** + * Creates an instance of EnrichmentDomainWhoisDetails class. + */ + private EnrichmentDomainWhoisDetails() { + } + + /** + * Get the registrar property: The registrar associated with this domain. + * + * @return the registrar value. + */ + public EnrichmentDomainWhoisRegistrarDetails registrar() { + return this.registrar; + } + + /** + * Get the contacts property: The set of contacts associated with this domain. + * + * @return the contacts value. + */ + public EnrichmentDomainWhoisContacts contacts() { + return this.contacts; + } + + /** + * Get the nameServers property: A list of name servers associated with this domain. + * + * @return the nameServers value. + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Get the statuses property: The set of status flags for this whois record. + * + * @return the statuses value. + */ + public List statuses() { + return this.statuses; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("registrar", this.registrar); + jsonWriter.writeJsonField("contacts", this.contacts); + jsonWriter.writeArrayField("nameServers", this.nameServers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("statuses", this.statuses, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentDomainWhoisDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentDomainWhoisDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentDomainWhoisDetails. + */ + public static EnrichmentDomainWhoisDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentDomainWhoisDetails deserializedEnrichmentDomainWhoisDetails = new EnrichmentDomainWhoisDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("registrar".equals(fieldName)) { + deserializedEnrichmentDomainWhoisDetails.registrar + = EnrichmentDomainWhoisRegistrarDetails.fromJson(reader); + } else if ("contacts".equals(fieldName)) { + deserializedEnrichmentDomainWhoisDetails.contacts = EnrichmentDomainWhoisContacts.fromJson(reader); + } else if ("nameServers".equals(fieldName)) { + List nameServers = reader.readArray(reader1 -> reader1.getString()); + deserializedEnrichmentDomainWhoisDetails.nameServers = nameServers; + } else if ("statuses".equals(fieldName)) { + List statuses = reader.readArray(reader1 -> reader1.getString()); + deserializedEnrichmentDomainWhoisDetails.statuses = statuses; + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentDomainWhoisDetails; + }); + } +} 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..ad44d63afdb4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The registrar associated with this domain. + */ +@Immutable +public final class EnrichmentDomainWhoisRegistrarDetails + implements JsonSerializable { + /* + * The name of this registrar + */ + private String name; + + /* + * This registrar's abuse contact email + */ + private String abuseContactEmail; + + /* + * This registrar's abuse contact phone number + */ + private String abuseContactPhone; + + /* + * This registrar's Internet Assigned Numbers Authority id + */ + private String ianaId; + + /* + * This registrar's URL + */ + private String url; + + /* + * The hostname of this registrar's whois server + */ + private String whoisServer; + + /** + * Creates an instance of EnrichmentDomainWhoisRegistrarDetails class. + */ + private EnrichmentDomainWhoisRegistrarDetails() { + } + + /** + * Get the name property: The name of this registrar. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the abuseContactEmail property: This registrar's abuse contact email. + * + * @return the abuseContactEmail value. + */ + public String abuseContactEmail() { + return this.abuseContactEmail; + } + + /** + * Get the abuseContactPhone property: This registrar's abuse contact phone number. + * + * @return the abuseContactPhone value. + */ + public String abuseContactPhone() { + return this.abuseContactPhone; + } + + /** + * Get the ianaId property: This registrar's Internet Assigned Numbers Authority id. + * + * @return the ianaId value. + */ + public String ianaId() { + return this.ianaId; + } + + /** + * Get the url property: This registrar's URL. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the whoisServer property: The hostname of this registrar's whois server. + * + * @return the whoisServer value. + */ + public String whoisServer() { + return this.whoisServer; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("abuseContactEmail", this.abuseContactEmail); + jsonWriter.writeStringField("abuseContactPhone", this.abuseContactPhone); + jsonWriter.writeStringField("ianaId", this.ianaId); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("whoisServer", this.whoisServer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentDomainWhoisRegistrarDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentDomainWhoisRegistrarDetails if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentDomainWhoisRegistrarDetails. + */ + public static EnrichmentDomainWhoisRegistrarDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentDomainWhoisRegistrarDetails deserializedEnrichmentDomainWhoisRegistrarDetails + = new EnrichmentDomainWhoisRegistrarDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEnrichmentDomainWhoisRegistrarDetails.name = reader.getString(); + } else if ("abuseContactEmail".equals(fieldName)) { + deserializedEnrichmentDomainWhoisRegistrarDetails.abuseContactEmail = reader.getString(); + } else if ("abuseContactPhone".equals(fieldName)) { + deserializedEnrichmentDomainWhoisRegistrarDetails.abuseContactPhone = reader.getString(); + } else if ("ianaId".equals(fieldName)) { + deserializedEnrichmentDomainWhoisRegistrarDetails.ianaId = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedEnrichmentDomainWhoisRegistrarDetails.url = reader.getString(); + } else if ("whoisServer".equals(fieldName)) { + deserializedEnrichmentDomainWhoisRegistrarDetails.whoisServer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentDomainWhoisRegistrarDetails; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpAddressBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpAddressBody.java new file mode 100644 index 000000000000..abac93ea4f9b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpAddressBody.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IP address (v4 or v6) to be enriched. + */ +@Fluent +public final class EnrichmentIpAddressBody implements JsonSerializable { + /* + * The dotted-decimal or colon-separated string representation of the IP address + */ + private String ipAddress; + + /** + * Creates an instance of EnrichmentIpAddressBody class. + */ + public EnrichmentIpAddressBody() { + } + + /** + * Get the ipAddress property: The dotted-decimal or colon-separated string representation of the IP address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: The dotted-decimal or colon-separated string representation of the IP address. + * + * @param ipAddress the ipAddress value to set. + * @return the EnrichmentIpAddressBody object itself. + */ + public EnrichmentIpAddressBody withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnrichmentIpAddressBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnrichmentIpAddressBody if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EnrichmentIpAddressBody. + */ + public static EnrichmentIpAddressBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnrichmentIpAddressBody deserializedEnrichmentIpAddressBody = new EnrichmentIpAddressBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddress".equals(fieldName)) { + deserializedEnrichmentIpAddressBody.ipAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEnrichmentIpAddressBody; + }); + } +} 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..759c6e0cb106 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 cityConfidenceFactor property: A numeric rating of confidence that the value in the 'city' field is + * correct, on a scale of 0-100. + * + * @return the cityConfidenceFactor value. + */ + Integer cityConfidenceFactor(); + + /** + * 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 countryConfidenceFactor property: A numeric rating of confidence that the value in the 'country' field + * is correct on a scale of 0-100. + * + * @return the countryConfidenceFactor value. + */ + Integer countryConfidenceFactor(); + + /** + * 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 stateConfidenceFactor property: A numeric rating of confidence that the value in the 'state' field is + * correct on a scale of 0-100. + * + * @return the stateConfidenceFactor value. + */ + Integer stateConfidenceFactor(); + + /** + * 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/EnrichmentType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentType.java new file mode 100644 index 000000000000..2c75e0dd5ed2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for EnrichmentType. + */ +public final class EnrichmentType extends ExpandableStringEnum { + /** + * main. + */ + public static final EnrichmentType MAIN = fromString("main"); + + /** + * Creates a new instance of EnrichmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnrichmentType() { + } + + /** + * Creates or finds a EnrichmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnrichmentType. + */ + public static EnrichmentType fromString(String name) { + return fromString(name, EnrichmentType.class); + } + + /** + * Gets known EnrichmentType values. + * + * @return known EnrichmentType values. + */ + public static Collection values() { + return values(EnrichmentType.class); + } +} 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..68d8cf754c8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Entities.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String entityId, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier entity ID. + * @param requestBody Describes the request body for triggering a playbook on an 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 {@link Response}. + */ + Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, String entityIdentifier, + EntityManualTriggerRequestBody requestBody, Context context); + + /** + * Triggers playbook on a specific entity. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param entityIdentifier 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. + */ + void runPlaybook(String resourceGroupName, String workspaceName, String entityIdentifier); + + /** + * 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 along with {@link Response}. + */ + Response expandWithResponse(String resourceGroupName, String workspaceName, String entityId, + EntityExpandParameters parameters, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable queries(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. + * @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 along with {@link Response}. + */ + Response getInsightsWithResponse(String resourceGroupName, String workspaceName, + String entityId, EntityGetInsightsParameters parameters, 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); +} 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..515cde208102 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesGetTimelines.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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. + * @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 along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String workspaceName, String entityId, + EntityTimelineParameters parameters, 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 com.azure.core.management.exception.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); +} 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..d47e31d6ee19 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesRelations.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 index d0f6c8170a56..230b7af48ff8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -18,7 +18,9 @@ @Immutable public class Entity extends ProxyResource { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.fromString("Entity"); @@ -45,11 +47,13 @@ public class Entity extends ProxyResource { /** * Creates an instance of Entity class. */ - public Entity() { + protected Entity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -107,14 +111,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -150,9 +146,7 @@ public static Entity fromJson(JsonReader jsonReader) throws IOException { } } // Use the discriminator value to determine which subtype should be deserialized. - if ("SecurityAlert".equals(discriminatorValue)) { - return SecurityAlert.fromJson(readerToUse.reset()); - } else if ("Bookmark".equals(discriminatorValue)) { + if ("Bookmark".equals(discriminatorValue)) { return HuntingBookmark.fromJson(readerToUse.reset()); } else if ("Account".equals(discriminatorValue)) { return AccountEntity.fromJson(readerToUse.reset()); @@ -192,6 +186,10 @@ public static Entity fromJson(JsonReader jsonReader) throws IOException { return SubmissionMailEntity.fromJson(readerToUse.reset()); } else if ("Url".equals(discriminatorValue)) { return UrlEntity.fromJson(readerToUse.reset()); + } else if ("Nic".equals(discriminatorValue)) { + return NicEntity.fromJson(readerToUse.reset()); + } else if ("SecurityAlert".equals(discriminatorValue)) { + return SecurityAlert.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } 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..d97df757b2cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityAnalyticsProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import java.io.IOException; +import java.util.List; + +/** + * Settings with single toggle. + */ +@Fluent +public final class EntityAnalytics extends SettingsInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private SettingKind kind = SettingKind.ENTITY_ANALYTICS; + + /* + * EntityAnalytics properties + */ + private EntityAnalyticsProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EntityAnalytics class. + */ + public EntityAnalytics() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public SettingKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: EntityAnalytics properties. + * + * @return the innerProperties value. + */ + private EntityAnalyticsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EntityAnalytics withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the entityProviders property: The relevant entity providers that are synced. + * + * @return the entityProviders value. + */ + public List entityProviders() { + return this.innerProperties() == null ? null : this.innerProperties().entityProviders(); + } + + /** + * Set the entityProviders property: The relevant entity providers that are synced. + * + * @param entityProviders the entityProviders value to set. + * @return the EntityAnalytics object itself. + */ + public EntityAnalytics withEntityProviders(List entityProviders) { + if (this.innerProperties() == null) { + this.innerProperties = new EntityAnalyticsProperties(); + } + this.innerProperties().withEntityProviders(entityProviders); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityAnalytics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityAnalytics if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityAnalytics. + */ + public static EntityAnalytics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityAnalytics deserializedEntityAnalytics = new EntityAnalytics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEntityAnalytics.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEntityAnalytics.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEntityAnalytics.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedEntityAnalytics.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedEntityAnalytics.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedEntityAnalytics.kind = SettingKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedEntityAnalytics.innerProperties = EntityAnalyticsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityAnalytics; + }); + } +} 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 index 09b4c0af713f..b735f2e2942b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -78,14 +78,6 @@ EntityCommonProperties withFriendlyName(String friendlyName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..c1b4168cf91a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The edge that connects the entity to the other entity. + */ +@Immutable +public final class EntityEdges implements JsonSerializable { + /* + * The target entity Id. + */ + private String targetEntityId; + + /* + * A bag of custom fields that should be part of the entity and will be presented to the user. + */ + private Map additionalData; + + /** + * Creates an instance of EntityEdges class. + */ + private EntityEdges() { + } + + /** + * Get the targetEntityId property: The target entity Id. + * + * @return the targetEntityId value. + */ + public String targetEntityId() { + return this.targetEntityId; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetEntityId", this.targetEntityId); + jsonWriter.writeMapField("additionalData", this.additionalData, + (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityEdges from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityEdges if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityEdges. + */ + public static EntityEdges fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityEdges deserializedEntityEdges = new EntityEdges(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetEntityId".equals(fieldName)) { + deserializedEntityEdges.targetEntityId = reader.getString(); + } else if ("additionalData".equals(fieldName)) { + Map additionalData = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedEntityEdges.additionalData = additionalData; + } else { + reader.skipChildren(); + } + } + + return deserializedEntityEdges; + }); + } +} 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..c8bbb837435a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The parameters required to execute an expand operation on the given entity. + */ +@Fluent +public final class EntityExpandParameters implements JsonSerializable { + /* + * The end date filter, so the only expansion results returned are before this date. + */ + private OffsetDateTime endTime; + + /* + * The Id of the expansion to perform. + */ + private String expansionId; + + /* + * The start date filter, so the only expansion results returned are after this date. + */ + private OffsetDateTime startTime; + + /** + * Creates an instance of EntityExpandParameters class. + */ + public EntityExpandParameters() { + } + + /** + * 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 String 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(String 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeStringField("expansionId", this.expansionId); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityExpandParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityExpandParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityExpandParameters. + */ + public static EntityExpandParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityExpandParameters deserializedEntityExpandParameters = new EntityExpandParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endTime".equals(fieldName)) { + deserializedEntityExpandParameters.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expansionId".equals(fieldName)) { + deserializedEntityExpandParameters.expansionId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedEntityExpandParameters.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityExpandParameters; + }); + } +} 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..77ce0a4a8554 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..aa747a47960d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponseValue.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The expansion result values. + */ +@Immutable +public final class EntityExpandResponseValue implements JsonSerializable { + /* + * Array of the expansion result entities. + */ + private List entities; + + /* + * Array of edges that connects the entity to the list of entities. + */ + private List edges; + + /** + * Creates an instance of EntityExpandResponseValue class. + */ + private EntityExpandResponseValue() { + } + + /** + * Get the entities property: Array of the expansion result entities. + * + * @return the entities value. + */ + public List entities() { + return this.entities; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("entities", this.entities, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("edges", this.edges, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityExpandResponseValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityExpandResponseValue if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityExpandResponseValue. + */ + public static EntityExpandResponseValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityExpandResponseValue deserializedEntityExpandResponseValue = new EntityExpandResponseValue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("entities".equals(fieldName)) { + List entities = reader.readArray(reader1 -> Entity.fromJson(reader1)); + deserializedEntityExpandResponseValue.entities = entities; + } else if ("edges".equals(fieldName)) { + List edges = reader.readArray(reader1 -> EntityEdges.fromJson(reader1)); + deserializedEntityExpandResponseValue.edges = edges; + } else { + reader.skipChildren(); + } + } + + return deserializedEntityExpandResponseValue; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityFieldMapping.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityFieldMapping.java new file mode 100644 index 000000000000..9873d5063266 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityFieldMapping.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Map identifiers of a single entity. + */ +@Fluent +public final class EntityFieldMapping implements JsonSerializable { + /* + * Alert V3 identifier + */ + private String identifier; + + /* + * The value of the identifier + */ + private String value; + + /** + * Creates an instance of EntityFieldMapping class. + */ + public EntityFieldMapping() { + } + + /** + * Get the identifier property: Alert V3 identifier. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: Alert V3 identifier. + * + * @param identifier the identifier value to set. + * @return the EntityFieldMapping object itself. + */ + public EntityFieldMapping withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the value property: The value of the identifier. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the identifier. + * + * @param value the value value to set. + * @return the EntityFieldMapping object itself. + */ + public EntityFieldMapping withValue(String value) { + this.value = value; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identifier", this.identifier); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityFieldMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityFieldMapping if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityFieldMapping. + */ + public static EntityFieldMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityFieldMapping deserializedEntityFieldMapping = new EntityFieldMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identifier".equals(fieldName)) { + deserializedEntityFieldMapping.identifier = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedEntityFieldMapping.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityFieldMapping; + }); + } +} 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..30fe7ef0a21c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The parameters required to execute insights operation on the given entity. + */ +@Fluent +public final class EntityGetInsightsParameters implements JsonSerializable { + /* + * The start timeline date, so the results returned are after this date. + */ + private OffsetDateTime startTime; + + /* + * The end timeline date, so the results returned are before this date. + */ + private OffsetDateTime endTime; + + /* + * Indicates if query time range should be extended with default time range of the query. Default value is false + */ + private Boolean addDefaultExtendedTimeRange; + + /* + * List of Insights Query Id. If empty, default value is all insights of this entity + */ + private List insightQueryIds; + + /** + * Creates an instance of EntityGetInsightsParameters class. + */ + public EntityGetInsightsParameters() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeBooleanField("addDefaultExtendedTimeRange", this.addDefaultExtendedTimeRange); + jsonWriter.writeArrayField("insightQueryIds", this.insightQueryIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityGetInsightsParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityGetInsightsParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityGetInsightsParameters. + */ + public static EntityGetInsightsParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityGetInsightsParameters deserializedEntityGetInsightsParameters = new EntityGetInsightsParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedEntityGetInsightsParameters.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedEntityGetInsightsParameters.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("addDefaultExtendedTimeRange".equals(fieldName)) { + deserializedEntityGetInsightsParameters.addDefaultExtendedTimeRange + = reader.getNullable(JsonReader::getBoolean); + } else if ("insightQueryIds".equals(fieldName)) { + List insightQueryIds = reader.readArray(reader1 -> reader1.getString()); + deserializedEntityGetInsightsParameters.insightQueryIds = insightQueryIds; + } else { + reader.skipChildren(); + } + } + + return deserializedEntityGetInsightsParameters; + }); + } +} 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..230ab3f883f7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..b40370800ba3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItem.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Entity insight Item. + */ +@Immutable +public final class EntityInsightItem implements JsonSerializable { + /* + * The query id of the insight + */ + private String queryId; + + /* + * The Time interval that the query actually executed on. + */ + private EntityInsightItemQueryTimeInterval queryTimeInterval; + + /* + * Query results for table insights query. + */ + private InsightsTableResult tableQueryResults; + + /* + * Query results for table insights query. + */ + private List chartQueryResults; + + /** + * Creates an instance of EntityInsightItem class. + */ + private EntityInsightItem() { + } + + /** + * Get the queryId property: The query id of the insight. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Get the queryTimeInterval property: The Time interval that the query actually executed on. + * + * @return the queryTimeInterval value. + */ + public EntityInsightItemQueryTimeInterval queryTimeInterval() { + return this.queryTimeInterval; + } + + /** + * Get the tableQueryResults property: Query results for table insights query. + * + * @return the tableQueryResults value. + */ + public InsightsTableResult tableQueryResults() { + return this.tableQueryResults; + } + + /** + * Get the chartQueryResults property: Query results for table insights query. + * + * @return the chartQueryResults value. + */ + public List chartQueryResults() { + return this.chartQueryResults; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queryId", this.queryId); + jsonWriter.writeJsonField("queryTimeInterval", this.queryTimeInterval); + jsonWriter.writeJsonField("tableQueryResults", this.tableQueryResults); + jsonWriter.writeArrayField("chartQueryResults", this.chartQueryResults, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityInsightItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityInsightItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityInsightItem. + */ + public static EntityInsightItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityInsightItem deserializedEntityInsightItem = new EntityInsightItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("queryId".equals(fieldName)) { + deserializedEntityInsightItem.queryId = reader.getString(); + } else if ("queryTimeInterval".equals(fieldName)) { + deserializedEntityInsightItem.queryTimeInterval + = EntityInsightItemQueryTimeInterval.fromJson(reader); + } else if ("tableQueryResults".equals(fieldName)) { + deserializedEntityInsightItem.tableQueryResults = InsightsTableResult.fromJson(reader); + } else if ("chartQueryResults".equals(fieldName)) { + List chartQueryResults + = reader.readArray(reader1 -> InsightsTableResult.fromJson(reader1)); + deserializedEntityInsightItem.chartQueryResults = chartQueryResults; + } else { + reader.skipChildren(); + } + } + + return deserializedEntityInsightItem; + }); + } +} 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..56977286f6eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The Time interval that the query actually executed on. + */ +@Immutable +public final class EntityInsightItemQueryTimeInterval implements JsonSerializable { + /* + * Insight query start time + */ + private OffsetDateTime startTime; + + /* + * Insight query end time + */ + private OffsetDateTime endTime; + + /** + * Creates an instance of EntityInsightItemQueryTimeInterval class. + */ + private EntityInsightItemQueryTimeInterval() { + } + + /** + * Get the startTime property: Insight query start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: Insight query end time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityInsightItemQueryTimeInterval from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityInsightItemQueryTimeInterval if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityInsightItemQueryTimeInterval. + */ + public static EntityInsightItemQueryTimeInterval fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityInsightItemQueryTimeInterval deserializedEntityInsightItemQueryTimeInterval + = new EntityInsightItemQueryTimeInterval(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedEntityInsightItemQueryTimeInterval.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedEntityInsightItemQueryTimeInterval.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityInsightItemQueryTimeInterval; + }); + } +} 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..4c9b373cbb99 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for EntityItemQueryKind. + */ +public final class EntityItemQueryKind extends ExpandableStringEnum { + /** + * insight. + */ + public static final EntityItemQueryKind INSIGHT = fromString("Insight"); + + /** + * Creates a new instance of EntityItemQueryKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityItemQueryKind() { + } + + /** + * Creates or finds a EntityItemQueryKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityItemQueryKind. + */ + public static EntityItemQueryKind fromString(String name) { + return fromString(name, EntityItemQueryKind.class); + } + + /** + * Gets known EntityItemQueryKind values. + * + * @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/EntityKindEnum.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKindEnum.java index bbad26b71fba..a2795f41464b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKindEnum.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKindEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,110 +12,115 @@ */ public final class EntityKindEnum extends ExpandableStringEnum { /** - * Static value Account for EntityKindEnum. + * Entity represents account in the system. */ public static final EntityKindEnum ACCOUNT = fromString("Account"); /** - * Static value Host for EntityKindEnum. + * Entity represents host in the system. */ public static final EntityKindEnum HOST = fromString("Host"); /** - * Static value File for EntityKindEnum. + * Entity represents file in the system. */ public static final EntityKindEnum FILE = fromString("File"); /** - * Static value AzureResource for EntityKindEnum. + * Entity represents azure resource in the system. */ public static final EntityKindEnum AZURE_RESOURCE = fromString("AzureResource"); /** - * Static value CloudApplication for EntityKindEnum. + * Entity represents cloud application in the system. */ public static final EntityKindEnum CLOUD_APPLICATION = fromString("CloudApplication"); /** - * Static value DnsResolution for EntityKindEnum. + * Entity represents dns resolution in the system. */ public static final EntityKindEnum DNS_RESOLUTION = fromString("DnsResolution"); /** - * Static value FileHash for EntityKindEnum. + * Entity represents file hash in the system. */ public static final EntityKindEnum FILE_HASH = fromString("FileHash"); /** - * Static value Ip for EntityKindEnum. + * Entity represents ip in the system. */ public static final EntityKindEnum IP = fromString("Ip"); /** - * Static value Malware for EntityKindEnum. + * Entity represents malware in the system. */ public static final EntityKindEnum MALWARE = fromString("Malware"); /** - * Static value Process for EntityKindEnum. + * Entity represents process in the system. */ public static final EntityKindEnum PROCESS = fromString("Process"); /** - * Static value RegistryKey for EntityKindEnum. + * Entity represents registry key in the system. */ public static final EntityKindEnum REGISTRY_KEY = fromString("RegistryKey"); /** - * Static value RegistryValue for EntityKindEnum. + * Entity represents registry value in the system. */ public static final EntityKindEnum REGISTRY_VALUE = fromString("RegistryValue"); /** - * Static value SecurityGroup for EntityKindEnum. + * Entity represents security group in the system. */ public static final EntityKindEnum SECURITY_GROUP = fromString("SecurityGroup"); /** - * Static value Url for EntityKindEnum. + * Entity represents url in the system. */ public static final EntityKindEnum URL = fromString("Url"); /** - * Static value IoTDevice for EntityKindEnum. + * Entity represents IoT device in the system. */ public static final EntityKindEnum IO_TDEVICE = fromString("IoTDevice"); /** - * Static value SecurityAlert for EntityKindEnum. + * Entity represents security alert in the system. */ public static final EntityKindEnum SECURITY_ALERT = fromString("SecurityAlert"); /** - * Static value Bookmark for EntityKindEnum. + * Entity represents bookmark in the system. */ public static final EntityKindEnum BOOKMARK = fromString("Bookmark"); /** - * Static value MailCluster for EntityKindEnum. + * Entity represents mail cluster in the system. */ public static final EntityKindEnum MAIL_CLUSTER = fromString("MailCluster"); /** - * Static value MailMessage for EntityKindEnum. + * Entity represents mail message in the system. */ public static final EntityKindEnum MAIL_MESSAGE = fromString("MailMessage"); /** - * Static value Mailbox for EntityKindEnum. + * Entity represents mailbox in the system. */ public static final EntityKindEnum MAILBOX = fromString("Mailbox"); /** - * Static value SubmissionMail for EntityKindEnum. + * Entity represents submission mail in the system. */ public static final EntityKindEnum SUBMISSION_MAIL = fromString("SubmissionMail"); + /** + * Entity represents network interface in the system. + */ + public static final EntityKindEnum NIC = fromString("Nic"); + /** * Creates a new instance of EntityKindEnum value. * diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityManualTriggerRequestBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityManualTriggerRequestBody.java new file mode 100644 index 000000000000..3247ec15d545 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityManualTriggerRequestBody.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the request body for triggering a playbook on an entity. + */ +@Fluent +public final class EntityManualTriggerRequestBody implements JsonSerializable { + /* + * Incident ARM id. + */ + private String incidentArmId; + + /* + * The tenant id of the playbook resource. + */ + private String tenantId; + + /* + * The resource id of the playbook resource. + */ + private String logicAppsResourceId; + + /** + * Creates an instance of EntityManualTriggerRequestBody class. + */ + public EntityManualTriggerRequestBody() { + } + + /** + * Get the incidentArmId property: Incident ARM id. + * + * @return the incidentArmId value. + */ + public String incidentArmId() { + return this.incidentArmId; + } + + /** + * Set the incidentArmId property: Incident ARM id. + * + * @param incidentArmId the incidentArmId value to set. + * @return the EntityManualTriggerRequestBody object itself. + */ + public EntityManualTriggerRequestBody withIncidentArmId(String incidentArmId) { + this.incidentArmId = incidentArmId; + 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 EntityManualTriggerRequestBody object itself. + */ + public EntityManualTriggerRequestBody withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the logicAppsResourceId property: The resource id of the playbook resource. + * + * @return the logicAppsResourceId value. + */ + public String logicAppsResourceId() { + return this.logicAppsResourceId; + } + + /** + * Set the logicAppsResourceId property: The resource id of the playbook resource. + * + * @param logicAppsResourceId the logicAppsResourceId value to set. + * @return the EntityManualTriggerRequestBody object itself. + */ + public EntityManualTriggerRequestBody withLogicAppsResourceId(String logicAppsResourceId) { + this.logicAppsResourceId = logicAppsResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logicAppsResourceId", this.logicAppsResourceId); + jsonWriter.writeStringField("incidentArmId", this.incidentArmId); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityManualTriggerRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityManualTriggerRequestBody if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityManualTriggerRequestBody. + */ + public static EntityManualTriggerRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityManualTriggerRequestBody deserializedEntityManualTriggerRequestBody + = new EntityManualTriggerRequestBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logicAppsResourceId".equals(fieldName)) { + deserializedEntityManualTriggerRequestBody.logicAppsResourceId = reader.getString(); + } else if ("incidentArmId".equals(fieldName)) { + deserializedEntityManualTriggerRequestBody.incidentArmId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedEntityManualTriggerRequestBody.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityManualTriggerRequestBody; + }); + } +} 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 index 660dae3e0b3a..002ae0d6c862 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -73,17 +73,6 @@ public EntityMapping withFieldMappings(List 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()); - } - } - /** * {@inheritDoc} */ 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 index d04970d27732..9c4592ded9a5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,92 +12,92 @@ */ public final class EntityMappingType extends ExpandableStringEnum { /** - * Static value Account for EntityMappingType. + * User account entity type. */ public static final EntityMappingType ACCOUNT = fromString("Account"); /** - * Static value Host for EntityMappingType. + * Host entity type. */ public static final EntityMappingType HOST = fromString("Host"); /** - * Static value IP for EntityMappingType. + * IP address entity type. */ public static final EntityMappingType IP = fromString("IP"); /** - * Static value Malware for EntityMappingType. + * Malware entity type. */ public static final EntityMappingType MALWARE = fromString("Malware"); /** - * Static value File for EntityMappingType. + * System file entity type. */ public static final EntityMappingType FILE = fromString("File"); /** - * Static value Process for EntityMappingType. + * Process entity type. */ public static final EntityMappingType PROCESS = fromString("Process"); /** - * Static value CloudApplication for EntityMappingType. + * Cloud app entity type. */ public static final EntityMappingType CLOUD_APPLICATION = fromString("CloudApplication"); /** - * Static value DNS for EntityMappingType. + * DNS entity type. */ public static final EntityMappingType DNS = fromString("DNS"); /** - * Static value AzureResource for EntityMappingType. + * Azure resource entity type. */ public static final EntityMappingType AZURE_RESOURCE = fromString("AzureResource"); /** - * Static value FileHash for EntityMappingType. + * File-hash entity type. */ public static final EntityMappingType FILE_HASH = fromString("FileHash"); /** - * Static value RegistryKey for EntityMappingType. + * Registry key entity type. */ public static final EntityMappingType REGISTRY_KEY = fromString("RegistryKey"); /** - * Static value RegistryValue for EntityMappingType. + * Registry value entity type. */ public static final EntityMappingType REGISTRY_VALUE = fromString("RegistryValue"); /** - * Static value SecurityGroup for EntityMappingType. + * Security group entity type. */ public static final EntityMappingType SECURITY_GROUP = fromString("SecurityGroup"); /** - * Static value URL for EntityMappingType. + * URL entity type. */ public static final EntityMappingType URL = fromString("URL"); /** - * Static value Mailbox for EntityMappingType. + * Mailbox entity type. */ public static final EntityMappingType MAILBOX = fromString("Mailbox"); /** - * Static value MailCluster for EntityMappingType. + * Mail cluster entity type. */ public static final EntityMappingType MAIL_CLUSTER = fromString("MailCluster"); /** - * Static value MailMessage for EntityMappingType. + * Mail message entity type. */ public static final EntityMappingType MAIL_MESSAGE = fromString("MailMessage"); /** - * Static value SubmissionMail for EntityMappingType. + * Submission mail entity type. */ public static final EntityMappingType SUBMISSION_MAIL = fromString("SubmissionMail"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityProviders.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityProviders.java new file mode 100644 index 000000000000..386930778615 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityProviders.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The entity provider that is synced. + */ +public final class EntityProviders extends ExpandableStringEnum { + /** + * ActiveDirectory. + */ + public static final EntityProviders ACTIVE_DIRECTORY = fromString("ActiveDirectory"); + + /** + * AzureActiveDirectory. + */ + public static final EntityProviders AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); + + /** + * Creates a new instance of EntityProviders value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityProviders() { + } + + /** + * Creates or finds a EntityProviders from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityProviders. + */ + public static EntityProviders fromString(String name) { + return fromString(name, EntityProviders.class); + } + + /** + * Gets known EntityProviders values. + * + * @return known EntityProviders values. + */ + public static Collection values() { + return values(EntityProviders.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..74b7f3b1a93e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueries.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + 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); + + /** + * 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 along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String entityQueryId, CustomEntityQuery entityQuery, 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); + + /** + * 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String entityQueryId, + 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, EntityQueryTemplateKind kind, + Context context); +} 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..dc9a23cb80ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQuery.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + EntityQueryKind kind(); + + /** + * 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..0802733b9d6d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItem.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryItemInner; + +/** + * An immutable client-side representation of EntityQueryItem. + */ +public interface EntityQueryItem { + /** + * Gets the kind property: The kind of the entity query. + * + * @return the kind value. + */ + EntityQueryKind kind(); + + /** + * Gets the id property: Query Template ARM ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Query Template ARM Name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: ARM Type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryItemInner object. + * + * @return the inner object. + */ + EntityQueryItemInner innerModel(); +} 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..dc0033f7b4a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An properties abstract Query item for entity. + */ +@Immutable +public class EntityQueryItemProperties implements JsonSerializable { + /* + * Data types for template + */ + private List dataTypes; + + /* + * The type of the entity + */ + private EntityType inputEntityType; + + /* + * Data types for template + */ + private List> requiredInputFieldsSets; + + /* + * The query applied only to entities matching to all filters + */ + private Object entitiesFilter; + + /** + * Creates an instance of EntityQueryItemProperties class. + */ + protected EntityQueryItemProperties() { + } + + /** + * 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. + */ + 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. + */ + 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. + */ + 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. + */ + EntityQueryItemProperties withEntitiesFilter(Object entitiesFilter) { + this.entitiesFilter = entitiesFilter; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataTypes", this.dataTypes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("inputEntityType", + this.inputEntityType == null ? null : this.inputEntityType.toString()); + jsonWriter.writeArrayField("requiredInputFieldsSets", this.requiredInputFieldsSets, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + if (this.entitiesFilter != null) { + jsonWriter.writeUntypedField("entitiesFilter", this.entitiesFilter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityQueryItemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityQueryItemProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityQueryItemProperties. + */ + public static EntityQueryItemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityQueryItemProperties deserializedEntityQueryItemProperties = new EntityQueryItemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataTypes".equals(fieldName)) { + List dataTypes + = reader.readArray(reader1 -> EntityQueryItemPropertiesDataTypesItem.fromJson(reader1)); + deserializedEntityQueryItemProperties.dataTypes = dataTypes; + } else if ("inputEntityType".equals(fieldName)) { + deserializedEntityQueryItemProperties.inputEntityType = EntityType.fromString(reader.getString()); + } else if ("requiredInputFieldsSets".equals(fieldName)) { + List> requiredInputFieldsSets + = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedEntityQueryItemProperties.requiredInputFieldsSets = requiredInputFieldsSets; + } else if ("entitiesFilter".equals(fieldName)) { + deserializedEntityQueryItemProperties.entitiesFilter = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityQueryItemProperties; + }); + } +} 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..49491f341a65 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The EntityQueryItemPropertiesDataTypesItem model. + */ +@Immutable +public final class EntityQueryItemPropertiesDataTypesItem + implements JsonSerializable { + /* + * Data type name + */ + private String dataType; + + /** + * Creates an instance of EntityQueryItemPropertiesDataTypesItem class. + */ + private EntityQueryItemPropertiesDataTypesItem() { + } + + /** + * Get the dataType property: Data type name. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dataType", this.dataType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityQueryItemPropertiesDataTypesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityQueryItemPropertiesDataTypesItem if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityQueryItemPropertiesDataTypesItem. + */ + public static EntityQueryItemPropertiesDataTypesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityQueryItemPropertiesDataTypesItem deserializedEntityQueryItemPropertiesDataTypesItem + = new EntityQueryItemPropertiesDataTypesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataType".equals(fieldName)) { + deserializedEntityQueryItemPropertiesDataTypesItem.dataType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityQueryItemPropertiesDataTypesItem; + }); + } +} 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..95bbe967e711 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the entity query. + */ +public final class EntityQueryKind extends ExpandableStringEnum { + /** + * Expansion. + */ + public static final EntityQueryKind EXPANSION = fromString("Expansion"); + + /** + * Insight. + */ + public static final EntityQueryKind INSIGHT = fromString("Insight"); + + /** + * Activity. + */ + public static final EntityQueryKind ACTIVITY = fromString("Activity"); + + /** + * Creates a new instance of EntityQueryKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityQueryKind() { + } + + /** + * Creates or finds a EntityQueryKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityQueryKind. + */ + public static EntityQueryKind fromString(String name) { + return fromString(name, EntityQueryKind.class); + } + + /** + * Gets known EntityQueryKind values. + * + * @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/EntityQueryTemplate.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java new file mode 100644 index 000000000000..6fda41066acd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 kind property: The kind of the entity query template. + * + * @return the kind value. + */ + EntityQueryTemplateKind kind(); + + /** + * 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..c80d2744a0d7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateKind.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for EntityQueryTemplateKind. + */ +public final class EntityQueryTemplateKind extends ExpandableStringEnum { + /** + * Activity. + */ + public static final EntityQueryTemplateKind ACTIVITY = fromString("Activity"); + + /** + * Insight. + */ + public static final EntityQueryTemplateKind INSIGHT = fromString("Insight"); + + /** + * SecurityAlert. + */ + public static final EntityQueryTemplateKind SECURITY_ALERT = fromString("SecurityAlert"); + + /** + * Bookmark. + */ + public static final EntityQueryTemplateKind BOOKMARK = fromString("Bookmark"); + + /** + * Expansion. + */ + public static final EntityQueryTemplateKind EXPANSION = fromString("Expansion"); + + /** + * GuidedInsight. + */ + public static final EntityQueryTemplateKind GUIDED_INSIGHT = fromString("GuidedInsight"); + + /** + * Anomaly. + */ + public static final EntityQueryTemplateKind ANOMALY = fromString("Anomaly"); + + /** + * Creates a new instance of EntityQueryTemplateKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityQueryTemplateKind() { + } + + /** + * Creates or finds a EntityQueryTemplateKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityQueryTemplateKind. + */ + public static EntityQueryTemplateKind fromString(String name) { + return fromString(name, EntityQueryTemplateKind.class); + } + + /** + * Gets known EntityQueryTemplateKind values. + * + * @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/EntityQueryTemplates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java new file mode 100644 index 000000000000..72d514566b1d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String entityQueryTemplateId, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, + EntityQueryTemplateKind kind, 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..b0fc9e0cbcbc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityRelations.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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. + * @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 along with {@link Response}. + */ + Response getRelationWithResponse(String resourceGroupName, String workspaceName, String entityId, + String relationName, 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 com.azure.core.management.exception.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); +} 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..e372cf91433e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineItem.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Entity timeline Item. + */ +@Immutable +public class EntityTimelineItem implements JsonSerializable { + /* + * The entity query kind type. + */ + private EntityTimelineKind kind = EntityTimelineKind.fromString("EntityTimelineItem"); + + /** + * Creates an instance of EntityTimelineItem class. + */ + protected EntityTimelineItem() { + } + + /** + * Get the kind property: The entity query kind type. + * + * @return the kind value. + */ + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityTimelineItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityTimelineItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EntityTimelineItem. + */ + public static EntityTimelineItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Activity".equals(discriminatorValue)) { + return ActivityTimelineItem.fromJson(readerToUse.reset()); + } else if ("Bookmark".equals(discriminatorValue)) { + return BookmarkTimelineItem.fromJson(readerToUse.reset()); + } else if ("Anomaly".equals(discriminatorValue)) { + return AnomalyTimelineItem.fromJson(readerToUse.reset()); + } else if ("SecurityAlert".equals(discriminatorValue)) { + return SecurityAlertTimelineItem.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static EntityTimelineItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityTimelineItem deserializedEntityTimelineItem = new EntityTimelineItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedEntityTimelineItem.kind = EntityTimelineKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityTimelineItem; + }); + } +} 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..c3fc7c452ed0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The entity query kind. + */ +public final class EntityTimelineKind extends ExpandableStringEnum { + /** + * activity. + */ + public static final EntityTimelineKind ACTIVITY = fromString("Activity"); + + /** + * bookmarks. + */ + public static final EntityTimelineKind BOOKMARK = fromString("Bookmark"); + + /** + * security alerts. + */ + public static final EntityTimelineKind SECURITY_ALERT = fromString("SecurityAlert"); + + /** + * anomaly. + */ + public static final EntityTimelineKind ANOMALY = fromString("Anomaly"); + + /** + * Creates a new instance of EntityTimelineKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityTimelineKind() { + } + + /** + * Creates or finds a EntityTimelineKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityTimelineKind. + */ + public static EntityTimelineKind fromString(String name) { + return fromString(name, EntityTimelineKind.class); + } + + /** + * Gets known EntityTimelineKind values. + * + * @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..be7c38a66623 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineParameters.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The parameters required to execute s timeline operation on the given entity. + */ +@Fluent +public final class EntityTimelineParameters implements JsonSerializable { + /* + * Array of timeline Item kinds. + */ + private List kinds; + + /* + * The start timeline date, so the results returned are after this date. + */ + private OffsetDateTime startTime; + + /* + * The end timeline date, so the results returned are before this date. + */ + private OffsetDateTime endTime; + + /* + * The number of bucket for timeline queries aggregation. + */ + private Integer numberOfBucket; + + /** + * Creates an instance of EntityTimelineParameters class. + */ + public EntityTimelineParameters() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("kinds", this.kinds, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeNumberField("numberOfBucket", this.numberOfBucket); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EntityTimelineParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EntityTimelineParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EntityTimelineParameters. + */ + public static EntityTimelineParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EntityTimelineParameters deserializedEntityTimelineParameters = new EntityTimelineParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedEntityTimelineParameters.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedEntityTimelineParameters.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("kinds".equals(fieldName)) { + List kinds + = reader.readArray(reader1 -> EntityTimelineKind.fromString(reader1.getString())); + deserializedEntityTimelineParameters.kinds = kinds; + } else if ("numberOfBucket".equals(fieldName)) { + deserializedEntityTimelineParameters.numberOfBucket = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedEntityTimelineParameters; + }); + } +} 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..594d5c65c792 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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..1e6938dc1b08 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EntityType.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the entity. + */ +public final class EntityType extends ExpandableStringEnum { + /** + * Entity represents account in the system. + */ + public static final EntityType ACCOUNT = fromString("Account"); + + /** + * Entity represents host in the system. + */ + public static final EntityType HOST = fromString("Host"); + + /** + * Entity represents file in the system. + */ + public static final EntityType FILE = fromString("File"); + + /** + * Entity represents azure resource in the system. + */ + public static final EntityType AZURE_RESOURCE = fromString("AzureResource"); + + /** + * Entity represents cloud application in the system. + */ + public static final EntityType CLOUD_APPLICATION = fromString("CloudApplication"); + + /** + * Entity represents dns in the system. + */ + public static final EntityType DNS = fromString("DNS"); + + /** + * Entity represents file hash in the system. + */ + public static final EntityType FILE_HASH = fromString("FileHash"); + + /** + * Entity represents ip in the system. + */ + public static final EntityType IP = fromString("IP"); + + /** + * Entity represents malware in the system. + */ + public static final EntityType MALWARE = fromString("Malware"); + + /** + * Entity represents process in the system. + */ + public static final EntityType PROCESS = fromString("Process"); + + /** + * Entity represents registry key in the system. + */ + public static final EntityType REGISTRY_KEY = fromString("RegistryKey"); + + /** + * Entity represents registry value in the system. + */ + public static final EntityType REGISTRY_VALUE = fromString("RegistryValue"); + + /** + * Entity represents security group in the system. + */ + public static final EntityType SECURITY_GROUP = fromString("SecurityGroup"); + + /** + * Entity represents url in the system. + */ + public static final EntityType URL = fromString("URL"); + + /** + * Entity represents IoT device in the system. + */ + public static final EntityType IO_TDEVICE = fromString("IoTDevice"); + + /** + * Entity represents security alert in the system. + */ + public static final EntityType SECURITY_ALERT = fromString("SecurityAlert"); + + /** + * Entity represents HuntingBookmark in the system. + */ + public static final EntityType HUNTING_BOOKMARK = fromString("HuntingBookmark"); + + /** + * Entity represents mail cluster in the system. + */ + public static final EntityType MAIL_CLUSTER = fromString("MailCluster"); + + /** + * Entity represents mail message in the system. + */ + public static final EntityType MAIL_MESSAGE = fromString("MailMessage"); + + /** + * Entity represents mailbox in the system. + */ + public static final EntityType MAILBOX = fromString("Mailbox"); + + /** + * Entity represents submission mail in the system. + */ + public static final EntityType SUBMISSION_MAIL = fromString("SubmissionMail"); + + /** + * Entity represents network interface in the system. + */ + public static final EntityType NIC = fromString("Nic"); + + /** + * Creates a new instance of EntityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EntityType() { + } + + /** + * Creates or finds a EntityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EntityType. + */ + public static EntityType fromString(String name) { + return fromString(name, EntityType.class); + } + + /** + * Gets known EntityType values. + * + * @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/Error.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Error.java new file mode 100644 index 000000000000..8d16e5758207 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Error.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The error description for why a publication failed. + */ +@Immutable +public final class Error implements JsonSerializable { + /* + * The member resource name for which the publication error occured + */ + private String memberResourceName; + + /* + * The error message + */ + private String errorMessage; + + /** + * Creates an instance of Error class. + */ + private Error() { + } + + /** + * Get the memberResourceName property: The member resource name for which the publication error occured. + * + * @return the memberResourceName value. + */ + public String memberResourceName() { + return this.memberResourceName; + } + + /** + * Get the errorMessage property: The error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("memberResourceName", this.memberResourceName); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Error from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Error. + */ + public static Error fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Error deserializedError = new Error(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("memberResourceName".equals(fieldName)) { + deserializedError.memberResourceName = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedError.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedError; + }); + } +} 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 index c91b4b558994..91c4f5b05dbc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,12 +12,12 @@ */ public final class EventGroupingAggregationKind extends ExpandableStringEnum { /** - * Static value SingleAlert for EventGroupingAggregationKind. + * SingleAlert. */ public static final EventGroupingAggregationKind SINGLE_ALERT = fromString("SingleAlert"); /** - * Static value AlertPerResult for EventGroupingAggregationKind. + * AlertPerResult. */ public static final EventGroupingAggregationKind ALERT_PER_RESULT = fromString("AlertPerResult"); 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 index 5edeaff4a31d..87c256f2b2a9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -47,14 +47,6 @@ public EventGroupingSettings withAggregationKind(EventGroupingAggregationKind ag return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..4b018cc0d182 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ExpansionEntityQueriesProperties; +import java.io.IOException; +import java.util.List; + +/** + * Represents Expansion entity query. + */ +@Immutable +public final class ExpansionEntityQuery extends EntityQueryInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private EntityQueryKind kind = EntityQueryKind.EXPANSION; + + /* + * Expansion entity query properties + */ + private ExpansionEntityQueriesProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Etag of the azure resource + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ExpansionEntityQuery class. + */ + private ExpansionEntityQuery() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public EntityQueryKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Expansion entity query properties. + * + * @return the innerProperties value. + */ + private ExpansionEntityQueriesProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: Etag of the azure resource. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * Get the displayName property: The query display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpansionEntityQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpansionEntityQuery if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpansionEntityQuery. + */ + public static ExpansionEntityQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpansionEntityQuery deserializedExpansionEntityQuery = new ExpansionEntityQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpansionEntityQuery.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedExpansionEntityQuery.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpansionEntityQuery.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedExpansionEntityQuery.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedExpansionEntityQuery.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedExpansionEntityQuery.kind = EntityQueryKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedExpansionEntityQuery.innerProperties + = ExpansionEntityQueriesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExpansionEntityQuery; + }); + } +} 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..a112049c572a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultAggregation.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information of a specific aggregation in the expansion result. + */ +@Immutable +public final class ExpansionResultAggregation implements JsonSerializable { + /* + * The common type of the aggregation. (for e.g. entity field name) + */ + private String aggregationType; + + /* + * Total number of aggregations of the given kind (and aggregationType if given) in the expansion result. + */ + private int count; + + /* + * The display name of the aggregation by type. + */ + private String displayName; + + /* + * The kind of the aggregated entity. + */ + private EntityKindEnum entityKind; + + /** + * Creates an instance of ExpansionResultAggregation class. + */ + private ExpansionResultAggregation() { + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Get the displayName property: The display name of the aggregation by type. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the entityKind property: The kind of the aggregated entity. + * + * @return the entityKind value. + */ + public EntityKindEnum entityKind() { + return this.entityKind; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("count", this.count); + jsonWriter.writeStringField("entityKind", this.entityKind == null ? null : this.entityKind.toString()); + jsonWriter.writeStringField("aggregationType", this.aggregationType); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpansionResultAggregation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpansionResultAggregation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpansionResultAggregation. + */ + public static ExpansionResultAggregation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpansionResultAggregation deserializedExpansionResultAggregation = new ExpansionResultAggregation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedExpansionResultAggregation.count = reader.getInt(); + } else if ("entityKind".equals(fieldName)) { + deserializedExpansionResultAggregation.entityKind = EntityKindEnum.fromString(reader.getString()); + } else if ("aggregationType".equals(fieldName)) { + deserializedExpansionResultAggregation.aggregationType = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedExpansionResultAggregation.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpansionResultAggregation; + }); + } +} 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..a24472d67814 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Expansion result metadata. + */ +@Immutable +public final class ExpansionResultsMetadata implements JsonSerializable { + /* + * Information of the aggregated nodes in the expansion result. + */ + private List aggregations; + + /** + * Creates an instance of ExpansionResultsMetadata class. + */ + private ExpansionResultsMetadata() { + } + + /** + * Get the aggregations property: Information of the aggregated nodes in the expansion result. + * + * @return the aggregations value. + */ + public List aggregations() { + return this.aggregations; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("aggregations", this.aggregations, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpansionResultsMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpansionResultsMetadata if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpansionResultsMetadata. + */ + public static ExpansionResultsMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpansionResultsMetadata deserializedExpansionResultsMetadata = new ExpansionResultsMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aggregations".equals(fieldName)) { + List aggregations + = reader.readArray(reader1 -> ExpansionResultAggregation.fromJson(reader1)); + deserializedExpansionResultsMetadata.aggregations = aggregations; + } else { + reader.skipChildren(); + } + } + + return deserializedExpansionResultsMetadata; + }); + } +} 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..0bba55d60fec --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/EyesOn.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.EyesOnSettingsProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import java.io.IOException; + +/** + * Settings with single toggle. + */ +@Fluent +public final class EyesOn extends SettingsInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private SettingKind kind = SettingKind.EYES_ON; + + /* + * EyesOn properties + */ + private EyesOnSettingsProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EyesOn class. + */ + public EyesOn() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public SettingKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: EyesOn properties. + * + * @return the innerProperties value. + */ + private EyesOnSettingsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EyesOn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EyesOn if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EyesOn. + */ + public static EyesOn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EyesOn deserializedEyesOn = new EyesOn(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEyesOn.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEyesOn.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEyesOn.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedEyesOn.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedEyesOn.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedEyesOn.kind = SettingKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedEyesOn.innerProperties = EyesOnSettingsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEyesOn; + }); + } +} 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 index b32e35951e8f..7c63b40a1a62 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -72,14 +72,6 @@ public FieldMapping withColumnName(String columnName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 00549d660863..05db49985874 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -20,7 +20,9 @@ @Immutable public final class FileEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.FILE; @@ -52,11 +54,13 @@ public final class FileEntity extends Entity { /** * Creates an instance of FileEntity class. */ - public FileEntity() { + private FileEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -170,18 +174,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileFormat.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileFormat.java new file mode 100644 index 000000000000..4c69a5816683 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileFormat.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The format of the file. + */ +public final class FileFormat extends ExpandableStringEnum { + /** + * A CSV file. + */ + public static final FileFormat CSV = fromString("CSV"); + + /** + * A JSON file. + */ + public static final FileFormat JSON = fromString("JSON"); + + /** + * A file of other format. + */ + public static final FileFormat UNSPECIFIED = fromString("Unspecified"); + + /** + * Creates a new instance of FileFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileFormat() { + } + + /** + * Creates or finds a FileFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileFormat. + */ + public static FileFormat fromString(String name) { + return fromString(name, FileFormat.class); + } + + /** + * Gets known FileFormat values. + * + * @return known FileFormat values. + */ + public static Collection values() { + return values(FileFormat.class); + } +} 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 index 3982ce79ff3c..7adfd8795ae1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,27 +12,27 @@ */ public final class FileHashAlgorithm extends ExpandableStringEnum { /** - * Static value Unknown for FileHashAlgorithm. + * Unknown hash algorithm. */ public static final FileHashAlgorithm UNKNOWN = fromString("Unknown"); /** - * Static value MD5 for FileHashAlgorithm. + * MD5 hash type. */ public static final FileHashAlgorithm MD5 = fromString("MD5"); /** - * Static value SHA1 for FileHashAlgorithm. + * SHA1 hash type. */ public static final FileHashAlgorithm SHA1 = fromString("SHA1"); /** - * Static value SHA256 for FileHashAlgorithm. + * SHA256 hash type. */ public static final FileHashAlgorithm SHA256 = fromString("SHA256"); /** - * Static value SHA256AC for FileHashAlgorithm. + * SHA256 Authenticode hash type. */ public static final FileHashAlgorithm SHA256AC = fromString("SHA256AC"); 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 index 745e2251e40f..5d752a5a160b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Immutable public final class FileHashEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.FILE_HASH; @@ -51,11 +53,13 @@ public final class FileHashEntity extends Entity { /** * Creates an instance of FileHashEntity class. */ - public FileHashEntity() { + private FileHashEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -151,18 +155,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImport.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImport.java new file mode 100644 index 000000000000..8eb0be5f664c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImport.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.FileImportInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of FileImport. + */ +public interface FileImport { + /** + * 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 ingestionMode property: Describes how to ingest the records in the file. + * + * @return the ingestionMode value. + */ + IngestionMode ingestionMode(); + + /** + * Gets the contentType property: The content type of this file. + * + * @return the contentType value. + */ + FileImportContentType contentType(); + + /** + * Gets the createdTimeUTC property: The time the file was imported. + * + * @return the createdTimeUTC value. + */ + OffsetDateTime createdTimeUTC(); + + /** + * Gets the errorFile property: Represents the error file (if the import was ingested with errors or failed the + * validation). + * + * @return the errorFile value. + */ + FileMetadata errorFile(); + + /** + * Gets the errorsPreview property: An ordered list of some of the errors that were encountered during validation. + * + * @return the errorsPreview value. + */ + List errorsPreview(); + + /** + * Gets the importFile property: Represents the imported file. + * + * @return the importFile value. + */ + FileMetadata importFile(); + + /** + * Gets the ingestedRecordCount property: The number of records that have been successfully ingested. + * + * @return the ingestedRecordCount value. + */ + Integer ingestedRecordCount(); + + /** + * Gets the source property: The source for the data in the file. + * + * @return the source value. + */ + String source(); + + /** + * Gets the state property: The state of the file import. + * + * @return the state value. + */ + FileImportState state(); + + /** + * Gets the totalRecordCount property: The number of records in the file. + * + * @return the totalRecordCount value. + */ + Integer totalRecordCount(); + + /** + * Gets the validRecordCount property: The number of records that have passed validation. + * + * @return the validRecordCount value. + */ + Integer validRecordCount(); + + /** + * Gets the filesValidUntilTimeUTC property: The time the files associated with this import are deleted from the + * storage account. + * + * @return the filesValidUntilTimeUTC value. + */ + OffsetDateTime filesValidUntilTimeUTC(); + + /** + * Gets the importValidUntilTimeUTC property: The time the file import record is soft deleted from the database and + * history. + * + * @return the importValidUntilTimeUTC value. + */ + OffsetDateTime importValidUntilTimeUTC(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner object. + * + * @return the inner object. + */ + FileImportInner innerModel(); + + /** + * The entirety of the FileImport definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The FileImport definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FileImport definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FileImport 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 FileImport 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.WithIngestionMode, DefinitionStages.WithContentType, + DefinitionStages.WithImportFile, DefinitionStages.WithSource { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileImport create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileImport create(Context context); + } + + /** + * The stage of the FileImport definition allowing to specify ingestionMode. + */ + interface WithIngestionMode { + /** + * Specifies the ingestionMode property: Describes how to ingest the records in the file.. + * + * @param ingestionMode Describes how to ingest the records in the file. + * @return the next definition stage. + */ + WithCreate withIngestionMode(IngestionMode ingestionMode); + } + + /** + * The stage of the FileImport definition allowing to specify contentType. + */ + interface WithContentType { + /** + * Specifies the contentType property: The content type of this file.. + * + * @param contentType The content type of this file. + * @return the next definition stage. + */ + WithCreate withContentType(FileImportContentType contentType); + } + + /** + * The stage of the FileImport definition allowing to specify importFile. + */ + interface WithImportFile { + /** + * Specifies the importFile property: Represents the imported file.. + * + * @param importFile Represents the imported file. + * @return the next definition stage. + */ + WithCreate withImportFile(FileMetadata importFile); + } + + /** + * The stage of the FileImport definition allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: The source for the data in the file.. + * + * @param source The source for the data in the file. + * @return the next definition stage. + */ + WithCreate withSource(String source); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileImport refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileImport refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportContentType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportContentType.java new file mode 100644 index 000000000000..f500da170c77 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportContentType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The content type of this file. + */ +public final class FileImportContentType extends ExpandableStringEnum { + /** + * File containing records with the core fields of an indicator, plus the observables to construct the STIX pattern. + */ + public static final FileImportContentType BASIC_INDICATOR = fromString("BasicIndicator"); + + /** + * File containing STIX indicators. + */ + public static final FileImportContentType STIX_INDICATOR = fromString("StixIndicator"); + + /** + * File containing other records. + */ + public static final FileImportContentType UNSPECIFIED = fromString("Unspecified"); + + /** + * Creates a new instance of FileImportContentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileImportContentType() { + } + + /** + * Creates or finds a FileImportContentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileImportContentType. + */ + public static FileImportContentType fromString(String name) { + return fromString(name, FileImportContentType.class); + } + + /** + * Gets known FileImportContentType values. + * + * @return known FileImportContentType values. + */ + public static Collection values() { + return values(FileImportContentType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportState.java new file mode 100644 index 000000000000..ee6dbe9fcf94 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of the file import. + */ +public final class FileImportState extends ExpandableStringEnum { + /** + * A fatal error has occurred while ingesting the file. + */ + public static final FileImportState FATAL_ERROR = fromString("FatalError"); + + /** + * The file has been ingested. + */ + public static final FileImportState INGESTED = fromString("Ingested"); + + /** + * The file has been ingested with errors. + */ + public static final FileImportState INGESTED_WITH_ERRORS = fromString("IngestedWithErrors"); + + /** + * The file ingestion is in progress. + */ + public static final FileImportState IN_PROGRESS = fromString("InProgress"); + + /** + * The file is invalid. + */ + public static final FileImportState INVALID = fromString("Invalid"); + + /** + * Waiting for the file to be uploaded. + */ + public static final FileImportState WAITING_FOR_UPLOAD = fromString("WaitingForUpload"); + + /** + * Unspecified state. + */ + public static final FileImportState UNSPECIFIED = fromString("Unspecified"); + + /** + * Creates a new instance of FileImportState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileImportState() { + } + + /** + * Creates or finds a FileImportState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileImportState. + */ + public static FileImportState fromString(String name) { + return fromString(name, FileImportState.class); + } + + /** + * Gets known FileImportState values. + * + * @return known FileImportState values. + */ + public static Collection values() { + return values(FileImportState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImports.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImports.java new file mode 100644 index 000000000000..e329e4e430e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileImports.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 FileImports. + */ +public interface FileImports { + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String fileImportId, + Context context); + + /** + * Gets a file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 file import. + */ + FileImport get(String resourceGroupName, String workspaceName, String fileImportId); + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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 fileImportId); + + /** + * Delete the file import. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param fileImportId File import 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. + */ + void delete(String resourceGroupName, String workspaceName, String fileImportId, Context context); + + /** + * Gets all file imports. + * + * @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 file imports as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all file imports. + * + * @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 file imports as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, Context context); + + /** + * Gets a file import. + * + * @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 file import along with {@link Response}. + */ + FileImport getById(String id); + + /** + * Gets a file import. + * + * @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 file import along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the file import. + * + * @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 file import. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FileImport resource. + * + * @param name resource name. + * @return the first stage of the new FileImport definition. + */ + FileImport.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileMetadata.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileMetadata.java new file mode 100644 index 000000000000..679fa16f3ba7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FileMetadata.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a file. + */ +@Fluent +public final class FileMetadata implements JsonSerializable { + /* + * The format of the file + */ + private FileFormat fileFormat; + + /* + * The name of the file. + */ + private String fileName; + + /* + * The size of the file. + */ + private Integer fileSize; + + /* + * A URI with a valid SAS token to allow uploading / downloading the file. + */ + private String fileContentUri; + + /* + * Indicates whether the file was deleted from the storage account. + */ + private DeleteStatus deleteStatus; + + /** + * Creates an instance of FileMetadata class. + */ + public FileMetadata() { + } + + /** + * Get the fileFormat property: The format of the file. + * + * @return the fileFormat value. + */ + public FileFormat fileFormat() { + return this.fileFormat; + } + + /** + * Set the fileFormat property: The format of the file. + * + * @param fileFormat the fileFormat value to set. + * @return the FileMetadata object itself. + */ + public FileMetadata withFileFormat(FileFormat fileFormat) { + this.fileFormat = fileFormat; + return this; + } + + /** + * Get the fileName property: The name of the file. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: The name of the file. + * + * @param fileName the fileName value to set. + * @return the FileMetadata object itself. + */ + public FileMetadata withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the fileSize property: The size of the file. + * + * @return the fileSize value. + */ + public Integer fileSize() { + return this.fileSize; + } + + /** + * Set the fileSize property: The size of the file. + * + * @param fileSize the fileSize value to set. + * @return the FileMetadata object itself. + */ + public FileMetadata withFileSize(Integer fileSize) { + this.fileSize = fileSize; + return this; + } + + /** + * Get the fileContentUri property: A URI with a valid SAS token to allow uploading / downloading the file. + * + * @return the fileContentUri value. + */ + public String fileContentUri() { + return this.fileContentUri; + } + + /** + * Get the deleteStatus property: Indicates whether the file was deleted from the storage account. + * + * @return the deleteStatus value. + */ + public DeleteStatus deleteStatus() { + return this.deleteStatus; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fileFormat", this.fileFormat == null ? null : this.fileFormat.toString()); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeNumberField("fileSize", this.fileSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FileMetadata. + */ + public static FileMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileMetadata deserializedFileMetadata = new FileMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileFormat".equals(fieldName)) { + deserializedFileMetadata.fileFormat = FileFormat.fromString(reader.getString()); + } else if ("fileName".equals(fieldName)) { + deserializedFileMetadata.fileName = reader.getString(); + } else if ("fileSize".equals(fieldName)) { + deserializedFileMetadata.fileSize = reader.getNullable(JsonReader::getInt); + } else if ("fileContentUri".equals(fieldName)) { + deserializedFileMetadata.fileContentUri = reader.getString(); + } else if ("deleteStatus".equals(fieldName)) { + deserializedFileMetadata.deleteStatus = DeleteStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFileMetadata; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java new file mode 100644 index 000000000000..f95e2941431f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The boolean value the metadata is for. + */ +public final class Flag extends ExpandableStringEnum { + /** + * true. + */ + public static final Flag TRUE = fromString("true"); + + /** + * false. + */ + public static final Flag FALSE = fromString("false"); + + /** + * Creates a new instance of Flag value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Flag() { + } + + /** + * Creates or finds a Flag from its string representation. + * + * @param name a name to look for. + * @return the corresponding Flag. + */ + public static Flag fromString(String name) { + return fromString(name, Flag.class); + } + + /** + * Gets known Flag values. + * + * @return known Flag values. + */ + public static Collection values() { + return values(Flag.class); + } +} 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 index 49fe5604b26b..8e551fce8e98 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -21,7 +21,9 @@ @Fluent public final class FusionAlertRule extends AlertRuleInner { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.FUSION; @@ -57,7 +59,9 @@ public FusionAlertRule() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -188,6 +192,53 @@ public FusionAlertRule withEnabled(Boolean enabled) { return this; } + /** + * Get the sourceSettings property: Configuration for all supported source signals in fusion detection. + * + * @return the sourceSettings value. + */ + public List sourceSettings() { + return this.innerProperties() == null ? null : this.innerProperties().sourceSettings(); + } + + /** + * Set the sourceSettings property: Configuration for all supported source signals in fusion detection. + * + * @param sourceSettings the sourceSettings value to set. + * @return the FusionAlertRule object itself. + */ + public FusionAlertRule withSourceSettings(List sourceSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleProperties(); + } + this.innerProperties().withSourceSettings(sourceSettings); + return this; + } + + /** + * Get the scenarioExclusionPatterns property: Configuration to exclude scenarios in fusion detection. + * + * @return the scenarioExclusionPatterns value. + */ + public List scenarioExclusionPatterns() { + return this.innerProperties() == null ? null : this.innerProperties().scenarioExclusionPatterns(); + } + + /** + * Set the scenarioExclusionPatterns property: Configuration to exclude scenarios in fusion detection. + * + * @param scenarioExclusionPatterns the scenarioExclusionPatterns value to set. + * @return the FusionAlertRule object itself. + */ + public FusionAlertRule + withScenarioExclusionPatterns(List scenarioExclusionPatterns) { + if (this.innerProperties() == null) { + this.innerProperties = new FusionAlertRuleProperties(); + } + this.innerProperties().withScenarioExclusionPatterns(scenarioExclusionPatterns); + return this; + } + /** * Get the lastModifiedUtc property: The last time that this alert has been modified. * @@ -225,15 +276,12 @@ public List techniques() { } /** - * Validates the instance. + * Get the subTechniques property: The sub-techniques of the alert rule. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the subTechniques value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public List subTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); } /** 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 index 220655c8962f..22753ee924ff 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,10 +18,12 @@ /** * Represents Fusion alert rule template. */ -@Fluent +@Immutable public final class FusionAlertRuleTemplate extends AlertRuleTemplateInner { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.FUSION; @@ -53,11 +55,13 @@ public final class FusionAlertRuleTemplate extends AlertRuleTemplateInner { /** * Creates an instance of FusionAlertRuleTemplate class. */ - public FusionAlertRuleTemplate() { + private FusionAlertRuleTemplate() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -116,7 +120,7 @@ public String id() { } /** - * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. * * @return the alertRulesCreatedByTemplateCount value. */ @@ -124,20 +128,6 @@ 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 createdDateUtc property: The time that this alert rule template has been added. * @@ -165,20 +155,6 @@ 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. * @@ -188,20 +164,6 @@ 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 connectors for this template. * @@ -211,21 +173,6 @@ public List requiredDataConnectors() { return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); } - /** - * Set the requiredDataConnectors property: The required data connectors 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. * @@ -235,20 +182,6 @@ 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; - } - /** * Get the severity property: The severity for alerts created by this alert rule. * @@ -258,20 +191,6 @@ 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. * @@ -282,21 +201,7 @@ public List 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 techniques property: The techniques of the alert rule template. + * Get the techniques property: The techniques of the alert rule. * * @return the techniques value. */ @@ -305,29 +210,21 @@ public List techniques() { } /** - * Set the techniques property: The techniques of the alert rule template. + * Get the subTechniques property: The sub-techniques of the alert rule. * - * @param techniques the techniques value to set. - * @return the FusionAlertRuleTemplate object itself. + * @return the subTechniques value. */ - public FusionAlertRuleTemplate withTechniques(List techniques) { - if (this.innerProperties() == null) { - this.innerProperties = new FusionAlertRuleTemplateProperties(); - } - this.innerProperties().withTechniques(techniques); - return this; + public List subTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); } /** - * Validates the instance. + * Get the sourceSettings property: All supported source signal configurations consumed in fusion detection. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the sourceSettings value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public List sourceSettings() { + return this.innerProperties() == null ? null : this.innerProperties().sourceSettings(); } /** diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionScenarioExclusionPattern.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionScenarioExclusionPattern.java new file mode 100644 index 000000000000..fac6dd7d13dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionScenarioExclusionPattern.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a Fusion scenario exclusion patterns in Fusion detection. + */ +@Fluent +public final class FusionScenarioExclusionPattern implements JsonSerializable { + /* + * Scenario exclusion pattern. + */ + private String exclusionPattern; + + /* + * DateTime when scenario exclusion pattern is added in UTC. + */ + private String dateAddedInUTC; + + /** + * Creates an instance of FusionScenarioExclusionPattern class. + */ + public FusionScenarioExclusionPattern() { + } + + /** + * Get the exclusionPattern property: Scenario exclusion pattern. + * + * @return the exclusionPattern value. + */ + public String exclusionPattern() { + return this.exclusionPattern; + } + + /** + * Set the exclusionPattern property: Scenario exclusion pattern. + * + * @param exclusionPattern the exclusionPattern value to set. + * @return the FusionScenarioExclusionPattern object itself. + */ + public FusionScenarioExclusionPattern withExclusionPattern(String exclusionPattern) { + this.exclusionPattern = exclusionPattern; + return this; + } + + /** + * Get the dateAddedInUTC property: DateTime when scenario exclusion pattern is added in UTC. + * + * @return the dateAddedInUTC value. + */ + public String dateAddedInUTC() { + return this.dateAddedInUTC; + } + + /** + * Set the dateAddedInUTC property: DateTime when scenario exclusion pattern is added in UTC. + * + * @param dateAddedInUTC the dateAddedInUTC value to set. + * @return the FusionScenarioExclusionPattern object itself. + */ + public FusionScenarioExclusionPattern withDateAddedInUTC(String dateAddedInUTC) { + this.dateAddedInUTC = dateAddedInUTC; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("exclusionPattern", this.exclusionPattern); + jsonWriter.writeStringField("dateAddedInUTC", this.dateAddedInUTC); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionScenarioExclusionPattern from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionScenarioExclusionPattern if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FusionScenarioExclusionPattern. + */ + public static FusionScenarioExclusionPattern fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionScenarioExclusionPattern deserializedFusionScenarioExclusionPattern + = new FusionScenarioExclusionPattern(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("exclusionPattern".equals(fieldName)) { + deserializedFusionScenarioExclusionPattern.exclusionPattern = reader.getString(); + } else if ("dateAddedInUTC".equals(fieldName)) { + deserializedFusionScenarioExclusionPattern.dateAddedInUTC = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFusionScenarioExclusionPattern; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSettings.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSettings.java new file mode 100644 index 000000000000..594cf3f04d78 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSettings.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a supported source signal configuration in Fusion detection. + */ +@Fluent +public final class FusionSourceSettings implements JsonSerializable { + /* + * Determines whether this source signal is enabled or disabled in Fusion detection. + */ + private boolean enabled; + + /* + * Name of the Fusion source signal. Refer to Fusion alert rule template for supported values. + */ + private String sourceName; + + /* + * Configuration for all source subtypes under this source signal consumed in fusion detection. + */ + private List sourceSubTypes; + + /** + * Creates an instance of FusionSourceSettings class. + */ + public FusionSourceSettings() { + } + + /** + * Get the enabled property: Determines whether this source signal is enabled or disabled in Fusion detection. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this source signal is enabled or disabled in Fusion detection. + * + * @param enabled the enabled value to set. + * @return the FusionSourceSettings object itself. + */ + public FusionSourceSettings withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the sourceName property: Name of the Fusion source signal. Refer to Fusion alert rule template for supported + * values. + * + * @return the sourceName value. + */ + public String sourceName() { + return this.sourceName; + } + + /** + * Set the sourceName property: Name of the Fusion source signal. Refer to Fusion alert rule template for supported + * values. + * + * @param sourceName the sourceName value to set. + * @return the FusionSourceSettings object itself. + */ + public FusionSourceSettings withSourceName(String sourceName) { + this.sourceName = sourceName; + return this; + } + + /** + * Get the sourceSubTypes property: Configuration for all source subtypes under this source signal consumed in + * fusion detection. + * + * @return the sourceSubTypes value. + */ + public List sourceSubTypes() { + return this.sourceSubTypes; + } + + /** + * Set the sourceSubTypes property: Configuration for all source subtypes under this source signal consumed in + * fusion detection. + * + * @param sourceSubTypes the sourceSubTypes value to set. + * @return the FusionSourceSettings object itself. + */ + public FusionSourceSettings withSourceSubTypes(List sourceSubTypes) { + this.sourceSubTypes = sourceSubTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("sourceName", this.sourceName); + jsonWriter.writeArrayField("sourceSubTypes", this.sourceSubTypes, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionSourceSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionSourceSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FusionSourceSettings. + */ + public static FusionSourceSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionSourceSettings deserializedFusionSourceSettings = new FusionSourceSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedFusionSourceSettings.enabled = reader.getBoolean(); + } else if ("sourceName".equals(fieldName)) { + deserializedFusionSourceSettings.sourceName = reader.getString(); + } else if ("sourceSubTypes".equals(fieldName)) { + List sourceSubTypes + = reader.readArray(reader1 -> FusionSourceSubTypeSetting.fromJson(reader1)); + deserializedFusionSourceSettings.sourceSubTypes = sourceSubTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedFusionSourceSettings; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSubTypeSetting.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSubTypeSetting.java new file mode 100644 index 000000000000..b3b773695734 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSubTypeSetting.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a supported source subtype configuration under a source signal in Fusion detection. + */ +@Fluent +public final class FusionSourceSubTypeSetting implements JsonSerializable { + /* + * Determines whether this source subtype under source signal is enabled or disabled in Fusion detection. + */ + private boolean enabled; + + /* + * The Name of the source subtype under a given source signal in Fusion detection. Refer to Fusion alert rule + * template for supported values. + */ + private String sourceSubTypeName; + + /* + * The display name of source subtype under a source signal consumed in Fusion detection. + */ + private String sourceSubTypeDisplayName; + + /* + * Severity configuration for a source subtype consumed in fusion detection. + */ + private FusionSubTypeSeverityFilter severityFilters; + + /** + * Creates an instance of FusionSourceSubTypeSetting class. + */ + public FusionSourceSubTypeSetting() { + } + + /** + * Get the enabled property: Determines whether this source subtype under source signal is enabled or disabled in + * Fusion detection. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this source subtype under source signal is enabled or disabled in + * Fusion detection. + * + * @param enabled the enabled value to set. + * @return the FusionSourceSubTypeSetting object itself. + */ + public FusionSourceSubTypeSetting withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the sourceSubTypeName property: The Name of the source subtype under a given source signal in Fusion + * detection. Refer to Fusion alert rule template for supported values. + * + * @return the sourceSubTypeName value. + */ + public String sourceSubTypeName() { + return this.sourceSubTypeName; + } + + /** + * Set the sourceSubTypeName property: The Name of the source subtype under a given source signal in Fusion + * detection. Refer to Fusion alert rule template for supported values. + * + * @param sourceSubTypeName the sourceSubTypeName value to set. + * @return the FusionSourceSubTypeSetting object itself. + */ + public FusionSourceSubTypeSetting withSourceSubTypeName(String sourceSubTypeName) { + this.sourceSubTypeName = sourceSubTypeName; + return this; + } + + /** + * Get the sourceSubTypeDisplayName property: The display name of source subtype under a source signal consumed in + * Fusion detection. + * + * @return the sourceSubTypeDisplayName value. + */ + public String sourceSubTypeDisplayName() { + return this.sourceSubTypeDisplayName; + } + + /** + * Get the severityFilters property: Severity configuration for a source subtype consumed in fusion detection. + * + * @return the severityFilters value. + */ + public FusionSubTypeSeverityFilter severityFilters() { + return this.severityFilters; + } + + /** + * Set the severityFilters property: Severity configuration for a source subtype consumed in fusion detection. + * + * @param severityFilters the severityFilters value to set. + * @return the FusionSourceSubTypeSetting object itself. + */ + public FusionSourceSubTypeSetting withSeverityFilters(FusionSubTypeSeverityFilter severityFilters) { + this.severityFilters = severityFilters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("sourceSubTypeName", this.sourceSubTypeName); + jsonWriter.writeJsonField("severityFilters", this.severityFilters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionSourceSubTypeSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionSourceSubTypeSetting if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FusionSourceSubTypeSetting. + */ + public static FusionSourceSubTypeSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionSourceSubTypeSetting deserializedFusionSourceSubTypeSetting = new FusionSourceSubTypeSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedFusionSourceSubTypeSetting.enabled = reader.getBoolean(); + } else if ("sourceSubTypeName".equals(fieldName)) { + deserializedFusionSourceSubTypeSetting.sourceSubTypeName = reader.getString(); + } else if ("severityFilters".equals(fieldName)) { + deserializedFusionSourceSubTypeSetting.severityFilters + = FusionSubTypeSeverityFilter.fromJson(reader); + } else if ("sourceSubTypeDisplayName".equals(fieldName)) { + deserializedFusionSourceSubTypeSetting.sourceSubTypeDisplayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFusionSourceSubTypeSetting; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFilter.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFilter.java new file mode 100644 index 000000000000..f191ea8676a1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFilter.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents severity configuration for a source subtype consumed in Fusion detection. + */ +@Fluent +public final class FusionSubTypeSeverityFilter implements JsonSerializable { + /* + * Determines whether this source subtype supports severity configuration or not. + */ + private Boolean isSupported; + + /* + * Individual Severity configuration settings for a given source subtype consumed in Fusion detection. + */ + private List filters; + + /** + * Creates an instance of FusionSubTypeSeverityFilter class. + */ + public FusionSubTypeSeverityFilter() { + } + + /** + * Get the isSupported property: Determines whether this source subtype supports severity configuration or not. + * + * @return the isSupported value. + */ + public Boolean isSupported() { + return this.isSupported; + } + + /** + * Get the filters property: Individual Severity configuration settings for a given source subtype consumed in + * Fusion detection. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: Individual Severity configuration settings for a given source subtype consumed in + * Fusion detection. + * + * @param filters the filters value to set. + * @return the FusionSubTypeSeverityFilter object itself. + */ + public FusionSubTypeSeverityFilter withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionSubTypeSeverityFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionSubTypeSeverityFilter if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FusionSubTypeSeverityFilter. + */ + public static FusionSubTypeSeverityFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionSubTypeSeverityFilter deserializedFusionSubTypeSeverityFilter = new FusionSubTypeSeverityFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isSupported".equals(fieldName)) { + deserializedFusionSubTypeSeverityFilter.isSupported = reader.getNullable(JsonReader::getBoolean); + } else if ("filters".equals(fieldName)) { + List filters + = reader.readArray(reader1 -> FusionSubTypeSeverityFiltersItem.fromJson(reader1)); + deserializedFusionSubTypeSeverityFilter.filters = filters; + } else { + reader.skipChildren(); + } + } + + return deserializedFusionSubTypeSeverityFilter; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFiltersItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFiltersItem.java new file mode 100644 index 000000000000..cac309efb734 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFiltersItem.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a Severity filter setting for a given source subtype consumed in Fusion detection. + */ +@Fluent +public final class FusionSubTypeSeverityFiltersItem implements JsonSerializable { + /* + * The Severity for a given source subtype consumed in Fusion detection. + */ + private AlertSeverity severity; + + /* + * Determines whether this severity is enabled or disabled for this source subtype consumed in Fusion detection. + */ + private boolean enabled; + + /** + * Creates an instance of FusionSubTypeSeverityFiltersItem class. + */ + public FusionSubTypeSeverityFiltersItem() { + } + + /** + * Get the severity property: The Severity for a given source subtype consumed in Fusion detection. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: The Severity for a given source subtype consumed in Fusion detection. + * + * @param severity the severity value to set. + * @return the FusionSubTypeSeverityFiltersItem object itself. + */ + public FusionSubTypeSeverityFiltersItem withSeverity(AlertSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the enabled property: Determines whether this severity is enabled or disabled for this source subtype + * consumed in Fusion detection. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether this severity is enabled or disabled for this source subtype + * consumed in Fusion detection. + * + * @param enabled the enabled value to set. + * @return the FusionSubTypeSeverityFiltersItem object itself. + */ + public FusionSubTypeSeverityFiltersItem withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionSubTypeSeverityFiltersItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionSubTypeSeverityFiltersItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FusionSubTypeSeverityFiltersItem. + */ + public static FusionSubTypeSeverityFiltersItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionSubTypeSeverityFiltersItem deserializedFusionSubTypeSeverityFiltersItem + = new FusionSubTypeSeverityFiltersItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("severity".equals(fieldName)) { + deserializedFusionSubTypeSeverityFiltersItem.severity + = AlertSeverity.fromString(reader.getString()); + } else if ("enabled".equals(fieldName)) { + deserializedFusionSubTypeSeverityFiltersItem.enabled = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedFusionSubTypeSeverityFiltersItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSetting.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSetting.java new file mode 100644 index 000000000000..91eb203e6ec9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSetting.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a source signal consumed in Fusion detection. + */ +@Immutable +public final class FusionTemplateSourceSetting implements JsonSerializable { + /* + * The name of a source signal consumed in Fusion detection. + */ + private String sourceName; + + /* + * All supported source subtypes under this source signal consumed in fusion detection. + */ + private List sourceSubTypes; + + /** + * Creates an instance of FusionTemplateSourceSetting class. + */ + private FusionTemplateSourceSetting() { + } + + /** + * Get the sourceName property: The name of a source signal consumed in Fusion detection. + * + * @return the sourceName value. + */ + public String sourceName() { + return this.sourceName; + } + + /** + * Get the sourceSubTypes property: All supported source subtypes under this source signal consumed in fusion + * detection. + * + * @return the sourceSubTypes value. + */ + public List sourceSubTypes() { + return this.sourceSubTypes; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceName", this.sourceName); + jsonWriter.writeArrayField("sourceSubTypes", this.sourceSubTypes, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionTemplateSourceSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionTemplateSourceSetting if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FusionTemplateSourceSetting. + */ + public static FusionTemplateSourceSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionTemplateSourceSetting deserializedFusionTemplateSourceSetting = new FusionTemplateSourceSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceName".equals(fieldName)) { + deserializedFusionTemplateSourceSetting.sourceName = reader.getString(); + } else if ("sourceSubTypes".equals(fieldName)) { + List sourceSubTypes + = reader.readArray(reader1 -> FusionTemplateSourceSubType.fromJson(reader1)); + deserializedFusionTemplateSourceSetting.sourceSubTypes = sourceSubTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedFusionTemplateSourceSetting; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSubType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSubType.java new file mode 100644 index 000000000000..b26a5a2c26d7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSubType.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a source subtype under a source signal consumed in Fusion detection. + */ +@Immutable +public final class FusionTemplateSourceSubType implements JsonSerializable { + /* + * The name of source subtype under a source signal consumed in Fusion detection. + */ + private String sourceSubTypeName; + + /* + * The display name of source subtype under a source signal consumed in Fusion detection. + */ + private String sourceSubTypeDisplayName; + + /* + * Severity configuration available for a source subtype consumed in fusion detection. + */ + private FusionTemplateSubTypeSeverityFilter severityFilter; + + /** + * Creates an instance of FusionTemplateSourceSubType class. + */ + private FusionTemplateSourceSubType() { + } + + /** + * Get the sourceSubTypeName property: The name of source subtype under a source signal consumed in Fusion + * detection. + * + * @return the sourceSubTypeName value. + */ + public String sourceSubTypeName() { + return this.sourceSubTypeName; + } + + /** + * Get the sourceSubTypeDisplayName property: The display name of source subtype under a source signal consumed in + * Fusion detection. + * + * @return the sourceSubTypeDisplayName value. + */ + public String sourceSubTypeDisplayName() { + return this.sourceSubTypeDisplayName; + } + + /** + * Get the severityFilter property: Severity configuration available for a source subtype consumed in fusion + * detection. + * + * @return the severityFilter value. + */ + public FusionTemplateSubTypeSeverityFilter severityFilter() { + return this.severityFilter; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceSubTypeName", this.sourceSubTypeName); + jsonWriter.writeJsonField("severityFilter", this.severityFilter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionTemplateSourceSubType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionTemplateSourceSubType if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FusionTemplateSourceSubType. + */ + public static FusionTemplateSourceSubType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionTemplateSourceSubType deserializedFusionTemplateSourceSubType = new FusionTemplateSourceSubType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceSubTypeName".equals(fieldName)) { + deserializedFusionTemplateSourceSubType.sourceSubTypeName = reader.getString(); + } else if ("severityFilter".equals(fieldName)) { + deserializedFusionTemplateSourceSubType.severityFilter + = FusionTemplateSubTypeSeverityFilter.fromJson(reader); + } else if ("sourceSubTypeDisplayName".equals(fieldName)) { + deserializedFusionTemplateSourceSubType.sourceSubTypeDisplayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFusionTemplateSourceSubType; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSubTypeSeverityFilter.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSubTypeSeverityFilter.java new file mode 100644 index 000000000000..0571639c8a32 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSubTypeSeverityFilter.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents severity configurations available for a source subtype consumed in Fusion detection. + */ +@Immutable +public final class FusionTemplateSubTypeSeverityFilter + implements JsonSerializable { + /* + * Determines whether severity configuration is supported for this source subtype consumed in Fusion detection. + */ + private boolean isSupported; + + /* + * List of all supported severities for this source subtype consumed in Fusion detection. + */ + private List severityFilters; + + /** + * Creates an instance of FusionTemplateSubTypeSeverityFilter class. + */ + private FusionTemplateSubTypeSeverityFilter() { + } + + /** + * Get the isSupported property: Determines whether severity configuration is supported for this source subtype + * consumed in Fusion detection. + * + * @return the isSupported value. + */ + public boolean isSupported() { + return this.isSupported; + } + + /** + * Get the severityFilters property: List of all supported severities for this source subtype consumed in Fusion + * detection. + * + * @return the severityFilters value. + */ + public List severityFilters() { + return this.severityFilters; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isSupported", this.isSupported); + jsonWriter.writeArrayField("severityFilters", this.severityFilters, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FusionTemplateSubTypeSeverityFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FusionTemplateSubTypeSeverityFilter if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FusionTemplateSubTypeSeverityFilter. + */ + public static FusionTemplateSubTypeSeverityFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FusionTemplateSubTypeSeverityFilter deserializedFusionTemplateSubTypeSeverityFilter + = new FusionTemplateSubTypeSeverityFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isSupported".equals(fieldName)) { + deserializedFusionTemplateSubTypeSeverityFilter.isSupported = reader.getBoolean(); + } else if ("severityFilters".equals(fieldName)) { + List severityFilters + = reader.readArray(reader1 -> AlertSeverity.fromString(reader1.getString())); + deserializedFusionTemplateSubTypeSeverityFilter.severityFilters = severityFilters; + } else { + reader.skipChildren(); + } + } + + return deserializedFusionTemplateSubTypeSeverityFilter; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthModel.java new file mode 100644 index 000000000000..e374c6daac08 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthModel.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for API authentication for all GCP kind connectors. + */ +@Fluent +public final class GCPAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.GCP; + + /* + * GCP Service Account Email + */ + private String serviceAccountEmail; + + /* + * GCP Project Number + */ + private String projectNumber; + + /* + * GCP Workload Identity Provider ID + */ + private String workloadIdentityProviderId; + + /** + * Creates an instance of GCPAuthModel class. + */ + public GCPAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the serviceAccountEmail property: GCP Service Account Email. + * + * @return the serviceAccountEmail value. + */ + public String serviceAccountEmail() { + return this.serviceAccountEmail; + } + + /** + * Set the serviceAccountEmail property: GCP Service Account Email. + * + * @param serviceAccountEmail the serviceAccountEmail value to set. + * @return the GCPAuthModel object itself. + */ + public GCPAuthModel withServiceAccountEmail(String serviceAccountEmail) { + this.serviceAccountEmail = serviceAccountEmail; + return this; + } + + /** + * Get the projectNumber property: GCP Project Number. + * + * @return the projectNumber value. + */ + public String projectNumber() { + return this.projectNumber; + } + + /** + * Set the projectNumber property: GCP Project Number. + * + * @param projectNumber the projectNumber value to set. + * @return the GCPAuthModel object itself. + */ + public GCPAuthModel withProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + return this; + } + + /** + * Get the workloadIdentityProviderId property: GCP Workload Identity Provider ID. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: GCP Workload Identity Provider ID. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the GCPAuthModel object itself. + */ + public GCPAuthModel withWorkloadIdentityProviderId(String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceAccountEmail", this.serviceAccountEmail); + jsonWriter.writeStringField("projectNumber", this.projectNumber); + jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GCPAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GCPAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GCPAuthModel. + */ + public static GCPAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GCPAuthModel deserializedGCPAuthModel = new GCPAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceAccountEmail".equals(fieldName)) { + deserializedGCPAuthModel.serviceAccountEmail = reader.getString(); + } else if ("projectNumber".equals(fieldName)) { + deserializedGCPAuthModel.projectNumber = reader.getString(); + } else if ("workloadIdentityProviderId".equals(fieldName)) { + deserializedGCPAuthModel.workloadIdentityProviderId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGCPAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGCPAuthModel; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthProperties.java new file mode 100644 index 000000000000..ee5cc1ef4709 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthProperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Google Cloud Platform auth section properties. + */ +@Fluent +public final class GCPAuthProperties implements JsonSerializable { + /* + * The service account that is used to access the GCP project. + */ + private String serviceAccountEmail; + + /* + * The GCP project number. + */ + private String projectNumber; + + /* + * The workload identity provider id that is used to gain access to the GCP project. + */ + private String workloadIdentityProviderId; + + /** + * Creates an instance of GCPAuthProperties class. + */ + public GCPAuthProperties() { + } + + /** + * Get the serviceAccountEmail property: The service account that is used to access the GCP project. + * + * @return the serviceAccountEmail value. + */ + public String serviceAccountEmail() { + return this.serviceAccountEmail; + } + + /** + * Set the serviceAccountEmail property: The service account that is used to access the GCP project. + * + * @param serviceAccountEmail the serviceAccountEmail value to set. + * @return the GCPAuthProperties object itself. + */ + public GCPAuthProperties withServiceAccountEmail(String serviceAccountEmail) { + this.serviceAccountEmail = serviceAccountEmail; + return this; + } + + /** + * Get the projectNumber property: The GCP project number. + * + * @return the projectNumber value. + */ + public String projectNumber() { + return this.projectNumber; + } + + /** + * Set the projectNumber property: The GCP project number. + * + * @param projectNumber the projectNumber value to set. + * @return the GCPAuthProperties object itself. + */ + public GCPAuthProperties withProjectNumber(String projectNumber) { + this.projectNumber = projectNumber; + return this; + } + + /** + * Get the workloadIdentityProviderId property: The workload identity provider id that is used to gain access to the + * GCP project. + * + * @return the workloadIdentityProviderId value. + */ + public String workloadIdentityProviderId() { + return this.workloadIdentityProviderId; + } + + /** + * Set the workloadIdentityProviderId property: The workload identity provider id that is used to gain access to the + * GCP project. + * + * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. + * @return the GCPAuthProperties object itself. + */ + public GCPAuthProperties withWorkloadIdentityProviderId(String workloadIdentityProviderId) { + this.workloadIdentityProviderId = workloadIdentityProviderId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceAccountEmail", this.serviceAccountEmail); + jsonWriter.writeStringField("projectNumber", this.projectNumber); + jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GCPAuthProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GCPAuthProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GCPAuthProperties. + */ + public static GCPAuthProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GCPAuthProperties deserializedGCPAuthProperties = new GCPAuthProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceAccountEmail".equals(fieldName)) { + deserializedGCPAuthProperties.serviceAccountEmail = reader.getString(); + } else if ("projectNumber".equals(fieldName)) { + deserializedGCPAuthProperties.projectNumber = reader.getString(); + } else if ("workloadIdentityProviderId".equals(fieldName)) { + deserializedGCPAuthProperties.workloadIdentityProviderId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGCPAuthProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPDataConnector.java new file mode 100644 index 000000000000..b6111ef59470 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPDataConnector.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.GCPDataConnectorProperties; +import java.io.IOException; + +/** + * Represents Google Cloud Platform data connector. + */ +@Fluent +public final class GCPDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.GCP; + + /* + * Google Cloud Platform data connector properties. + */ + private GCPDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GCPDataConnector class. + */ + public GCPDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Google Cloud Platform data connector properties. + * + * @return the innerProperties value. + */ + private GCPDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GCPDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the connectorDefinitionName property: The name of the connector definition that represents the UI config. + * + * @return the connectorDefinitionName value. + */ + public String connectorDefinitionName() { + return this.innerProperties() == null ? null : this.innerProperties().connectorDefinitionName(); + } + + /** + * Set the connectorDefinitionName property: The name of the connector definition that represents the UI config. + * + * @param connectorDefinitionName the connectorDefinitionName value to set. + * @return the GCPDataConnector object itself. + */ + public GCPDataConnector withConnectorDefinitionName(String connectorDefinitionName) { + if (this.innerProperties() == null) { + this.innerProperties = new GCPDataConnectorProperties(); + } + this.innerProperties().withConnectorDefinitionName(connectorDefinitionName); + return this; + } + + /** + * Get the auth property: The auth section of the connector. + * + * @return the auth value. + */ + public GCPAuthProperties auth() { + return this.innerProperties() == null ? null : this.innerProperties().auth(); + } + + /** + * Set the auth property: The auth section of the connector. + * + * @param auth the auth value to set. + * @return the GCPDataConnector object itself. + */ + public GCPDataConnector withAuth(GCPAuthProperties auth) { + if (this.innerProperties() == null) { + this.innerProperties = new GCPDataConnectorProperties(); + } + this.innerProperties().withAuth(auth); + return this; + } + + /** + * Get the request property: The request section of the connector. + * + * @return the request value. + */ + public GCPRequestProperties request() { + return this.innerProperties() == null ? null : this.innerProperties().request(); + } + + /** + * Set the request property: The request section of the connector. + * + * @param request the request value to set. + * @return the GCPDataConnector object itself. + */ + public GCPDataConnector withRequest(GCPRequestProperties request) { + if (this.innerProperties() == null) { + this.innerProperties = new GCPDataConnectorProperties(); + } + this.innerProperties().withRequest(request); + return this; + } + + /** + * Get the dcrConfig property: The configuration of the destination of the data. + * + * @return the dcrConfig value. + */ + public DCRConfiguration dcrConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dcrConfig(); + } + + /** + * Set the dcrConfig property: The configuration of the destination of the data. + * + * @param dcrConfig the dcrConfig value to set. + * @return the GCPDataConnector object itself. + */ + public GCPDataConnector withDcrConfig(DCRConfiguration dcrConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new GCPDataConnectorProperties(); + } + this.innerProperties().withDcrConfig(dcrConfig); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GCPDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GCPDataConnector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GCPDataConnector. + */ + public static GCPDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GCPDataConnector deserializedGCPDataConnector = new GCPDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGCPDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGCPDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGCPDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedGCPDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedGCPDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedGCPDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedGCPDataConnector.innerProperties = GCPDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGCPDataConnector; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPRequestProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPRequestProperties.java new file mode 100644 index 000000000000..dc9b811eed2d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GCPRequestProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Google Cloud Platform request section properties. + */ +@Fluent +public final class GCPRequestProperties implements JsonSerializable { + /* + * The GCP project id. + */ + private String projectId; + + /* + * The GCP pub/sub subscription names. + */ + private List subscriptionNames; + + /** + * Creates an instance of GCPRequestProperties class. + */ + public GCPRequestProperties() { + } + + /** + * Get the projectId property: The GCP project id. + * + * @return the projectId value. + */ + public String projectId() { + return this.projectId; + } + + /** + * Set the projectId property: The GCP project id. + * + * @param projectId the projectId value to set. + * @return the GCPRequestProperties object itself. + */ + public GCPRequestProperties withProjectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get the subscriptionNames property: The GCP pub/sub subscription names. + * + * @return the subscriptionNames value. + */ + public List subscriptionNames() { + return this.subscriptionNames; + } + + /** + * Set the subscriptionNames property: The GCP pub/sub subscription names. + * + * @param subscriptionNames the subscriptionNames value to set. + * @return the GCPRequestProperties object itself. + */ + public GCPRequestProperties withSubscriptionNames(List subscriptionNames) { + this.subscriptionNames = subscriptionNames; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectId", this.projectId); + jsonWriter.writeArrayField("subscriptionNames", this.subscriptionNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GCPRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GCPRequestProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GCPRequestProperties. + */ + public static GCPRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GCPRequestProperties deserializedGCPRequestProperties = new GCPRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectId".equals(fieldName)) { + deserializedGCPRequestProperties.projectId = reader.getString(); + } else if ("subscriptionNames".equals(fieldName)) { + List subscriptionNames = reader.readArray(reader1 -> reader1.getString()); + deserializedGCPRequestProperties.subscriptionNames = subscriptionNames; + } else { + reader.skipChildren(); + } + } + + return deserializedGCPRequestProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GenericBlobSbsAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GenericBlobSbsAuthModel.java new file mode 100644 index 000000000000..2ff91fd4ad17 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GenericBlobSbsAuthModel.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Model for API authentication for working with service bus or storage account. + */ +@Fluent +public final class GenericBlobSbsAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.SERVICE_BUS; + + /* + * Credentials for service bus namespace, keyvault uri for access key + */ + private Map credentialsConfig; + + /* + * Credentials for storage account, keyvault uri for access key + */ + private Map storageAccountCredentialsConfig; + + /** + * Creates an instance of GenericBlobSbsAuthModel class. + */ + public GenericBlobSbsAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the credentialsConfig property: Credentials for service bus namespace, keyvault uri for access key. + * + * @return the credentialsConfig value. + */ + public Map credentialsConfig() { + return this.credentialsConfig; + } + + /** + * Set the credentialsConfig property: Credentials for service bus namespace, keyvault uri for access key. + * + * @param credentialsConfig the credentialsConfig value to set. + * @return the GenericBlobSbsAuthModel object itself. + */ + public GenericBlobSbsAuthModel withCredentialsConfig(Map credentialsConfig) { + this.credentialsConfig = credentialsConfig; + return this; + } + + /** + * Get the storageAccountCredentialsConfig property: Credentials for storage account, keyvault uri for access key. + * + * @return the storageAccountCredentialsConfig value. + */ + public Map storageAccountCredentialsConfig() { + return this.storageAccountCredentialsConfig; + } + + /** + * Set the storageAccountCredentialsConfig property: Credentials for storage account, keyvault uri for access key. + * + * @param storageAccountCredentialsConfig the storageAccountCredentialsConfig value to set. + * @return the GenericBlobSbsAuthModel object itself. + */ + public GenericBlobSbsAuthModel + withStorageAccountCredentialsConfig(Map storageAccountCredentialsConfig) { + this.storageAccountCredentialsConfig = storageAccountCredentialsConfig; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("credentialsConfig", this.credentialsConfig, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("storageAccountCredentialsConfig", this.storageAccountCredentialsConfig, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenericBlobSbsAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenericBlobSbsAuthModel if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GenericBlobSbsAuthModel. + */ + public static GenericBlobSbsAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenericBlobSbsAuthModel deserializedGenericBlobSbsAuthModel = new GenericBlobSbsAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedGenericBlobSbsAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else if ("credentialsConfig".equals(fieldName)) { + Map credentialsConfig = reader.readMap(reader1 -> reader1.getString()); + deserializedGenericBlobSbsAuthModel.credentialsConfig = credentialsConfig; + } else if ("storageAccountCredentialsConfig".equals(fieldName)) { + Map storageAccountCredentialsConfig + = reader.readMap(reader1 -> reader1.getString()); + deserializedGenericBlobSbsAuthModel.storageAccountCredentialsConfig + = storageAccountCredentialsConfig; + } else { + reader.skipChildren(); + } + } + + return deserializedGenericBlobSbsAuthModel; + }); + } +} 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 index 77e7bf4a7d00..680f5c52af7d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -37,16 +37,14 @@ public final class GeoLocation implements JsonSerializable { 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. + * The latitude of the identified location, expressed as a floating point number with range of - 90 to 90. Latitude + * and longitude are derived from the city or postal code. */ 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. + * The longitude of the identified location, expressed as a floating point number with range of -180 to 180. + * Latitude and longitude are derived from the city or postal code. */ private Double longitude; @@ -58,7 +56,7 @@ public final class GeoLocation implements JsonSerializable { /** * Creates an instance of GeoLocation class. */ - public GeoLocation() { + private GeoLocation() { } /** @@ -99,9 +97,8 @@ public String 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. + * Get the latitude property: The latitude of the identified location, expressed as a floating point number with + * range of - 90 to 90. Latitude and longitude are derived from the city or postal code. * * @return the latitude value. */ @@ -110,9 +107,8 @@ public Double 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. + * Get the longitude property: The longitude of the identified location, expressed as a floating point number with + * range of -180 to 180. Latitude and longitude are derived from the city or postal code. * * @return the longitude value. */ @@ -129,14 +125,6 @@ public String state() { return this.state; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..86f7f1cd22df --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * the query kind. + */ +public final class GetInsightsError extends ExpandableStringEnum { + /** + * Insight. + */ + public static final GetInsightsError INSIGHT = fromString("Insight"); + + /** + * Creates a new instance of GetInsightsError value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GetInsightsError() { + } + + /** + * Creates or finds a GetInsightsError from its string representation. + * + * @param name a name to look for. + * @return the corresponding GetInsightsError. + */ + public static GetInsightsError fromString(String name) { + return fromString(name, GetInsightsError.class); + } + + /** + * Gets known GetInsightsError values. + * + * @return known GetInsightsError values. + */ + public static Collection values() { + return values(GetInsightsError.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsErrorKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsErrorKind.java new file mode 100644 index 000000000000..a81d4cbe42c6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsErrorKind.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * GetInsights Query Errors. + */ +@Immutable +public final class GetInsightsErrorKind implements JsonSerializable { + /* + * the query kind + */ + private GetInsightsError kind; + + /* + * the query id + */ + private String queryId; + + /* + * the error message + */ + private String errorMessage; + + /** + * Creates an instance of GetInsightsErrorKind class. + */ + private GetInsightsErrorKind() { + } + + /** + * Get the kind property: the query kind. + * + * @return the kind value. + */ + public GetInsightsError kind() { + return this.kind; + } + + /** + * Get the queryId property: the query id. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Get the errorMessage property: the error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeStringField("queryId", this.queryId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetInsightsErrorKind from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetInsightsErrorKind if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GetInsightsErrorKind. + */ + public static GetInsightsErrorKind fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetInsightsErrorKind deserializedGetInsightsErrorKind = new GetInsightsErrorKind(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedGetInsightsErrorKind.kind = GetInsightsError.fromString(reader.getString()); + } else if ("errorMessage".equals(fieldName)) { + deserializedGetInsightsErrorKind.errorMessage = reader.getString(); + } else if ("queryId".equals(fieldName)) { + deserializedGetInsightsErrorKind.queryId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetInsightsErrorKind; + }); + } +} 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..7be302537fd1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsResultsMetadata.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Get Insights result metadata. + */ +@Immutable +public final class GetInsightsResultsMetadata implements JsonSerializable { + /* + * the total items found for the insights request + */ + private int totalCount; + + /* + * information about the failed queries + */ + private List errors; + + /** + * Creates an instance of GetInsightsResultsMetadata class. + */ + private GetInsightsResultsMetadata() { + } + + /** + * Get the totalCount property: the total items found for the insights request. + * + * @return the totalCount value. + */ + public int totalCount() { + return this.totalCount; + } + + /** + * Get the errors property: information about the failed queries. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("totalCount", this.totalCount); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetInsightsResultsMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetInsightsResultsMetadata if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GetInsightsResultsMetadata. + */ + public static GetInsightsResultsMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetInsightsResultsMetadata deserializedGetInsightsResultsMetadata = new GetInsightsResultsMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedGetInsightsResultsMetadata.totalCount = reader.getInt(); + } else if ("errors".equals(fieldName)) { + List errors + = reader.readArray(reader1 -> GetInsightsErrorKind.fromJson(reader1)); + deserializedGetInsightsResultsMetadata.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedGetInsightsResultsMetadata; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetRecommendations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetRecommendations.java new file mode 100644 index 000000000000..a8264a921356 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetRecommendations.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 GetRecommendations. + */ +public interface GetRecommendations { + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets a list of all recommendations. + * + * @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 a list of all recommendations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetTriggeredAnalyticsRuleRuns.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetTriggeredAnalyticsRuleRuns.java new file mode 100644 index 000000000000..687fe3820dad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GetTriggeredAnalyticsRuleRuns.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 GetTriggeredAnalyticsRuleRuns. + */ +public interface GetTriggeredAnalyticsRuleRuns { + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets the triggered analytics rule runs. + * + * @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 the triggered analytics rule runs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Gets.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Gets.java new file mode 100644 index 000000000000..029777bb30d0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Gets.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Gets. + */ +public interface Gets { + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id along with {@link Response}. + */ + Response singleRecommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, Context context); + + /** + * Gets a recommendation by its id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 recommendation by its id. + */ + Recommendation singleRecommendation(String resourceGroupName, String workspaceName, String recommendationId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubAuthModel.java new file mode 100644 index 000000000000..e98053f3f7f0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubAuthModel.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for API authentication for GitHub. For this authentication first we need to approve the Router app (Microsoft + * Security DevOps) to access the GitHub account, Then we only need the InstallationId to get the access token from + * https://api.github.com/app/installations/{installId}/access_tokens. + */ +@Fluent +public final class GitHubAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.GIT_HUB; + + /* + * The GitHubApp auth installation id. + */ + private String installationId; + + /** + * Creates an instance of GitHubAuthModel class. + */ + public GitHubAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the installationId property: The GitHubApp auth installation id. + * + * @return the installationId value. + */ + public String installationId() { + return this.installationId; + } + + /** + * Set the installationId property: The GitHubApp auth installation id. + * + * @param installationId the installationId value to set. + * @return the GitHubAuthModel object itself. + */ + public GitHubAuthModel withInstallationId(String installationId) { + this.installationId = installationId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("installationId", this.installationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitHubAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitHubAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GitHubAuthModel. + */ + public static GitHubAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GitHubAuthModel deserializedGitHubAuthModel = new GitHubAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedGitHubAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else if ("installationId".equals(fieldName)) { + deserializedGitHubAuthModel.installationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGitHubAuthModel; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubResourceInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubResourceInfo.java new file mode 100644 index 000000000000..0bae1a2e765d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubResourceInfo.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resources created in GitHub repository. + */ +@Immutable +public final class GitHubResourceInfo implements JsonSerializable { + /* + * GitHub application installation id. + */ + private String appInstallationId; + + /** + * Creates an instance of GitHubResourceInfo class. + */ + private GitHubResourceInfo() { + } + + /** + * Get the appInstallationId property: GitHub application installation id. + * + * @return the appInstallationId value. + */ + public String appInstallationId() { + return this.appInstallationId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appInstallationId", this.appInstallationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitHubResourceInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitHubResourceInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GitHubResourceInfo. + */ + public static GitHubResourceInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GitHubResourceInfo deserializedGitHubResourceInfo = new GitHubResourceInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appInstallationId".equals(fieldName)) { + deserializedGitHubResourceInfo.appInstallationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGitHubResourceInfo; + }); + } +} 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..d7c6613221ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The graph query to show the current data status. + */ +@Fluent +public class GraphQueries implements JsonSerializable { + /* + * the metric that the query is checking + */ + private String metricName; + + /* + * The legend for the graph + */ + private String legend; + + /* + * The base query for the graph + */ + private String baseQuery; + + /** + * Creates an instance of GraphQueries class. + */ + public GraphQueries() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metricName", this.metricName); + jsonWriter.writeStringField("legend", this.legend); + jsonWriter.writeStringField("baseQuery", this.baseQuery); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQueries from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQueries if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphQueries. + */ + public static GraphQueries fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQueries deserializedGraphQueries = new GraphQueries(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricName".equals(fieldName)) { + deserializedGraphQueries.metricName = reader.getString(); + } else if ("legend".equals(fieldName)) { + deserializedGraphQueries.legend = reader.getString(); + } else if ("baseQuery".equals(fieldName)) { + deserializedGraphQueries.baseQuery = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphQueries; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQuery.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQuery.java new file mode 100644 index 000000000000..8e9bdfb9d134 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQuery.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The graph query to show the volume of data arriving into the workspace over time. + */ +@Fluent +public final class GraphQuery implements JsonSerializable { + /* + * Gets or sets the metric name that the query is checking. For example: 'Total data receive'. + */ + private String metricName; + + /* + * Gets or sets the legend for the graph. + */ + private String legend; + + /* + * Gets or sets the base query for the graph. + * The base query is wrapped by Sentinel UI infra with a KQL query, that measures the volume over time. + */ + private String baseQuery; + + /** + * Creates an instance of GraphQuery class. + */ + public GraphQuery() { + } + + /** + * Get the metricName property: Gets or sets the metric name that the query is checking. For example: 'Total data + * receive'. + * + * @return the metricName value. + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the metricName property: Gets or sets the metric name that the query is checking. For example: 'Total data + * receive'. + * + * @param metricName the metricName value to set. + * @return the GraphQuery object itself. + */ + public GraphQuery withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the legend property: Gets or sets the legend for the graph. + * + * @return the legend value. + */ + public String legend() { + return this.legend; + } + + /** + * Set the legend property: Gets or sets the legend for the graph. + * + * @param legend the legend value to set. + * @return the GraphQuery object itself. + */ + public GraphQuery withLegend(String legend) { + this.legend = legend; + return this; + } + + /** + * Get the baseQuery property: Gets or sets the base query for the graph. + * The base query is wrapped by Sentinel UI infra with a KQL query, that measures the volume over time. + * + * @return the baseQuery value. + */ + public String baseQuery() { + return this.baseQuery; + } + + /** + * Set the baseQuery property: Gets or sets the base query for the graph. + * The base query is wrapped by Sentinel UI infra with a KQL query, that measures the volume over time. + * + * @param baseQuery the baseQuery value to set. + * @return the GraphQuery object itself. + */ + public GraphQuery withBaseQuery(String baseQuery) { + this.baseQuery = baseQuery; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("metricName", this.metricName); + jsonWriter.writeStringField("legend", this.legend); + jsonWriter.writeStringField("baseQuery", this.baseQuery); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphQuery if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphQuery. + */ + public static GraphQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphQuery deserializedGraphQuery = new GraphQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricName".equals(fieldName)) { + deserializedGraphQuery.metricName = reader.getString(); + } else if ("legend".equals(fieldName)) { + deserializedGraphQuery.legend = reader.getString(); + } else if ("baseQuery".equals(fieldName)) { + deserializedGraphQuery.baseQuery = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphQuery; + }); + } +} 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 index 01c70186eefe..2e0164192803 100644 --- 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -212,26 +211,6 @@ public GroupingConfiguration withGroupByCustomDetails(List groupByCustom return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (lookbackDuration() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property lookbackDuration in model GroupingConfiguration")); - } - if (matchingMethod() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property matchingMethod in model GroupingConfiguration")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GroupingConfiguration.class); - /** * {@inheritDoc} */ 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 index e472ae3c7496..dcdbd8d49df1 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -16,10 +16,12 @@ /** * Represents a host entity. */ -@Fluent +@Immutable public final class HostEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.HOST; @@ -51,11 +53,13 @@ public final class HostEntity extends Entity { /** * Creates an instance of HostEntity class. */ - public HostEntity() { + private HostEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -186,20 +190,6 @@ 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. @@ -230,18 +220,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HttpMethodVerb.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HttpMethodVerb.java new file mode 100644 index 000000000000..8b6713611b24 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HttpMethodVerb.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The HTTP method, default value GET. + */ +public final class HttpMethodVerb extends ExpandableStringEnum { + /** + * GET. + */ + public static final HttpMethodVerb GET = fromString("GET"); + + /** + * POST. + */ + public static final HttpMethodVerb POST = fromString("POST"); + + /** + * PUT. + */ + public static final HttpMethodVerb PUT = fromString("PUT"); + + /** + * DELETE. + */ + public static final HttpMethodVerb DELETE = fromString("DELETE"); + + /** + * Creates a new instance of HttpMethodVerb value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpMethodVerb() { + } + + /** + * Creates or finds a HttpMethodVerb from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpMethodVerb. + */ + public static HttpMethodVerb fromString(String name) { + return fromString(name, HttpMethodVerb.class); + } + + /** + * Gets known HttpMethodVerb values. + * + * @return known HttpMethodVerb values. + */ + public static Collection values() { + return values(HttpMethodVerb.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunt.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunt.java new file mode 100644 index 000000000000..e1967a88c7bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunt.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntInner; +import java.util.List; + +/** + * An immutable client-side representation of Hunt. + */ +public interface Hunt { + /** + * 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 hunt. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The description of the hunt. + * + * @return the description value. + */ + String description(); + + /** + * Gets the status property: The status of the hunt. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the hypothesisStatus property: The hypothesis status of the hunt. + * + * @return the hypothesisStatus value. + */ + HypothesisStatus hypothesisStatus(); + + /** + * Gets the attackTactics property: A list of mitre attack tactics the hunt is associated with. + * + * @return the attackTactics value. + */ + List attackTactics(); + + /** + * Gets the attackTechniques property: A list of a mitre attack techniques the hunt is associated with. + * + * @return the attackTechniques value. + */ + List attackTechniques(); + + /** + * Gets the labels property: List of labels relevant to this hunt. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the owner property: Describes a user that the hunt is assigned to. + * + * @return the owner value. + */ + HuntOwner owner(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.HuntInner object. + * + * @return the inner object. + */ + HuntInner innerModel(); + + /** + * The entirety of the Hunt definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Hunt definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Hunt definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Hunt 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 Hunt 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.WithDescription, + DefinitionStages.WithStatus, DefinitionStages.WithHypothesisStatus, DefinitionStages.WithAttackTactics, + DefinitionStages.WithAttackTechniques, DefinitionStages.WithLabels, DefinitionStages.WithOwner { + /** + * Executes the create request. + * + * @return the created resource. + */ + Hunt create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Hunt create(Context context); + } + + /** + * The stage of the Hunt 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 Hunt definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the hunt. + * + * @param displayName The display name of the hunt. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the Hunt definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the hunt. + * + * @param description The description of the hunt. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the Hunt definition allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: The status of the hunt.. + * + * @param status The status of the hunt. + * @return the next definition stage. + */ + WithCreate withStatus(Status status); + } + + /** + * The stage of the Hunt definition allowing to specify hypothesisStatus. + */ + interface WithHypothesisStatus { + /** + * Specifies the hypothesisStatus property: The hypothesis status of the hunt.. + * + * @param hypothesisStatus The hypothesis status of the hunt. + * @return the next definition stage. + */ + WithCreate withHypothesisStatus(HypothesisStatus hypothesisStatus); + } + + /** + * The stage of the Hunt definition allowing to specify attackTactics. + */ + interface WithAttackTactics { + /** + * Specifies the attackTactics property: A list of mitre attack tactics the hunt is associated with. + * + * @param attackTactics A list of mitre attack tactics the hunt is associated with. + * @return the next definition stage. + */ + WithCreate withAttackTactics(List attackTactics); + } + + /** + * The stage of the Hunt definition allowing to specify attackTechniques. + */ + interface WithAttackTechniques { + /** + * Specifies the attackTechniques property: A list of a mitre attack techniques the hunt is associated with. + * + * @param attackTechniques A list of a mitre attack techniques the hunt is associated with. + * @return the next definition stage. + */ + WithCreate withAttackTechniques(List attackTechniques); + } + + /** + * The stage of the Hunt definition allowing to specify labels. + */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this hunt. + * + * @param labels List of labels relevant to this hunt. + * @return the next definition stage. + */ + WithCreate withLabels(List labels); + } + + /** + * The stage of the Hunt definition allowing to specify owner. + */ + interface WithOwner { + /** + * Specifies the owner property: Describes a user that the hunt is assigned to. + * + * @param owner Describes a user that the hunt is assigned to. + * @return the next definition stage. + */ + WithCreate withOwner(HuntOwner owner); + } + } + + /** + * Begins update for the Hunt resource. + * + * @return the stage of resource update. + */ + Hunt.Update update(); + + /** + * The template for Hunt update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithDisplayName, UpdateStages.WithDescription, + UpdateStages.WithStatus, UpdateStages.WithHypothesisStatus, UpdateStages.WithAttackTactics, + UpdateStages.WithAttackTechniques, UpdateStages.WithLabels, UpdateStages.WithOwner { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Hunt apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Hunt apply(Context context); + } + + /** + * The Hunt update stages. + */ + interface UpdateStages { + /** + * The stage of the Hunt 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 Hunt update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the hunt. + * + * @param displayName The display name of the hunt. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the Hunt update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the hunt. + * + * @param description The description of the hunt. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the Hunt update allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: The status of the hunt.. + * + * @param status The status of the hunt. + * @return the next definition stage. + */ + Update withStatus(Status status); + } + + /** + * The stage of the Hunt update allowing to specify hypothesisStatus. + */ + interface WithHypothesisStatus { + /** + * Specifies the hypothesisStatus property: The hypothesis status of the hunt.. + * + * @param hypothesisStatus The hypothesis status of the hunt. + * @return the next definition stage. + */ + Update withHypothesisStatus(HypothesisStatus hypothesisStatus); + } + + /** + * The stage of the Hunt update allowing to specify attackTactics. + */ + interface WithAttackTactics { + /** + * Specifies the attackTactics property: A list of mitre attack tactics the hunt is associated with. + * + * @param attackTactics A list of mitre attack tactics the hunt is associated with. + * @return the next definition stage. + */ + Update withAttackTactics(List attackTactics); + } + + /** + * The stage of the Hunt update allowing to specify attackTechniques. + */ + interface WithAttackTechniques { + /** + * Specifies the attackTechniques property: A list of a mitre attack techniques the hunt is associated with. + * + * @param attackTechniques A list of a mitre attack techniques the hunt is associated with. + * @return the next definition stage. + */ + Update withAttackTechniques(List attackTechniques); + } + + /** + * The stage of the Hunt update allowing to specify labels. + */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this hunt. + * + * @param labels List of labels relevant to this hunt. + * @return the next definition stage. + */ + Update withLabels(List labels); + } + + /** + * The stage of the Hunt update allowing to specify owner. + */ + interface WithOwner { + /** + * Specifies the owner property: Describes a user that the hunt is assigned to. + * + * @param owner Describes a user that the hunt is assigned to. + * @return the next definition stage. + */ + Update withOwner(HuntOwner owner); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Hunt refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Hunt refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComment.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComment.java new file mode 100644 index 000000000000..baa9f1252192 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComment.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntCommentInner; + +/** + * An immutable client-side representation of HuntComment. + */ +public interface HuntComment { + /** + * 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 message property: The message for the comment. + * + * @return the message value. + */ + String message(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner object. + * + * @return the inner object. + */ + HuntCommentInner innerModel(); + + /** + * The entirety of the HuntComment definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The HuntComment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HuntComment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the HuntComment definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, huntId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @return the next definition stage. + */ + WithCreate withExistingHunt(String resourceGroupName, String workspaceName, String huntId); + } + + /** + * The stage of the HuntComment 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. + */ + HuntComment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HuntComment create(Context context); + } + + /** + * The stage of the HuntComment 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 HuntComment definition allowing to specify message. + */ + interface WithMessage { + /** + * Specifies the message property: The message for the comment. + * + * @param message The message for the comment. + * @return the next definition stage. + */ + WithCreate withMessage(String message); + } + } + + /** + * Begins update for the HuntComment resource. + * + * @return the stage of resource update. + */ + HuntComment.Update update(); + + /** + * The template for HuntComment update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithMessage { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HuntComment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HuntComment apply(Context context); + } + + /** + * The HuntComment update stages. + */ + interface UpdateStages { + /** + * The stage of the HuntComment 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 HuntComment update allowing to specify message. + */ + interface WithMessage { + /** + * Specifies the message property: The message for the comment. + * + * @param message The message for the comment. + * @return the next definition stage. + */ + Update withMessage(String message); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HuntComment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HuntComment refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComments.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComments.java new file mode 100644 index 000000000000..c475b502c634 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComments.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 HuntComments. + */ +public interface HuntComments { + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context); + + /** + * Gets a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 hunt comment. + */ + HuntComment get(String resourceGroupName, String workspaceName, String huntId, String huntCommentId); + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntCommentId, Context context); + + /** + * Delete a hunt comment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntCommentId The hunt comment 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 huntId, String huntCommentId); + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt comments as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String huntId); + + /** + * Gets all hunt comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt comments as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String huntId, String filter, + String orderby, Integer top, String skipToken, Context context); + + /** + * Gets a hunt 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 a hunt comment along with {@link Response}. + */ + HuntComment getById(String id); + + /** + * Gets a hunt 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 a hunt comment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a hunt 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 a hunt 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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HuntComment resource. + * + * @param name resource name. + * @return the first stage of the new HuntComment definition. + */ + HuntComment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntOwner.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntOwner.java new file mode 100644 index 000000000000..e53eb91c62e8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntOwner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a user that the hunt is assigned to. + */ +@Fluent +public final class HuntOwner implements JsonSerializable { + /* + * The email of the user the hunt is assigned to. + */ + private String email; + + /* + * The name of the user the hunt is assigned to. + */ + private String assignedTo; + + /* + * The object id of the user the hunt is assigned to. + */ + private String objectId; + + /* + * The user principal name of the user the hunt is assigned to. + */ + private String userPrincipalName; + + /* + * The type of the owner the hunt is assigned to. + */ + private OwnerType ownerType; + + /** + * Creates an instance of HuntOwner class. + */ + public HuntOwner() { + } + + /** + * Get the email property: The email of the user the hunt is assigned to. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: The email of the user the hunt is assigned to. + * + * @param email the email value to set. + * @return the HuntOwner object itself. + */ + public HuntOwner withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the assignedTo property: The name of the user the hunt is assigned to. + * + * @return the assignedTo value. + */ + public String assignedTo() { + return this.assignedTo; + } + + /** + * Set the assignedTo property: The name of the user the hunt is assigned to. + * + * @param assignedTo the assignedTo value to set. + * @return the HuntOwner object itself. + */ + public HuntOwner withAssignedTo(String assignedTo) { + this.assignedTo = assignedTo; + return this; + } + + /** + * Get the objectId property: The object id of the user the hunt is assigned to. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object id of the user the hunt is assigned to. + * + * @param objectId the objectId value to set. + * @return the HuntOwner object itself. + */ + public HuntOwner withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the userPrincipalName property: The user principal name of the user the hunt 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 hunt is assigned to. + * + * @param userPrincipalName the userPrincipalName value to set. + * @return the HuntOwner object itself. + */ + public HuntOwner withUserPrincipalName(String userPrincipalName) { + this.userPrincipalName = userPrincipalName; + return this; + } + + /** + * Get the ownerType property: The type of the owner the hunt is assigned to. + * + * @return the ownerType value. + */ + public OwnerType ownerType() { + return this.ownerType; + } + + /** + * Set the ownerType property: The type of the owner the hunt is assigned to. + * + * @param ownerType the ownerType value to set. + * @return the HuntOwner object itself. + */ + public HuntOwner withOwnerType(OwnerType ownerType) { + this.ownerType = ownerType; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("assignedTo", this.assignedTo); + jsonWriter.writeStringField("objectId", this.objectId); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + jsonWriter.writeStringField("ownerType", this.ownerType == null ? null : this.ownerType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HuntOwner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HuntOwner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the HuntOwner. + */ + public static HuntOwner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HuntOwner deserializedHuntOwner = new HuntOwner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("email".equals(fieldName)) { + deserializedHuntOwner.email = reader.getString(); + } else if ("assignedTo".equals(fieldName)) { + deserializedHuntOwner.assignedTo = reader.getString(); + } else if ("objectId".equals(fieldName)) { + deserializedHuntOwner.objectId = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedHuntOwner.userPrincipalName = reader.getString(); + } else if ("ownerType".equals(fieldName)) { + deserializedHuntOwner.ownerType = OwnerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHuntOwner; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java new file mode 100644 index 000000000000..c7fd1ffb17f9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.HuntRelationInner; +import java.util.List; + +/** + * An immutable client-side representation of HuntRelation. + */ +public interface HuntRelation { + /** + * 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 relatedResourceId property: The 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 relationType property: The type of the hunt relation. + * + * @return the relationType value. + */ + String relationType(); + + /** + * Gets the relatedResourceKind property: The resource that the relation is related to. + * + * @return the relatedResourceKind value. + */ + String relatedResourceKind(); + + /** + * Gets the labels property: List of labels relevant to this hunt. + * + * @return the labels value. + */ + List labels(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner object. + * + * @return the inner object. + */ + HuntRelationInner innerModel(); + + /** + * The entirety of the HuntRelation definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The HuntRelation definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the HuntRelation definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the HuntRelation definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, huntId. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @return the next definition stage. + */ + WithCreate withExistingHunt(String resourceGroupName, String workspaceName, String huntId); + } + + /** + * The stage of the HuntRelation 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.WithRelatedResourceId, DefinitionStages.WithLabels { + /** + * Executes the create request. + * + * @return the created resource. + */ + HuntRelation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HuntRelation create(Context context); + } + + /** + * The stage of the HuntRelation definition allowing to specify relatedResourceId. + */ + interface WithRelatedResourceId { + /** + * Specifies the relatedResourceId property: The id of the related resource. + * + * @param relatedResourceId The id of the related resource. + * @return the next definition stage. + */ + WithCreate withRelatedResourceId(String relatedResourceId); + } + + /** + * The stage of the HuntRelation definition allowing to specify labels. + */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this hunt. + * + * @param labels List of labels relevant to this hunt. + * @return the next definition stage. + */ + WithCreate withLabels(List labels); + } + } + + /** + * Begins update for the HuntRelation resource. + * + * @return the stage of resource update. + */ + HuntRelation.Update update(); + + /** + * The template for HuntRelation update. + */ + interface Update extends UpdateStages.WithRelatedResourceId, UpdateStages.WithLabels { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HuntRelation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HuntRelation apply(Context context); + } + + /** + * The HuntRelation update stages. + */ + interface UpdateStages { + /** + * The stage of the HuntRelation update allowing to specify relatedResourceId. + */ + interface WithRelatedResourceId { + /** + * Specifies the relatedResourceId property: The id of the related resource. + * + * @param relatedResourceId The id of the related resource. + * @return the next definition stage. + */ + Update withRelatedResourceId(String relatedResourceId); + } + + /** + * The stage of the HuntRelation update allowing to specify labels. + */ + interface WithLabels { + /** + * Specifies the labels property: List of labels relevant to this hunt. + * + * @param labels List of labels relevant to this hunt. + * @return the next definition stage. + */ + Update withLabels(List labels); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HuntRelation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HuntRelation refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelations.java new file mode 100644 index 000000000000..098ba3a9a52d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 HuntRelations. + */ +public interface HuntRelations { + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context); + + /** + * Gets a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 hunt relation. + */ + HuntRelation get(String resourceGroupName, String workspaceName, String huntId, String huntRelationId); + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, + String huntRelationId, Context context); + + /** + * Delete a hunt relation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @param huntRelationId The hunt relation 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 huntId, String huntRelationId); + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 all hunt relations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String huntId); + + /** + * Gets all hunt relations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt id (GUID). + * @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 hunt relations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String huntId, String filter, + String orderby, Integer top, String skipToken, Context context); + + /** + * Gets a hunt 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 hunt relation along with {@link Response}. + */ + HuntRelation getById(String id); + + /** + * Gets a hunt 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 hunt relation along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a hunt 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 a hunt 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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HuntRelation resource. + * + * @param name resource name. + * @return the first stage of the new HuntRelation definition. + */ + HuntRelation.DefinitionStages.Blank define(String name); +} 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 index 34b7f678cec6..63998283e007 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,10 +18,12 @@ /** * Represents a Hunting bookmark entity. */ -@Fluent +@Immutable public final class HuntingBookmark extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.BOOKMARK; @@ -53,11 +55,13 @@ public final class HuntingBookmark extends Entity { /** * Creates an instance of HuntingBookmark class. */ - public HuntingBookmark() { + private HuntingBookmark() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -124,20 +128,6 @@ 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. * @@ -147,20 +137,6 @@ 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. * @@ -170,20 +146,6 @@ 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. * @@ -193,20 +155,6 @@ 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. * @@ -216,20 +164,6 @@ 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. * @@ -239,20 +173,6 @@ 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. * @@ -262,20 +182,6 @@ 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. * @@ -285,20 +191,6 @@ 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. * @@ -308,20 +200,6 @@ 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. * @@ -331,20 +209,6 @@ 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. * @@ -354,20 +218,6 @@ 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. @@ -388,18 +238,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunts.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunts.java new file mode 100644 index 000000000000..82aa1bb57f5d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Hunts.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Hunts. + */ +public interface Hunts { + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String huntId, Context context); + + /** + * Gets a hunt, without relations and comments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 hunt, without relations and comments. + */ + Hunt get(String resourceGroupName, String workspaceName, String huntId); + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String huntId, Context context); + + /** + * Delete a hunt. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param huntId The hunt 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 huntId); + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all hunts, without relations and comments. + * + * @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 hunts, without relations and comments as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, Integer top, + String skipToken, Context context); + + /** + * Gets a hunt, without relations and comments. + * + * @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 hunt, without relations and comments along with {@link Response}. + */ + Hunt getById(String id); + + /** + * Gets a hunt, without relations and comments. + * + * @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 hunt, without relations and comments along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a hunt. + * + * @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 hunt. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Hunt resource. + * + * @param name resource name. + * @return the first stage of the new Hunt definition. + */ + Hunt.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HypothesisStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HypothesisStatus.java new file mode 100644 index 000000000000..970d9526974a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/HypothesisStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The hypothesis status of the hunt. + */ +public final class HypothesisStatus extends ExpandableStringEnum { + /** + * Unknown. + */ + public static final HypothesisStatus UNKNOWN = fromString("Unknown"); + + /** + * Invalidated. + */ + public static final HypothesisStatus INVALIDATED = fromString("Invalidated"); + + /** + * Validated. + */ + public static final HypothesisStatus VALIDATED = fromString("Validated"); + + /** + * Creates a new instance of HypothesisStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HypothesisStatus() { + } + + /** + * Creates or finds a HypothesisStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HypothesisStatus. + */ + public static HypothesisStatus fromString(String name) { + return fromString(name, HypothesisStatus.class); + } + + /** + * Gets known HypothesisStatus values. + * + * @return known HypothesisStatus values. + */ + public static Collection values() { + return values(HypothesisStatus.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Identity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Identity.java new file mode 100644 index 000000000000..8ca00138cd34 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Identity.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents an identity in Azure Security Insights. + */ +@Immutable +public final class Identity extends TIObjectInner { + /* + * The kind of the TI object + */ + private TIObjectKind kind = TIObjectKind.IDENTITY; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The properties of the TI object + */ + private TIObjectCommonProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Identity class. + */ + private Identity() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: The properties of the TI object. + * + * @return the innerProperties value. + */ + private TIObjectCommonProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + public Map data() { + return this.innerProperties() == null ? null : this.innerProperties().data(); + } + + /** + * Get the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the source property: The source name for this TI object. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + public OffsetDateTime firstIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstIngestedTimeUtc(); + } + + /** + * Get the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + public OffsetDateTime lastIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastIngestedTimeUtc(); + } + + /** + * Get the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + public String ingestionRulesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionRulesVersion(); + } + + /** + * Get the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + public String lastUpdateMethod() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdateMethod(); + } + + /** + * Get the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + public UserInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateTimeUtc(); + } + + /** + * Get the relationshipHints property: A dictionary used to help follow relationships from this object to other STIX + * objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of sources + * that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + public List relationshipHints() { + return this.innerProperties() == null ? null : this.innerProperties().relationshipHints(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIdentity.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIdentity.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIdentity.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIdentity.innerProperties = TIObjectCommonProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIdentity.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedIdentity.kind = TIObjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } +} 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 index d57eb8a39872..53edbc4e03b9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -51,74 +51,74 @@ public interface Incident { SystemData systemData(); /** - * Gets the additionalData property: Additional data on the incident. + * Gets the title property: The title of the incident. * - * @return the additionalData value. + * @return the title value. */ - IncidentAdditionalData additionalData(); + String title(); /** - * Gets the classification property: The reason the incident was closed. + * Gets the description property: The description of the incident. * - * @return the classification value. + * @return the description value. */ - IncidentClassification classification(); + String description(); /** - * Gets the classificationComment property: Describes the reason the incident was closed. + * Gets the severity property: The severity of the incident. * - * @return the classificationComment value. + * @return the severity value. */ - String classificationComment(); + IncidentSeverity severity(); /** - * Gets the classificationReason property: The classification reason the incident was closed with. + * Gets the status property: The status of the incident. * - * @return the classificationReason value. + * @return the status value. */ - IncidentClassificationReason classificationReason(); + IncidentStatus status(); /** - * Gets the createdTimeUtc property: The time the incident was created. + * Gets the classification property: The reason the incident was closed. * - * @return the createdTimeUtc value. + * @return the classification value. */ - OffsetDateTime createdTimeUtc(); + IncidentClassification classification(); /** - * Gets the description property: The description of the incident. + * Gets the classificationReason property: The classification reason the incident was closed with. * - * @return the description value. + * @return the classificationReason value. */ - String description(); + IncidentClassificationReason classificationReason(); /** - * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. + * Gets the classificationComment property: Describes the reason the incident was closed. * - * @return the firstActivityTimeUtc value. + * @return the classificationComment value. */ - OffsetDateTime firstActivityTimeUtc(); + String classificationComment(); /** - * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. + * Gets the owner property: Describes a user that the incident is assigned to. * - * @return the incidentUrl value. + * @return the owner value. */ - String incidentUrl(); + IncidentOwnerInfo owner(); /** - * Gets the incidentNumber property: A sequential number. + * Gets the labels property: List of labels relevant to this incident. * - * @return the incidentNumber value. + * @return the labels value. */ - Integer incidentNumber(); + List labels(); /** - * Gets the labels property: List of labels relevant to this incident. + * Gets the firstActivityTimeUtc property: The time of the first activity in the incident. * - * @return the labels value. + * @return the firstActivityTimeUtc value. */ - List labels(); + OffsetDateTime firstActivityTimeUtc(); /** * Gets the lastActivityTimeUtc property: The time of the last activity in the incident. @@ -135,11 +135,25 @@ public interface Incident { OffsetDateTime lastModifiedTimeUtc(); /** - * Gets the owner property: Describes a user that the incident is assigned to. + * Gets the createdTimeUtc property: The time the incident was created. * - * @return the owner value. + * @return the createdTimeUtc value. */ - IncidentOwnerInfo owner(); + OffsetDateTime createdTimeUtc(); + + /** + * Gets the incidentNumber property: A sequential number. + * + * @return the incidentNumber value. + */ + Integer incidentNumber(); + + /** + * Gets the additionalData property: Additional data on the incident. + * + * @return the additionalData value. + */ + IncidentAdditionalData additionalData(); /** * Gets the relatedAnalyticRuleIds property: List of resource ids of Analytic rules related to the incident. @@ -149,25 +163,32 @@ public interface Incident { List relatedAnalyticRuleIds(); /** - * Gets the severity property: The severity of the incident. + * Gets the incidentUrl property: The deep-link url to the incident in Azure portal. * - * @return the severity value. + * @return the incidentUrl value. */ - IncidentSeverity severity(); + String incidentUrl(); /** - * Gets the status property: The status of the incident. + * Gets the providerName property: The name of the source provider that generated the incident. * - * @return the status value. + * @return the providerName value. */ - IncidentStatus status(); + String providerName(); /** - * Gets the title property: The title of the incident. + * Gets the providerIncidentId property: The incident ID assigned by the incident provider. * - * @return the title value. + * @return the providerIncidentId value. */ - String title(); + String providerIncidentId(); + + /** + * Gets the teamInformation property: Describes a team for the incident. + * + * @return the teamInformation value. + */ + TeamInformation teamInformation(); /** * Gets the name of the resource group. @@ -208,7 +229,7 @@ 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. + * @param workspaceName The name of the monitor workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); @@ -218,11 +239,12 @@ interface WithParentResource { * 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.WithLastActivityTimeUtc, DefinitionStages.WithOwner, DefinitionStages.WithSeverity, - DefinitionStages.WithStatus, DefinitionStages.WithTitle { + interface WithCreate + extends DefinitionStages.WithEtag, DefinitionStages.WithTitle, DefinitionStages.WithDescription, + DefinitionStages.WithSeverity, DefinitionStages.WithStatus, DefinitionStages.WithClassification, + DefinitionStages.WithClassificationReason, DefinitionStages.WithClassificationComment, + DefinitionStages.WithOwner, DefinitionStages.WithLabels, DefinitionStages.WithFirstActivityTimeUtc, + DefinitionStages.WithLastActivityTimeUtc, DefinitionStages.WithTeamInformation { /** * Executes the create request. * @@ -253,94 +275,94 @@ interface WithEtag { } /** - * The stage of the Incident definition allowing to specify classification. + * The stage of the Incident definition allowing to specify title. */ - interface WithClassification { + interface WithTitle { /** - * Specifies the classification property: The reason the incident was closed. + * Specifies the title property: The title of the incident. * - * @param classification The reason the incident was closed. + * @param title The title of the incident. * @return the next definition stage. */ - WithCreate withClassification(IncidentClassification classification); + WithCreate withTitle(String title); } /** - * The stage of the Incident definition allowing to specify classificationComment. + * The stage of the Incident definition allowing to specify description. */ - interface WithClassificationComment { + interface WithDescription { /** - * Specifies the classificationComment property: Describes the reason the incident was closed. + * Specifies the description property: The description of the incident. * - * @param classificationComment Describes the reason the incident was closed. + * @param description The description of the incident. * @return the next definition stage. */ - WithCreate withClassificationComment(String classificationComment); + WithCreate withDescription(String description); } /** - * The stage of the Incident definition allowing to specify classificationReason. + * The stage of the Incident definition allowing to specify severity. */ - interface WithClassificationReason { + interface WithSeverity { /** - * Specifies the classificationReason property: The classification reason the incident was closed with. + * Specifies the severity property: The severity of the incident. * - * @param classificationReason The classification reason the incident was closed with. + * @param severity The severity of the incident. * @return the next definition stage. */ - WithCreate withClassificationReason(IncidentClassificationReason classificationReason); + WithCreate withSeverity(IncidentSeverity severity); } /** - * The stage of the Incident definition allowing to specify description. + * The stage of the Incident definition allowing to specify status. */ - interface WithDescription { + interface WithStatus { /** - * Specifies the description property: The description of the incident. + * Specifies the status property: The status of the incident. * - * @param description The description of the incident. + * @param status The status of the incident. * @return the next definition stage. */ - WithCreate withDescription(String description); + WithCreate withStatus(IncidentStatus status); } /** - * The stage of the Incident definition allowing to specify firstActivityTimeUtc. + * The stage of the Incident definition allowing to specify classification. */ - interface WithFirstActivityTimeUtc { + interface WithClassification { /** - * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. + * Specifies the classification property: The reason the incident was closed. * - * @param firstActivityTimeUtc The time of the first activity in the incident. + * @param classification The reason the incident was closed. * @return the next definition stage. */ - WithCreate withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); + WithCreate withClassification(IncidentClassification classification); } /** - * The stage of the Incident definition allowing to specify labels. + * The stage of the Incident definition allowing to specify classificationReason. */ - interface WithLabels { + interface WithClassificationReason { /** - * Specifies the labels property: List of labels relevant to this incident. + * Specifies the classificationReason property: The classification reason the incident was closed with. * - * @param labels List of labels relevant to this incident. + * @param classificationReason The classification reason the incident was closed with. * @return the next definition stage. */ - WithCreate withLabels(List labels); + WithCreate withClassificationReason(IncidentClassificationReason classificationReason); } /** - * The stage of the Incident definition allowing to specify lastActivityTimeUtc. + * The stage of the Incident definition allowing to specify classificationComment. */ - interface WithLastActivityTimeUtc { + interface WithClassificationComment { /** - * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. + * Specifies the classificationComment property: Describes the reason the incident was closed. * - * @param lastActivityTimeUtc The time of the last activity in the incident. + * @param classificationComment Describes the reason the incident was closed. * @return the next definition stage. */ - WithCreate withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + WithCreate withClassificationComment(String classificationComment); } /** @@ -357,42 +379,55 @@ interface WithOwner { } /** - * The stage of the Incident definition allowing to specify severity. + * The stage of the Incident definition allowing to specify labels. */ - interface WithSeverity { + interface WithLabels { /** - * Specifies the severity property: The severity of the incident. + * Specifies the labels property: List of labels relevant to this incident. * - * @param severity The severity of the incident. + * @param labels List of labels relevant to this incident. * @return the next definition stage. */ - WithCreate withSeverity(IncidentSeverity severity); + WithCreate withLabels(List labels); } /** - * The stage of the Incident definition allowing to specify status. + * The stage of the Incident definition allowing to specify firstActivityTimeUtc. */ - interface WithStatus { + interface WithFirstActivityTimeUtc { /** - * Specifies the status property: The status of the incident. + * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. * - * @param status The status of the incident. + * @param firstActivityTimeUtc The time of the first activity in the incident. * @return the next definition stage. */ - WithCreate withStatus(IncidentStatus status); + WithCreate withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); } /** - * The stage of the Incident definition allowing to specify title. + * The stage of the Incident definition allowing to specify lastActivityTimeUtc. */ - interface WithTitle { + interface WithLastActivityTimeUtc { /** - * Specifies the title property: The title of the incident. + * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. * - * @param title The title of the incident. + * @param lastActivityTimeUtc The time of the last activity in the incident. * @return the next definition stage. */ - WithCreate withTitle(String title); + WithCreate withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + } + + /** + * 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(TeamInformation teamInformation); } } @@ -406,10 +441,11 @@ interface WithTitle { /** * The template for Incident update. */ - interface Update extends UpdateStages.WithEtag, UpdateStages.WithClassification, - UpdateStages.WithClassificationComment, UpdateStages.WithClassificationReason, UpdateStages.WithDescription, - UpdateStages.WithFirstActivityTimeUtc, UpdateStages.WithLabels, UpdateStages.WithLastActivityTimeUtc, - UpdateStages.WithOwner, UpdateStages.WithSeverity, UpdateStages.WithStatus, UpdateStages.WithTitle { + interface Update + extends UpdateStages.WithEtag, UpdateStages.WithTitle, UpdateStages.WithDescription, UpdateStages.WithSeverity, + UpdateStages.WithStatus, UpdateStages.WithClassification, UpdateStages.WithClassificationReason, + UpdateStages.WithClassificationComment, UpdateStages.WithOwner, UpdateStages.WithLabels, + UpdateStages.WithFirstActivityTimeUtc, UpdateStages.WithLastActivityTimeUtc, UpdateStages.WithTeamInformation { /** * Executes the update request. * @@ -444,94 +480,94 @@ interface WithEtag { } /** - * The stage of the Incident update allowing to specify classification. + * The stage of the Incident update allowing to specify title. */ - interface WithClassification { + interface WithTitle { /** - * Specifies the classification property: The reason the incident was closed. + * Specifies the title property: The title of the incident. * - * @param classification The reason the incident was closed. + * @param title The title of the incident. * @return the next definition stage. */ - Update withClassification(IncidentClassification classification); + Update withTitle(String title); } /** - * The stage of the Incident update allowing to specify classificationComment. + * The stage of the Incident update allowing to specify description. */ - interface WithClassificationComment { + interface WithDescription { /** - * Specifies the classificationComment property: Describes the reason the incident was closed. + * Specifies the description property: The description of the incident. * - * @param classificationComment Describes the reason the incident was closed. + * @param description The description of the incident. * @return the next definition stage. */ - Update withClassificationComment(String classificationComment); + Update withDescription(String description); } /** - * The stage of the Incident update allowing to specify classificationReason. + * The stage of the Incident update allowing to specify severity. */ - interface WithClassificationReason { + interface WithSeverity { /** - * Specifies the classificationReason property: The classification reason the incident was closed with. + * Specifies the severity property: The severity of the incident. * - * @param classificationReason The classification reason the incident was closed with. + * @param severity The severity of the incident. * @return the next definition stage. */ - Update withClassificationReason(IncidentClassificationReason classificationReason); + Update withSeverity(IncidentSeverity severity); } /** - * The stage of the Incident update allowing to specify description. + * The stage of the Incident update allowing to specify status. */ - interface WithDescription { + interface WithStatus { /** - * Specifies the description property: The description of the incident. + * Specifies the status property: The status of the incident. * - * @param description The description of the incident. + * @param status The status of the incident. * @return the next definition stage. */ - Update withDescription(String description); + Update withStatus(IncidentStatus status); } /** - * The stage of the Incident update allowing to specify firstActivityTimeUtc. + * The stage of the Incident update allowing to specify classification. */ - interface WithFirstActivityTimeUtc { + interface WithClassification { /** - * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. + * Specifies the classification property: The reason the incident was closed. * - * @param firstActivityTimeUtc The time of the first activity in the incident. + * @param classification The reason the incident was closed. * @return the next definition stage. */ - Update withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); + Update withClassification(IncidentClassification classification); } /** - * The stage of the Incident update allowing to specify labels. + * The stage of the Incident update allowing to specify classificationReason. */ - interface WithLabels { + interface WithClassificationReason { /** - * Specifies the labels property: List of labels relevant to this incident. + * Specifies the classificationReason property: The classification reason the incident was closed with. * - * @param labels List of labels relevant to this incident. + * @param classificationReason The classification reason the incident was closed with. * @return the next definition stage. */ - Update withLabels(List labels); + Update withClassificationReason(IncidentClassificationReason classificationReason); } /** - * The stage of the Incident update allowing to specify lastActivityTimeUtc. + * The stage of the Incident update allowing to specify classificationComment. */ - interface WithLastActivityTimeUtc { + interface WithClassificationComment { /** - * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. + * Specifies the classificationComment property: Describes the reason the incident was closed. * - * @param lastActivityTimeUtc The time of the last activity in the incident. + * @param classificationComment Describes the reason the incident was closed. * @return the next definition stage. */ - Update withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + Update withClassificationComment(String classificationComment); } /** @@ -548,42 +584,55 @@ interface WithOwner { } /** - * The stage of the Incident update allowing to specify severity. + * The stage of the Incident update allowing to specify labels. */ - interface WithSeverity { + interface WithLabels { /** - * Specifies the severity property: The severity of the incident. + * Specifies the labels property: List of labels relevant to this incident. * - * @param severity The severity of the incident. + * @param labels List of labels relevant to this incident. * @return the next definition stage. */ - Update withSeverity(IncidentSeverity severity); + Update withLabels(List labels); } /** - * The stage of the Incident update allowing to specify status. + * The stage of the Incident update allowing to specify firstActivityTimeUtc. */ - interface WithStatus { + interface WithFirstActivityTimeUtc { /** - * Specifies the status property: The status of the incident. + * Specifies the firstActivityTimeUtc property: The time of the first activity in the incident. * - * @param status The status of the incident. + * @param firstActivityTimeUtc The time of the first activity in the incident. * @return the next definition stage. */ - Update withStatus(IncidentStatus status); + Update withFirstActivityTimeUtc(OffsetDateTime firstActivityTimeUtc); } /** - * The stage of the Incident update allowing to specify title. + * The stage of the Incident update allowing to specify lastActivityTimeUtc. */ - interface WithTitle { + interface WithLastActivityTimeUtc { /** - * Specifies the title property: The title of the incident. + * Specifies the lastActivityTimeUtc property: The time of the last activity in the incident. * - * @param title The title of the incident. + * @param lastActivityTimeUtc The time of the last activity in the incident. * @return the next definition stage. */ - Update withTitle(String title); + Update withLastActivityTimeUtc(OffsetDateTime lastActivityTimeUtc); + } + + /** + * 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(TeamInformation teamInformation); } } 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 index d193bc8a8af3..9de5bbc029b9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -42,10 +42,30 @@ public final class IncidentAdditionalData implements JsonSerializable tactics; + /* + * The techniques associated with incident's tactics + */ + private List techniques; + + /* + * The provider incident url to the incident in Microsoft 365 Defender portal + */ + private String providerIncidentUrl; + + /* + * The incident number of the incident that the current incident was merged into + */ + private String mergedIncidentNumber; + + /* + * The URL to the incident that the current incident was merged into + */ + private String mergedIncidentUrl; + /** * Creates an instance of IncidentAdditionalData class. */ - public IncidentAdditionalData() { + private IncidentAdditionalData() { } /** @@ -94,11 +114,40 @@ public List tactics() { } /** - * Validates the instance. + * Get the techniques property: The techniques associated with incident's tactics. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * Get the providerIncidentUrl property: The provider incident url to the incident in Microsoft 365 Defender portal. + * + * @return the providerIncidentUrl value. + */ + public String providerIncidentUrl() { + return this.providerIncidentUrl; + } + + /** + * Get the mergedIncidentNumber property: The incident number of the incident that the current incident was merged + * into. + * + * @return the mergedIncidentNumber value. + */ + public String mergedIncidentNumber() { + return this.mergedIncidentNumber; + } + + /** + * Get the mergedIncidentUrl property: The URL to the incident that the current incident was merged into. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the mergedIncidentUrl value. */ - public void validate() { + public String mergedIncidentUrl() { + return this.mergedIncidentUrl; } /** @@ -138,6 +187,15 @@ public static IncidentAdditionalData fromJson(JsonReader jsonReader) throws IOEx List tactics = reader.readArray(reader1 -> AttackTactic.fromString(reader1.getString())); deserializedIncidentAdditionalData.tactics = tactics; + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedIncidentAdditionalData.techniques = techniques; + } else if ("providerIncidentUrl".equals(fieldName)) { + deserializedIncidentAdditionalData.providerIncidentUrl = reader.getString(); + } else if ("mergedIncidentNumber".equals(fieldName)) { + deserializedIncidentAdditionalData.mergedIncidentNumber = reader.getString(); + } else if ("mergedIncidentUrl".equals(fieldName)) { + deserializedIncidentAdditionalData.mergedIncidentUrl = reader.getString(); } else { reader.skipChildren(); } 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 index 07c903080c0c..7943c25f0ae2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; 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 index 317dafc7fae7..ae5607024351 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; 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 index 45dbc64ff861..28b622538861 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,22 +12,22 @@ */ public final class IncidentClassification extends ExpandableStringEnum { /** - * Static value Undetermined for IncidentClassification. + * Incident classification was undetermined. */ public static final IncidentClassification UNDETERMINED = fromString("Undetermined"); /** - * Static value TruePositive for IncidentClassification. + * Incident was true positive. */ public static final IncidentClassification TRUE_POSITIVE = fromString("TruePositive"); /** - * Static value BenignPositive for IncidentClassification. + * Incident was benign positive. */ public static final IncidentClassification BENIGN_POSITIVE = fromString("BenignPositive"); /** - * Static value FalsePositive for IncidentClassification. + * Incident was false positive. */ public static final IncidentClassification FALSE_POSITIVE = fromString("FalsePositive"); 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 index be86cc8bc35b..579b1995c4c6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,22 +12,22 @@ */ public final class IncidentClassificationReason extends ExpandableStringEnum { /** - * Static value SuspiciousActivity for IncidentClassificationReason. + * Classification reason was suspicious activity. */ public static final IncidentClassificationReason SUSPICIOUS_ACTIVITY = fromString("SuspiciousActivity"); /** - * Static value SuspiciousButExpected for IncidentClassificationReason. + * Classification reason was suspicious but expected. */ public static final IncidentClassificationReason SUSPICIOUS_BUT_EXPECTED = fromString("SuspiciousButExpected"); /** - * Static value IncorrectAlertLogic for IncidentClassificationReason. + * Classification reason was incorrect alert logic. */ public static final IncidentClassificationReason INCORRECT_ALERT_LOGIC = fromString("IncorrectAlertLogic"); /** - * Static value InaccurateData for IncidentClassificationReason. + * Classification reason was inaccurate data. */ public static final IncidentClassificationReason INACCURATE_DATA = fromString("InaccurateData"); 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 index 9388f3e915f1..69f7c4ed0064 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -48,6 +48,13 @@ public interface IncidentComment { */ SystemData systemData(); + /** + * Gets the message property: The comment message. + * + * @return the message value. + */ + String message(); + /** * Gets the createdTimeUtc property: The time the comment was created. * @@ -62,13 +69,6 @@ public interface IncidentComment { */ 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. * @@ -115,7 +115,7 @@ 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 workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @return the next definition stage. */ 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 index 8670cc25bf44..3cfd716c8695 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,118 +13,118 @@ */ public interface IncidentComments { /** - * Gets all comments for a given incident. + * 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 workspaceName The name of the monitor 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 all comments for a given incident as paginated response with {@link PagedIterable}. + * @return an incident comment along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentCommentId, Context context); /** - * Gets all comments for a given incident. + * 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 workspaceName The name of the monitor 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. + * @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 all comments for a given incident as paginated response with {@link PagedIterable}. + * @return an incident comment. */ - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, - String filter, String orderby, Integer top, String skipToken, Context context); + IncidentComment get(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); /** - * Gets a comment for a given incident. + * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a comment for a given incident along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId, Context context); /** - * Gets a comment for a given incident. + * Deletes a comment for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a comment for a given incident. */ - IncidentComment get(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); /** - * Deletes a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 {@link Response}. + * @return all comments for a given incident as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, - String incidentCommentId, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); /** - * Deletes a comment for a given incident. + * Gets all comments for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. - * @param incidentCommentId Incident comment 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 comments for a given incident as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String workspaceName, String incidentId, String incidentCommentId); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + String filter, String orderby, Integer top, String skipToken, Context context); /** - * Gets a comment for a given incident. + * 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 a comment for a given incident along with {@link Response}. + * @return an incident comment along with {@link Response}. */ IncidentComment getById(String id); /** - * Gets a comment for a given incident. + * 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 a comment for a given incident along with {@link Response}. + * @return an incident comment along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); 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 index 1693e55f4b45..afc59bfe14d4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -74,17 +74,6 @@ public IncidentConfiguration withGroupingConfiguration(GroupingConfiguration gro return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (groupingConfiguration() != null) { - groupingConfiguration().validate(); - } - } - /** * {@inheritDoc} */ 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 index ba4c6c1154fd..89ad4de7da2c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; 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 index 7bc08ed6a4ec..537bbaf690b3 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,42 +14,22 @@ /** * Information of a specific aggregation in the incident related entities result. */ -@Fluent +@Immutable public final class IncidentEntitiesResultsMetadata implements JsonSerializable { - /* - * Total number of aggregations of the given kind in the incident related entities result. - */ - private int count; - /* * The kind of the aggregated entity. */ private EntityKindEnum entityKind; - /** - * Creates an instance of IncidentEntitiesResultsMetadata class. - */ - public IncidentEntitiesResultsMetadata() { - } - - /** - * Get the count property: Total number of aggregations of the given kind in the incident related entities result. - * - * @return the count value. + /* + * Total number of aggregations of the given kind in the incident related entities result. */ - public int count() { - return this.count; - } + private int 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. + * Creates an instance of IncidentEntitiesResultsMetadata class. */ - public IncidentEntitiesResultsMetadata withCount(int count) { - this.count = count; - return this; + private IncidentEntitiesResultsMetadata() { } /** @@ -63,39 +42,22 @@ public EntityKindEnum 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(EntityKindEnum entityKind) { - this.entityKind = entityKind; - return this; - } - - /** - * Validates the instance. + * Get the count property: Total number of aggregations of the given kind in the incident related entities result. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the count value. */ - public void validate() { - if (entityKind() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property entityKind in model IncidentEntitiesResultsMetadata")); - } + public int count() { + return this.count; } - private static final ClientLogger LOGGER = new ClientLogger(IncidentEntitiesResultsMetadata.class); - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeIntField("count", this.count); jsonWriter.writeStringField("entityKind", this.entityKind == null ? null : this.entityKind.toString()); + jsonWriter.writeIntField("count", this.count); return jsonWriter.writeEndObject(); } @@ -116,11 +78,11 @@ public static IncidentEntitiesResultsMetadata fromJson(JsonReader jsonReader) th String fieldName = reader.getFieldName(); reader.nextToken(); - if ("count".equals(fieldName)) { - deserializedIncidentEntitiesResultsMetadata.count = reader.getInt(); - } else if ("entityKind".equals(fieldName)) { + if ("entityKind".equals(fieldName)) { deserializedIncidentEntitiesResultsMetadata.entityKind = EntityKindEnum.fromString(reader.getString()); + } else if ("count".equals(fieldName)) { + deserializedIncidentEntitiesResultsMetadata.count = reader.getInt(); } else { reader.skipChildren(); } 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 index 638b58a315ae..48481345e08c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -122,14 +122,6 @@ public IncidentInfo withRelationName(String relationName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index b11ee466ffe4..a00caddc7543 100644 --- 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -62,20 +61,6 @@ 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.atError() - .log(new IllegalArgumentException("Missing required property labelName in model IncidentLabel")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IncidentLabel.class); - /** * {@inheritDoc} */ 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 index e3bba75a4e30..044bfa53bdfb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,12 +12,12 @@ */ public final class IncidentLabelType extends ExpandableStringEnum { /** - * Static value User for IncidentLabelType. + * Label manually created by a user. */ public static final IncidentLabelType USER = fromString("User"); /** - * Static value AutoAssigned for IncidentLabelType. + * Label automatically created by the system. */ public static final IncidentLabelType AUTO_ASSIGNED = fromString("AutoAssigned"); 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 index 1f48c0b965ed..63cf52c31739 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -10,8 +10,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Objects; -import java.util.UUID; /** * Information on the user an incident is assigned to. @@ -31,7 +29,7 @@ public final class IncidentOwnerInfo implements JsonSerializable UUID.fromString(nonNullReader.getString())); + deserializedIncidentOwnerInfo.objectId = reader.getString(); } else if ("userPrincipalName".equals(fieldName)) { deserializedIncidentOwnerInfo.userPrincipalName = reader.getString(); } else if ("ownerType".equals(fieldName)) { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentPropertiesAction.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentPropertiesAction.java index d330b7a6a02d..4679152a95f0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentPropertiesAction.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentPropertiesAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -198,20 +198,6 @@ public IncidentPropertiesAction withLabels(List labels) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (owner() != null) { - owner().validate(); - } - if (labels() != null) { - labels().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 index a7a0bb4edfb7..299d604acf17 100644 --- 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 @@ -1,86 +1,86 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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 relations for a given incident. + * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 all relations for a given incident as paginated response with {@link PagedIterable}. + * @return a relation for a given incident along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, Context context); /** - * Gets all relations for a given incident. + * Gets a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. + * @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 all relations for a given incident as paginated response with {@link PagedIterable}. + * @return a relation for a given incident. */ - PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, String filter, - String orderby, Integer top, String skipToken, Context context); + Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName); /** - * Gets a relation for a given incident. + * 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 workspaceName The name of the monitor 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 a relation for a given incident along with {@link Response}. + * @return represents a relation between two resources along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, - String relationName, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String relationName, RelationInner relation, Context context); /** - * Gets a relation for a given incident. + * 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 workspaceName The name of the monitor 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 a relation for a given incident. + * @return represents a relation between two resources. */ - Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName); + Relation createOrUpdate(String resourceGroupName, String workspaceName, String incidentId, String relationName, + RelationInner relation); /** * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @param context The context to associate with this operation. @@ -96,7 +96,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * Deletes a relation for a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param relationName Relation Name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -106,55 +106,36 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName void delete(String resourceGroupName, String workspaceName, String incidentId, String relationName); /** - * Gets a relation for a given 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 a relation for a given incident along with {@link Response}. - */ - Relation getById(String id); - - /** - * Gets a relation for a given 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 a relation for a given incident along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a relation for a given incident. + * Gets all relations for a given incident. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 relations for a given incident as paginated response with {@link PagedIterable}. */ - void deleteById(String id); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); /** - * Deletes a relation for a given incident. + * Gets all relations for a given incident. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 the {@link 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. + * @return all relations for a given incident as paginated response with {@link PagedIterable}. */ - Relation.DefinitionStages.Blank define(String name); + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, 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/IncidentSeverity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentSeverity.java index 90a5be4431fc..b149618c9a5d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,22 +12,22 @@ */ public final class IncidentSeverity extends ExpandableStringEnum { /** - * Static value High for IncidentSeverity. + * High severity. */ public static final IncidentSeverity HIGH = fromString("High"); /** - * Static value Medium for IncidentSeverity. + * Medium severity. */ public static final IncidentSeverity MEDIUM = fromString("Medium"); /** - * Static value Low for IncidentSeverity. + * Low severity. */ public static final IncidentSeverity LOW = fromString("Low"); /** - * Static value Informational for IncidentSeverity. + * Informational severity. */ public static final IncidentSeverity INFORMATIONAL = fromString("Informational"); 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 index 5765a0a12f2c..a5fc879e5edb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,17 +12,17 @@ */ public final class IncidentStatus extends ExpandableStringEnum { /** - * Static value New for IncidentStatus. + * An active incident which isn't being handled currently. */ public static final IncidentStatus NEW = fromString("New"); /** - * Static value Active for IncidentStatus. + * An active incident which is being handled. */ public static final IncidentStatus ACTIVE = fromString("Active"); /** - * Static value Closed for IncidentStatus. + * A non-active incident. */ public static final IncidentStatus CLOSED = fromString("Closed"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTask.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTask.java new file mode 100644 index 000000000000..af98d80ae105 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTask.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.IncidentTaskInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of IncidentTask. + */ +public interface IncidentTask { + /** + * 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 title property: The title of the task. + * + * @return the title value. + */ + String title(); + + /** + * Gets the description property: The description of the task. + * + * @return the description value. + */ + String description(); + + /** + * Gets the status property: The status of the task. + * + * @return the status value. + */ + IncidentTaskStatus status(); + + /** + * Gets the createdTimeUtc property: The time the task was created. + * + * @return the createdTimeUtc value. + */ + OffsetDateTime createdTimeUtc(); + + /** + * Gets the lastModifiedTimeUtc property: The last time the task was updated. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * Gets the createdBy property: Information on the client (user or application) that made some action. + * + * @return the createdBy value. + */ + ClientInfo createdBy(); + + /** + * Gets the lastModifiedBy property: Information on the client (user or application) that made some action. + * + * @return the lastModifiedBy value. + */ + ClientInfo lastModifiedBy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner object. + * + * @return the inner object. + */ + IncidentTaskInner innerModel(); + + /** + * The entirety of the IncidentTask definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithTitle, DefinitionStages.WithStatus, DefinitionStages.WithCreate { + } + + /** + * The IncidentTask definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the IncidentTask definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the IncidentTask 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 monitor workspace. + * @param incidentId Incident ID. + * @return the next definition stage. + */ + WithTitle withExistingIncident(String resourceGroupName, String workspaceName, String incidentId); + } + + /** + * The stage of the IncidentTask definition allowing to specify title. + */ + interface WithTitle { + /** + * Specifies the title property: The title of the task. + * + * @param title The title of the task. + * @return the next definition stage. + */ + WithStatus withTitle(String title); + } + + /** + * The stage of the IncidentTask definition allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: The status of the task. + * + * @param status The status of the task. + * @return the next definition stage. + */ + WithCreate withStatus(IncidentTaskStatus status); + } + + /** + * The stage of the IncidentTask 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.WithDescription, + DefinitionStages.WithCreatedBy, DefinitionStages.WithLastModifiedBy { + /** + * Executes the create request. + * + * @return the created resource. + */ + IncidentTask create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IncidentTask create(Context context); + } + + /** + * The stage of the IncidentTask 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 IncidentTask definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the task. + * + * @param description The description of the task. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the IncidentTask definition allowing to specify createdBy. + */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Information on the client (user or application) that made some action. + * + * @param createdBy Information on the client (user or application) that made some action. + * @return the next definition stage. + */ + WithCreate withCreatedBy(ClientInfo createdBy); + } + + /** + * The stage of the IncidentTask definition allowing to specify lastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies the lastModifiedBy property: Information on the client (user or application) that made some + * action. + * + * @param lastModifiedBy Information on the client (user or application) that made some action. + * @return the next definition stage. + */ + WithCreate withLastModifiedBy(ClientInfo lastModifiedBy); + } + } + + /** + * Begins update for the IncidentTask resource. + * + * @return the stage of resource update. + */ + IncidentTask.Update update(); + + /** + * The template for IncidentTask update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithTitle, UpdateStages.WithDescription, + UpdateStages.WithStatus, UpdateStages.WithCreatedBy, UpdateStages.WithLastModifiedBy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IncidentTask apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IncidentTask apply(Context context); + } + + /** + * The IncidentTask update stages. + */ + interface UpdateStages { + /** + * The stage of the IncidentTask 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 IncidentTask update allowing to specify title. + */ + interface WithTitle { + /** + * Specifies the title property: The title of the task. + * + * @param title The title of the task. + * @return the next definition stage. + */ + Update withTitle(String title); + } + + /** + * The stage of the IncidentTask update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the task. + * + * @param description The description of the task. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the IncidentTask update allowing to specify status. + */ + interface WithStatus { + /** + * Specifies the status property: The status of the task. + * + * @param status The status of the task. + * @return the next definition stage. + */ + Update withStatus(IncidentTaskStatus status); + } + + /** + * The stage of the IncidentTask update allowing to specify createdBy. + */ + interface WithCreatedBy { + /** + * Specifies the createdBy property: Information on the client (user or application) that made some action. + * + * @param createdBy Information on the client (user or application) that made some action. + * @return the next definition stage. + */ + Update withCreatedBy(ClientInfo createdBy); + } + + /** + * The stage of the IncidentTask update allowing to specify lastModifiedBy. + */ + interface WithLastModifiedBy { + /** + * Specifies the lastModifiedBy property: Information on the client (user or application) that made some + * action. + * + * @param lastModifiedBy Information on the client (user or application) that made some action. + * @return the next definition stage. + */ + Update withLastModifiedBy(ClientInfo lastModifiedBy); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IncidentTask refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IncidentTask refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskStatus.java new file mode 100644 index 000000000000..22d4c77c8d2b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the task. + */ +public final class IncidentTaskStatus extends ExpandableStringEnum { + /** + * A new task. + */ + public static final IncidentTaskStatus NEW = fromString("New"); + + /** + * A completed task. + */ + public static final IncidentTaskStatus COMPLETED = fromString("Completed"); + + /** + * Creates a new instance of IncidentTaskStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IncidentTaskStatus() { + } + + /** + * Creates or finds a IncidentTaskStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncidentTaskStatus. + */ + public static IncidentTaskStatus fromString(String name) { + return fromString(name, IncidentTaskStatus.class); + } + + /** + * Gets known IncidentTaskStatus values. + * + * @return known IncidentTaskStatus values. + */ + public static Collection values() { + return values(IncidentTaskStatus.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTasks.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTasks.java new file mode 100644 index 000000000000..010ff5bb5810 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTasks.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 IncidentTasks. + */ +public interface IncidentTasks { + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context); + + /** + * Gets an incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 task. + */ + IncidentTask get(String resourceGroupName, String workspaceName, String incidentId, String incidentTaskId); + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, + String incidentTaskId, Context context); + + /** + * Delete the incident task. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. + * @param incidentTaskId Incident task 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 incidentTaskId); + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId); + + /** + * Gets all incident tasks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 tasks as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, + Context context); + + /** + * Gets an incident task. + * + * @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 task along with {@link Response}. + */ + IncidentTask getById(String id); + + /** + * Gets an incident task. + * + * @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 task along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the incident task. + * + * @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 task. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IncidentTask resource. + * + * @param name resource name. + * @return the first stage of the new IncidentTask definition. + */ + IncidentTask.DefinitionStages.Blank define(String name); +} 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 index f84d58af587a..180f13bd0b2f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,97 +13,126 @@ */ public interface Incidents { /** - * Gets all incidents. + * Gets a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 incidents as paginated response with {@link PagedIterable}. + * @return a given incident along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName); + Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Context context); /** - * Gets all incidents. + * Gets a given incident. * * @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. + * @param workspaceName The name of the monitor 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 incidents as paginated response with {@link PagedIterable}. + * @return a given incident. */ - PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, - Integer top, String skipToken, Context context); + Incident get(String resourceGroupName, String workspaceName, String incidentId); /** - * Gets a given incident. + * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a given incident along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String incidentId, + Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, Context context); /** - * Gets a given incident. + * Deletes a given incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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 a given incident. */ - Incident get(String resourceGroupName, String workspaceName, String incidentId); + void delete(String resourceGroupName, String workspaceName, String incidentId); /** - * Deletes a given incident. + * Gets all incidents. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, String skipToken, Context context); + + /** + * Triggers playbook on a specific 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 incidentIdentifier The incident identifier. + * @param requestBody Describes the request body for triggering a playbook on an 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 the {@link Response}. + * @return anything along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, - Context context); + Response runPlaybookWithResponse(String resourceGroupName, String workspaceName, String incidentIdentifier, + ManualTriggerRequestBody requestBody, Context context); /** - * Deletes a given incident. + * Triggers playbook on a specific 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 incidentIdentifier The incident identifier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return anything. */ - void delete(String resourceGroupName, String workspaceName, String incidentId); + Object runPlaybook(String resourceGroupName, String workspaceName, String incidentIdentifier); /** * Gets all alerts for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -118,7 +147,7 @@ Response listAlertsWithResponse(String resourceGroupName, Str * Gets all alerts for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -131,7 +160,7 @@ Response listAlertsWithResponse(String resourceGroupName, Str * Gets all bookmarks for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,7 +175,7 @@ Response listBookmarksWithResponse(String resourceGroupNam * Gets all bookmarks for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. @@ -159,7 +188,7 @@ Response listBookmarksWithResponse(String resourceGroupNam * Gets all entities for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param incidentId Incident ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -174,7 +203,7 @@ Response listEntitiesWithResponse(String resourceGroup * Gets all entities for an incident. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor 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. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Indicator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Indicator.java new file mode 100644 index 000000000000..e9278e1599b6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Indicator.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents an indicator in Azure Security Insights. + */ +@Immutable +public final class Indicator extends TIObjectInner { + /* + * The kind of the TI object + */ + private TIObjectKind kind = TIObjectKind.INDICATOR; + + /* + * The observables of this indicator + */ + private List observables; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The properties of the TI object + */ + private TIObjectCommonProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Indicator class. + */ + private Indicator() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Get the observables property: The observables of this indicator. + * + * @return the observables value. + */ + public List observables() { + return this.observables; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: The properties of the TI object. + * + * @return the innerProperties value. + */ + private TIObjectCommonProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + public Map data() { + return this.innerProperties() == null ? null : this.innerProperties().data(); + } + + /** + * Get the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the source property: The source name for this TI object. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + public OffsetDateTime firstIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstIngestedTimeUtc(); + } + + /** + * Get the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + public OffsetDateTime lastIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastIngestedTimeUtc(); + } + + /** + * Get the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + public String ingestionRulesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionRulesVersion(); + } + + /** + * Get the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + public String lastUpdateMethod() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdateMethod(); + } + + /** + * Get the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + public UserInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateTimeUtc(); + } + + /** + * Get the relationshipHints property: A dictionary used to help follow relationships from this object to other STIX + * objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of sources + * that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + public List relationshipHints() { + return this.innerProperties() == null ? null : this.innerProperties().relationshipHints(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeArrayField("observables", this.observables, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Indicator from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Indicator if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Indicator. + */ + public static Indicator fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Indicator deserializedIndicator = new Indicator(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIndicator.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIndicator.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIndicator.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIndicator.innerProperties = TIObjectCommonProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedIndicator.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedIndicator.kind = TIObjectKind.fromString(reader.getString()); + } else if ("observables".equals(fieldName)) { + List observables + = reader.readArray(reader1 -> IndicatorObservablesItem.fromJson(reader1)); + deserializedIndicator.observables = observables; + } else { + reader.skipChildren(); + } + } + + return deserializedIndicator; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IndicatorObservablesItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IndicatorObservablesItem.java new file mode 100644 index 000000000000..e35ffb572ae6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IndicatorObservablesItem.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An observable of this indicator. + */ +@Immutable +public final class IndicatorObservablesItem implements JsonSerializable { + /* + * The type of the observable of this indicator + */ + private String type; + + /* + * The value of the observable of this indicator + */ + private String value; + + /** + * Creates an instance of IndicatorObservablesItem class. + */ + private IndicatorObservablesItem() { + } + + /** + * Get the type property: The type of the observable of this indicator. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the value property: The value of the observable of this indicator. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IndicatorObservablesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IndicatorObservablesItem if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IndicatorObservablesItem. + */ + public static IndicatorObservablesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IndicatorObservablesItem deserializedIndicatorObservablesItem = new IndicatorObservablesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedIndicatorObservablesItem.type = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedIndicatorObservablesItem.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIndicatorObservablesItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionMode.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionMode.java new file mode 100644 index 000000000000..4672ff832797 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes how to ingest the records in the file. + */ +public final class IngestionMode extends ExpandableStringEnum { + /** + * No records should be ingested when invalid records are detected. + */ + public static final IngestionMode INGEST_ONLY_IF_ALL_ARE_VALID = fromString("IngestOnlyIfAllAreValid"); + + /** + * Valid records should still be ingested when invalid records are detected. + */ + public static final IngestionMode INGEST_ANY_VALID_RECORDS = fromString("IngestAnyValidRecords"); + + /** + * Unspecified. + */ + public static final IngestionMode UNSPECIFIED = fromString("Unspecified"); + + /** + * Creates a new instance of IngestionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IngestionMode() { + } + + /** + * Creates or finds a IngestionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IngestionMode. + */ + public static IngestionMode fromString(String name) { + return fromString(name, IngestionMode.class); + } + + /** + * Gets known IngestionMode values. + * + * @return known IngestionMode values. + */ + public static Collection values() { + return values(IngestionMode.class); + } +} 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..46eee8a5b21a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItem.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryItemInner; +import java.io.IOException; + +/** + * Represents Insight Query. + */ +@Immutable +public final class InsightQueryItem extends EntityQueryItemInner { + /* + * The kind of the entity query + */ + private EntityQueryKind kind = EntityQueryKind.INSIGHT; + + /* + * Properties bag for InsightQueryItem + */ + private InsightQueryItemProperties properties; + + /* + * ARM Type + */ + private String type; + + /* + * Query Template ARM Name + */ + private String name; + + /* + * Query Template ARM ID + */ + private String id; + + /** + * Creates an instance of InsightQueryItem class. + */ + private InsightQueryItem() { + } + + /** + * Get the kind property: The kind of the entity query. + * + * @return the kind value. + */ + @Override + public EntityQueryKind kind() { + return this.kind; + } + + /** + * Get the properties property: Properties bag for InsightQueryItem. + * + * @return the properties value. + */ + public InsightQueryItemProperties properties() { + return this.properties; + } + + /** + * Get the type property: ARM Type. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: Query Template ARM Name. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Query Template ARM ID. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("type", type()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightQueryItem. + */ + public static InsightQueryItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItem deserializedInsightQueryItem = new InsightQueryItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedInsightQueryItem.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedInsightQueryItem.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedInsightQueryItem.type = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedInsightQueryItem.kind = EntityQueryKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedInsightQueryItem.properties = InsightQueryItemProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItem; + }); + } +} 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..de56d746305b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemProperties.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents Insight Query. + */ +@Immutable +public final class InsightQueryItemProperties extends EntityQueryItemProperties { + /* + * The insight display name. + */ + private String displayName; + + /* + * The insight description. + */ + private String description; + + /* + * The base query of the insight. + */ + private String baseQuery; + + /* + * The insight table query. + */ + private InsightQueryItemPropertiesTableQuery tableQuery; + + /* + * The insight chart query. + */ + private Object chartQuery; + + /* + * The activity query definitions. + */ + private InsightQueryItemPropertiesAdditionalQuery additionalQuery; + + /* + * The insight chart query. + */ + private InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange; + + /* + * The insight chart query. + */ + private InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange; + + /* + * The query applied only to entities matching to all filters + */ + private Object entitiesFilter; + + /* + * Data types for template + */ + private List> requiredInputFieldsSets; + + /* + * The type of the entity + */ + private EntityType inputEntityType; + + /* + * Data types for template + */ + private List dataTypes; + + /** + * Creates an instance of InsightQueryItemProperties class. + */ + private InsightQueryItemProperties() { + } + + /** + * Get the displayName property: The insight display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The insight description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the baseQuery property: The base query of the insight. + * + * @return the baseQuery value. + */ + public String baseQuery() { + return this.baseQuery; + } + + /** + * Get the tableQuery property: The insight table query. + * + * @return the tableQuery value. + */ + public InsightQueryItemPropertiesTableQuery tableQuery() { + return this.tableQuery; + } + + /** + * Get the chartQuery property: The insight chart query. + * + * @return the chartQuery value. + */ + public Object chartQuery() { + return this.chartQuery; + } + + /** + * Get the additionalQuery property: The activity query definitions. + * + * @return the additionalQuery value. + */ + public InsightQueryItemPropertiesAdditionalQuery additionalQuery() { + return this.additionalQuery; + } + + /** + * Get the defaultTimeRange property: The insight chart query. + * + * @return the defaultTimeRange value. + */ + public InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange() { + return this.defaultTimeRange; + } + + /** + * Get the referenceTimeRange property: The insight chart query. + * + * @return the referenceTimeRange value. + */ + public InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange() { + return this.referenceTimeRange; + } + + /** + * Get the entitiesFilter property: The query applied only to entities matching to all filters. + * + * @return the entitiesFilter value. + */ + @Override + public Object entitiesFilter() { + return this.entitiesFilter; + } + + /** + * Get the requiredInputFieldsSets property: Data types for template. + * + * @return the requiredInputFieldsSets value. + */ + @Override + public List> requiredInputFieldsSets() { + return this.requiredInputFieldsSets; + } + + /** + * Get the inputEntityType property: The type of the entity. + * + * @return the inputEntityType value. + */ + @Override + public EntityType inputEntityType() { + return this.inputEntityType; + } + + /** + * Get the dataTypes property: Data types for template. + * + * @return the dataTypes value. + */ + @Override + public List dataTypes() { + return this.dataTypes; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dataTypes", dataTypes(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("inputEntityType", inputEntityType() == null ? null : inputEntityType().toString()); + jsonWriter.writeArrayField("requiredInputFieldsSets", requiredInputFieldsSets(), + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + if (entitiesFilter() != null) { + jsonWriter.writeUntypedField("entitiesFilter", entitiesFilter()); + } + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("baseQuery", this.baseQuery); + jsonWriter.writeJsonField("tableQuery", this.tableQuery); + if (this.chartQuery != null) { + jsonWriter.writeUntypedField("chartQuery", this.chartQuery); + } + jsonWriter.writeJsonField("additionalQuery", this.additionalQuery); + jsonWriter.writeJsonField("defaultTimeRange", this.defaultTimeRange); + jsonWriter.writeJsonField("referenceTimeRange", this.referenceTimeRange); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightQueryItemProperties. + */ + public static InsightQueryItemProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemProperties deserializedInsightQueryItemProperties = new InsightQueryItemProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dataTypes".equals(fieldName)) { + List dataTypes + = reader.readArray(reader1 -> EntityQueryItemPropertiesDataTypesItem.fromJson(reader1)); + deserializedInsightQueryItemProperties.dataTypes = dataTypes; + } else if ("inputEntityType".equals(fieldName)) { + deserializedInsightQueryItemProperties.inputEntityType = EntityType.fromString(reader.getString()); + } else if ("requiredInputFieldsSets".equals(fieldName)) { + List> requiredInputFieldsSets + = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedInsightQueryItemProperties.requiredInputFieldsSets = requiredInputFieldsSets; + } else if ("entitiesFilter".equals(fieldName)) { + deserializedInsightQueryItemProperties.entitiesFilter = reader.readUntyped(); + } else if ("displayName".equals(fieldName)) { + deserializedInsightQueryItemProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedInsightQueryItemProperties.description = reader.getString(); + } else if ("baseQuery".equals(fieldName)) { + deserializedInsightQueryItemProperties.baseQuery = reader.getString(); + } else if ("tableQuery".equals(fieldName)) { + deserializedInsightQueryItemProperties.tableQuery + = InsightQueryItemPropertiesTableQuery.fromJson(reader); + } else if ("chartQuery".equals(fieldName)) { + deserializedInsightQueryItemProperties.chartQuery = reader.readUntyped(); + } else if ("additionalQuery".equals(fieldName)) { + deserializedInsightQueryItemProperties.additionalQuery + = InsightQueryItemPropertiesAdditionalQuery.fromJson(reader); + } else if ("defaultTimeRange".equals(fieldName)) { + deserializedInsightQueryItemProperties.defaultTimeRange + = InsightQueryItemPropertiesDefaultTimeRange.fromJson(reader); + } else if ("referenceTimeRange".equals(fieldName)) { + deserializedInsightQueryItemProperties.referenceTimeRange + = InsightQueryItemPropertiesReferenceTimeRange.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemProperties; + }); + } +} 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..4948d4018c9b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesAdditionalQuery.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The activity query definitions. + */ +@Immutable +public final class InsightQueryItemPropertiesAdditionalQuery + implements JsonSerializable { + /* + * The insight query. + */ + private String query; + + /* + * The insight text. + */ + private String text; + + /** + * Creates an instance of InsightQueryItemPropertiesAdditionalQuery class. + */ + private InsightQueryItemPropertiesAdditionalQuery() { + } + + /** + * Get the query property: The insight query. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Get the text property: The insight text. + * + * @return the text value. + */ + public String text() { + return this.text; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeStringField("text", this.text); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemPropertiesAdditionalQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemPropertiesAdditionalQuery if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightQueryItemPropertiesAdditionalQuery. + */ + public static InsightQueryItemPropertiesAdditionalQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemPropertiesAdditionalQuery deserializedInsightQueryItemPropertiesAdditionalQuery + = new InsightQueryItemPropertiesAdditionalQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("query".equals(fieldName)) { + deserializedInsightQueryItemPropertiesAdditionalQuery.query = reader.getString(); + } else if ("text".equals(fieldName)) { + deserializedInsightQueryItemPropertiesAdditionalQuery.text = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemPropertiesAdditionalQuery; + }); + } +} 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..5f4330323bb7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The insight chart query. + */ +@Immutable +public final class InsightQueryItemPropertiesDefaultTimeRange + implements JsonSerializable { + /* + * The padding for the start time of the query. + */ + private String beforeRange; + + /* + * The padding for the end time of the query. + */ + private String afterRange; + + /** + * Creates an instance of InsightQueryItemPropertiesDefaultTimeRange class. + */ + private InsightQueryItemPropertiesDefaultTimeRange() { + } + + /** + * Get the beforeRange property: The padding for the start time of the query. + * + * @return the beforeRange value. + */ + public String beforeRange() { + return this.beforeRange; + } + + /** + * Get the afterRange property: The padding for the end time of the query. + * + * @return the afterRange value. + */ + public String afterRange() { + return this.afterRange; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("beforeRange", this.beforeRange); + jsonWriter.writeStringField("afterRange", this.afterRange); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemPropertiesDefaultTimeRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemPropertiesDefaultTimeRange if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightQueryItemPropertiesDefaultTimeRange. + */ + public static InsightQueryItemPropertiesDefaultTimeRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemPropertiesDefaultTimeRange deserializedInsightQueryItemPropertiesDefaultTimeRange + = new InsightQueryItemPropertiesDefaultTimeRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("beforeRange".equals(fieldName)) { + deserializedInsightQueryItemPropertiesDefaultTimeRange.beforeRange = reader.getString(); + } else if ("afterRange".equals(fieldName)) { + deserializedInsightQueryItemPropertiesDefaultTimeRange.afterRange = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemPropertiesDefaultTimeRange; + }); + } +} 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..36e45867e99b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The insight chart query. + */ +@Immutable +public final class InsightQueryItemPropertiesReferenceTimeRange + implements JsonSerializable { + /* + * Additional query time for looking back. + */ + private String beforeRange; + + /** + * Creates an instance of InsightQueryItemPropertiesReferenceTimeRange class. + */ + private InsightQueryItemPropertiesReferenceTimeRange() { + } + + /** + * Get the beforeRange property: Additional query time for looking back. + * + * @return the beforeRange value. + */ + public String beforeRange() { + return this.beforeRange; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("beforeRange", this.beforeRange); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemPropertiesReferenceTimeRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemPropertiesReferenceTimeRange if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightQueryItemPropertiesReferenceTimeRange. + */ + public static InsightQueryItemPropertiesReferenceTimeRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemPropertiesReferenceTimeRange deserializedInsightQueryItemPropertiesReferenceTimeRange + = new InsightQueryItemPropertiesReferenceTimeRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("beforeRange".equals(fieldName)) { + deserializedInsightQueryItemPropertiesReferenceTimeRange.beforeRange = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemPropertiesReferenceTimeRange; + }); + } +} 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..5f1396eeb0c8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The insight table query. + */ +@Immutable +public final class InsightQueryItemPropertiesTableQuery + implements JsonSerializable { + /* + * List of insight column definitions. + */ + private List columnsDefinitions; + + /* + * List of insight queries definitions. + */ + private List queriesDefinitions; + + /** + * Creates an instance of InsightQueryItemPropertiesTableQuery class. + */ + private InsightQueryItemPropertiesTableQuery() { + } + + /** + * Get the columnsDefinitions property: List of insight column definitions. + * + * @return the columnsDefinitions value. + */ + public List columnsDefinitions() { + return this.columnsDefinitions; + } + + /** + * Get the queriesDefinitions property: List of insight queries definitions. + * + * @return the queriesDefinitions value. + */ + public List queriesDefinitions() { + return this.queriesDefinitions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("columnsDefinitions", this.columnsDefinitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("queriesDefinitions", this.queriesDefinitions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemPropertiesTableQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemPropertiesTableQuery if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightQueryItemPropertiesTableQuery. + */ + public static InsightQueryItemPropertiesTableQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemPropertiesTableQuery deserializedInsightQueryItemPropertiesTableQuery + = new InsightQueryItemPropertiesTableQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("columnsDefinitions".equals(fieldName)) { + List columnsDefinitions + = reader.readArray( + reader1 -> InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.fromJson(reader1)); + deserializedInsightQueryItemPropertiesTableQuery.columnsDefinitions = columnsDefinitions; + } else if ("queriesDefinitions".equals(fieldName)) { + List queriesDefinitions + = reader.readArray( + reader1 -> InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.fromJson(reader1)); + deserializedInsightQueryItemPropertiesTableQuery.queriesDefinitions = queriesDefinitions; + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemPropertiesTableQuery; + }); + } +} 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..631f62b19d75 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem model. + */ +@Immutable +public final class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem + implements JsonSerializable { + /* + * Insight column header. + */ + private String headerProperty; + + /* + * Insights Column type. + */ + private OutputType outputType; + + /* + * Is query supports deep-link. + */ + private Boolean supportDeepLink; + + /** + * Creates an instance of InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem class. + */ + private InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem() { + } + + /** + * Get the headerProperty property: Insight column header. + * + * @return the headerProperty value. + */ + public String headerProperty() { + return this.headerProperty; + } + + /** + * Get the outputType property: Insights Column type. + * + * @return the outputType value. + */ + public OutputType outputType() { + return this.outputType; + } + + /** + * Get the supportDeepLink property: Is query supports deep-link. + * + * @return the supportDeepLink value. + */ + public Boolean supportDeepLink() { + return this.supportDeepLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("header", this.headerProperty); + jsonWriter.writeStringField("outputType", this.outputType == null ? null : this.outputType.toString()); + jsonWriter.writeBooleanField("supportDeepLink", this.supportDeepLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem. + */ + public static InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem deserializedInsightQueryItemPropertiesTableQueryColumnsDefinitionsItem + = new InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("header".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.headerProperty + = reader.getString(); + } else if ("outputType".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.outputType + = OutputType.fromString(reader.getString()); + } else if ("supportDeepLink".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.supportDeepLink + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemPropertiesTableQueryColumnsDefinitionsItem; + }); + } +} 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..a5592ba7b682 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem model. + */ +@Immutable +public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem + implements JsonSerializable { + /* + * Insight column header. + */ + private String filter; + + /* + * Insight column header. + */ + private String summarize; + + /* + * Insight column header. + */ + private String project; + + /* + * Insight column header. + */ + private List linkColumnsDefinitions; + + /** + * Creates an instance of InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem class. + */ + private InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem() { + } + + /** + * Get the filter property: Insight column header. + * + * @return the filter value. + */ + public String filter() { + return this.filter; + } + + /** + * Get the summarize property: Insight column header. + * + * @return the summarize value. + */ + public String summarize() { + return this.summarize; + } + + /** + * Get the project property: Insight column header. + * + * @return the project value. + */ + public String project() { + return this.project; + } + + /** + * Get the linkColumnsDefinitions property: Insight column header. + * + * @return the linkColumnsDefinitions value. + */ + public List linkColumnsDefinitions() { + return this.linkColumnsDefinitions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filter", this.filter); + jsonWriter.writeStringField("summarize", this.summarize); + jsonWriter.writeStringField("project", this.project); + jsonWriter.writeArrayField("linkColumnsDefinitions", this.linkColumnsDefinitions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem. + */ + public static InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsItem + = new InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filter".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.filter = reader.getString(); + } else if ("summarize".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.summarize + = reader.getString(); + } else if ("project".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.project = reader.getString(); + } else if ("linkColumnsDefinitions".equals(fieldName)) { + List linkColumnsDefinitions + = reader.readArray( + reader1 -> InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem + .fromJson(reader1)); + deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.linkColumnsDefinitions + = linkColumnsDefinitions; + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsItem; + }); + } +} 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..8752aaa93474 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem model. + */ +@Immutable +public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem + implements JsonSerializable { + /* + * Insight Link Definition Projected Name. + */ + private String projectedName; + + /* + * Insight Link Definition Query. + */ + private String query; + + /** + * Creates an instance of InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem class. + */ + private InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem() { + } + + /** + * Get the projectedName property: Insight Link Definition Projected Name. + * + * @return the projectedName value. + */ + public String projectedName() { + return this.projectedName; + } + + /** + * Get the query property: Insight Link Definition Query. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("projectedName", this.projectedName); + jsonWriter.writeStringField("Query", this.query); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem from the + * JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem if the + * JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem. + */ + public static InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem + fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem + = new InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("projectedName".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.projectedName + = reader.getString(); + } else if ("Query".equals(fieldName)) { + deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.query + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem; + }); + } +} 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..663ddee2c3d5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Query results for table insights query. + */ +@Immutable +public final class InsightsTableResult implements JsonSerializable { + /* + * Columns Metadata of the table + */ + private List columns; + + /* + * Rows data of the table + */ + private List> rows; + + /** + * Creates an instance of InsightsTableResult class. + */ + private InsightsTableResult() { + } + + /** + * Get the columns property: Columns Metadata of the table. + * + * @return the columns value. + */ + public List columns() { + return this.columns; + } + + /** + * Get the rows property: Rows data of the table. + * + * @return the rows value. + */ + public List> rows() { + return this.rows; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("rows", this.rows, + (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightsTableResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightsTableResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightsTableResult. + */ + public static InsightsTableResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightsTableResult deserializedInsightsTableResult = new InsightsTableResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("columns".equals(fieldName)) { + List columns + = reader.readArray(reader1 -> InsightsTableResultColumnsItem.fromJson(reader1)); + deserializedInsightsTableResult.columns = columns; + } else if ("rows".equals(fieldName)) { + List> rows + = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); + deserializedInsightsTableResult.rows = rows; + } else { + reader.skipChildren(); + } + } + + return deserializedInsightsTableResult; + }); + } +} 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..b4fd812e6604 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The InsightsTableResultColumnsItem model. + */ +@Immutable +public final class InsightsTableResultColumnsItem implements JsonSerializable { + /* + * the type of the column + */ + private String type; + + /* + * the name of the column + */ + private String name; + + /** + * Creates an instance of InsightsTableResultColumnsItem class. + */ + private InsightsTableResultColumnsItem() { + } + + /** + * Get the type property: the type of the column. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the name property: the name of the column. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InsightsTableResultColumnsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InsightsTableResultColumnsItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InsightsTableResultColumnsItem. + */ + public static InsightsTableResultColumnsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InsightsTableResultColumnsItem deserializedInsightsTableResultColumnsItem + = new InsightsTableResultColumnsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedInsightsTableResultColumnsItem.type = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedInsightsTableResultColumnsItem.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInsightsTableResultColumnsItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStep.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStep.java new file mode 100644 index 000000000000..3723e56d780a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStep.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Instruction steps to enable the connector. + */ +@Fluent +public final class InstructionStep implements JsonSerializable { + /* + * Gets or sets the instruction step title. + */ + private String title; + + /* + * Gets or sets the instruction step description. + */ + private String description; + + /* + * Gets or sets the instruction step details. + */ + private List instructions; + + /* + * Gets or sets the inner instruction steps details. + * For Example: instruction step 1 might contain inner instruction steps: [instruction step 1.1, instruction step + * 1.2]. + */ + private List innerSteps; + + /** + * Creates an instance of InstructionStep class. + */ + public InstructionStep() { + } + + /** + * Get the title property: Gets or sets the instruction step title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Gets or sets the instruction step title. + * + * @param title the title value to set. + * @return the InstructionStep object itself. + */ + public InstructionStep withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Gets or sets the instruction step description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Gets or sets the instruction step description. + * + * @param description the description value to set. + * @return the InstructionStep object itself. + */ + public InstructionStep withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the instructions property: Gets or sets the instruction step details. + * + * @return the instructions value. + */ + public List instructions() { + return this.instructions; + } + + /** + * Set the instructions property: Gets or sets the instruction step details. + * + * @param instructions the instructions value to set. + * @return the InstructionStep object itself. + */ + public InstructionStep withInstructions(List instructions) { + this.instructions = instructions; + return this; + } + + /** + * Get the innerSteps property: Gets or sets the inner instruction steps details. + * For Example: instruction step 1 might contain inner instruction steps: [instruction step 1.1, instruction step + * 1.2]. + * + * @return the innerSteps value. + */ + public List innerSteps() { + return this.innerSteps; + } + + /** + * Set the innerSteps property: Gets or sets the inner instruction steps details. + * For Example: instruction step 1 might contain inner instruction steps: [instruction step 1.1, instruction step + * 1.2]. + * + * @param innerSteps the innerSteps value to set. + * @return the InstructionStep object itself. + */ + public InstructionStep withInnerSteps(List innerSteps) { + this.innerSteps = innerSteps; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("instructions", this.instructions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("innerSteps", this.innerSteps, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstructionStep from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstructionStep if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstructionStep. + */ + public static InstructionStep fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstructionStep deserializedInstructionStep = new InstructionStep(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedInstructionStep.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedInstructionStep.description = reader.getString(); + } else if ("instructions".equals(fieldName)) { + List instructions + = reader.readArray(reader1 -> InstructionStepDetails.fromJson(reader1)); + deserializedInstructionStep.instructions = instructions; + } else if ("innerSteps".equals(fieldName)) { + List innerSteps = reader.readArray(reader1 -> InstructionStep.fromJson(reader1)); + deserializedInstructionStep.innerSteps = innerSteps; + } else { + reader.skipChildren(); + } + } + + return deserializedInstructionStep; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepDetails.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepDetails.java new file mode 100644 index 000000000000..eaa7b9210a42 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepDetails.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Instruction step details, to be displayed in the Instructions steps section in the connector's page in Sentinel + * Portal. + */ +@Fluent +public final class InstructionStepDetails implements JsonSerializable { + /* + * Gets or sets the instruction type parameters settings. + */ + private Object parameters; + + /* + * Gets or sets the instruction type name. + */ + private String type; + + /** + * Creates an instance of InstructionStepDetails class. + */ + public InstructionStepDetails() { + } + + /** + * Get the parameters property: Gets or sets the instruction type parameters settings. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Gets or sets the instruction type parameters settings. + * + * @param parameters the parameters value to set. + * @return the InstructionStepDetails object itself. + */ + public InstructionStepDetails withParameters(Object parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the type property: Gets or sets the instruction type name. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Gets or sets the instruction type name. + * + * @param type the type value to set. + * @return the InstructionStepDetails object itself. + */ + public InstructionStepDetails withType(String type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeUntypedField("parameters", this.parameters); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstructionStepDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstructionStepDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InstructionStepDetails. + */ + public static InstructionStepDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstructionStepDetails deserializedInstructionStepDetails = new InstructionStepDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("parameters".equals(fieldName)) { + deserializedInstructionStepDetails.parameters = reader.readUntyped(); + } else if ("type".equals(fieldName)) { + deserializedInstructionStepDetails.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInstructionStepDetails; + }); + } +} 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..cffd2380bdb5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionSteps.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Instruction steps to enable the connector. + */ +@Fluent +public class InstructionSteps implements JsonSerializable { + /* + * Instruction step title + */ + private String title; + + /* + * Instruction step description + */ + private String description; + + /* + * Instruction step details + */ + private List instructions; + + /** + * Creates an instance of InstructionSteps class. + */ + public InstructionSteps() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("instructions", this.instructions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstructionSteps from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstructionSteps if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InstructionSteps. + */ + public static InstructionSteps fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstructionSteps deserializedInstructionSteps = new InstructionSteps(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedInstructionSteps.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedInstructionSteps.description = reader.getString(); + } else if ("instructions".equals(fieldName)) { + List instructions + = reader.readArray(reader1 -> InstructionStepsInstructionsItem.fromJson(reader1)); + deserializedInstructionSteps.instructions = instructions; + } else { + reader.skipChildren(); + } + } + + return deserializedInstructionSteps; + }); + } +} 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..35243c752994 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The InstructionStepsInstructionsItem model. + */ +@Fluent +public final class InstructionStepsInstructionsItem extends ConnectorInstructionModelBase { + /** + * Creates an instance of InstructionStepsInstructionsItem class. + */ + public InstructionStepsInstructionsItem() { + } + + /** + * {@inheritDoc} + */ + @Override + public InstructionStepsInstructionsItem withParameters(Object parameters) { + super.withParameters(parameters); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public InstructionStepsInstructionsItem withType(SettingType type) { + super.withType(type); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + if (parameters() != null) { + jsonWriter.writeUntypedField("parameters", parameters()); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstructionStepsInstructionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstructionStepsInstructionsItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InstructionStepsInstructionsItem. + */ + public static InstructionStepsInstructionsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InstructionStepsInstructionsItem deserializedInstructionStepsInstructionsItem + = new InstructionStepsInstructionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedInstructionStepsInstructionsItem.withType(SettingType.fromString(reader.getString())); + } else if ("parameters".equals(fieldName)) { + deserializedInstructionStepsInstructionsItem.withParameters(reader.readUntyped()); + } else { + reader.skipChildren(); + } + } + + return deserializedInstructionStepsInstructionsItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTCheckRequirements.java new file mode 100644 index 000000000000..9835e7471478 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTCheckRequirements.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.IoTCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents IoT requirements check request. + */ +@Fluent +public final class IoTCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.IOT; + + /* + * IoT requirements check properties. + */ + private IoTCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of IoTCheckRequirements class. + */ + public IoTCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: IoT requirements check properties. + * + * @return the innerProperties value. + */ + IoTCheckRequirementsProperties 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 IoTCheckRequirements object itself. + */ + public IoTCheckRequirements withSubscriptionId(String subscriptionId) { + if (this.innerProperties() == null) { + this.innerProperties = new IoTCheckRequirementsProperties(); + } + this.innerProperties().withSubscriptionId(subscriptionId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IoTCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IoTCheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IoTCheckRequirements. + */ + public static IoTCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IoTCheckRequirements deserializedIoTCheckRequirements = new IoTCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedIoTCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedIoTCheckRequirements.innerProperties = IoTCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIoTCheckRequirements; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDataConnector.java new file mode 100644 index 000000000000..59b0d32bed29 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDataConnector.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.IoTDataConnectorProperties; +import java.io.IOException; + +/** + * Represents IoT data connector. + */ +@Fluent +public final class IoTDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.IOT; + + /* + * IoT data connector properties. + */ + private IoTDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IoTDataConnector class. + */ + public IoTDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: IoT data connector properties. + * + * @return the innerProperties value. + */ + private IoTDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public IoTDataConnector 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 IoTDataConnector object itself. + */ + public IoTDataConnector withSubscriptionId(String subscriptionId) { + if (this.innerProperties() == null) { + this.innerProperties = new IoTDataConnectorProperties(); + } + 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 IoTDataConnector object itself. + */ + public IoTDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new IoTDataConnectorProperties(); + } + this.innerProperties().withDataTypes(dataTypes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IoTDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IoTDataConnector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IoTDataConnector. + */ + public static IoTDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IoTDataConnector deserializedIoTDataConnector = new IoTDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIoTDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIoTDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIoTDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedIoTDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedIoTDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedIoTDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedIoTDataConnector.innerProperties = IoTDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIoTDataConnector; + }); + } +} 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 index b4789194231d..9eb0e30f1cff 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,7 +13,6 @@ import java.io.IOException; import java.util.List; import java.util.Map; -import java.util.UUID; /** * Represents an IoT device entity. @@ -21,7 +20,9 @@ @Immutable public final class IoTDeviceEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.IO_TDEVICE; @@ -53,11 +54,13 @@ public final class IoTDeviceEntity extends Entity { /** * Creates an instance of IoTDeviceEntity class. */ - public IoTDeviceEntity() { + private IoTDeviceEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -147,7 +150,7 @@ public String source() { * * @return the iotSecurityAgentId value. */ - public UUID iotSecurityAgentId() { + public String iotSecurityAgentId() { return this.innerProperties() == null ? null : this.innerProperties().iotSecurityAgentId(); } @@ -268,6 +271,105 @@ public List protocols() { return this.innerProperties() == null ? null : this.innerProperties().protocols(); } + /** + * Get the owners property: A list of owners of the IoTDevice entity. + * + * @return the owners value. + */ + public List owners() { + return this.innerProperties() == null ? null : this.innerProperties().owners(); + } + + /** + * Get the nicEntityIds property: A list of Nic entity ids of the IoTDevice entity. + * + * @return the nicEntityIds value. + */ + public List nicEntityIds() { + return this.innerProperties() == null ? null : this.innerProperties().nicEntityIds(); + } + + /** + * Get the site property: The site of the device. + * + * @return the site value. + */ + public String site() { + return this.innerProperties() == null ? null : this.innerProperties().site(); + } + + /** + * Get the zone property: The zone location of the device within a site. + * + * @return the zone value. + */ + public String zone() { + return this.innerProperties() == null ? null : this.innerProperties().zone(); + } + + /** + * Get the sensor property: The sensor the device is monitored by. + * + * @return the sensor value. + */ + public String sensor() { + return this.innerProperties() == null ? null : this.innerProperties().sensor(); + } + + /** + * Get the deviceSubType property: The subType of the device ('PLC', 'HMI', 'EWS', etc.). + * + * @return the deviceSubType value. + */ + public String deviceSubType() { + return this.innerProperties() == null ? null : this.innerProperties().deviceSubType(); + } + + /** + * Get the importance property: Device importance, determines if the device classified as 'crown jewel'. + * + * @return the importance value. + */ + public DeviceImportance importance() { + return this.innerProperties() == null ? null : this.innerProperties().importance(); + } + + /** + * Get the purdueLayer property: The Purdue Layer of the device. + * + * @return the purdueLayer value. + */ + public String purdueLayer() { + return this.innerProperties() == null ? null : this.innerProperties().purdueLayer(); + } + + /** + * Get the isAuthorized property: Determines whether the device classified as authorized device. + * + * @return the isAuthorized value. + */ + public Boolean isAuthorized() { + return this.innerProperties() == null ? null : this.innerProperties().isAuthorized(); + } + + /** + * Get the isProgramming property: Determines whether the device classified as programming device. + * + * @return the isProgramming value. + */ + public Boolean isProgramming() { + return this.innerProperties() == null ? null : this.innerProperties().isProgramming(); + } + + /** + * Get the isScanner property: Is the device classified as a scanner device. + * + * @return the isScanner value. + */ + public Boolean isScanner() { + return this.innerProperties() == null ? null : this.innerProperties().isScanner(); + } + /** * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented * to the user. @@ -288,18 +390,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index 13b1e56a8840..d26b9089d5c9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -20,7 +20,9 @@ @Immutable public final class IpEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.IP; @@ -52,11 +54,13 @@ public final class IpEntity extends Entity { /** * Creates an instance of IpEntity class. */ - public IpEntity() { + private IpEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -161,18 +165,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Job.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Job.java new file mode 100644 index 000000000000..dba716de5e72 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Job.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of Job. + */ +public interface Job { + /** + * 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 endTime property: The time the job completed. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the items property: List of items published by the job. + * + * @return the items value. + */ + List items(); + + /** + * Gets the provisioningState property: State of the job. + * + * @return the provisioningState value. + */ + JobProvisioningState provisioningState(); + + /** + * Gets the startTime property: The time the job started. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the errorMessage property: Message to describe error, if an error exists. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.JobInner object. + * + * @return the inner object. + */ + JobInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobItem.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobItem.java new file mode 100644 index 000000000000..1c469172d22b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobItem.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An entity describing the publish status of a content item. + */ +@Immutable +public final class JobItem implements JsonSerializable { + /* + * The resource id of the content item + */ + private String resourceId; + + /* + * Status of the item publication + */ + private Status status; + + /* + * The time the item publishing was completed + */ + private OffsetDateTime executionTime; + + /* + * The list of error descriptions if the item publication fails. + */ + private List errors; + + /** + * Creates an instance of JobItem class. + */ + private JobItem() { + } + + /** + * Get the resourceId property: The resource id of the content item. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the status property: Status of the item publication. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the executionTime property: The time the item publishing was completed. + * + * @return the executionTime value. + */ + public OffsetDateTime executionTime() { + return this.executionTime; + } + + /** + * Get the errors property: The list of error descriptions if the item publication fails. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JobItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JobItem if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the JobItem. + */ + public static JobItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JobItem deserializedJobItem = new JobItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedJobItem.resourceId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedJobItem.status = Status.fromString(reader.getString()); + } else if ("executionTime".equals(fieldName)) { + deserializedJobItem.executionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> Error.fromJson(reader1)); + deserializedJobItem.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedJobItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobProvisioningState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobProvisioningState.java new file mode 100644 index 000000000000..7dc7303a0792 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JobProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the workspace manager job. + */ +public final class JobProvisioningState extends ExpandableStringEnum { + /** + * Succeeded. + */ + public static final JobProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * InProgress. + */ + public static final JobProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Canceled. + */ + public static final JobProvisioningState CANCELED = fromString("Canceled"); + + /** + * Failed. + */ + public static final JobProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of JobProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobProvisioningState() { + } + + /** + * Creates or finds a JobProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobProvisioningState. + */ + public static JobProvisioningState fromString(String name) { + return fromString(name, JobProvisioningState.class); + } + + /** + * Gets known JobProvisioningState values. + * + * @return known JobProvisioningState values. + */ + public static Collection values() { + return values(JobProvisioningState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JwtAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JwtAuthModel.java new file mode 100644 index 000000000000..289befba769d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/JwtAuthModel.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Model for API authentication with JWT. Simple exchange between user name + password to access token. + */ +@Fluent +public final class JwtAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.JWT_TOKEN; + + /* + * Token endpoint to request JWT + */ + private String tokenEndpoint; + + /* + * The user name. If user name and password sent in header request we only need to populate the `value` property + * with the user name (Same as basic auth). If user name and password sent in body request we need to specify the + * `Key` and `Value`. + */ + private Map userName; + + /* + * The password + */ + private Map password; + + /* + * The custom query parameter we want to add once we send request to token endpoint. + */ + private Map queryParameters; + + /* + * The custom headers we want to add once we send request to token endpoint. + */ + private Map headers; + + /* + * Flag indicating whether we want to send the user name and password to token endpoint in the headers. + */ + private Boolean isCredentialsInHeaders; + + /* + * Flag indicating whether the body request is JSON (header Content-Type = application/json), meaning its a Form URL + * encoded request (header Content-Type = application/x-www-form-urlencoded). + */ + private Boolean isJsonRequest; + + /* + * Request timeout in seconds. + */ + private Integer requestTimeoutInSeconds; + + /** + * Creates an instance of JwtAuthModel class. + */ + public JwtAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the tokenEndpoint property: Token endpoint to request JWT. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: Token endpoint to request JWT. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the userName property: The user name. If user name and password sent in header request we only need to + * populate the `value` property with the user name (Same as basic auth). If user name and password sent in body + * request we need to specify the `Key` and `Value`. + * + * @return the userName value. + */ + public Map userName() { + return this.userName; + } + + /** + * Set the userName property: The user name. If user name and password sent in header request we only need to + * populate the `value` property with the user name (Same as basic auth). If user name and password sent in body + * request we need to specify the `Key` and `Value`. + * + * @param userName the userName value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withUserName(Map userName) { + this.userName = userName; + return this; + } + + /** + * Get the password property: The password. + * + * @return the password value. + */ + public Map password() { + return this.password; + } + + /** + * Set the password property: The password. + * + * @param password the password value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withPassword(Map password) { + this.password = password; + return this; + } + + /** + * Get the queryParameters property: The custom query parameter we want to add once we send request to token + * endpoint. + * + * @return the queryParameters value. + */ + public Map queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: The custom query parameter we want to add once we send request to token + * endpoint. + * + * @param queryParameters the queryParameters value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withQueryParameters(Map queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the headers property: The custom headers we want to add once we send request to token endpoint. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: The custom headers we want to add once we send request to token endpoint. + * + * @param headers the headers value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the isCredentialsInHeaders property: Flag indicating whether we want to send the user name and password to + * token endpoint in the headers. + * + * @return the isCredentialsInHeaders value. + */ + public Boolean isCredentialsInHeaders() { + return this.isCredentialsInHeaders; + } + + /** + * Set the isCredentialsInHeaders property: Flag indicating whether we want to send the user name and password to + * token endpoint in the headers. + * + * @param isCredentialsInHeaders the isCredentialsInHeaders value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withIsCredentialsInHeaders(Boolean isCredentialsInHeaders) { + this.isCredentialsInHeaders = isCredentialsInHeaders; + return this; + } + + /** + * Get the isJsonRequest property: Flag indicating whether the body request is JSON (header Content-Type = + * application/json), meaning its a Form URL encoded request (header Content-Type = + * application/x-www-form-urlencoded). + * + * @return the isJsonRequest value. + */ + public Boolean isJsonRequest() { + return this.isJsonRequest; + } + + /** + * Set the isJsonRequest property: Flag indicating whether the body request is JSON (header Content-Type = + * application/json), meaning its a Form URL encoded request (header Content-Type = + * application/x-www-form-urlencoded). + * + * @param isJsonRequest the isJsonRequest value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withIsJsonRequest(Boolean isJsonRequest) { + this.isJsonRequest = isJsonRequest; + return this; + } + + /** + * Get the requestTimeoutInSeconds property: Request timeout in seconds. + * + * @return the requestTimeoutInSeconds value. + */ + public Integer requestTimeoutInSeconds() { + return this.requestTimeoutInSeconds; + } + + /** + * Set the requestTimeoutInSeconds property: Request timeout in seconds. + * + * @param requestTimeoutInSeconds the requestTimeoutInSeconds value to set. + * @return the JwtAuthModel object itself. + */ + public JwtAuthModel withRequestTimeoutInSeconds(Integer requestTimeoutInSeconds) { + this.requestTimeoutInSeconds = requestTimeoutInSeconds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tokenEndpoint", this.tokenEndpoint); + jsonWriter.writeMapField("userName", this.userName, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("password", this.password, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("queryParameters", this.queryParameters, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isCredentialsInHeaders", this.isCredentialsInHeaders); + jsonWriter.writeBooleanField("isJsonRequest", this.isJsonRequest); + jsonWriter.writeNumberField("requestTimeoutInSeconds", this.requestTimeoutInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of JwtAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of JwtAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the JwtAuthModel. + */ + public static JwtAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JwtAuthModel deserializedJwtAuthModel = new JwtAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tokenEndpoint".equals(fieldName)) { + deserializedJwtAuthModel.tokenEndpoint = reader.getString(); + } else if ("userName".equals(fieldName)) { + Map userName = reader.readMap(reader1 -> reader1.getString()); + deserializedJwtAuthModel.userName = userName; + } else if ("password".equals(fieldName)) { + Map password = reader.readMap(reader1 -> reader1.getString()); + deserializedJwtAuthModel.password = password; + } else if ("type".equals(fieldName)) { + deserializedJwtAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else if ("queryParameters".equals(fieldName)) { + Map queryParameters = reader.readMap(reader1 -> reader1.getString()); + deserializedJwtAuthModel.queryParameters = queryParameters; + } else if ("headers".equals(fieldName)) { + Map headers = reader.readMap(reader1 -> reader1.getString()); + deserializedJwtAuthModel.headers = headers; + } else if ("isCredentialsInHeaders".equals(fieldName)) { + deserializedJwtAuthModel.isCredentialsInHeaders = reader.getNullable(JsonReader::getBoolean); + } else if ("isJsonRequest".equals(fieldName)) { + deserializedJwtAuthModel.isJsonRequest = reader.getNullable(JsonReader::getBoolean); + } else if ("requestTimeoutInSeconds".equals(fieldName)) { + deserializedJwtAuthModel.requestTimeoutInSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedJwtAuthModel; + }); + } +} 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 index fbb2cc1ccc75..47d9d8ab7434 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -8,76 +8,111 @@ import java.util.Collection; /** - * Holds the alert intent stage(s) mapping for this alert. + * The intent of the alert. */ public final class KillChainIntent extends ExpandableStringEnum { /** - * Static value Unknown for KillChainIntent. + * The default value. */ public static final KillChainIntent UNKNOWN = fromString("Unknown"); /** - * Static value Probing for KillChainIntent. + * Probing could be an attempt to access a certain resource regardless of a malicious intent or a failed attempt to + * gain access to a target system to gather information prior to exploitation. This step is usually detected as an + * attempt originating from outside the network in attempt to scan the target system and find a way in. */ public static final KillChainIntent PROBING = fromString("Probing"); /** - * Static value Exploitation for KillChainIntent. + * Exploitation is the stage where an attacker manage to get foothold on the attacked resource. This stage is + * applicable not only for compute hosts, but also for resources such as user accounts, certificates etc. + * Adversaries will often be able to control the resource after this stage. */ public static final KillChainIntent EXPLOITATION = fromString("Exploitation"); /** - * Static value Persistence for KillChainIntent. + * Persistence is any access, action, or configuration change to a system that gives an adversary a persistent + * presence on that system. Adversaries will often need to maintain access to systems through interruptions such as + * system restarts, loss of credentials, or other failures that would require a remote access tool to restart or + * alternate backdoor for them to regain access. */ public static final KillChainIntent PERSISTENCE = fromString("Persistence"); /** - * Static value PrivilegeEscalation for KillChainIntent. + * Privilege escalation is the result of actions that allow an adversary to obtain a higher level of permissions on + * a system or network. Certain tools or actions require a higher level of privilege to work and are likely + * necessary at many points throughout an operation. User accounts with permissions to access specific systems or + * perform specific functions necessary for adversaries to achieve their objective may also be considered an + * escalation of privilege. */ public static final KillChainIntent PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); /** - * Static value DefenseEvasion for KillChainIntent. + * Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. Sometimes + * these actions are the same as or variations of techniques in other categories that have the added benefit of + * subverting a particular defense or mitigation. */ public static final KillChainIntent DEFENSE_EVASION = fromString("DefenseEvasion"); /** - * Static value CredentialAccess for KillChainIntent. + * Credential access represents techniques resulting in access to or control over system, domain, or service + * credentials that are used within an enterprise environment. Adversaries will likely attempt to obtain legitimate + * credentials from users or administrator accounts (local system administrator or domain users with administrator + * access) to use within the network. With sufficient access within a network, an adversary can create accounts for + * later use within the environment. */ public static final KillChainIntent CREDENTIAL_ACCESS = fromString("CredentialAccess"); /** - * Static value Discovery for KillChainIntent. + * Discovery consists of techniques that allow the adversary to gain knowledge about the system and internal + * network. When adversaries gain access to a new system, they must navigate themselves to what they now have + * control of and what benefits operating from that system give to their current objective or overall goals during + * the intrusion. The operating system provides many native tools that aid in this post-compromise + * information-gathering phase. */ public static final KillChainIntent DISCOVERY = fromString("Discovery"); /** - * Static value LateralMovement for KillChainIntent. + * Lateral movement consists of techniques that enable an adversary to access and control remote systems on a + * network and could, but does not necessarily, include execution of tools on remote systems. The lateral movement + * techniques could allow an adversary to gather information from a system without needing additional tools, such as + * a remote access tool. An adversary can use lateral movement for many purposes, including remote Execution of + * tools, pivoting to additional systems, access to specific information or files, access to additional credentials, + * or to cause an effect. */ public static final KillChainIntent LATERAL_MOVEMENT = fromString("LateralMovement"); /** - * Static value Execution for KillChainIntent. + * The execution tactic represents techniques that result in execution of adversary-controlled code on a local or + * remote system. This tactic is often used in conjunction with lateral movement to expand access to remote systems + * on a network. */ public static final KillChainIntent EXECUTION = fromString("Execution"); /** - * Static value Collection for KillChainIntent. + * Collection consists of techniques used to identify and gather information, such as sensitive files, from a target + * network prior to exfiltration. This category also covers locations on a system or network where the adversary may + * look for information to exfiltrate. */ public static final KillChainIntent COLLECTION = fromString("Collection"); /** - * Static value Exfiltration for KillChainIntent. + * Exfiltration refers to techniques and attributes that result or aid in the adversary removing files and + * information from a target network. This category also covers locations on a system or network where the adversary + * may look for information to exfiltrate. */ public static final KillChainIntent EXFILTRATION = fromString("Exfiltration"); /** - * Static value CommandAndControl for KillChainIntent. + * The command and control tactic represents how adversaries communicate with systems under their control within a + * target network. */ public static final KillChainIntent COMMAND_AND_CONTROL = fromString("CommandAndControl"); /** - * Static value Impact for KillChainIntent. + * The impact intent primary objective is to directly reduce the availability or integrity of a system, service, or + * network; including manipulation of data to impact a business or operational process. This would often refer to + * techniques such as ransom-ware, defacement, data manipulation and others. */ public static final KillChainIntent IMPACT = fromString("Impact"); 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..aaf91ec49a07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Kind.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of content the metadata is for. + */ +public final class Kind extends ExpandableStringEnum { + /** + * DataConnector. + */ + public static final Kind DATA_CONNECTOR = fromString("DataConnector"); + + /** + * DataType. + */ + public static final Kind DATA_TYPE = fromString("DataType"); + + /** + * Workbook. + */ + public static final Kind WORKBOOK = fromString("Workbook"); + + /** + * WorkbookTemplate. + */ + public static final Kind WORKBOOK_TEMPLATE = fromString("WorkbookTemplate"); + + /** + * Playbook. + */ + public static final Kind PLAYBOOK = fromString("Playbook"); + + /** + * PlaybookTemplate. + */ + public static final Kind PLAYBOOK_TEMPLATE = fromString("PlaybookTemplate"); + + /** + * AnalyticsRuleTemplate. + */ + public static final Kind ANALYTICS_RULE_TEMPLATE = fromString("AnalyticsRuleTemplate"); + + /** + * AnalyticsRule. + */ + public static final Kind ANALYTICS_RULE = fromString("AnalyticsRule"); + + /** + * HuntingQuery. + */ + public static final Kind HUNTING_QUERY = fromString("HuntingQuery"); + + /** + * InvestigationQuery. + */ + public static final Kind INVESTIGATION_QUERY = fromString("InvestigationQuery"); + + /** + * Parser. + */ + public static final Kind PARSER = fromString("Parser"); + + /** + * Watchlist. + */ + public static final Kind WATCHLIST = fromString("Watchlist"); + + /** + * WatchlistTemplate. + */ + public static final Kind WATCHLIST_TEMPLATE = fromString("WatchlistTemplate"); + + /** + * Solution. + */ + public static final Kind SOLUTION = fromString("Solution"); + + /** + * AzureFunction. + */ + public static final Kind AZURE_FUNCTION = fromString("AzureFunction"); + + /** + * LogicAppsCustomConnector. + */ + public static final Kind LOGIC_APPS_CUSTOM_CONNECTOR = fromString("LogicAppsCustomConnector"); + + /** + * AutomationRule. + */ + public static final Kind AUTOMATION_RULE = fromString("AutomationRule"); + + /** + * ResourcesDataConnector. + */ + public static final Kind RESOURCES_DATA_CONNECTOR = fromString("ResourcesDataConnector"); + + /** + * Notebook. + */ + public static final Kind NOTEBOOK = fromString("Notebook"); + + /** + * Standalone. + */ + public static final Kind STANDALONE = fromString("Standalone"); + + /** + * SummaryRule. + */ + public static final Kind SUMMARY_RULE = fromString("SummaryRule"); + + /** + * Custom detections enable proactive monitoring and automated response actions for various events and system states + * across your tenant. + */ + public static final Kind CUSTOM_DETECTION = fromString("CustomDetection"); + + /** + * Creates a new instance of Kind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Kind() { + } + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * Gets known Kind values. + * + * @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..98fb38b50d8f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/LastDataReceivedDataType.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Data type for last data received. + */ +@Fluent +public class LastDataReceivedDataType implements JsonSerializable { + /* + * Name of the data type to show in the graph. can be use with {{graphQueriesTableName}} placeholder + */ + private String name; + + /* + * Query for indicate last data received + */ + private String lastDataReceivedQuery; + + /** + * Creates an instance of LastDataReceivedDataType class. + */ + public LastDataReceivedDataType() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("lastDataReceivedQuery", this.lastDataReceivedQuery); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LastDataReceivedDataType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LastDataReceivedDataType if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LastDataReceivedDataType. + */ + public static LastDataReceivedDataType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LastDataReceivedDataType deserializedLastDataReceivedDataType = new LastDataReceivedDataType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLastDataReceivedDataType.name = reader.getString(); + } else if ("lastDataReceivedQuery".equals(fieldName)) { + deserializedLastDataReceivedDataType.lastDataReceivedQuery = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLastDataReceivedDataType; + }); + } +} 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..f3d2fb1c7ad8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MCASCheckRequirements.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.MCASCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents MCAS (Microsoft Cloud App Security) requirements check request. + */ +@Fluent +public final class MCASCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_CLOUD_APP_SECURITY; + + /* + * MCAS (Microsoft Cloud App Security) requirements check properties. + */ + private MCASCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of MCASCheckRequirements class. + */ + public MCASCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: MCAS (Microsoft Cloud App Security) requirements check properties. + * + * @return the innerProperties value. + */ + MCASCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 MCASCheckRequirements object itself. + */ + public MCASCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MCASCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MCASCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MCASCheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MCASCheckRequirements. + */ + public static MCASCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MCASCheckRequirements deserializedMCASCheckRequirements = new MCASCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedMCASCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMCASCheckRequirements.innerProperties + = MCASCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMCASCheckRequirements; + }); + } +} 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..c1cf7885ca6d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MDATPCheckRequirements.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.MDATPCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents MDATP (Microsoft Defender Advanced Threat Protection) requirements check request. + */ +@Fluent +public final class MDATPCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION; + + /* + * MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. + */ + private MDATPCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of MDATPCheckRequirements class. + */ + public MDATPCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: MDATP (Microsoft Defender Advanced Threat Protection) requirements check + * properties. + * + * @return the innerProperties value. + */ + MDATPCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 MDATPCheckRequirements object itself. + */ + public MDATPCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MDATPCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MDATPCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MDATPCheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MDATPCheckRequirements. + */ + public static MDATPCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MDATPCheckRequirements deserializedMDATPCheckRequirements = new MDATPCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedMDATPCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMDATPCheckRequirements.innerProperties + = MDATPCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMDATPCheckRequirements; + }); + } +} 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..c5d81f2c8227 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRule.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Represents MLBehaviorAnalytics alert rule. + */ +@Fluent +public final class MLBehaviorAnalyticsAlertRule extends AlertRuleInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private AlertRuleKind kind = AlertRuleKind.MLBEHAVIOR_ANALYTICS; + + /* + * MLBehaviorAnalytics alert rule properties + */ + private MLBehaviorAnalyticsAlertRuleProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MLBehaviorAnalyticsAlertRule class. + */ + public MLBehaviorAnalyticsAlertRule() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: MLBehaviorAnalytics alert rule properties. + * + * @return the innerProperties value. + */ + private MLBehaviorAnalyticsAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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(); + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLBehaviorAnalyticsAlertRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLBehaviorAnalyticsAlertRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MLBehaviorAnalyticsAlertRule. + */ + public static MLBehaviorAnalyticsAlertRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLBehaviorAnalyticsAlertRule deserializedMLBehaviorAnalyticsAlertRule = new MLBehaviorAnalyticsAlertRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRule.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRule.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRule.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRule.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRule.kind = AlertRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRule.innerProperties + = MLBehaviorAnalyticsAlertRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMLBehaviorAnalyticsAlertRule; + }); + } +} 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..4281a97a4998 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRuleTemplate.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleTemplateProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Represents MLBehaviorAnalytics alert rule template. + */ +@Immutable +public final class MLBehaviorAnalyticsAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private AlertRuleKind kind = AlertRuleKind.MLBEHAVIOR_ANALYTICS; + + /* + * MLBehaviorAnalytics alert rule template properties. + */ + private MLBehaviorAnalyticsAlertRuleTemplateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MLBehaviorAnalyticsAlertRuleTemplate class. + */ + private MLBehaviorAnalyticsAlertRuleTemplate() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: MLBehaviorAnalytics alert rule template properties. + * + * @return the innerProperties value. + */ + private MLBehaviorAnalyticsAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MLBehaviorAnalyticsAlertRuleTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MLBehaviorAnalyticsAlertRuleTemplate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MLBehaviorAnalyticsAlertRuleTemplate. + */ + public static MLBehaviorAnalyticsAlertRuleTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MLBehaviorAnalyticsAlertRuleTemplate deserializedMLBehaviorAnalyticsAlertRuleTemplate + = new MLBehaviorAnalyticsAlertRuleTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplate.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplate.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplate.kind + = AlertRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMLBehaviorAnalyticsAlertRuleTemplate.innerProperties + = MLBehaviorAnalyticsAlertRuleTemplateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMLBehaviorAnalyticsAlertRuleTemplate; + }); + } +} 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..406e496bea16 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MSTICheckRequirements.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.MSTICheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents Microsoft Threat Intelligence requirements check request. + */ +@Fluent +public final class MSTICheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_INTELLIGENCE; + + /* + * Microsoft Threat Intelligence requirements check properties. + */ + private MSTICheckRequirementsProperties innerProperties; + + /** + * Creates an instance of MSTICheckRequirements class. + */ + public MSTICheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Microsoft Threat Intelligence requirements check properties. + * + * @return the innerProperties value. + */ + MSTICheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 MSTICheckRequirements object itself. + */ + public MSTICheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MSTICheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MSTICheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MSTICheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MSTICheckRequirements. + */ + public static MSTICheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MSTICheckRequirements deserializedMSTICheckRequirements = new MSTICheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedMSTICheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMSTICheckRequirements.innerProperties + = MSTICheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMSTICheckRequirements; + }); + } +} 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..f39b61c2dc24 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MSTIDataConnector.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MSTIDataConnectorProperties; +import java.io.IOException; + +/** + * Represents Microsoft Threat Intelligence data connector. + */ +@Fluent +public final class MSTIDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_INTELLIGENCE; + + /* + * Microsoft Threat Intelligence data connector properties. + */ + private MSTIDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MSTIDataConnector class. + */ + public MSTIDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Microsoft Threat Intelligence data connector properties. + * + * @return the innerProperties value. + */ + private MSTIDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MSTIDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MSTIDataConnector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MSTIDataConnector. + */ + public static MSTIDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MSTIDataConnector deserializedMSTIDataConnector = new MSTIDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMSTIDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMSTIDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMSTIDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedMSTIDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedMSTIDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedMSTIDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMSTIDataConnector.innerProperties = MSTIDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMSTIDataConnector; + }); + } +} 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..0df80d2f0401 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MSTIDataConnectorDataTypes.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Microsoft Threat Intelligence Platforms data connector. + */ +@Fluent +public final class MSTIDataConnectorDataTypes implements JsonSerializable { + /* + * Data type for Microsoft Threat Intelligence Platforms data connector. + */ + private MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingThreatFeed; + + /** + * Creates an instance of MSTIDataConnectorDataTypes class. + */ + public MSTIDataConnectorDataTypes() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("microsoftEmergingThreatFeed", this.microsoftEmergingThreatFeed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MSTIDataConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MSTIDataConnectorDataTypes if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MSTIDataConnectorDataTypes. + */ + public static MSTIDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MSTIDataConnectorDataTypes deserializedMSTIDataConnectorDataTypes = new MSTIDataConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("microsoftEmergingThreatFeed".equals(fieldName)) { + deserializedMSTIDataConnectorDataTypes.microsoftEmergingThreatFeed + = MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMSTIDataConnectorDataTypes; + }); + } +} 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..567e19f2c1fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnector.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MTPDataConnectorProperties; +import java.io.IOException; + +/** + * Represents MTP (Microsoft Threat Protection) data connector. + */ +@Fluent +public final class MTPDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_PROTECTION; + + /* + * MTP (Microsoft Threat Protection) data connector properties. + */ + private MTPDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MTPDataConnector class. + */ + public MTPDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: MTP (Microsoft Threat Protection) data connector properties. + * + * @return the innerProperties value. + */ + private MTPDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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 filteredProviders property: The available filtered providers for the connector. + * + * @return the filteredProviders value. + */ + public MtpFilteredProviders filteredProviders() { + return this.innerProperties() == null ? null : this.innerProperties().filteredProviders(); + } + + /** + * Set the filteredProviders property: The available filtered providers for the connector. + * + * @param filteredProviders the filteredProviders value to set. + * @return the MTPDataConnector object itself. + */ + public MTPDataConnector withFilteredProviders(MtpFilteredProviders filteredProviders) { + if (this.innerProperties() == null) { + this.innerProperties = new MTPDataConnectorProperties(); + } + this.innerProperties().withFilteredProviders(filteredProviders); + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MTPDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MTPDataConnector if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MTPDataConnector. + */ + public static MTPDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MTPDataConnector deserializedMTPDataConnector = new MTPDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMTPDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMTPDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMTPDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedMTPDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedMTPDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedMTPDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMTPDataConnector.innerProperties = MTPDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMTPDataConnector; + }); + } +} 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..d9cdfd818f01 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypes.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Microsoft Threat Protection Platforms data connector. + */ +@Fluent +public final class MTPDataConnectorDataTypes implements JsonSerializable { + /* + * Incidents data type for Microsoft Threat Protection Platforms data connector. + */ + private MTPDataConnectorDataTypesIncidents incidents; + + /* + * Alerts data type for Microsoft Threat Protection Platforms data connector. + */ + private MTPDataConnectorDataTypesAlerts alerts; + + /** + * Creates an instance of MTPDataConnectorDataTypes class. + */ + public MTPDataConnectorDataTypes() { + } + + /** + * Get the incidents property: Incidents data type for Microsoft Threat Protection Platforms data connector. + * + * @return the incidents value. + */ + public MTPDataConnectorDataTypesIncidents incidents() { + return this.incidents; + } + + /** + * Set the incidents property: Incidents 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; + } + + /** + * Get the alerts property: Alerts data type for Microsoft Threat Protection Platforms data connector. + * + * @return the alerts value. + */ + public MTPDataConnectorDataTypesAlerts alerts() { + return this.alerts; + } + + /** + * Set the alerts property: Alerts data type for Microsoft Threat Protection Platforms data connector. + * + * @param alerts the alerts value to set. + * @return the MTPDataConnectorDataTypes object itself. + */ + public MTPDataConnectorDataTypes withAlerts(MTPDataConnectorDataTypesAlerts alerts) { + this.alerts = alerts; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("incidents", this.incidents); + jsonWriter.writeJsonField("alerts", this.alerts); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MTPDataConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MTPDataConnectorDataTypes if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MTPDataConnectorDataTypes. + */ + public static MTPDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MTPDataConnectorDataTypes deserializedMTPDataConnectorDataTypes = new MTPDataConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("incidents".equals(fieldName)) { + deserializedMTPDataConnectorDataTypes.incidents + = MTPDataConnectorDataTypesIncidents.fromJson(reader); + } else if ("alerts".equals(fieldName)) { + deserializedMTPDataConnectorDataTypes.alerts = MTPDataConnectorDataTypesAlerts.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMTPDataConnectorDataTypes; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypesAlerts.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypesAlerts.java new file mode 100644 index 000000000000..eda3bd531d11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypesAlerts.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Alerts data type for Microsoft Threat Protection Platforms data connector. + */ +@Fluent +public final class MTPDataConnectorDataTypesAlerts extends DataConnectorDataTypeCommon { + /** + * Creates an instance of MTPDataConnectorDataTypesAlerts class. + */ + public MTPDataConnectorDataTypesAlerts() { + } + + /** + * {@inheritDoc} + */ + @Override + public MTPDataConnectorDataTypesAlerts withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MTPDataConnectorDataTypesAlerts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MTPDataConnectorDataTypesAlerts if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MTPDataConnectorDataTypesAlerts. + */ + public static MTPDataConnectorDataTypesAlerts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MTPDataConnectorDataTypesAlerts deserializedMTPDataConnectorDataTypesAlerts + = new MTPDataConnectorDataTypesAlerts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMTPDataConnectorDataTypesAlerts.withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMTPDataConnectorDataTypesAlerts; + }); + } +} 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..1bf3cefaacfe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypesIncidents.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Incidents data type for Microsoft Threat Protection Platforms data connector. + */ +@Fluent +public final class MTPDataConnectorDataTypesIncidents extends DataConnectorDataTypeCommon { + /** + * Creates an instance of MTPDataConnectorDataTypesIncidents class. + */ + public MTPDataConnectorDataTypesIncidents() { + } + + /** + * {@inheritDoc} + */ + @Override + public MTPDataConnectorDataTypesIncidents withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MTPDataConnectorDataTypesIncidents from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MTPDataConnectorDataTypesIncidents if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MTPDataConnectorDataTypesIncidents. + */ + public static MTPDataConnectorDataTypesIncidents fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MTPDataConnectorDataTypesIncidents deserializedMTPDataConnectorDataTypesIncidents + = new MTPDataConnectorDataTypesIncidents(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMTPDataConnectorDataTypesIncidents + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMTPDataConnectorDataTypesIncidents; + }); + } +} 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 index 2624e61021d4..3813b1c188ad 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -21,7 +21,9 @@ @Immutable public final class MailClusterEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.MAIL_CLUSTER; @@ -53,11 +55,13 @@ public final class MailClusterEntity extends Entity { /** * Creates an instance of MailClusterEntity class. */ - public MailClusterEntity() { + private MailClusterEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -270,18 +274,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index d0347b297f53..47d8a08fd3f8 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,15 +14,16 @@ import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import java.util.UUID; /** * Represents a mail message entity. */ -@Fluent +@Immutable public final class MailMessageEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.MAIL_MESSAGE; @@ -54,11 +55,13 @@ public final class MailMessageEntity extends Entity { /** * Creates an instance of MailMessageEntity class. */ - public MailMessageEntity() { + private MailMessageEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -230,7 +233,7 @@ public OffsetDateTime receiveDate() { * * @return the networkMessageId value. */ - public UUID networkMessageId() { + public String networkMessageId() { return this.innerProperties() == null ? null : this.innerProperties().networkMessageId(); } @@ -279,20 +282,6 @@ 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. * @@ -302,20 +291,6 @@ 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. * @@ -325,20 +300,6 @@ 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. * @@ -348,20 +309,6 @@ 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. * @@ -371,20 +318,6 @@ 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. * @@ -394,20 +327,6 @@ 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. * @@ -417,20 +336,6 @@ 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. * @@ -440,20 +345,6 @@ 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. @@ -474,18 +365,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index 544385c39d3f..652593506e71 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,7 +12,6 @@ import com.azure.resourcemanager.securityinsights.fluent.models.MailboxEntityProperties; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Represents a mailbox entity. @@ -20,7 +19,9 @@ @Immutable public final class MailboxEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.MAILBOX; @@ -52,11 +53,13 @@ public final class MailboxEntity extends Entity { /** * Creates an instance of MailboxEntity class. */ - public MailboxEntity() { + private MailboxEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -147,7 +150,7 @@ public String upn() { * * @return the externalDirectoryObjectId value. */ - public UUID externalDirectoryObjectId() { + public String externalDirectoryObjectId() { return this.innerProperties() == null ? null : this.innerProperties().externalDirectoryObjectId(); } @@ -171,18 +174,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index 2569161a74aa..3eb3cfaf4ed7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -20,7 +20,9 @@ @Immutable public final class MalwareEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.MALWARE; @@ -52,11 +54,13 @@ public final class MalwareEntity extends Entity { /** * Creates an instance of MalwareEntity class. */ - public MalwareEntity() { + private MalwareEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -170,18 +174,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ManualTriggerRequestBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ManualTriggerRequestBody.java new file mode 100644 index 000000000000..65cf4f95b385 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ManualTriggerRequestBody.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ManualTriggerRequestBody model. + */ +@Fluent +public final class ManualTriggerRequestBody implements JsonSerializable { + /* + * The tenantId property. + */ + private String tenantId; + + /* + * The logicAppsResourceId property. + */ + private String logicAppsResourceId; + + /** + * Creates an instance of ManualTriggerRequestBody class. + */ + public ManualTriggerRequestBody() { + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the ManualTriggerRequestBody object itself. + */ + public ManualTriggerRequestBody withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the logicAppsResourceId property: The logicAppsResourceId property. + * + * @return the logicAppsResourceId value. + */ + public String logicAppsResourceId() { + return this.logicAppsResourceId; + } + + /** + * Set the logicAppsResourceId property: The logicAppsResourceId property. + * + * @param logicAppsResourceId the logicAppsResourceId value to set. + * @return the ManualTriggerRequestBody object itself. + */ + public ManualTriggerRequestBody withLogicAppsResourceId(String logicAppsResourceId) { + this.logicAppsResourceId = logicAppsResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logicAppsResourceId", this.logicAppsResourceId); + jsonWriter.writeStringField("tenantId", this.tenantId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManualTriggerRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManualTriggerRequestBody if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManualTriggerRequestBody. + */ + public static ManualTriggerRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManualTriggerRequestBody deserializedManualTriggerRequestBody = new ManualTriggerRequestBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logicAppsResourceId".equals(fieldName)) { + deserializedManualTriggerRequestBody.logicAppsResourceId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManualTriggerRequestBody.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManualTriggerRequestBody; + }); + } +} 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 index 0c601296068d..ef460380bdf8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,17 +13,17 @@ */ public final class MatchingMethod extends ExpandableStringEnum { /** - * Static value AllEntities for MatchingMethod. + * Grouping alerts into a single incident if all the entities match. */ public static final MatchingMethod ALL_ENTITIES = fromString("AllEntities"); /** - * Static value AnyAlert for MatchingMethod. + * Grouping any alerts triggered by this rule into a single incident. */ public static final MatchingMethod ANY_ALERT = fromString("AnyAlert"); /** - * Static value Selected for MatchingMethod. + * Grouping alerts into a single incident if the selected entities, custom details and alert details match. */ public static final MatchingMethod SELECTED = fromString("Selected"); 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 index ef67e7474d1c..5a5c59b6002f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -10,7 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; -import com.azure.resourcemanager.securityinsights.fluent.models.McasDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.MCASDataConnectorProperties; import java.io.IOException; /** @@ -19,14 +19,16 @@ @Fluent public final class McasDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.MICROSOFT_CLOUD_APP_SECURITY; /* * MCAS (Microsoft Cloud App Security) data connector properties. */ - private McasDataConnectorProperties innerProperties; + private MCASDataConnectorProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -55,7 +57,9 @@ public McasDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -69,7 +73,7 @@ public DataConnectorKind kind() { * * @return the innerProperties value. */ - private McasDataConnectorProperties innerProperties() { + private MCASDataConnectorProperties innerProperties() { return this.innerProperties; } @@ -122,29 +126,6 @@ public McasDataConnector withEtag(String etag) { 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; - } - /** * Get the dataTypes property: The available data types for the connector. * @@ -162,22 +143,33 @@ public McasDataConnectorDataTypes dataTypes() { */ public McasDataConnector withDataTypes(McasDataConnectorDataTypes dataTypes) { if (this.innerProperties() == null) { - this.innerProperties = new McasDataConnectorProperties(); + this.innerProperties = new MCASDataConnectorProperties(); } this.innerProperties().withDataTypes(dataTypes); return this; } /** - * Validates the instance. + * Get the tenantId property: The tenant id to connect to, and get the data from. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the tenantId value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + 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; } /** @@ -221,7 +213,7 @@ public static McasDataConnector fromJson(JsonReader jsonReader) throws IOExcepti } else if ("kind".equals(fieldName)) { deserializedMcasDataConnector.kind = DataConnectorKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { - deserializedMcasDataConnector.innerProperties = McasDataConnectorProperties.fromJson(reader); + deserializedMcasDataConnector.innerProperties = MCASDataConnectorProperties.fromJson(reader); } else { reader.skipChildren(); } 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 index 130604edbcf1..cb1628baae72 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -55,21 +55,6 @@ public McasDataConnectorDataTypes withAlerts(DataConnectorDataTypeCommon alerts) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (discoveryLogs() != null) { - discoveryLogs().validate(); - } - if (alerts() != null) { - alerts().validate(); - } - } - /** * {@inheritDoc} */ @@ -87,6 +72,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of McasDataConnectorDataTypes if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the McasDataConnectorDataTypes. */ public static McasDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { 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 index 3f27949c9039..a1d2d7262db2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -10,7 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; -import com.azure.resourcemanager.securityinsights.fluent.models.MdatpDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.MDATPDataConnectorProperties; import java.io.IOException; /** @@ -19,14 +19,16 @@ @Fluent public final class MdatpDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION; /* * MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. */ - private MdatpDataConnectorProperties innerProperties; + private MDATPDataConnectorProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -55,7 +57,9 @@ public MdatpDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -70,7 +74,7 @@ public DataConnectorKind kind() { * * @return the innerProperties value. */ - private MdatpDataConnectorProperties innerProperties() { + private MDATPDataConnectorProperties innerProperties() { return this.innerProperties; } @@ -140,7 +144,7 @@ public String tenantId() { */ public MdatpDataConnector withTenantId(String tenantId) { if (this.innerProperties() == null) { - this.innerProperties = new MdatpDataConnectorProperties(); + this.innerProperties = new MDATPDataConnectorProperties(); } this.innerProperties().withTenantId(tenantId); return this; @@ -163,24 +167,12 @@ public AlertsDataTypeOfDataConnector dataTypes() { */ public MdatpDataConnector withDataTypes(AlertsDataTypeOfDataConnector dataTypes) { if (this.innerProperties() == null) { - this.innerProperties = new MdatpDataConnectorProperties(); + this.innerProperties = new MDATPDataConnectorProperties(); } this.innerProperties().withDataTypes(dataTypes); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -222,7 +214,7 @@ public static MdatpDataConnector fromJson(JsonReader jsonReader) throws IOExcept } else if ("kind".equals(fieldName)) { deserializedMdatpDataConnector.kind = DataConnectorKind.fromString(reader.getString()); } else if ("properties".equals(fieldName)) { - deserializedMdatpDataConnector.innerProperties = MdatpDataConnectorProperties.fromJson(reader); + deserializedMdatpDataConnector.innerProperties = MDATPDataConnectorProperties.fromJson(reader); } else { reader.skipChildren(); } 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..7ebe6aa53e45 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataAuthor.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Publisher or creator of the content item. + */ +@Fluent +public final class MetadataAuthor implements JsonSerializable { + /* + * Name of the author. Company or person. + */ + private String name; + + /* + * Email of author contact + */ + private String email; + + /* + * Link for author/vendor page + */ + private String link; + + /** + * Creates an instance of MetadataAuthor class. + */ + public MetadataAuthor() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("link", this.link); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataAuthor from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataAuthor if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetadataAuthor. + */ + public static MetadataAuthor fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataAuthor deserializedMetadataAuthor = new MetadataAuthor(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetadataAuthor.name = reader.getString(); + } else if ("email".equals(fieldName)) { + deserializedMetadataAuthor.email = reader.getString(); + } else if ("link".equals(fieldName)) { + deserializedMetadataAuthor.link = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataAuthor; + }); + } +} 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..80dd8395ef7e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * ies for the solution content item. + */ +@Fluent +public final class MetadataCategories implements JsonSerializable { + /* + * domain for the solution content item + */ + private List domains; + + /* + * Industry verticals for the solution content item + */ + private List verticals; + + /** + * Creates an instance of MetadataCategories class. + */ + public MetadataCategories() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("domains", this.domains, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("verticals", this.verticals, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataCategories from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataCategories if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetadataCategories. + */ + public static MetadataCategories fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataCategories deserializedMetadataCategories = new MetadataCategories(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domains".equals(fieldName)) { + List domains = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataCategories.domains = domains; + } else if ("verticals".equals(fieldName)) { + List verticals = reader.readArray(reader1 -> reader1.getString()); + deserializedMetadataCategories.verticals = verticals; + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataCategories; + }); + } +} 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..dcd9ee9e7437 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * Id of the content item we depend on + */ + private String contentId; + + /* + * Type of the content item we depend on + */ + 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. + */ + private String version; + + /* + * Name of the content item + */ + private String name; + + /* + * Operator used for list of dependencies in criteria array. + */ + private MetadataDependencyOperator operator; + + /* + * This is the list of dependencies we must fulfill, according to the AND/OR operator + */ + private List criteria; + + /** + * Creates an instance of MetadataDependencies class. + */ + public MetadataDependencies() { + } + + /** + * 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 MetadataDependencyOperator 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(MetadataDependencyOperator 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentId", this.contentId); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeArrayField("criteria", this.criteria, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataDependencies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataDependencies if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MetadataDependencies. + */ + public static MetadataDependencies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataDependencies deserializedMetadataDependencies = new MetadataDependencies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentId".equals(fieldName)) { + deserializedMetadataDependencies.contentId = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedMetadataDependencies.kind = Kind.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedMetadataDependencies.version = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMetadataDependencies.name = reader.getString(); + } else if ("operator".equals(fieldName)) { + deserializedMetadataDependencies.operator + = MetadataDependencyOperator.fromString(reader.getString()); + } else if ("criteria".equals(fieldName)) { + List criteria + = reader.readArray(reader1 -> MetadataDependencies.fromJson(reader1)); + deserializedMetadataDependencies.criteria = criteria; + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataDependencies; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencyOperator.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencyOperator.java new file mode 100644 index 000000000000..ddae939a3ecf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencyOperator.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operator used for list of dependencies in criteria array. + */ +public final class MetadataDependencyOperator extends ExpandableStringEnum { + /** + * AND. + */ + public static final MetadataDependencyOperator AND = fromString("AND"); + + /** + * OR. + */ + public static final MetadataDependencyOperator OR = fromString("OR"); + + /** + * Creates a new instance of MetadataDependencyOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetadataDependencyOperator() { + } + + /** + * Creates or finds a MetadataDependencyOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetadataDependencyOperator. + */ + public static MetadataDependencyOperator fromString(String name) { + return fromString(name, MetadataDependencyOperator.class); + } + + /** + * Gets known MetadataDependencyOperator values. + * + * @return known MetadataDependencyOperator values. + */ + public static Collection values() { + return values(MetadataDependencyOperator.class); + } +} 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..71508276c83a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java @@ -0,0 +1,890 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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. + */ + String 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 of solution content item. + * + * @return the firstPublishDate value. + */ + LocalDate firstPublishDate(); + + /** + * Gets the lastPublishDate property: last publish date of solution content item. + * + * @return the lastPublishDate value. + */ + LocalDate lastPublishDate(); + + /** + * Gets the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + String customVersion(); + + /** + * Gets the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + String contentSchemaVersion(); + + /** + * Gets the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @return the icon value. + */ + String icon(); + + /** + * Gets the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + List threatAnalysisTactics(); + + /** + * Gets the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + List threatAnalysisTechniques(); + + /** + * Gets the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + List previewImages(); + + /** + * Gets the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + List previewImagesDark(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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 monitor 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, + DefinitionStages.WithCustomVersion, DefinitionStages.WithContentSchemaVersion, DefinitionStages.WithIcon, + DefinitionStages.WithThreatAnalysisTactics, DefinitionStages.WithThreatAnalysisTechniques, + DefinitionStages.WithPreviewImages, DefinitionStages.WithPreviewImagesDark { + /** + * 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. Can be + * optionally set for user created content to define dependencies. If an active content item is made from a + * template, both will have the same contentId.. + * + * @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. Can be optionally set for user + * created content to define dependencies. If an active content item is made from a template, both will have + * the same contentId. + * @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(String 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 of solution content item. + * + * @param firstPublishDate first publish date of 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 of solution content item. + * + * @param lastPublishDate last publish date of solution content item. + * @return the next definition stage. + */ + WithCreate withLastPublishDate(LocalDate lastPublishDate); + } + + /** + * The stage of the MetadataModel definition allowing to specify customVersion. + */ + interface WithCustomVersion { + /** + * Specifies the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion The custom version of the content. A optional free text. + * @return the next definition stage. + */ + WithCreate withCustomVersion(String customVersion); + } + + /** + * The stage of the MetadataModel definition allowing to specify contentSchemaVersion. + */ + interface WithContentSchemaVersion { + /** + * Specifies the contentSchemaVersion property: Schema version of the content. Can be used to distinguish + * between different flow based on the schema version. + * + * @param contentSchemaVersion Schema version of the content. Can be used to distinguish between different + * flow based on the schema version. + * @return the next definition stage. + */ + WithCreate withContentSchemaVersion(String contentSchemaVersion); + } + + /** + * The stage of the MetadataModel definition allowing to specify icon. + */ + interface WithIcon { + /** + * Specifies the icon property: the icon identifier. this id can later be fetched from the solution + * template. + * + * @param icon the icon identifier. this id can later be fetched from the solution template. + * @return the next definition stage. + */ + WithCreate withIcon(String icon); + } + + /** + * The stage of the MetadataModel definition allowing to specify threatAnalysisTactics. + */ + interface WithThreatAnalysisTactics { + /** + * Specifies the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the tactics the resource covers. + * @return the next definition stage. + */ + WithCreate withThreatAnalysisTactics(List threatAnalysisTactics); + } + + /** + * The stage of the MetadataModel definition allowing to specify threatAnalysisTechniques. + */ + interface WithThreatAnalysisTechniques { + /** + * Specifies the threatAnalysisTechniques property: the techniques the resource covers, these have to be + * aligned with the tactics being used. + * + * @param threatAnalysisTechniques the techniques the resource covers, these have to be aligned with the + * tactics being used. + * @return the next definition stage. + */ + WithCreate withThreatAnalysisTechniques(List threatAnalysisTechniques); + } + + /** + * The stage of the MetadataModel definition allowing to specify previewImages. + */ + interface WithPreviewImages { + /** + * Specifies the previewImages property: preview image file names. These will be taken from the solution + * artifacts. + * + * @param previewImages preview image file names. These will be taken from the solution artifacts. + * @return the next definition stage. + */ + WithCreate withPreviewImages(List previewImages); + } + + /** + * The stage of the MetadataModel definition allowing to specify previewImagesDark. + */ + interface WithPreviewImagesDark { + /** + * Specifies the previewImagesDark property: preview image file names. These will be taken from the solution + * artifacts. used for dark theme support. + * + * @param previewImagesDark preview image file names. These will be taken from the solution artifacts. used + * for dark theme support. + * @return the next definition stage. + */ + WithCreate withPreviewImagesDark(List previewImagesDark); + } + } + + /** + * 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, UpdateStages.WithCustomVersion, + UpdateStages.WithContentSchemaVersion, UpdateStages.WithIcon, UpdateStages.WithThreatAnalysisTactics, + UpdateStages.WithThreatAnalysisTechniques, UpdateStages.WithPreviewImages, UpdateStages.WithPreviewImagesDark { + /** + * 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. Can be + * optionally set for user created content to define dependencies. If an active content item is made from a + * template, both will have the same contentId.. + * + * @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. Can be optionally set for user + * created content to define dependencies. If an active content item is made from a template, both will have + * the same contentId. + * @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(String 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 of solution content item. + * + * @param firstPublishDate first publish date of 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 of solution content item. + * + * @param lastPublishDate last publish date of solution content item. + * @return the next definition stage. + */ + Update withLastPublishDate(LocalDate lastPublishDate); + } + + /** + * The stage of the MetadataModel update allowing to specify customVersion. + */ + interface WithCustomVersion { + /** + * Specifies the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion The custom version of the content. A optional free text. + * @return the next definition stage. + */ + Update withCustomVersion(String customVersion); + } + + /** + * The stage of the MetadataModel update allowing to specify contentSchemaVersion. + */ + interface WithContentSchemaVersion { + /** + * Specifies the contentSchemaVersion property: Schema version of the content. Can be used to distinguish + * between different flow based on the schema version. + * + * @param contentSchemaVersion Schema version of the content. Can be used to distinguish between different + * flow based on the schema version. + * @return the next definition stage. + */ + Update withContentSchemaVersion(String contentSchemaVersion); + } + + /** + * The stage of the MetadataModel update allowing to specify icon. + */ + interface WithIcon { + /** + * Specifies the icon property: the icon identifier. this id can later be fetched from the solution + * template. + * + * @param icon the icon identifier. this id can later be fetched from the solution template. + * @return the next definition stage. + */ + Update withIcon(String icon); + } + + /** + * The stage of the MetadataModel update allowing to specify threatAnalysisTactics. + */ + interface WithThreatAnalysisTactics { + /** + * Specifies the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the tactics the resource covers. + * @return the next definition stage. + */ + Update withThreatAnalysisTactics(List threatAnalysisTactics); + } + + /** + * The stage of the MetadataModel update allowing to specify threatAnalysisTechniques. + */ + interface WithThreatAnalysisTechniques { + /** + * Specifies the threatAnalysisTechniques property: the techniques the resource covers, these have to be + * aligned with the tactics being used. + * + * @param threatAnalysisTechniques the techniques the resource covers, these have to be aligned with the + * tactics being used. + * @return the next definition stage. + */ + Update withThreatAnalysisTechniques(List threatAnalysisTechniques); + } + + /** + * The stage of the MetadataModel update allowing to specify previewImages. + */ + interface WithPreviewImages { + /** + * Specifies the previewImages property: preview image file names. These will be taken from the solution + * artifacts. + * + * @param previewImages preview image file names. These will be taken from the solution artifacts. + * @return the next definition stage. + */ + Update withPreviewImages(List previewImages); + } + + /** + * The stage of the MetadataModel update allowing to specify previewImagesDark. + */ + interface WithPreviewImagesDark { + /** + * Specifies the previewImagesDark property: preview image file names. These will be taken from the solution + * artifacts. used for dark theme support. + * + * @param previewImagesDark preview image file names. These will be taken from the solution artifacts. used + * for dark theme support. + * @return the next definition stage. + */ + Update withPreviewImagesDark(List previewImagesDark); + } + } + + /** + * 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..1dc098590d8d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataPatch.java @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataPropertiesPatch; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; + +/** + * Metadata patch request body. + */ +@Fluent +public final class MetadataPatch extends ResourceWithEtag { + /* + * Metadata patch request body + */ + private MetadataPropertiesPatch innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MetadataPatch class. + */ + public MetadataPatch() { + } + + /** + * Get the innerProperties property: Metadata patch request body. + * + * @return the innerProperties value. + */ + private MetadataPropertiesPatch innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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. Can be optionally set for user created + * content to define dependencies. If an active content item is made from a template, both will have the same + * contentId. + * + * @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 String 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(String 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 of 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 of 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 of 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 of 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; + } + + /** + * Get the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + public String customVersion() { + return this.innerProperties() == null ? null : this.innerProperties().customVersion(); + } + + /** + * Set the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion the customVersion value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withCustomVersion(String customVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withCustomVersion(customVersion); + return this; + } + + /** + * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.innerProperties() == null ? null : this.innerProperties().contentSchemaVersion(); + } + + /** + * Set the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withContentSchemaVersion(String contentSchemaVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withContentSchemaVersion(contentSchemaVersion); + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @return the icon value. + */ + public String icon() { + return this.innerProperties() == null ? null : this.innerProperties().icon(); + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the solution template. + * + * @param icon the icon value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withIcon(String icon) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withIcon(icon); + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTactics(); + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withThreatAnalysisTactics(List threatAnalysisTactics) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withThreatAnalysisTactics(threatAnalysisTactics); + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTechniques(); + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withThreatAnalysisTechniques(List threatAnalysisTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withThreatAnalysisTechniques(threatAnalysisTechniques); + return this; + } + + /** + * Get the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + public List previewImages() { + return this.innerProperties() == null ? null : this.innerProperties().previewImages(); + } + + /** + * Set the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @param previewImages the previewImages value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withPreviewImages(List previewImages) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withPreviewImages(previewImages); + return this; + } + + /** + * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + public List previewImagesDark() { + return this.innerProperties() == null ? null : this.innerProperties().previewImagesDark(); + } + + /** + * Set the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @param previewImagesDark the previewImagesDark value to set. + * @return the MetadataPatch object itself. + */ + public MetadataPatch withPreviewImagesDark(List previewImagesDark) { + if (this.innerProperties() == null) { + this.innerProperties = new MetadataPropertiesPatch(); + } + this.innerProperties().withPreviewImagesDark(previewImagesDark); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetadataPatch. + */ + public static MetadataPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataPatch deserializedMetadataPatch = new MetadataPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMetadataPatch.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMetadataPatch.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMetadataPatch.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedMetadataPatch.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedMetadataPatch.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedMetadataPatch.innerProperties = MetadataPropertiesPatch.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataPatch; + }); + } +} 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..6e6793a57d59 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSource.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The original source of the content item, where it comes from. + */ +@Fluent +public final class MetadataSource implements JsonSerializable { + /* + * Source type of the content + */ + private SourceKind kind; + + /* + * Name of the content source. The repo name, solution name, LA workspace name etc. + */ + private String name; + + /* + * ID of the content source. The solution ID, workspace ID, etc + */ + private String sourceId; + + /** + * Creates an instance of MetadataSource class. + */ + public MetadataSource() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("sourceId", this.sourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataSource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetadataSource. + */ + public static MetadataSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataSource deserializedMetadataSource = new MetadataSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedMetadataSource.kind = SourceKind.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedMetadataSource.name = reader.getString(); + } else if ("sourceId".equals(fieldName)) { + deserializedMetadataSource.sourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataSource; + }); + } +} 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..b28531388e18 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Support information for the content item. + */ +@Fluent +public final class MetadataSupport implements JsonSerializable { + /* + * Type of support for content item + */ + private SupportTier tier; + + /* + * Name of the support contact. Company or person. + */ + private String name; + + /* + * Email of support contact + */ + private String email; + + /* + * Link for support help, like to support page to open a ticket etc. + */ + private String link; + + /** + * Creates an instance of MetadataSupport class. + */ + public MetadataSupport() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeStringField("link", this.link); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetadataSupport from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetadataSupport if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MetadataSupport. + */ + public static MetadataSupport fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetadataSupport deserializedMetadataSupport = new MetadataSupport(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tier".equals(fieldName)) { + deserializedMetadataSupport.tier = SupportTier.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedMetadataSupport.name = reader.getString(); + } else if ("email".equals(fieldName)) { + deserializedMetadataSupport.email = reader.getString(); + } else if ("link".equals(fieldName)) { + deserializedMetadataSupport.link = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetadataSupport; + }); + } +} 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..c33fa4d8c573 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 { + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String metadataName, + Context context); + + /** + * Get a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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); + + /** + * Delete a Metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 {@link Response}. + */ + Response deleteWithResponse(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 monitor 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); + + /** + * List of all metadata. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 as paginated response with {@link PagedIterable}. + */ + 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, String orderby, + Integer top, Integer skip, 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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/MicrosoftPurviewInformationProtectionCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionCheckRequirements.java new file mode 100644 index 000000000000..d2da4b6f78ef --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionCheckRequirements.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents MicrosoftPurviewInformationProtection requirements check request. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_PURVIEW_INFORMATION_PROTECTION; + + /* + * MicrosoftPurviewInformationProtection requirements check properties. + */ + private MicrosoftPurviewInformationProtectionCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of MicrosoftPurviewInformationProtectionCheckRequirements class. + */ + public MicrosoftPurviewInformationProtectionCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: MicrosoftPurviewInformationProtection requirements check properties. + * + * @return the innerProperties value. + */ + MicrosoftPurviewInformationProtectionCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 MicrosoftPurviewInformationProtectionCheckRequirements object itself. + */ + public MicrosoftPurviewInformationProtectionCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftPurviewInformationProtectionCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftPurviewInformationProtectionCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftPurviewInformationProtectionCheckRequirements if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MicrosoftPurviewInformationProtectionCheckRequirements. + */ + public static MicrosoftPurviewInformationProtectionCheckRequirements fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftPurviewInformationProtectionCheckRequirements deserializedMicrosoftPurviewInformationProtectionCheckRequirements + = new MicrosoftPurviewInformationProtectionCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionCheckRequirements.kind + = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionCheckRequirements.innerProperties + = MicrosoftPurviewInformationProtectionCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMicrosoftPurviewInformationProtectionCheckRequirements; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java new file mode 100644 index 000000000000..e0a3d40d8d55 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Microsoft Purview Information Protection data connector. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionConnectorDataTypes + implements JsonSerializable { + /* + * Logs data type. + */ + private MicrosoftPurviewInformationProtectionConnectorDataTypesLogs logs; + + /** + * Creates an instance of MicrosoftPurviewInformationProtectionConnectorDataTypes class. + */ + public MicrosoftPurviewInformationProtectionConnectorDataTypes() { + } + + /** + * Get the logs property: Logs data type. + * + * @return the logs value. + */ + public MicrosoftPurviewInformationProtectionConnectorDataTypesLogs logs() { + return this.logs; + } + + /** + * Set the logs property: Logs data type. + * + * @param logs the logs value to set. + * @return the MicrosoftPurviewInformationProtectionConnectorDataTypes object itself. + */ + public MicrosoftPurviewInformationProtectionConnectorDataTypes + withLogs(MicrosoftPurviewInformationProtectionConnectorDataTypesLogs logs) { + this.logs = logs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logs", this.logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftPurviewInformationProtectionConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftPurviewInformationProtectionConnectorDataTypes if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MicrosoftPurviewInformationProtectionConnectorDataTypes. + */ + public static MicrosoftPurviewInformationProtectionConnectorDataTypes fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftPurviewInformationProtectionConnectorDataTypes deserializedMicrosoftPurviewInformationProtectionConnectorDataTypes + = new MicrosoftPurviewInformationProtectionConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionConnectorDataTypes.logs + = MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMicrosoftPurviewInformationProtectionConnectorDataTypes; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.java new file mode 100644 index 000000000000..13c7a518c191 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Logs data type. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionConnectorDataTypesLogs extends DataConnectorDataTypeCommon { + /** + * Creates an instance of MicrosoftPurviewInformationProtectionConnectorDataTypesLogs class. + */ + public MicrosoftPurviewInformationProtectionConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ + @Override + public MicrosoftPurviewInformationProtectionConnectorDataTypesLogs withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftPurviewInformationProtectionConnectorDataTypesLogs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftPurviewInformationProtectionConnectorDataTypesLogs if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * MicrosoftPurviewInformationProtectionConnectorDataTypesLogs. + */ + public static MicrosoftPurviewInformationProtectionConnectorDataTypesLogs fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftPurviewInformationProtectionConnectorDataTypesLogs deserializedMicrosoftPurviewInformationProtectionConnectorDataTypesLogs + = new MicrosoftPurviewInformationProtectionConnectorDataTypesLogs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionConnectorDataTypesLogs + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMicrosoftPurviewInformationProtectionConnectorDataTypesLogs; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java new file mode 100644 index 000000000000..8112a6fa7ec7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionDataConnectorProperties; +import java.io.IOException; + +/** + * Represents Microsoft Purview Information Protection data connector. + */ +@Fluent +public final class MicrosoftPurviewInformationProtectionDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_PURVIEW_INFORMATION_PROTECTION; + + /* + * Microsoft Purview Information Protection data connector properties. + */ + private MicrosoftPurviewInformationProtectionDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MicrosoftPurviewInformationProtectionDataConnector class. + */ + public MicrosoftPurviewInformationProtectionDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Microsoft Purview Information Protection data connector properties. + * + * @return the innerProperties value. + */ + private MicrosoftPurviewInformationProtectionDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public MicrosoftPurviewInformationProtectionDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public MicrosoftPurviewInformationProtectionConnectorDataTypes 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 MicrosoftPurviewInformationProtectionDataConnector object itself. + */ + public MicrosoftPurviewInformationProtectionDataConnector + withDataTypes(MicrosoftPurviewInformationProtectionConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftPurviewInformationProtectionDataConnectorProperties(); + } + 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 MicrosoftPurviewInformationProtectionDataConnector object itself. + */ + public MicrosoftPurviewInformationProtectionDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MicrosoftPurviewInformationProtectionDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftPurviewInformationProtectionDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftPurviewInformationProtectionDataConnector if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MicrosoftPurviewInformationProtectionDataConnector. + */ + public static MicrosoftPurviewInformationProtectionDataConnector fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftPurviewInformationProtectionDataConnector deserializedMicrosoftPurviewInformationProtectionDataConnector + = new MicrosoftPurviewInformationProtectionDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnector.systemData + = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnector.kind + = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMicrosoftPurviewInformationProtectionDataConnector.innerProperties + = MicrosoftPurviewInformationProtectionDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMicrosoftPurviewInformationProtectionDataConnector; + }); + } +} 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 index e2a360a4b2c3..0d34e9d04e66 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -21,7 +21,9 @@ @Fluent public final class MicrosoftSecurityIncidentCreationAlertRule extends AlertRuleInner { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.MICROSOFT_SECURITY_INCIDENT_CREATION; @@ -57,7 +59,9 @@ public MicrosoftSecurityIncidentCreationAlertRule() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -318,18 +322,6 @@ public MicrosoftSecurityIncidentCreationAlertRule withSeveritiesFilter(List severitiesFilter() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (productFilter() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property productFilter in model MicrosoftSecurityIncidentCreationAlertRuleCommonProperties")); - } - } - - private static final ClientLogger LOGGER - = new ClientLogger(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.class); - /** * {@inheritDoc} */ 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 index 9667e3c42ee0..b75431a88a5c 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,10 +18,12 @@ /** * Represents MicrosoftSecurityIncidentCreation rule template. */ -@Fluent +@Immutable public final class MicrosoftSecurityIncidentCreationAlertRuleTemplate extends AlertRuleTemplateInner { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.MICROSOFT_SECURITY_INCIDENT_CREATION; @@ -53,11 +55,13 @@ public final class MicrosoftSecurityIncidentCreationAlertRuleTemplate extends Al /** * Creates an instance of MicrosoftSecurityIncidentCreationAlertRuleTemplate class. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplate() { + private MicrosoftSecurityIncidentCreationAlertRuleTemplate() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -116,115 +120,93 @@ public String id() { } /** - * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * Get the displayNamesFilter property: the alerts' displayNames on which the cases will be generated. * - * @return the alertRulesCreatedByTemplateCount value. + * @return the displayNamesFilter value. */ - public Integer alertRulesCreatedByTemplateCount() { - return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); + public List displayNamesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().displayNamesFilter(); } /** - * Set the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * Get the displayNamesExcludeFilter property: the alerts' displayNames on which the cases will not be generated. * - * @param alertRulesCreatedByTemplateCount the alertRulesCreatedByTemplateCount value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + * @return the displayNamesExcludeFilter value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplate - withAlertRulesCreatedByTemplateCount(Integer alertRulesCreatedByTemplateCount) { - if (this.innerProperties() == null) { - this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); - } - this.innerProperties().withAlertRulesCreatedByTemplateCount(alertRulesCreatedByTemplateCount); - return this; + public List displayNamesExcludeFilter() { + return this.innerProperties() == null ? null : this.innerProperties().displayNamesExcludeFilter(); } /** - * Get the createdDateUtc property: The time that this alert rule template has been added. + * Get the productFilter property: The alerts' productName on which the cases will be generated. * - * @return the createdDateUtc value. + * @return the productFilter value. */ - public OffsetDateTime createdDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); + public MicrosoftSecurityProductName productFilter() { + return this.innerProperties() == null ? null : this.innerProperties().productFilter(); } /** - * Get the lastUpdatedDateUtc property: The time that this alert rule template was last updated. + * Get the severitiesFilter property: the alerts' severities on which the cases will be generated. * - * @return the lastUpdatedDateUtc value. + * @return the severitiesFilter value. */ - public OffsetDateTime lastUpdatedDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); + public List severitiesFilter() { + return this.innerProperties() == null ? null : this.innerProperties().severitiesFilter(); } /** - * Get the description property: The description of the alert rule template. + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. * - * @return the description value. + * @return the alertRulesCreatedByTemplateCount value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public Integer alertRulesCreatedByTemplateCount() { + return this.innerProperties() == null ? null : this.innerProperties().alertRulesCreatedByTemplateCount(); } /** - * Set the description property: The description of the alert rule template. + * Get the lastUpdatedDateUtc property: The last time that this alert rule template has been updated. * - * @param description the description value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + * @return the lastUpdatedDateUtc value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); - } - this.innerProperties().withDescription(description); - return this; + public OffsetDateTime lastUpdatedDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateUtc(); } /** - * Get the displayName property: The display name for alert rule template. + * Get the createdDateUtc property: The time that this alert rule template has been added. * - * @return the displayName value. + * @return the createdDateUtc value. */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); + public OffsetDateTime createdDateUtc() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); } /** - * Set the displayName property: The display name for alert rule template. + * Get the description property: The description of the alert rule template. * - * @param displayName the displayName value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + * @return the description value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplate withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** - * Get the requiredDataConnectors property: The required data connectors for this template. + * Get the displayName property: The display name for alert rule template. * - * @return the requiredDataConnectors value. + * @return the displayName value. */ - public List requiredDataConnectors() { - return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** - * Set the requiredDataConnectors property: The required data connectors for this template. + * Get the requiredDataConnectors property: The required data sources for this template. * - * @param requiredDataConnectors the requiredDataConnectors value to set. - * @return the MicrosoftSecurityIncidentCreationAlertRuleTemplate object itself. + * @return the requiredDataConnectors value. */ - public MicrosoftSecurityIncidentCreationAlertRuleTemplate - withRequiredDataConnectors(List requiredDataConnectors) { - if (this.innerProperties() == null) { - this.innerProperties = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties(); - } - this.innerProperties().withRequiredDataConnectors(requiredDataConnectors); - return this; + public List requiredDataConnectors() { + return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); } /** @@ -236,127 +218,6 @@ 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; - } - - /** - * 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; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index 03eede753943..17462860fde8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,34 +12,46 @@ */ public final class MicrosoftSecurityProductName extends ExpandableStringEnum { /** - * Static value Microsoft Cloud App Security for MicrosoftSecurityProductName. + * Microsoft Cloud App Security. */ public static final MicrosoftSecurityProductName MICROSOFT_CLOUD_APP_SECURITY = fromString("Microsoft Cloud App Security"); /** - * Static value Azure Security Center for MicrosoftSecurityProductName. + * Azure Security Center. */ public static final MicrosoftSecurityProductName AZURE_SECURITY_CENTER = fromString("Azure Security Center"); /** - * Static value Azure Advanced Threat Protection for MicrosoftSecurityProductName. + * Azure Advanced Threat Protection. */ public static final MicrosoftSecurityProductName AZURE_ADVANCED_THREAT_PROTECTION = fromString("Azure Advanced Threat Protection"); /** - * Static value Azure Active Directory Identity Protection for MicrosoftSecurityProductName. + * Azure Active Directory Identity Protection. */ public static final MicrosoftSecurityProductName AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION = fromString("Azure Active Directory Identity Protection"); /** - * Static value Azure Security Center for IoT for MicrosoftSecurityProductName. + * Azure Security Center for IoT. */ public static final MicrosoftSecurityProductName AZURE_SECURITY_CENTER_FOR_IOT = fromString("Azure Security Center for IoT"); + /** + * Office 365 Advanced Threat Protection. + */ + public static final MicrosoftSecurityProductName OFFICE_365_ADVANCED_THREAT_PROTECTION + = fromString("Office 365 Advanced Threat Protection"); + + /** + * Microsoft Defender Advanced Threat Protection. + */ + public static final MicrosoftSecurityProductName MICROSOFT_DEFENDER_ADVANCED_THREAT_PROTECTION + = fromString("Microsoft Defender Advanced Threat Protection"); + /** * Creates a new instance of MicrosoftSecurityProductName value. * diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Mode.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Mode.java new file mode 100644 index 000000000000..2b843fc9a14c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Mode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current mode of the workspace manager configuration. + */ +public final class Mode extends ExpandableStringEnum { + /** + * The workspace manager configuration is enabled. + */ + public static final Mode ENABLED = fromString("Enabled"); + + /** + * The workspace manager configuration is disabled. + */ + public static final Mode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of Mode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Mode() { + } + + /** + * Creates or finds a Mode from its string representation. + * + * @param name a name to look for. + * @return the corresponding Mode. + */ + public static Mode fromString(String name) { + return fromString(name, Mode.class); + } + + /** + * Gets known Mode values. + * + * @return known Mode values. + */ + public static Collection values() { + return values(Mode.class); + } +} 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..bf41c38cdc78 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Data type for Microsoft Threat Intelligence Platforms data connector. + */ +@Fluent +public final class MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed extends DataConnectorDataTypeCommon { + /* + * The lookback period for the feed to be imported. + */ + private OffsetDateTime lookbackPeriod; + + /** + * Creates an instance of MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed class. + */ + public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed() { + } + + /** + * Get the lookbackPeriod property: The lookback period for the feed to be imported. + * + * @return the lookbackPeriod value. + */ + public OffsetDateTime lookbackPeriod() { + return this.lookbackPeriod; + } + + /** + * Set the lookbackPeriod property: The lookback period for the feed to be imported. + * + * @param lookbackPeriod the lookbackPeriod value to set. + * @return the MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed object itself. + */ + public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withLookbackPeriod(OffsetDateTime lookbackPeriod) { + this.lookbackPeriod = lookbackPeriod; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeStringField("lookbackPeriod", + this.lookbackPeriod == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lookbackPeriod)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed. + */ + public static MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed deserializedMstiDataConnectorDataTypesMicrosoftEmergingThreatFeed + = new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMstiDataConnectorDataTypesMicrosoftEmergingThreatFeed + .withState(DataTypeState.fromString(reader.getString())); + } else if ("lookbackPeriod".equals(fieldName)) { + deserializedMstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.lookbackPeriod = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedMstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; + }); + } +} 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..911552ea8921 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpCheckRequirements.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.MTPCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents MTP (Microsoft Threat Protection) requirements check request. + */ +@Fluent +public final class MtpCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.MICROSOFT_THREAT_PROTECTION; + + /* + * MTP (Microsoft Threat Protection) requirements check properties. + */ + private MTPCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of MtpCheckRequirements class. + */ + public MtpCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: MTP (Microsoft Threat Protection) requirements check properties. + * + * @return the innerProperties value. + */ + MTPCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 MtpCheckRequirements object itself. + */ + public MtpCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new MTPCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MtpCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MtpCheckRequirements if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MtpCheckRequirements. + */ + public static MtpCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MtpCheckRequirements deserializedMtpCheckRequirements = new MtpCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedMtpCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedMtpCheckRequirements.innerProperties = MTPCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMtpCheckRequirements; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpFilteredProviders.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpFilteredProviders.java new file mode 100644 index 000000000000..ba72b28128a4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpFilteredProviders.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents the connector's Filtered providers. + */ +@Fluent +public final class MtpFilteredProviders implements JsonSerializable { + /* + * Alerts filtered providers. When filters are not applied, all alerts will stream through the MTP pipeline, still + * in private preview for all products EXCEPT MDA and MDI, which are in GA state. + */ + private List alerts; + + /** + * Creates an instance of MtpFilteredProviders class. + */ + public MtpFilteredProviders() { + } + + /** + * Get the alerts property: Alerts filtered providers. When filters are not applied, all alerts will stream through + * the MTP pipeline, still in private preview for all products EXCEPT MDA and MDI, which are in GA state. + * + * @return the alerts value. + */ + public List alerts() { + return this.alerts; + } + + /** + * Set the alerts property: Alerts filtered providers. When filters are not applied, all alerts will stream through + * the MTP pipeline, still in private preview for all products EXCEPT MDA and MDI, which are in GA state. + * + * @param alerts the alerts value to set. + * @return the MtpFilteredProviders object itself. + */ + public MtpFilteredProviders withAlerts(List alerts) { + this.alerts = alerts; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("alerts", this.alerts, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MtpFilteredProviders from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MtpFilteredProviders if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MtpFilteredProviders. + */ + public static MtpFilteredProviders fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MtpFilteredProviders deserializedMtpFilteredProviders = new MtpFilteredProviders(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("alerts".equals(fieldName)) { + List alerts = reader.readArray(reader1 -> MtpProvider.fromString(reader1.getString())); + deserializedMtpFilteredProviders.alerts = alerts; + } else { + reader.skipChildren(); + } + } + + return deserializedMtpFilteredProviders; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpProvider.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpProvider.java new file mode 100644 index 000000000000..aca58d5e28b8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/MtpProvider.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The available data providers. + */ +public final class MtpProvider extends ExpandableStringEnum { + /** + * microsoftDefenderForCloudApps. + */ + public static final MtpProvider MICROSOFT_DEFENDER_FOR_CLOUD_APPS = fromString("microsoftDefenderForCloudApps"); + + /** + * microsoftDefenderForIdentity. + */ + public static final MtpProvider MICROSOFT_DEFENDER_FOR_IDENTITY = fromString("microsoftDefenderForIdentity"); + + /** + * Creates a new instance of MtpProvider value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MtpProvider() { + } + + /** + * Creates or finds a MtpProvider from its string representation. + * + * @param name a name to look for. + * @return the corresponding MtpProvider. + */ + public static MtpProvider fromString(String name) { + return fromString(name, MtpProvider.class); + } + + /** + * Gets known MtpProvider values. + * + * @return known MtpProvider values. + */ + public static Collection values() { + return values(MtpProvider.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NicEntity.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NicEntity.java new file mode 100644 index 000000000000..eadb0aba66cf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NicEntity.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.NicEntityProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Represents an network interface entity. + */ +@Immutable +public final class NicEntity extends Entity { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private EntityKindEnum kind = EntityKindEnum.NIC; + + /* + * Network interface entity properties + */ + private NicEntityProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NicEntity class. + */ + private NicEntity() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public EntityKindEnum kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Network interface entity properties. + * + * @return the innerProperties value. + */ + private NicEntityProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the macAddress property: The MAC address of this network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.innerProperties() == null ? null : this.innerProperties().macAddress(); + } + + /** + * Get the ipAddressEntityId property: The IP entity id of this network interface. + * + * @return the ipAddressEntityId value. + */ + public String ipAddressEntityId() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddressEntityId(); + } + + /** + * Get the vlans property: A list of VLANs of the network interface entity. + * + * @return the vlans value. + */ + public List vlans() { + return this.innerProperties() == null ? null : this.innerProperties().vlans(); + } + + /** + * 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(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NicEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NicEntity if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NicEntity. + */ + public static NicEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NicEntity deserializedNicEntity = new NicEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNicEntity.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNicEntity.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNicEntity.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedNicEntity.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedNicEntity.kind = EntityKindEnum.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedNicEntity.innerProperties = NicEntityProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNicEntity; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NoneAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NoneAuthModel.java new file mode 100644 index 000000000000..67c1e5c148ea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NoneAuthModel.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for API authentication with no authentication method - public API. + */ +@Immutable +public final class NoneAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.NONE; + + /** + * Creates an instance of NoneAuthModel class. + */ + public NoneAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoneAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoneAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NoneAuthModel. + */ + public static NoneAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoneAuthModel deserializedNoneAuthModel = new NoneAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedNoneAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNoneAuthModel; + }); + } +} 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..536caffd6de8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; +import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleProperties; +import java.io.IOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents NRT alert rule. + */ +@Fluent +public final class NrtAlertRule extends AlertRuleInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private AlertRuleKind kind = AlertRuleKind.NRT; + + /* + * NRT alert rule properties + */ + private NrtAlertRuleProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NrtAlertRule class. + */ + public NrtAlertRule() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: NRT alert rule properties. + * + * @return the innerProperties value. + */ + private NrtAlertRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public NrtAlertRule 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 NrtAlertRule object itself. + */ + public NrtAlertRule withAlertRuleTemplateName(String alertRuleTemplateName) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withTemplateVersion(String templateVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withQuery(String query) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withQuery(query); + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withTactics(List tactics) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withTactics(tactics); + return this; + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * Set the techniques property: The techniques of the alert rule. + * + * @param techniques the techniques value to set. + * @return the NrtAlertRule object itself. + */ + public NrtAlertRule withTechniques(List techniques) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withTechniques(techniques); + return this; + } + + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); + } + + /** + * Set the subTechniques property: The sub-techniques of the alert rule. + * + * @param subTechniques the subTechniques value to set. + * @return the NrtAlertRule object itself. + */ + public NrtAlertRule withSubTechniques(List subTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withSubTechniques(subTechniques); + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withSuppressionDuration(Duration suppressionDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withSuppressionEnabled(Boolean suppressionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withSeverity(AlertSeverity severity) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withSeverity(severity); + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withIncidentConfiguration(IncidentConfiguration incidentConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withCustomDetails(Map customDetails) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withEntityMappings(List entityMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withAlertDetailsOverride(AlertDetailsOverride alertDetailsOverride) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withAlertDetailsOverride(alertDetailsOverride); + 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 NrtAlertRule object itself. + */ + public NrtAlertRule withEventGroupingSettings(EventGroupingSettings eventGroupingSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withEventGroupingSettings(eventGroupingSettings); + return this; + } + + /** + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @return the sentinelEntitiesMappings value. + */ + public List sentinelEntitiesMappings() { + return this.innerProperties() == null ? null : this.innerProperties().sentinelEntitiesMappings(); + } + + /** + * Set the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @param sentinelEntitiesMappings the sentinelEntitiesMappings value to set. + * @return the NrtAlertRule object itself. + */ + public NrtAlertRule withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new NrtAlertRuleProperties(); + } + this.innerProperties().withSentinelEntitiesMappings(sentinelEntitiesMappings); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NrtAlertRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NrtAlertRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NrtAlertRule. + */ + public static NrtAlertRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NrtAlertRule deserializedNrtAlertRule = new NrtAlertRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNrtAlertRule.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNrtAlertRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNrtAlertRule.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedNrtAlertRule.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedNrtAlertRule.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedNrtAlertRule.kind = AlertRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedNrtAlertRule.innerProperties = NrtAlertRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNrtAlertRule; + }); + } +} 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..fcd9e842244d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRuleTemplate.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleTemplateProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents NRT alert rule template. + */ +@Immutable +public final class NrtAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private AlertRuleKind kind = AlertRuleKind.NRT; + + /* + * NRT alert rule template properties + */ + private NrtAlertRuleTemplateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NrtAlertRuleTemplate class. + */ + private NrtAlertRuleTemplate() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: NRT alert rule template properties. + * + * @return the innerProperties value. + */ + private NrtAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * 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(); + } + + /** + * 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 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * Get the alertDetailsOverride property: The alert details override settings. + * + * @return the alertDetailsOverride value. + */ + public AlertDetailsOverride alertDetailsOverride() { + return this.innerProperties() == null ? null : this.innerProperties().alertDetailsOverride(); + } + + /** + * Get the eventGroupingSettings property: The event grouping settings. + * + * @return the eventGroupingSettings value. + */ + public EventGroupingSettings eventGroupingSettings() { + return this.innerProperties() == null ? null : this.innerProperties().eventGroupingSettings(); + } + + /** + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @return the sentinelEntitiesMappings value. + */ + public List sentinelEntitiesMappings() { + return this.innerProperties() == null ? null : this.innerProperties().sentinelEntitiesMappings(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NrtAlertRuleTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NrtAlertRuleTemplate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NrtAlertRuleTemplate. + */ + public static NrtAlertRuleTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NrtAlertRuleTemplate deserializedNrtAlertRuleTemplate = new NrtAlertRuleTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNrtAlertRuleTemplate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNrtAlertRuleTemplate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNrtAlertRuleTemplate.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedNrtAlertRuleTemplate.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedNrtAlertRuleTemplate.kind = AlertRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedNrtAlertRuleTemplate.innerProperties = NrtAlertRuleTemplateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNrtAlertRuleTemplate; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OAuthModel.java new file mode 100644 index 000000000000..2dae052aa0a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OAuthModel.java @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Model for API authentication with OAuth2. + */ +@Fluent +public final class OAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.OAUTH2; + + /* + * The user's authorization code. + */ + private String authorizationCode; + + /* + * The Application (client) secret that the OAuth provider assigned to your app. + */ + private String clientSecret; + + /* + * The Application (client) ID that the OAuth provider assigned to your app. + */ + private String clientId; + + /* + * Indicating whether we want to send the clientId and clientSecret to token endpoint in the headers. + */ + private Boolean isCredentialsInHeaders; + + /* + * The Application (client) Scope that the OAuth provider assigned to your app. + */ + private String scope; + + /* + * The Application redirect url that the user config in the OAuth provider. + */ + private String redirectUri; + + /* + * The grant type, usually will be 'authorization code'. + */ + private String grantType; + + /* + * The token endpoint. Defines the OAuth2 refresh token. + */ + private String tokenEndpoint; + + /* + * The token endpoint headers. + */ + private Map tokenEndpointHeaders; + + /* + * The token endpoint query parameters. + */ + private Map tokenEndpointQueryParameters; + + /* + * The authorization endpoint. + */ + private String authorizationEndpoint; + + /* + * The authorization endpoint headers. + */ + private Map authorizationEndpointHeaders; + + /* + * The authorization endpoint query parameters. + */ + private Map authorizationEndpointQueryParameters; + + /* + * A value indicating whether it's a JWT flow. + */ + private Boolean isJwtBearerFlow; + + /* + * Access token prepend. Default is 'Bearer'. + */ + private String accessTokenPrepend; + + /** + * Creates an instance of OAuthModel class. + */ + public OAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the authorizationCode property: The user's authorization code. + * + * @return the authorizationCode value. + */ + public String authorizationCode() { + return this.authorizationCode; + } + + /** + * Set the authorizationCode property: The user's authorization code. + * + * @param authorizationCode the authorizationCode value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withAuthorizationCode(String authorizationCode) { + this.authorizationCode = authorizationCode; + return this; + } + + /** + * Get the clientSecret property: The Application (client) secret that the OAuth provider assigned to your app. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The Application (client) secret that the OAuth provider assigned to your app. + * + * @param clientSecret the clientSecret value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the clientId property: The Application (client) ID that the OAuth provider assigned to your app. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The Application (client) ID that the OAuth provider assigned to your app. + * + * @param clientId the clientId value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the isCredentialsInHeaders property: Indicating whether we want to send the clientId and clientSecret to + * token endpoint in the headers. + * + * @return the isCredentialsInHeaders value. + */ + public Boolean isCredentialsInHeaders() { + return this.isCredentialsInHeaders; + } + + /** + * Set the isCredentialsInHeaders property: Indicating whether we want to send the clientId and clientSecret to + * token endpoint in the headers. + * + * @param isCredentialsInHeaders the isCredentialsInHeaders value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withIsCredentialsInHeaders(Boolean isCredentialsInHeaders) { + this.isCredentialsInHeaders = isCredentialsInHeaders; + return this; + } + + /** + * Get the scope property: The Application (client) Scope that the OAuth provider assigned to your app. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The Application (client) Scope that the OAuth provider assigned to your app. + * + * @param scope the scope value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the redirectUri property: The Application redirect url that the user config in the OAuth provider. + * + * @return the redirectUri value. + */ + public String redirectUri() { + return this.redirectUri; + } + + /** + * Set the redirectUri property: The Application redirect url that the user config in the OAuth provider. + * + * @param redirectUri the redirectUri value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withRedirectUri(String redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + * Get the grantType property: The grant type, usually will be 'authorization code'. + * + * @return the grantType value. + */ + public String grantType() { + return this.grantType; + } + + /** + * Set the grantType property: The grant type, usually will be 'authorization code'. + * + * @param grantType the grantType value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withGrantType(String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get the tokenEndpoint property: The token endpoint. Defines the OAuth2 refresh token. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: The token endpoint. Defines the OAuth2 refresh token. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the tokenEndpointHeaders property: The token endpoint headers. + * + * @return the tokenEndpointHeaders value. + */ + public Map tokenEndpointHeaders() { + return this.tokenEndpointHeaders; + } + + /** + * Set the tokenEndpointHeaders property: The token endpoint headers. + * + * @param tokenEndpointHeaders the tokenEndpointHeaders value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withTokenEndpointHeaders(Map tokenEndpointHeaders) { + this.tokenEndpointHeaders = tokenEndpointHeaders; + return this; + } + + /** + * Get the tokenEndpointQueryParameters property: The token endpoint query parameters. + * + * @return the tokenEndpointQueryParameters value. + */ + public Map tokenEndpointQueryParameters() { + return this.tokenEndpointQueryParameters; + } + + /** + * Set the tokenEndpointQueryParameters property: The token endpoint query parameters. + * + * @param tokenEndpointQueryParameters the tokenEndpointQueryParameters value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withTokenEndpointQueryParameters(Map tokenEndpointQueryParameters) { + this.tokenEndpointQueryParameters = tokenEndpointQueryParameters; + return this; + } + + /** + * Get the authorizationEndpoint property: The authorization endpoint. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: The authorization endpoint. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the authorizationEndpointHeaders property: The authorization endpoint headers. + * + * @return the authorizationEndpointHeaders value. + */ + public Map authorizationEndpointHeaders() { + return this.authorizationEndpointHeaders; + } + + /** + * Set the authorizationEndpointHeaders property: The authorization endpoint headers. + * + * @param authorizationEndpointHeaders the authorizationEndpointHeaders value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withAuthorizationEndpointHeaders(Map authorizationEndpointHeaders) { + this.authorizationEndpointHeaders = authorizationEndpointHeaders; + return this; + } + + /** + * Get the authorizationEndpointQueryParameters property: The authorization endpoint query parameters. + * + * @return the authorizationEndpointQueryParameters value. + */ + public Map authorizationEndpointQueryParameters() { + return this.authorizationEndpointQueryParameters; + } + + /** + * Set the authorizationEndpointQueryParameters property: The authorization endpoint query parameters. + * + * @param authorizationEndpointQueryParameters the authorizationEndpointQueryParameters value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel + withAuthorizationEndpointQueryParameters(Map authorizationEndpointQueryParameters) { + this.authorizationEndpointQueryParameters = authorizationEndpointQueryParameters; + return this; + } + + /** + * Get the isJwtBearerFlow property: A value indicating whether it's a JWT flow. + * + * @return the isJwtBearerFlow value. + */ + public Boolean isJwtBearerFlow() { + return this.isJwtBearerFlow; + } + + /** + * Set the isJwtBearerFlow property: A value indicating whether it's a JWT flow. + * + * @param isJwtBearerFlow the isJwtBearerFlow value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withIsJwtBearerFlow(Boolean isJwtBearerFlow) { + this.isJwtBearerFlow = isJwtBearerFlow; + return this; + } + + /** + * Get the accessTokenPrepend property: Access token prepend. Default is 'Bearer'. + * + * @return the accessTokenPrepend value. + */ + public String accessTokenPrepend() { + return this.accessTokenPrepend; + } + + /** + * Set the accessTokenPrepend property: Access token prepend. Default is 'Bearer'. + * + * @param accessTokenPrepend the accessTokenPrepend value to set. + * @return the OAuthModel object itself. + */ + public OAuthModel withAccessTokenPrepend(String accessTokenPrepend) { + this.accessTokenPrepend = accessTokenPrepend; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientSecret", this.clientSecret); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("grantType", this.grantType); + jsonWriter.writeStringField("tokenEndpoint", this.tokenEndpoint); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("authorizationCode", this.authorizationCode); + jsonWriter.writeBooleanField("isCredentialsInHeaders", this.isCredentialsInHeaders); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("redirectUri", this.redirectUri); + jsonWriter.writeMapField("tokenEndpointHeaders", this.tokenEndpointHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("tokenEndpointQueryParameters", this.tokenEndpointQueryParameters, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("authorizationEndpoint", this.authorizationEndpoint); + jsonWriter.writeMapField("authorizationEndpointHeaders", this.authorizationEndpointHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("authorizationEndpointQueryParameters", this.authorizationEndpointQueryParameters, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isJwtBearerFlow", this.isJwtBearerFlow); + jsonWriter.writeStringField("accessTokenPrepend", this.accessTokenPrepend); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OAuthModel if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OAuthModel. + */ + public static OAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OAuthModel deserializedOAuthModel = new OAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientSecret".equals(fieldName)) { + deserializedOAuthModel.clientSecret = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedOAuthModel.clientId = reader.getString(); + } else if ("grantType".equals(fieldName)) { + deserializedOAuthModel.grantType = reader.getString(); + } else if ("tokenEndpoint".equals(fieldName)) { + deserializedOAuthModel.tokenEndpoint = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else if ("authorizationCode".equals(fieldName)) { + deserializedOAuthModel.authorizationCode = reader.getString(); + } else if ("isCredentialsInHeaders".equals(fieldName)) { + deserializedOAuthModel.isCredentialsInHeaders = reader.getNullable(JsonReader::getBoolean); + } else if ("scope".equals(fieldName)) { + deserializedOAuthModel.scope = reader.getString(); + } else if ("redirectUri".equals(fieldName)) { + deserializedOAuthModel.redirectUri = reader.getString(); + } else if ("tokenEndpointHeaders".equals(fieldName)) { + Map tokenEndpointHeaders = reader.readMap(reader1 -> reader1.getString()); + deserializedOAuthModel.tokenEndpointHeaders = tokenEndpointHeaders; + } else if ("tokenEndpointQueryParameters".equals(fieldName)) { + Map tokenEndpointQueryParameters = reader.readMap(reader1 -> reader1.getString()); + deserializedOAuthModel.tokenEndpointQueryParameters = tokenEndpointQueryParameters; + } else if ("authorizationEndpoint".equals(fieldName)) { + deserializedOAuthModel.authorizationEndpoint = reader.getString(); + } else if ("authorizationEndpointHeaders".equals(fieldName)) { + Map authorizationEndpointHeaders = reader.readMap(reader1 -> reader1.getString()); + deserializedOAuthModel.authorizationEndpointHeaders = authorizationEndpointHeaders; + } else if ("authorizationEndpointQueryParameters".equals(fieldName)) { + Map authorizationEndpointQueryParameters + = reader.readMap(reader1 -> reader1.getString()); + deserializedOAuthModel.authorizationEndpointQueryParameters = authorizationEndpointQueryParameters; + } else if ("isJwtBearerFlow".equals(fieldName)) { + deserializedOAuthModel.isJwtBearerFlow = reader.getNullable(JsonReader::getBoolean); + } else if ("accessTokenPrepend".equals(fieldName)) { + deserializedOAuthModel.accessTokenPrepend = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOAuthModel; + }); + } +} 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 index de9870a69187..66a5821af195 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,27 +9,27 @@ */ public enum OSFamily { /** - * Enum value Linux. + * Host with Linux operating system. */ LINUX("Linux"), /** - * Enum value Windows. + * Host with Windows operating system. */ WINDOWS("Windows"), /** - * Enum value Android. + * Host with Android operating system. */ ANDROID("Android"), /** - * Enum value IOS. + * Host with IOS operating system. */ IOS("IOS"), /** - * Enum value Unknown. + * Host with Unknown operating system. */ UNKNOWN("Unknown"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectCheckRequirements.java new file mode 100644 index 000000000000..556ce0306285 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectCheckRequirements.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents Office365 Project requirements check request. + */ +@Fluent +public final class Office365ProjectCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE365PROJECT; + + /* + * Office365 Project requirements check properties. + */ + private Office365ProjectCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of Office365ProjectCheckRequirements class. + */ + public Office365ProjectCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Office365 Project requirements check properties. + * + * @return the innerProperties value. + */ + Office365ProjectCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 Office365ProjectCheckRequirements object itself. + */ + public Office365ProjectCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new Office365ProjectCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Office365ProjectCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Office365ProjectCheckRequirements if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Office365ProjectCheckRequirements. + */ + public static Office365ProjectCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Office365ProjectCheckRequirements deserializedOffice365ProjectCheckRequirements + = new Office365ProjectCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedOffice365ProjectCheckRequirements.kind + = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOffice365ProjectCheckRequirements.innerProperties + = Office365ProjectCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOffice365ProjectCheckRequirements; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypes.java new file mode 100644 index 000000000000..cf49bf652bfb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypes.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Office Microsoft Project data connector. + */ +@Fluent +public final class Office365ProjectConnectorDataTypes implements JsonSerializable { + /* + * Logs data type. + */ + private Office365ProjectConnectorDataTypesLogs logs; + + /** + * Creates an instance of Office365ProjectConnectorDataTypes class. + */ + public Office365ProjectConnectorDataTypes() { + } + + /** + * Get the logs property: Logs data type. + * + * @return the logs value. + */ + public Office365ProjectConnectorDataTypesLogs logs() { + return this.logs; + } + + /** + * Set the logs property: Logs data type. + * + * @param logs the logs value to set. + * @return the Office365ProjectConnectorDataTypes object itself. + */ + public Office365ProjectConnectorDataTypes withLogs(Office365ProjectConnectorDataTypesLogs logs) { + this.logs = logs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logs", this.logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Office365ProjectConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Office365ProjectConnectorDataTypes if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Office365ProjectConnectorDataTypes. + */ + public static Office365ProjectConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Office365ProjectConnectorDataTypes deserializedOffice365ProjectConnectorDataTypes + = new Office365ProjectConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + deserializedOffice365ProjectConnectorDataTypes.logs + = Office365ProjectConnectorDataTypesLogs.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOffice365ProjectConnectorDataTypes; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypesLogs.java new file mode 100644 index 000000000000..a0dba7eb5d50 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypesLogs.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Logs data type. + */ +@Fluent +public final class Office365ProjectConnectorDataTypesLogs extends DataConnectorDataTypeCommon { + /** + * Creates an instance of Office365ProjectConnectorDataTypesLogs class. + */ + public Office365ProjectConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ + @Override + public Office365ProjectConnectorDataTypesLogs withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Office365ProjectConnectorDataTypesLogs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Office365ProjectConnectorDataTypesLogs if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Office365ProjectConnectorDataTypesLogs. + */ + public static Office365ProjectConnectorDataTypesLogs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Office365ProjectConnectorDataTypesLogs deserializedOffice365ProjectConnectorDataTypesLogs + = new Office365ProjectConnectorDataTypesLogs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedOffice365ProjectConnectorDataTypesLogs + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedOffice365ProjectConnectorDataTypesLogs; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectDataConnector.java new file mode 100644 index 000000000000..cb23aecb064f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectDataConnector.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectDataConnectorProperties; +import java.io.IOException; + +/** + * Represents Office Microsoft Project data connector. + */ +@Fluent +public final class Office365ProjectDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE365PROJECT; + + /* + * Office Microsoft Project data connector properties. + */ + private Office365ProjectDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Office365ProjectDataConnector class. + */ + public Office365ProjectDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Office Microsoft Project data connector properties. + * + * @return the innerProperties value. + */ + private Office365ProjectDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public Office365ProjectDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public Office365ProjectConnectorDataTypes 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 Office365ProjectDataConnector object itself. + */ + public Office365ProjectDataConnector withDataTypes(Office365ProjectConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new Office365ProjectDataConnectorProperties(); + } + 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 Office365ProjectDataConnector object itself. + */ + public Office365ProjectDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new Office365ProjectDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Office365ProjectDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Office365ProjectDataConnector if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Office365ProjectDataConnector. + */ + public static Office365ProjectDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Office365ProjectDataConnector deserializedOffice365ProjectDataConnector + = new Office365ProjectDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOffice365ProjectDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOffice365ProjectDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOffice365ProjectDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedOffice365ProjectDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedOffice365ProjectDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOffice365ProjectDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOffice365ProjectDataConnector.innerProperties + = Office365ProjectDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOffice365ProjectDataConnector; + }); + } +} 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..0815a92cc9a5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeATPCheckRequirements.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeATPCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents OfficeATP (Office 365 Advanced Threat Protection) requirements check request. + */ +@Fluent +public final class OfficeATPCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE_ATP; + + /* + * OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. + */ + private OfficeATPCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of OfficeATPCheckRequirements class. + */ + public OfficeATPCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: OfficeATP (Office 365 Advanced Threat Protection) requirements check + * properties. + * + * @return the innerProperties value. + */ + OfficeATPCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 OfficeATPCheckRequirements object itself. + */ + public OfficeATPCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeATPCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeATPCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeATPCheckRequirements if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OfficeATPCheckRequirements. + */ + public static OfficeATPCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeATPCheckRequirements deserializedOfficeATPCheckRequirements = new OfficeATPCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedOfficeATPCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOfficeATPCheckRequirements.innerProperties + = OfficeATPCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeATPCheckRequirements; + }); + } +} 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..8a4a41b50bca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeATPDataConnector.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeATPDataConnectorProperties; +import java.io.IOException; + +/** + * Represents OfficeATP (Office 365 Advanced Threat Protection) data connector. + */ +@Fluent +public final class OfficeATPDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE_ATP; + + /* + * OfficeATP (Office 365 Advanced Threat Protection) data connector properties. + */ + private OfficeATPDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OfficeATPDataConnector class. + */ + public OfficeATPDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: OfficeATP (Office 365 Advanced Threat Protection) data connector properties. + * + * @return the innerProperties value. + */ + private OfficeATPDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OfficeATPDataConnector withEtag(String etag) { + super.withEtag(etag); + 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; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeATPDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeATPDataConnector if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficeATPDataConnector. + */ + public static OfficeATPDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeATPDataConnector deserializedOfficeATPDataConnector = new OfficeATPDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOfficeATPDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOfficeATPDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOfficeATPDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedOfficeATPDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedOfficeATPDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOfficeATPDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOfficeATPDataConnector.innerProperties + = OfficeATPDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeATPDataConnector; + }); + } +} 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..132a0b4b1d94 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsent.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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/OfficeConsents.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java new file mode 100644 index 000000000000..0e2241d13b2b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String consentId, + 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); + + /** + * 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 {@link Response}. + */ + Response deleteWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, 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 index 09176819de9e..b7c255ac2813 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Fluent public final class OfficeDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.OFFICE365; @@ -55,7 +57,9 @@ public OfficeDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -123,63 +127,51 @@ public OfficeDataConnector withEtag(String etag) { } /** - * Get the tenantId property: The tenant id to connect to, and get the data from. + * Get the dataTypes property: The available data types for the connector. * - * @return the tenantId value. + * @return the dataTypes value. */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + public OfficeDataConnectorDataTypes dataTypes() { + return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); } /** - * Set the tenantId property: The tenant id to connect to, and get the data from. + * Set the dataTypes property: The available data types for the connector. * - * @param tenantId the tenantId value to set. + * @param dataTypes the dataTypes value to set. * @return the OfficeDataConnector object itself. */ - public OfficeDataConnector withTenantId(String tenantId) { + public OfficeDataConnector withDataTypes(OfficeDataConnectorDataTypes dataTypes) { if (this.innerProperties() == null) { this.innerProperties = new OfficeDataConnectorProperties(); } - this.innerProperties().withTenantId(tenantId); + this.innerProperties().withDataTypes(dataTypes); return this; } /** - * Get the dataTypes property: The available data types for the connector. + * Get the tenantId property: The tenant id to connect to, and get the data from. * - * @return the dataTypes value. + * @return the tenantId value. */ - public OfficeDataConnectorDataTypes dataTypes() { - return this.innerProperties() == null ? null : this.innerProperties().dataTypes(); + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); } /** - * Set the dataTypes property: The available data types for the connector. + * Set the tenantId property: The tenant id to connect to, and get the data from. * - * @param dataTypes the dataTypes value to set. + * @param tenantId the tenantId value to set. * @return the OfficeDataConnector object itself. */ - public OfficeDataConnector withDataTypes(OfficeDataConnectorDataTypes dataTypes) { + public OfficeDataConnector withTenantId(String tenantId) { if (this.innerProperties() == null) { this.innerProperties = new OfficeDataConnectorProperties(); } - this.innerProperties().withDataTypes(dataTypes); + this.innerProperties().withTenantId(tenantId); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index d09bbb1385fd..578c4470f8ac 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -97,23 +97,6 @@ public OfficeDataConnectorDataTypes withTeams(OfficeDataConnectorDataTypesTeams return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (exchange() != null) { - exchange().validate(); - } - if (sharePoint() != null) { - sharePoint().validate(); - } - if (teams() != null) { - teams().validate(); - } - } - /** * {@inheritDoc} */ @@ -132,6 +115,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OfficeDataConnectorDataTypes if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OfficeDataConnectorDataTypes. */ public static OfficeDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { 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 index ca4b0c5083f0..5c7ef4fc3595 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -30,15 +30,6 @@ public OfficeDataConnectorDataTypesExchange withState(DataTypeState state) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -55,6 +46,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OfficeDataConnectorDataTypesExchange if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OfficeDataConnectorDataTypesExchange. */ public static OfficeDataConnectorDataTypesExchange fromJson(JsonReader jsonReader) throws IOException { 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 index 327fbc01eb2e..524867d6cecc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -30,15 +30,6 @@ public OfficeDataConnectorDataTypesSharePoint withState(DataTypeState state) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -55,6 +46,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OfficeDataConnectorDataTypesSharePoint if the JsonReader was pointing to an instance of * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OfficeDataConnectorDataTypesSharePoint. */ public static OfficeDataConnectorDataTypesSharePoint fromJson(JsonReader jsonReader) throws IOException { 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 index 0a20f0a0e0bf..332bbe95435c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -30,15 +30,6 @@ public OfficeDataConnectorDataTypesTeams withState(DataTypeState state) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -55,6 +46,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OfficeDataConnectorDataTypesTeams if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OfficeDataConnectorDataTypesTeams. */ public static OfficeDataConnectorDataTypesTeams fromJson(JsonReader jsonReader) throws IOException { 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..0b7f0c6f7cf9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIRMCheckRequirements.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIRMCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request. + */ +@Fluent +public final class OfficeIRMCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE_IRM; + + /* + * OfficeIRM (Microsoft Insider Risk Management) requirements check properties. + */ + private OfficeIRMCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of OfficeIRMCheckRequirements class. + */ + public OfficeIRMCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: OfficeIRM (Microsoft Insider Risk Management) requirements check properties. + * + * @return the innerProperties value. + */ + OfficeIRMCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 OfficeIRMCheckRequirements object itself. + */ + public OfficeIRMCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficeIRMCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeIRMCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeIRMCheckRequirements if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OfficeIRMCheckRequirements. + */ + public static OfficeIRMCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeIRMCheckRequirements deserializedOfficeIRMCheckRequirements = new OfficeIRMCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedOfficeIRMCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOfficeIRMCheckRequirements.innerProperties + = OfficeIRMCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeIRMCheckRequirements; + }); + } +} 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..14cd82ba0e2c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIRMDataConnector.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIRMDataConnectorProperties; +import java.io.IOException; + +/** + * Represents OfficeIRM (Microsoft Insider Risk Management) data connector. + */ +@Fluent +public final class OfficeIRMDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE_IRM; + + /* + * OfficeIRM (Microsoft Insider Risk Management) data connector properties. + */ + private OfficeIRMDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OfficeIRMDataConnector class. + */ + public OfficeIRMDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: OfficeIRM (Microsoft Insider Risk Management) data connector properties. + * + * @return the innerProperties value. + */ + private OfficeIRMDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OfficeIRMDataConnector withEtag(String etag) { + super.withEtag(etag); + 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; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficeIRMDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficeIRMDataConnector if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficeIRMDataConnector. + */ + public static OfficeIRMDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficeIRMDataConnector deserializedOfficeIRMDataConnector = new OfficeIRMDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOfficeIRMDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOfficeIRMDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOfficeIRMDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedOfficeIRMDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedOfficeIRMDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOfficeIRMDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOfficeIRMDataConnector.innerProperties + = OfficeIRMDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficeIRMDataConnector; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBICheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBICheckRequirements.java new file mode 100644 index 000000000000..28f7f3b98d90 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBICheckRequirements.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBICheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents Office PowerBI requirements check request. + */ +@Fluent +public final class OfficePowerBICheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE_POWER_BI; + + /* + * Office Power BI requirements check properties. + */ + private OfficePowerBICheckRequirementsProperties innerProperties; + + /** + * Creates an instance of OfficePowerBICheckRequirements class. + */ + public OfficePowerBICheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Office Power BI requirements check properties. + * + * @return the innerProperties value. + */ + OfficePowerBICheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 OfficePowerBICheckRequirements object itself. + */ + public OfficePowerBICheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficePowerBICheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficePowerBICheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficePowerBICheckRequirements if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OfficePowerBICheckRequirements. + */ + public static OfficePowerBICheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficePowerBICheckRequirements deserializedOfficePowerBICheckRequirements + = new OfficePowerBICheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedOfficePowerBICheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOfficePowerBICheckRequirements.innerProperties + = OfficePowerBICheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficePowerBICheckRequirements; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypes.java new file mode 100644 index 000000000000..971333eafcba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypes.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Office Microsoft PowerBI data connector. + */ +@Fluent +public final class OfficePowerBIConnectorDataTypes implements JsonSerializable { + /* + * Logs data type. + */ + private OfficePowerBIConnectorDataTypesLogs logs; + + /** + * Creates an instance of OfficePowerBIConnectorDataTypes class. + */ + public OfficePowerBIConnectorDataTypes() { + } + + /** + * Get the logs property: Logs data type. + * + * @return the logs value. + */ + public OfficePowerBIConnectorDataTypesLogs logs() { + return this.logs; + } + + /** + * Set the logs property: Logs data type. + * + * @param logs the logs value to set. + * @return the OfficePowerBIConnectorDataTypes object itself. + */ + public OfficePowerBIConnectorDataTypes withLogs(OfficePowerBIConnectorDataTypesLogs logs) { + this.logs = logs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logs", this.logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficePowerBIConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficePowerBIConnectorDataTypes if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficePowerBIConnectorDataTypes. + */ + public static OfficePowerBIConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficePowerBIConnectorDataTypes deserializedOfficePowerBIConnectorDataTypes + = new OfficePowerBIConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + deserializedOfficePowerBIConnectorDataTypes.logs + = OfficePowerBIConnectorDataTypesLogs.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficePowerBIConnectorDataTypes; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypesLogs.java new file mode 100644 index 000000000000..3671499ffac3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypesLogs.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Logs data type. + */ +@Fluent +public final class OfficePowerBIConnectorDataTypesLogs extends DataConnectorDataTypeCommon { + /** + * Creates an instance of OfficePowerBIConnectorDataTypesLogs class. + */ + public OfficePowerBIConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ + @Override + public OfficePowerBIConnectorDataTypesLogs withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficePowerBIConnectorDataTypesLogs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficePowerBIConnectorDataTypesLogs if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficePowerBIConnectorDataTypesLogs. + */ + public static OfficePowerBIConnectorDataTypesLogs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficePowerBIConnectorDataTypesLogs deserializedOfficePowerBIConnectorDataTypesLogs + = new OfficePowerBIConnectorDataTypesLogs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedOfficePowerBIConnectorDataTypesLogs + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficePowerBIConnectorDataTypesLogs; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIDataConnector.java new file mode 100644 index 000000000000..94d1d56c1061 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIDataConnector.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBIDataConnectorProperties; +import java.io.IOException; + +/** + * Represents Office Microsoft PowerBI data connector. + */ +@Fluent +public final class OfficePowerBIDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.OFFICE_POWER_BI; + + /* + * Office Microsoft PowerBI data connector properties. + */ + private OfficePowerBIDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OfficePowerBIDataConnector class. + */ + public OfficePowerBIDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Office Microsoft PowerBI data connector properties. + * + * @return the innerProperties value. + */ + private OfficePowerBIDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OfficePowerBIDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public OfficePowerBIConnectorDataTypes 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 OfficePowerBIDataConnector object itself. + */ + public OfficePowerBIDataConnector withDataTypes(OfficePowerBIConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficePowerBIDataConnectorProperties(); + } + 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 OfficePowerBIDataConnector object itself. + */ + public OfficePowerBIDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new OfficePowerBIDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OfficePowerBIDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OfficePowerBIDataConnector if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OfficePowerBIDataConnector. + */ + public static OfficePowerBIDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OfficePowerBIDataConnector deserializedOfficePowerBIDataConnector = new OfficePowerBIDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOfficePowerBIDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOfficePowerBIDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOfficePowerBIDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedOfficePowerBIDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedOfficePowerBIDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedOfficePowerBIDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOfficePowerBIDataConnector.innerProperties + = OfficePowerBIDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOfficePowerBIDataConnector; + }); + } +} 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 index fcd5d4b35357..a9d9a280696c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; 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 index 8d4284d1b4f5..f64e72de16e8 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Properties of the operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * Description of the operation @@ -39,7 +39,7 @@ public final class OperationDisplay implements JsonSerializable { + /** + * Equals. + */ + public static final Operator EQUALS = fromString("Equals"); + + /** + * NotEquals. + */ + public static final Operator NOT_EQUALS = fromString("NotEquals"); + + /** + * LessThan. + */ + public static final Operator LESS_THAN = fromString("LessThan"); + + /** + * LessThanEqual. + */ + public static final Operator LESS_THAN_EQUAL = fromString("LessThanEqual"); + + /** + * GreaterThan. + */ + public static final Operator GREATER_THAN = fromString("GreaterThan"); + + /** + * GreaterThanEqual. + */ + public static final Operator GREATER_THAN_EQUAL = fromString("GreaterThanEqual"); + + /** + * StringContains. + */ + public static final Operator STRING_CONTAINS = fromString("StringContains"); + + /** + * StringNotContains. + */ + public static final Operator STRING_NOT_CONTAINS = fromString("StringNotContains"); + + /** + * StringStartsWith. + */ + public static final Operator STRING_STARTS_WITH = fromString("StringStartsWith"); + + /** + * StringNotStartsWith. + */ + public static final Operator STRING_NOT_STARTS_WITH = fromString("StringNotStartsWith"); + + /** + * StringEndsWith. + */ + public static final Operator STRING_ENDS_WITH = fromString("StringEndsWith"); + + /** + * StringNotEndsWith. + */ + public static final Operator STRING_NOT_ENDS_WITH = fromString("StringNotEndsWith"); + + /** + * StringIsEmpty. + */ + public static final Operator STRING_IS_EMPTY = fromString("StringIsEmpty"); + + /** + * IsNull. + */ + public static final Operator IS_NULL = fromString("IsNull"); + + /** + * IsTrue. + */ + public static final Operator IS_TRUE = fromString("IsTrue"); + + /** + * IsFalse. + */ + public static final Operator IS_FALSE = fromString("IsFalse"); + + /** + * ArrayContains. + */ + public static final Operator ARRAY_CONTAINS = fromString("ArrayContains"); + + /** + * ArrayNotContains. + */ + public static final Operator ARRAY_NOT_CONTAINS = fromString("ArrayNotContains"); + + /** + * OnOrAfterRelative. + */ + public static final Operator ON_OR_AFTER_RELATIVE = fromString("OnOrAfterRelative"); + + /** + * AfterRelative. + */ + public static final Operator AFTER_RELATIVE = fromString("AfterRelative"); + + /** + * OnOrBeforeRelative. + */ + public static final Operator ON_OR_BEFORE_RELATIVE = fromString("OnOrBeforeRelative"); + + /** + * BeforeRelative. + */ + public static final Operator BEFORE_RELATIVE = fromString("BeforeRelative"); + + /** + * OnOrAfterAbsolute. + */ + public static final Operator ON_OR_AFTER_ABSOLUTE = fromString("OnOrAfterAbsolute"); + + /** + * AfterAbsolute. + */ + public static final Operator AFTER_ABSOLUTE = fromString("AfterAbsolute"); + + /** + * OnOrBeforeAbsolute. + */ + public static final Operator ON_OR_BEFORE_ABSOLUTE = fromString("OnOrBeforeAbsolute"); + + /** + * BeforeAbsolute. + */ + public static final Operator BEFORE_ABSOLUTE = fromString("BeforeAbsolute"); + + /** + * Creates a new instance of Operator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Operator() { + } + + /** + * Creates or finds a Operator from its string representation. + * + * @param name a name to look for. + * @return the corresponding Operator. + */ + public static Operator fromString(String name) { + return fromString(name, Operator.class); + } + + /** + * Gets known Operator values. + * + * @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/OracleAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OracleAuthModel.java new file mode 100644 index 000000000000..a6ee9d3aed2a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OracleAuthModel.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Model for API authentication for Oracle. + */ +@Fluent +public final class OracleAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.ORACLE; + + /* + * Oracle tenant ID + */ + private String tenantId; + + /* + * Oracle user ID + */ + private String userId; + + /* + * Public Fingerprint + */ + private String publicFingerprint; + + /* + * Content of the PRM file + */ + private String pemFile; + + /** + * Creates an instance of OracleAuthModel class. + */ + public OracleAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the tenantId property: Oracle tenant ID. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Oracle tenant ID. + * + * @param tenantId the tenantId value to set. + * @return the OracleAuthModel object itself. + */ + public OracleAuthModel withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the userId property: Oracle user ID. + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: Oracle user ID. + * + * @param userId the userId value to set. + * @return the OracleAuthModel object itself. + */ + public OracleAuthModel withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Get the publicFingerprint property: Public Fingerprint. + * + * @return the publicFingerprint value. + */ + public String publicFingerprint() { + return this.publicFingerprint; + } + + /** + * Set the publicFingerprint property: Public Fingerprint. + * + * @param publicFingerprint the publicFingerprint value to set. + * @return the OracleAuthModel object itself. + */ + public OracleAuthModel withPublicFingerprint(String publicFingerprint) { + this.publicFingerprint = publicFingerprint; + return this; + } + + /** + * Get the pemFile property: Content of the PRM file. + * + * @return the pemFile value. + */ + public String pemFile() { + return this.pemFile; + } + + /** + * Set the pemFile property: Content of the PRM file. + * + * @param pemFile the pemFile value to set. + * @return the OracleAuthModel object itself. + */ + public OracleAuthModel withPemFile(String pemFile) { + this.pemFile = pemFile; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("userId", this.userId); + jsonWriter.writeStringField("publicFingerprint", this.publicFingerprint); + jsonWriter.writeStringField("pemFile", this.pemFile); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OracleAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OracleAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OracleAuthModel. + */ + public static OracleAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OracleAuthModel deserializedOracleAuthModel = new OracleAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedOracleAuthModel.tenantId = reader.getString(); + } else if ("userId".equals(fieldName)) { + deserializedOracleAuthModel.userId = reader.getString(); + } else if ("publicFingerprint".equals(fieldName)) { + deserializedOracleAuthModel.publicFingerprint = reader.getString(); + } else if ("pemFile".equals(fieldName)) { + deserializedOracleAuthModel.pemFile = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOracleAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOracleAuthModel; + }); + } +} 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..e435b8434790 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Insights Column type. + */ +public final class OutputType extends ExpandableStringEnum { + /** + * Number. + */ + public static final OutputType NUMBER = fromString("Number"); + + /** + * String. + */ + public static final OutputType STRING = fromString("String"); + + /** + * Date. + */ + public static final OutputType DATE = fromString("Date"); + + /** + * Entity. + */ + public static final OutputType ENTITY = fromString("Entity"); + + /** + * Creates a new instance of OutputType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OutputType() { + } + + /** + * Creates or finds a OutputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutputType. + */ + public static OutputType fromString(String name) { + return fromString(name, OutputType.class); + } + + /** + * Gets known OutputType values. + * + * @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 index fcbd03c30ede..90f1a826f4d4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -8,21 +8,21 @@ import java.util.Collection; /** - * The type of the owner the incident is assigned to. + * The type of the owner the hunt is assigned to. */ public final class OwnerType extends ExpandableStringEnum { /** - * Static value Unknown for OwnerType. + * The hunt owner type is unknown. */ public static final OwnerType UNKNOWN = fromString("Unknown"); /** - * Static value User for OwnerType. + * The hunt owner type is an AAD user. */ public static final OwnerType USER = fromString("User"); /** - * Static value Group for OwnerType. + * The hunt owner type is an AAD group. */ public static final OwnerType GROUP = fromString("Group"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageBaseProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageBaseProperties.java new file mode 100644 index 000000000000..616e36e872e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageBaseProperties.java @@ -0,0 +1,716 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.List; +import java.util.Objects; + +/** + * Describes package properties. + */ +@Fluent +public class PackageBaseProperties implements JsonSerializable { + /* + * The content id of the package + */ + private String contentId; + + /* + * Unique ID for the content. It should be generated based on the contentId, contentKind and the contentVersion of + * the package + */ + private String contentProductId; + + /* + * The package kind + */ + private PackageKind contentKind; + + /* + * The version of the content schema. + */ + private String contentSchemaVersion; + + /* + * Flag indicates if this is a newly published package. + */ + private Flag isNew; + + /* + * Flag indicates if this package is in preview. + */ + private Flag isPreview; + + /* + * Flag indicates if this package is among the featured list. + */ + private Flag isFeatured; + + /* + * Flag indicates if this template is deprecated + */ + private Flag isDeprecated; + + /* + * the latest version number of the package + */ + private String version; + + /* + * The display name of the package + */ + private String displayName; + + /* + * The description of the package + */ + private String description; + + /* + * The publisher display name of the package + */ + private String publisherDisplayName; + + /* + * The source of the package + */ + private MetadataSource source; + + /* + * The author of the package + */ + private MetadataAuthor author; + + /* + * The support tier of the package + */ + private MetadataSupport support; + + /* + * The support tier of the package + */ + private MetadataDependencies dependencies; + + /* + * Providers for the package item + */ + private List providers; + + /* + * first publish date package item + */ + private LocalDate firstPublishDate; + + /* + * last publish date for the package item + */ + private LocalDate lastPublishDate; + + /* + * The categories of the package + */ + private MetadataCategories categories; + + /* + * the tactics the resource covers + */ + private List threatAnalysisTactics; + + /* + * the techniques the resource covers, these have to be aligned with the tactics being used + */ + private List threatAnalysisTechniques; + + /* + * the icon identifier. this id can later be fetched from the content metadata + */ + private String icon; + + /** + * Creates an instance of PackageBaseProperties class. + */ + public PackageBaseProperties() { + } + + /** + * Get the contentId property: The content id of the package. + * + * @return the contentId value. + */ + public String contentId() { + return this.contentId; + } + + /** + * Set the contentId property: The content id of the package. + * + * @param contentId the contentId value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withContentId(String contentId) { + this.contentId = contentId; + return this; + } + + /** + * Get the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @return the contentProductId value. + */ + public String contentProductId() { + return this.contentProductId; + } + + /** + * Set the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @param contentProductId the contentProductId value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withContentProductId(String contentProductId) { + this.contentProductId = contentProductId; + return this; + } + + /** + * Get the contentKind property: The package kind. + * + * @return the contentKind value. + */ + public PackageKind contentKind() { + return this.contentKind; + } + + /** + * Set the contentKind property: The package kind. + * + * @param contentKind the contentKind value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withContentKind(PackageKind contentKind) { + this.contentKind = contentKind; + return this; + } + + /** + * Get the contentSchemaVersion property: The version of the content schema. + * + * @return the contentSchemaVersion value. + */ + public String contentSchemaVersion() { + return this.contentSchemaVersion; + } + + /** + * Set the contentSchemaVersion property: The version of the content schema. + * + * @param contentSchemaVersion the contentSchemaVersion value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withContentSchemaVersion(String contentSchemaVersion) { + this.contentSchemaVersion = contentSchemaVersion; + return this; + } + + /** + * Get the isNew property: Flag indicates if this is a newly published package. + * + * @return the isNew value. + */ + public Flag isNew() { + return this.isNew; + } + + /** + * Set the isNew property: Flag indicates if this is a newly published package. + * + * @param isNew the isNew value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withIsNew(Flag isNew) { + this.isNew = isNew; + return this; + } + + /** + * Get the isPreview property: Flag indicates if this package is in preview. + * + * @return the isPreview value. + */ + public Flag isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Flag indicates if this package is in preview. + * + * @param isPreview the isPreview value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withIsPreview(Flag isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Get the isFeatured property: Flag indicates if this package is among the featured list. + * + * @return the isFeatured value. + */ + public Flag isFeatured() { + return this.isFeatured; + } + + /** + * Set the isFeatured property: Flag indicates if this package is among the featured list. + * + * @param isFeatured the isFeatured value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withIsFeatured(Flag isFeatured) { + this.isFeatured = isFeatured; + return this; + } + + /** + * Get the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + public Flag isDeprecated() { + return this.isDeprecated; + } + + /** + * Set the isDeprecated property: Flag indicates if this template is deprecated. + * + * @param isDeprecated the isDeprecated value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withIsDeprecated(Flag isDeprecated) { + this.isDeprecated = isDeprecated; + return this; + } + + /** + * Get the version property: the latest version number of the package. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: the latest version number of the package. + * + * @param version the version value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the displayName property: The display name of the package. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the package. + * + * @param displayName the displayName value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description of the package. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the package. + * + * @param description the description value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the publisherDisplayName property: The publisher display name of the package. + * + * @return the publisherDisplayName value. + */ + public String publisherDisplayName() { + return this.publisherDisplayName; + } + + /** + * Set the publisherDisplayName property: The publisher display name of the package. + * + * @param publisherDisplayName the publisherDisplayName value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withPublisherDisplayName(String publisherDisplayName) { + this.publisherDisplayName = publisherDisplayName; + return this; + } + + /** + * Get the source property: The source of the package. + * + * @return the source value. + */ + public MetadataSource source() { + return this.source; + } + + /** + * Set the source property: The source of the package. + * + * @param source the source value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withSource(MetadataSource source) { + this.source = source; + return this; + } + + /** + * Get the author property: The author of the package. + * + * @return the author value. + */ + public MetadataAuthor author() { + return this.author; + } + + /** + * Set the author property: The author of the package. + * + * @param author the author value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withAuthor(MetadataAuthor author) { + this.author = author; + return this; + } + + /** + * Get the support property: The support tier of the package. + * + * @return the support value. + */ + public MetadataSupport support() { + return this.support; + } + + /** + * Set the support property: The support tier of the package. + * + * @param support the support value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withSupport(MetadataSupport support) { + this.support = support; + return this; + } + + /** + * Get the dependencies property: The support tier of the package. + * + * @return the dependencies value. + */ + public MetadataDependencies dependencies() { + return this.dependencies; + } + + /** + * Set the dependencies property: The support tier of the package. + * + * @param dependencies the dependencies value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withDependencies(MetadataDependencies dependencies) { + this.dependencies = dependencies; + return this; + } + + /** + * Get the providers property: Providers for the package item. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Set the providers property: Providers for the package item. + * + * @param providers the providers value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withProviders(List providers) { + this.providers = providers; + return this; + } + + /** + * Get the firstPublishDate property: first publish date package item. + * + * @return the firstPublishDate value. + */ + public LocalDate firstPublishDate() { + return this.firstPublishDate; + } + + /** + * Set the firstPublishDate property: first publish date package item. + * + * @param firstPublishDate the firstPublishDate value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withFirstPublishDate(LocalDate firstPublishDate) { + this.firstPublishDate = firstPublishDate; + return this; + } + + /** + * Get the lastPublishDate property: last publish date for the package item. + * + * @return the lastPublishDate value. + */ + public LocalDate lastPublishDate() { + return this.lastPublishDate; + } + + /** + * Set the lastPublishDate property: last publish date for the package item. + * + * @param lastPublishDate the lastPublishDate value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withLastPublishDate(LocalDate lastPublishDate) { + this.lastPublishDate = lastPublishDate; + return this; + } + + /** + * Get the categories property: The categories of the package. + * + * @return the categories value. + */ + public MetadataCategories categories() { + return this.categories; + } + + /** + * Set the categories property: The categories of the package. + * + * @param categories the categories value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withCategories(MetadataCategories categories) { + this.categories = categories; + return this; + } + + /** + * Get the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + public List threatAnalysisTactics() { + return this.threatAnalysisTactics; + } + + /** + * Set the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the threatAnalysisTactics value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withThreatAnalysisTactics(List threatAnalysisTactics) { + this.threatAnalysisTactics = threatAnalysisTactics; + return this; + } + + /** + * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + public List threatAnalysisTechniques() { + return this.threatAnalysisTechniques; + } + + /** + * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @param threatAnalysisTechniques the threatAnalysisTechniques value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withThreatAnalysisTechniques(List threatAnalysisTechniques) { + this.threatAnalysisTechniques = threatAnalysisTechniques; + return this; + } + + /** + * Get the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + public String icon() { + return this.icon; + } + + /** + * Set the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon value to set. + * @return the PackageBaseProperties object itself. + */ + public PackageBaseProperties withIcon(String icon) { + this.icon = icon; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentId", this.contentId); + jsonWriter.writeStringField("contentProductId", this.contentProductId); + jsonWriter.writeStringField("contentKind", this.contentKind == null ? null : this.contentKind.toString()); + jsonWriter.writeStringField("contentSchemaVersion", this.contentSchemaVersion); + jsonWriter.writeStringField("isNew", this.isNew == null ? null : this.isNew.toString()); + jsonWriter.writeStringField("isPreview", this.isPreview == null ? null : this.isPreview.toString()); + jsonWriter.writeStringField("isFeatured", this.isFeatured == null ? null : this.isFeatured.toString()); + jsonWriter.writeStringField("isDeprecated", this.isDeprecated == null ? null : this.isDeprecated.toString()); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("publisherDisplayName", this.publisherDisplayName); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("author", this.author); + jsonWriter.writeJsonField("support", this.support); + jsonWriter.writeJsonField("dependencies", this.dependencies); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("firstPublishDate", Objects.toString(this.firstPublishDate, null)); + jsonWriter.writeStringField("lastPublishDate", Objects.toString(this.lastPublishDate, null)); + jsonWriter.writeJsonField("categories", this.categories); + jsonWriter.writeArrayField("threatAnalysisTactics", this.threatAnalysisTactics, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threatAnalysisTechniques", this.threatAnalysisTechniques, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("icon", this.icon); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PackageBaseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PackageBaseProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PackageBaseProperties. + */ + public static PackageBaseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PackageBaseProperties deserializedPackageBaseProperties = new PackageBaseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentId".equals(fieldName)) { + deserializedPackageBaseProperties.contentId = reader.getString(); + } else if ("contentProductId".equals(fieldName)) { + deserializedPackageBaseProperties.contentProductId = reader.getString(); + } else if ("contentKind".equals(fieldName)) { + deserializedPackageBaseProperties.contentKind = PackageKind.fromString(reader.getString()); + } else if ("contentSchemaVersion".equals(fieldName)) { + deserializedPackageBaseProperties.contentSchemaVersion = reader.getString(); + } else if ("isNew".equals(fieldName)) { + deserializedPackageBaseProperties.isNew = Flag.fromString(reader.getString()); + } else if ("isPreview".equals(fieldName)) { + deserializedPackageBaseProperties.isPreview = Flag.fromString(reader.getString()); + } else if ("isFeatured".equals(fieldName)) { + deserializedPackageBaseProperties.isFeatured = Flag.fromString(reader.getString()); + } else if ("isDeprecated".equals(fieldName)) { + deserializedPackageBaseProperties.isDeprecated = Flag.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedPackageBaseProperties.version = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedPackageBaseProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedPackageBaseProperties.description = reader.getString(); + } else if ("publisherDisplayName".equals(fieldName)) { + deserializedPackageBaseProperties.publisherDisplayName = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedPackageBaseProperties.source = MetadataSource.fromJson(reader); + } else if ("author".equals(fieldName)) { + deserializedPackageBaseProperties.author = MetadataAuthor.fromJson(reader); + } else if ("support".equals(fieldName)) { + deserializedPackageBaseProperties.support = MetadataSupport.fromJson(reader); + } else if ("dependencies".equals(fieldName)) { + deserializedPackageBaseProperties.dependencies = MetadataDependencies.fromJson(reader); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedPackageBaseProperties.providers = providers; + } else if ("firstPublishDate".equals(fieldName)) { + deserializedPackageBaseProperties.firstPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("lastPublishDate".equals(fieldName)) { + deserializedPackageBaseProperties.lastPublishDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("categories".equals(fieldName)) { + deserializedPackageBaseProperties.categories = MetadataCategories.fromJson(reader); + } else if ("threatAnalysisTactics".equals(fieldName)) { + List threatAnalysisTactics = reader.readArray(reader1 -> reader1.getString()); + deserializedPackageBaseProperties.threatAnalysisTactics = threatAnalysisTactics; + } else if ("threatAnalysisTechniques".equals(fieldName)) { + List threatAnalysisTechniques = reader.readArray(reader1 -> reader1.getString()); + deserializedPackageBaseProperties.threatAnalysisTechniques = threatAnalysisTechniques; + } else if ("icon".equals(fieldName)) { + deserializedPackageBaseProperties.icon = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPackageBaseProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageKind.java new file mode 100644 index 000000000000..60b3a0614d7b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageKind.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The package kind. + */ +public final class PackageKind extends ExpandableStringEnum { + /** + * Solution. + */ + public static final PackageKind SOLUTION = fromString("Solution"); + + /** + * Standalone. + */ + public static final PackageKind STANDALONE = fromString("Standalone"); + + /** + * Creates a new instance of PackageKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PackageKind() { + } + + /** + * Creates or finds a PackageKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding PackageKind. + */ + public static PackageKind fromString(String name) { + return fromString(name, PackageKind.class); + } + + /** + * Gets known PackageKind values. + * + * @return known PackageKind values. + */ + public static Collection values() { + return values(PackageKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageModel.java new file mode 100644 index 000000000000..8de0cbac3f26 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PackageModel.java @@ -0,0 +1,961 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.PackageModelInner; +import java.time.LocalDate; +import java.util.List; + +/** + * An immutable client-side representation of PackageModel. + */ +public interface PackageModel { + /** + * 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: The content id of the package. + * + * @return the contentId value. + */ + String contentId(); + + /** + * Gets the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @return the contentProductId value. + */ + String contentProductId(); + + /** + * Gets the contentKind property: The package kind. + * + * @return the contentKind value. + */ + PackageKind contentKind(); + + /** + * Gets the contentSchemaVersion property: The version of the content schema. + * + * @return the contentSchemaVersion value. + */ + String contentSchemaVersion(); + + /** + * Gets the isNew property: Flag indicates if this is a newly published package. + * + * @return the isNew value. + */ + Flag isNew(); + + /** + * Gets the isPreview property: Flag indicates if this package is in preview. + * + * @return the isPreview value. + */ + Flag isPreview(); + + /** + * Gets the isFeatured property: Flag indicates if this package is among the featured list. + * + * @return the isFeatured value. + */ + Flag isFeatured(); + + /** + * Gets the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + Flag isDeprecated(); + + /** + * Gets the version property: the latest version number of the package. + * + * @return the version value. + */ + String version(); + + /** + * Gets the displayName property: The display name of the package. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The description of the package. + * + * @return the description value. + */ + String description(); + + /** + * Gets the publisherDisplayName property: The publisher display name of the package. + * + * @return the publisherDisplayName value. + */ + String publisherDisplayName(); + + /** + * Gets the source property: The source of the package. + * + * @return the source value. + */ + MetadataSource source(); + + /** + * Gets the author property: The author of the package. + * + * @return the author value. + */ + MetadataAuthor author(); + + /** + * Gets the support property: The support tier of the package. + * + * @return the support value. + */ + MetadataSupport support(); + + /** + * Gets the dependencies property: The support tier of the package. + * + * @return the dependencies value. + */ + MetadataDependencies dependencies(); + + /** + * Gets the providers property: Providers for the package item. + * + * @return the providers value. + */ + List providers(); + + /** + * Gets the firstPublishDate property: first publish date package item. + * + * @return the firstPublishDate value. + */ + LocalDate firstPublishDate(); + + /** + * Gets the lastPublishDate property: last publish date for the package item. + * + * @return the lastPublishDate value. + */ + LocalDate lastPublishDate(); + + /** + * Gets the categories property: The categories of the package. + * + * @return the categories value. + */ + MetadataCategories categories(); + + /** + * Gets the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + List threatAnalysisTactics(); + + /** + * Gets the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + List threatAnalysisTechniques(); + + /** + * Gets the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + String icon(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner object. + * + * @return the inner object. + */ + PackageModelInner innerModel(); + + /** + * The entirety of the PackageModel definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The PackageModel definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PackageModel definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the PackageModel 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 monitor workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the PackageModel 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.WithContentProductId, + DefinitionStages.WithContentKind, DefinitionStages.WithContentSchemaVersion, DefinitionStages.WithIsNew, + DefinitionStages.WithIsPreview, DefinitionStages.WithIsFeatured, DefinitionStages.WithIsDeprecated, + DefinitionStages.WithVersion, DefinitionStages.WithDisplayName, DefinitionStages.WithDescription, + DefinitionStages.WithPublisherDisplayName, DefinitionStages.WithSource, DefinitionStages.WithAuthor, + DefinitionStages.WithSupport, DefinitionStages.WithDependencies, DefinitionStages.WithProviders, + DefinitionStages.WithFirstPublishDate, DefinitionStages.WithLastPublishDate, + DefinitionStages.WithCategories, DefinitionStages.WithThreatAnalysisTactics, + DefinitionStages.WithThreatAnalysisTechniques, DefinitionStages.WithIcon { + /** + * Executes the create request. + * + * @return the created resource. + */ + PackageModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PackageModel create(Context context); + } + + /** + * The stage of the PackageModel 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 PackageModel definition allowing to specify contentId. + */ + interface WithContentId { + /** + * Specifies the contentId property: The content id of the package. + * + * @param contentId The content id of the package. + * @return the next definition stage. + */ + WithCreate withContentId(String contentId); + } + + /** + * The stage of the PackageModel definition allowing to specify contentProductId. + */ + interface WithContentProductId { + /** + * Specifies the contentProductId property: Unique ID for the content. It should be generated based on the + * contentId, contentKind and the contentVersion of the package. + * + * @param contentProductId Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * @return the next definition stage. + */ + WithCreate withContentProductId(String contentProductId); + } + + /** + * The stage of the PackageModel definition allowing to specify contentKind. + */ + interface WithContentKind { + /** + * Specifies the contentKind property: The package kind. + * + * @param contentKind The package kind. + * @return the next definition stage. + */ + WithCreate withContentKind(PackageKind contentKind); + } + + /** + * The stage of the PackageModel definition allowing to specify contentSchemaVersion. + */ + interface WithContentSchemaVersion { + /** + * Specifies the contentSchemaVersion property: The version of the content schema.. + * + * @param contentSchemaVersion The version of the content schema. + * @return the next definition stage. + */ + WithCreate withContentSchemaVersion(String contentSchemaVersion); + } + + /** + * The stage of the PackageModel definition allowing to specify isNew. + */ + interface WithIsNew { + /** + * Specifies the isNew property: Flag indicates if this is a newly published package.. + * + * @param isNew Flag indicates if this is a newly published package. + * @return the next definition stage. + */ + WithCreate withIsNew(Flag isNew); + } + + /** + * The stage of the PackageModel definition allowing to specify isPreview. + */ + interface WithIsPreview { + /** + * Specifies the isPreview property: Flag indicates if this package is in preview.. + * + * @param isPreview Flag indicates if this package is in preview. + * @return the next definition stage. + */ + WithCreate withIsPreview(Flag isPreview); + } + + /** + * The stage of the PackageModel definition allowing to specify isFeatured. + */ + interface WithIsFeatured { + /** + * Specifies the isFeatured property: Flag indicates if this package is among the featured list.. + * + * @param isFeatured Flag indicates if this package is among the featured list. + * @return the next definition stage. + */ + WithCreate withIsFeatured(Flag isFeatured); + } + + /** + * The stage of the PackageModel definition allowing to specify isDeprecated. + */ + interface WithIsDeprecated { + /** + * Specifies the isDeprecated property: Flag indicates if this template is deprecated. + * + * @param isDeprecated Flag indicates if this template is deprecated. + * @return the next definition stage. + */ + WithCreate withIsDeprecated(Flag isDeprecated); + } + + /** + * The stage of the PackageModel definition allowing to specify version. + */ + interface WithVersion { + /** + * Specifies the version property: the latest version number of the package. + * + * @param version the latest version number of the package. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + + /** + * The stage of the PackageModel definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the package. + * + * @param displayName The display name of the package. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the PackageModel definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the package. + * + * @param description The description of the package. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the PackageModel definition allowing to specify publisherDisplayName. + */ + interface WithPublisherDisplayName { + /** + * Specifies the publisherDisplayName property: The publisher display name of the package. + * + * @param publisherDisplayName The publisher display name of the package. + * @return the next definition stage. + */ + WithCreate withPublisherDisplayName(String publisherDisplayName); + } + + /** + * The stage of the PackageModel definition allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: The source of the package. + * + * @param source The source of the package. + * @return the next definition stage. + */ + WithCreate withSource(MetadataSource source); + } + + /** + * The stage of the PackageModel definition allowing to specify author. + */ + interface WithAuthor { + /** + * Specifies the author property: The author of the package. + * + * @param author The author of the package. + * @return the next definition stage. + */ + WithCreate withAuthor(MetadataAuthor author); + } + + /** + * The stage of the PackageModel definition allowing to specify support. + */ + interface WithSupport { + /** + * Specifies the support property: The support tier of the package. + * + * @param support The support tier of the package. + * @return the next definition stage. + */ + WithCreate withSupport(MetadataSupport support); + } + + /** + * The stage of the PackageModel definition allowing to specify dependencies. + */ + interface WithDependencies { + /** + * Specifies the dependencies property: The support tier of the package. + * + * @param dependencies The support tier of the package. + * @return the next definition stage. + */ + WithCreate withDependencies(MetadataDependencies dependencies); + } + + /** + * The stage of the PackageModel definition allowing to specify providers. + */ + interface WithProviders { + /** + * Specifies the providers property: Providers for the package item. + * + * @param providers Providers for the package item. + * @return the next definition stage. + */ + WithCreate withProviders(List providers); + } + + /** + * The stage of the PackageModel definition allowing to specify firstPublishDate. + */ + interface WithFirstPublishDate { + /** + * Specifies the firstPublishDate property: first publish date package item. + * + * @param firstPublishDate first publish date package item. + * @return the next definition stage. + */ + WithCreate withFirstPublishDate(LocalDate firstPublishDate); + } + + /** + * The stage of the PackageModel definition allowing to specify lastPublishDate. + */ + interface WithLastPublishDate { + /** + * Specifies the lastPublishDate property: last publish date for the package item. + * + * @param lastPublishDate last publish date for the package item. + * @return the next definition stage. + */ + WithCreate withLastPublishDate(LocalDate lastPublishDate); + } + + /** + * The stage of the PackageModel definition allowing to specify categories. + */ + interface WithCategories { + /** + * Specifies the categories property: The categories of the package. + * + * @param categories The categories of the package. + * @return the next definition stage. + */ + WithCreate withCategories(MetadataCategories categories); + } + + /** + * The stage of the PackageModel definition allowing to specify threatAnalysisTactics. + */ + interface WithThreatAnalysisTactics { + /** + * Specifies the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the tactics the resource covers. + * @return the next definition stage. + */ + WithCreate withThreatAnalysisTactics(List threatAnalysisTactics); + } + + /** + * The stage of the PackageModel definition allowing to specify threatAnalysisTechniques. + */ + interface WithThreatAnalysisTechniques { + /** + * Specifies the threatAnalysisTechniques property: the techniques the resource covers, these have to be + * aligned with the tactics being used. + * + * @param threatAnalysisTechniques the techniques the resource covers, these have to be aligned with the + * tactics being used. + * @return the next definition stage. + */ + WithCreate withThreatAnalysisTechniques(List threatAnalysisTechniques); + } + + /** + * The stage of the PackageModel definition allowing to specify icon. + */ + interface WithIcon { + /** + * Specifies the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon identifier. this id can later be fetched from the content metadata. + * @return the next definition stage. + */ + WithCreate withIcon(String icon); + } + } + + /** + * Begins update for the PackageModel resource. + * + * @return the stage of resource update. + */ + PackageModel.Update update(); + + /** + * The template for PackageModel update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithContentId, UpdateStages.WithContentProductId, + UpdateStages.WithContentKind, UpdateStages.WithContentSchemaVersion, UpdateStages.WithIsNew, + UpdateStages.WithIsPreview, UpdateStages.WithIsFeatured, UpdateStages.WithIsDeprecated, + UpdateStages.WithVersion, UpdateStages.WithDisplayName, UpdateStages.WithDescription, + UpdateStages.WithPublisherDisplayName, UpdateStages.WithSource, UpdateStages.WithAuthor, + UpdateStages.WithSupport, UpdateStages.WithDependencies, UpdateStages.WithProviders, + UpdateStages.WithFirstPublishDate, UpdateStages.WithLastPublishDate, UpdateStages.WithCategories, + UpdateStages.WithThreatAnalysisTactics, UpdateStages.WithThreatAnalysisTechniques, UpdateStages.WithIcon { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PackageModel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PackageModel apply(Context context); + } + + /** + * The PackageModel update stages. + */ + interface UpdateStages { + /** + * The stage of the PackageModel 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 PackageModel update allowing to specify contentId. + */ + interface WithContentId { + /** + * Specifies the contentId property: The content id of the package. + * + * @param contentId The content id of the package. + * @return the next definition stage. + */ + Update withContentId(String contentId); + } + + /** + * The stage of the PackageModel update allowing to specify contentProductId. + */ + interface WithContentProductId { + /** + * Specifies the contentProductId property: Unique ID for the content. It should be generated based on the + * contentId, contentKind and the contentVersion of the package. + * + * @param contentProductId Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * @return the next definition stage. + */ + Update withContentProductId(String contentProductId); + } + + /** + * The stage of the PackageModel update allowing to specify contentKind. + */ + interface WithContentKind { + /** + * Specifies the contentKind property: The package kind. + * + * @param contentKind The package kind. + * @return the next definition stage. + */ + Update withContentKind(PackageKind contentKind); + } + + /** + * The stage of the PackageModel update allowing to specify contentSchemaVersion. + */ + interface WithContentSchemaVersion { + /** + * Specifies the contentSchemaVersion property: The version of the content schema.. + * + * @param contentSchemaVersion The version of the content schema. + * @return the next definition stage. + */ + Update withContentSchemaVersion(String contentSchemaVersion); + } + + /** + * The stage of the PackageModel update allowing to specify isNew. + */ + interface WithIsNew { + /** + * Specifies the isNew property: Flag indicates if this is a newly published package.. + * + * @param isNew Flag indicates if this is a newly published package. + * @return the next definition stage. + */ + Update withIsNew(Flag isNew); + } + + /** + * The stage of the PackageModel update allowing to specify isPreview. + */ + interface WithIsPreview { + /** + * Specifies the isPreview property: Flag indicates if this package is in preview.. + * + * @param isPreview Flag indicates if this package is in preview. + * @return the next definition stage. + */ + Update withIsPreview(Flag isPreview); + } + + /** + * The stage of the PackageModel update allowing to specify isFeatured. + */ + interface WithIsFeatured { + /** + * Specifies the isFeatured property: Flag indicates if this package is among the featured list.. + * + * @param isFeatured Flag indicates if this package is among the featured list. + * @return the next definition stage. + */ + Update withIsFeatured(Flag isFeatured); + } + + /** + * The stage of the PackageModel update allowing to specify isDeprecated. + */ + interface WithIsDeprecated { + /** + * Specifies the isDeprecated property: Flag indicates if this template is deprecated. + * + * @param isDeprecated Flag indicates if this template is deprecated. + * @return the next definition stage. + */ + Update withIsDeprecated(Flag isDeprecated); + } + + /** + * The stage of the PackageModel update allowing to specify version. + */ + interface WithVersion { + /** + * Specifies the version property: the latest version number of the package. + * + * @param version the latest version number of the package. + * @return the next definition stage. + */ + Update withVersion(String version); + } + + /** + * The stage of the PackageModel update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the package. + * + * @param displayName The display name of the package. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the PackageModel update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the package. + * + * @param description The description of the package. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the PackageModel update allowing to specify publisherDisplayName. + */ + interface WithPublisherDisplayName { + /** + * Specifies the publisherDisplayName property: The publisher display name of the package. + * + * @param publisherDisplayName The publisher display name of the package. + * @return the next definition stage. + */ + Update withPublisherDisplayName(String publisherDisplayName); + } + + /** + * The stage of the PackageModel update allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: The source of the package. + * + * @param source The source of the package. + * @return the next definition stage. + */ + Update withSource(MetadataSource source); + } + + /** + * The stage of the PackageModel update allowing to specify author. + */ + interface WithAuthor { + /** + * Specifies the author property: The author of the package. + * + * @param author The author of the package. + * @return the next definition stage. + */ + Update withAuthor(MetadataAuthor author); + } + + /** + * The stage of the PackageModel update allowing to specify support. + */ + interface WithSupport { + /** + * Specifies the support property: The support tier of the package. + * + * @param support The support tier of the package. + * @return the next definition stage. + */ + Update withSupport(MetadataSupport support); + } + + /** + * The stage of the PackageModel update allowing to specify dependencies. + */ + interface WithDependencies { + /** + * Specifies the dependencies property: The support tier of the package. + * + * @param dependencies The support tier of the package. + * @return the next definition stage. + */ + Update withDependencies(MetadataDependencies dependencies); + } + + /** + * The stage of the PackageModel update allowing to specify providers. + */ + interface WithProviders { + /** + * Specifies the providers property: Providers for the package item. + * + * @param providers Providers for the package item. + * @return the next definition stage. + */ + Update withProviders(List providers); + } + + /** + * The stage of the PackageModel update allowing to specify firstPublishDate. + */ + interface WithFirstPublishDate { + /** + * Specifies the firstPublishDate property: first publish date package item. + * + * @param firstPublishDate first publish date package item. + * @return the next definition stage. + */ + Update withFirstPublishDate(LocalDate firstPublishDate); + } + + /** + * The stage of the PackageModel update allowing to specify lastPublishDate. + */ + interface WithLastPublishDate { + /** + * Specifies the lastPublishDate property: last publish date for the package item. + * + * @param lastPublishDate last publish date for the package item. + * @return the next definition stage. + */ + Update withLastPublishDate(LocalDate lastPublishDate); + } + + /** + * The stage of the PackageModel update allowing to specify categories. + */ + interface WithCategories { + /** + * Specifies the categories property: The categories of the package. + * + * @param categories The categories of the package. + * @return the next definition stage. + */ + Update withCategories(MetadataCategories categories); + } + + /** + * The stage of the PackageModel update allowing to specify threatAnalysisTactics. + */ + interface WithThreatAnalysisTactics { + /** + * Specifies the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the tactics the resource covers. + * @return the next definition stage. + */ + Update withThreatAnalysisTactics(List threatAnalysisTactics); + } + + /** + * The stage of the PackageModel update allowing to specify threatAnalysisTechniques. + */ + interface WithThreatAnalysisTechniques { + /** + * Specifies the threatAnalysisTechniques property: the techniques the resource covers, these have to be + * aligned with the tactics being used. + * + * @param threatAnalysisTechniques the techniques the resource covers, these have to be aligned with the + * tactics being used. + * @return the next definition stage. + */ + Update withThreatAnalysisTechniques(List threatAnalysisTechniques); + } + + /** + * The stage of the PackageModel update allowing to specify icon. + */ + interface WithIcon { + /** + * Specifies the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon identifier. this id can later be fetched from the content metadata. + * @return the next definition stage. + */ + Update withIcon(String icon); + } + } +} 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..9d585ec0f2c7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionProviderScope.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Permission provider scope. + */ +public final class PermissionProviderScope extends ExpandableStringEnum { + /** + * ResourceGroup. + */ + public static final PermissionProviderScope RESOURCE_GROUP = fromString("ResourceGroup"); + + /** + * Subscription. + */ + public static final PermissionProviderScope SUBSCRIPTION = fromString("Subscription"); + + /** + * Workspace. + */ + public static final PermissionProviderScope WORKSPACE = fromString("Workspace"); + + /** + * Creates a new instance of PermissionProviderScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PermissionProviderScope() { + } + + /** + * Creates or finds a PermissionProviderScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding PermissionProviderScope. + */ + public static PermissionProviderScope fromString(String name) { + return fromString(name, PermissionProviderScope.class); + } + + /** + * Gets known PermissionProviderScope values. + * + * @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..0d431358a938 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Permissions.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Permissions required for the connector. + */ +@Fluent +public final class Permissions implements JsonSerializable { + /* + * Resource provider permissions required for the connector + */ + private List resourceProvider; + + /* + * Customs permissions required for the connector + */ + private List customs; + + /** + * Creates an instance of Permissions class. + */ + public Permissions() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourceProvider", this.resourceProvider, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("customs", this.customs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Permissions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Permissions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Permissions. + */ + public static Permissions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Permissions deserializedPermissions = new Permissions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceProvider".equals(fieldName)) { + List resourceProvider + = reader.readArray(reader1 -> PermissionsResourceProviderItem.fromJson(reader1)); + deserializedPermissions.resourceProvider = resourceProvider; + } else if ("customs".equals(fieldName)) { + List customs + = reader.readArray(reader1 -> PermissionsCustomsItem.fromJson(reader1)); + deserializedPermissions.customs = customs; + } else { + reader.skipChildren(); + } + } + + return deserializedPermissions; + }); + } +} 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..22f7ef5f1c46 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PermissionsCustomsItem model. + */ +@Fluent +public final class PermissionsCustomsItem extends Customs { + /** + * Creates an instance of PermissionsCustomsItem class. + */ + public PermissionsCustomsItem() { + } + + /** + * {@inheritDoc} + */ + @Override + public PermissionsCustomsItem withName(String name) { + super.withName(name); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PermissionsCustomsItem withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("description", description()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PermissionsCustomsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PermissionsCustomsItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PermissionsCustomsItem. + */ + public static PermissionsCustomsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PermissionsCustomsItem deserializedPermissionsCustomsItem = new PermissionsCustomsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPermissionsCustomsItem.withName(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPermissionsCustomsItem.withDescription(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPermissionsCustomsItem; + }); + } +} 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..71dd493f2c5f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsResourceProviderItem.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PermissionsResourceProviderItem model. + */ +@Fluent +public final class PermissionsResourceProviderItem extends ResourceProvider { + /** + * Creates an instance of PermissionsResourceProviderItem class. + */ + public PermissionsResourceProviderItem() { + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", provider() == null ? null : provider().toString()); + jsonWriter.writeStringField("permissionsDisplayText", permissionsDisplayText()); + jsonWriter.writeStringField("providerDisplayName", providerDisplayName()); + jsonWriter.writeStringField("scope", scope() == null ? null : scope().toString()); + jsonWriter.writeJsonField("requiredPermissions", requiredPermissions()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PermissionsResourceProviderItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PermissionsResourceProviderItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PermissionsResourceProviderItem. + */ + public static PermissionsResourceProviderItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PermissionsResourceProviderItem deserializedPermissionsResourceProviderItem + = new PermissionsResourceProviderItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedPermissionsResourceProviderItem + .withProvider(ProviderName.fromString(reader.getString())); + } else if ("permissionsDisplayText".equals(fieldName)) { + deserializedPermissionsResourceProviderItem.withPermissionsDisplayText(reader.getString()); + } else if ("providerDisplayName".equals(fieldName)) { + deserializedPermissionsResourceProviderItem.withProviderDisplayName(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedPermissionsResourceProviderItem + .withScope(PermissionProviderScope.fromString(reader.getString())); + } else if ("requiredPermissions".equals(fieldName)) { + deserializedPermissionsResourceProviderItem + .withRequiredPermissions(RequiredPermissions.fromJson(reader)); + } else { + reader.skipChildren(); + } + } + + return deserializedPermissionsResourceProviderItem; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PlaybookActionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PlaybookActionProperties.java index ab0ef219df6c..1cf8831f43bb 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PlaybookActionProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PlaybookActionProperties.java @@ -1,18 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Objects; -import java.util.UUID; /** * The PlaybookActionProperties model. @@ -27,7 +24,7 @@ public final class PlaybookActionProperties implements JsonSerializable UUID.fromString(nonNullReader.getString())); + deserializedPlaybookActionProperties.tenantId = reader.getString(); } else { reader.skipChildren(); } 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..c78fa3559b02 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PollingFrequency.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The polling frequency for the TAXII server. + */ +public final class PollingFrequency extends ExpandableStringEnum { + /** + * Once a minute. + */ + public static final PollingFrequency ONCE_AMINUTE = fromString("OnceAMinute"); + + /** + * Once an hour. + */ + public static final PollingFrequency ONCE_AN_HOUR = fromString("OnceAnHour"); + + /** + * Once a day. + */ + public static final PollingFrequency ONCE_ADAY = fromString("OnceADay"); + + /** + * Creates a new instance of PollingFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PollingFrequency() { + } + + /** + * Creates or finds a PollingFrequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding PollingFrequency. + */ + public static PollingFrequency fromString(String name) { + return fromString(name, PollingFrequency.class); + } + + /** + * Gets known PollingFrequency values. + * + * @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/PremiumMdtiDataConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypes.java new file mode 100644 index 000000000000..e9109885f229 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypes.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Microsoft Defender for Threat Intelligence Premium data connector. + */ +@Fluent +public final class PremiumMdtiDataConnectorDataTypes implements JsonSerializable { + /* + * Data type for Microsoft Defender for Threat Intelligence Premium data connector. + */ + private PremiumMdtiDataConnectorDataTypesConnector connector; + + /** + * Creates an instance of PremiumMdtiDataConnectorDataTypes class. + */ + public PremiumMdtiDataConnectorDataTypes() { + } + + /** + * Get the connector property: Data type for Microsoft Defender for Threat Intelligence Premium data connector. + * + * @return the connector value. + */ + public PremiumMdtiDataConnectorDataTypesConnector connector() { + return this.connector; + } + + /** + * Set the connector property: Data type for Microsoft Defender for Threat Intelligence Premium data connector. + * + * @param connector the connector value to set. + * @return the PremiumMdtiDataConnectorDataTypes object itself. + */ + public PremiumMdtiDataConnectorDataTypes withConnector(PremiumMdtiDataConnectorDataTypesConnector connector) { + this.connector = connector; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connector", this.connector); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PremiumMdtiDataConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PremiumMdtiDataConnectorDataTypes if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PremiumMdtiDataConnectorDataTypes. + */ + public static PremiumMdtiDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PremiumMdtiDataConnectorDataTypes deserializedPremiumMdtiDataConnectorDataTypes + = new PremiumMdtiDataConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connector".equals(fieldName)) { + deserializedPremiumMdtiDataConnectorDataTypes.connector + = PremiumMdtiDataConnectorDataTypesConnector.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPremiumMdtiDataConnectorDataTypes; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypesConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypesConnector.java new file mode 100644 index 000000000000..ccf3ad58d021 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypesConnector.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Data type for Microsoft Defender for Threat Intelligence Premium data connector. + */ +@Fluent +public final class PremiumMdtiDataConnectorDataTypesConnector extends DataConnectorDataTypeCommon { + /** + * Creates an instance of PremiumMdtiDataConnectorDataTypesConnector class. + */ + public PremiumMdtiDataConnectorDataTypesConnector() { + } + + /** + * {@inheritDoc} + */ + @Override + public PremiumMdtiDataConnectorDataTypesConnector withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PremiumMdtiDataConnectorDataTypesConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PremiumMdtiDataConnectorDataTypesConnector if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PremiumMdtiDataConnectorDataTypesConnector. + */ + public static PremiumMdtiDataConnectorDataTypesConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PremiumMdtiDataConnectorDataTypesConnector deserializedPremiumMdtiDataConnectorDataTypesConnector + = new PremiumMdtiDataConnectorDataTypesConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedPremiumMdtiDataConnectorDataTypesConnector + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPremiumMdtiDataConnectorDataTypesConnector; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMicrosoftDefenderForThreatIntelligence.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMicrosoftDefenderForThreatIntelligence.java new file mode 100644 index 000000000000..983cee9cba24 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMicrosoftDefenderForThreatIntelligence.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.PremiumMdtiDataConnectorProperties; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Represents Microsoft Defender for Threat Intelligence Premium data connector. + */ +@Fluent +public final class PremiumMicrosoftDefenderForThreatIntelligence extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.PREMIUM_MICROSOFT_DEFENDER_FOR_THREAT_INTELLIGENCE; + + /* + * Microsoft Defender for Threat Intelligence Premium data connector properties. + */ + private PremiumMdtiDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PremiumMicrosoftDefenderForThreatIntelligence class. + */ + public PremiumMicrosoftDefenderForThreatIntelligence() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Microsoft Defender for Threat Intelligence Premium data connector properties. + * + * @return the innerProperties value. + */ + private PremiumMdtiDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public PremiumMicrosoftDefenderForThreatIntelligence withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the lookbackPeriod property: The lookback period for the feed to be imported. The date-time to begin + * importing the feed from, for example: 2024-01-01T00:00:00.000Z. + * + * @return the lookbackPeriod value. + */ + public OffsetDateTime lookbackPeriod() { + return this.innerProperties() == null ? null : this.innerProperties().lookbackPeriod(); + } + + /** + * Set the lookbackPeriod property: The lookback period for the feed to be imported. The date-time to begin + * importing the feed from, for example: 2024-01-01T00:00:00.000Z. + * + * @param lookbackPeriod the lookbackPeriod value to set. + * @return the PremiumMicrosoftDefenderForThreatIntelligence object itself. + */ + public PremiumMicrosoftDefenderForThreatIntelligence withLookbackPeriod(OffsetDateTime lookbackPeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new PremiumMdtiDataConnectorProperties(); + } + this.innerProperties().withLookbackPeriod(lookbackPeriod); + return this; + } + + /** + * Get the requiredSKUsPresent property: The flag to indicate whether the tenant has the premium SKU required to + * access this connector. + * + * @return the requiredSKUsPresent value. + */ + public Boolean requiredSKUsPresent() { + return this.innerProperties() == null ? null : this.innerProperties().requiredSKUsPresent(); + } + + /** + * Set the requiredSKUsPresent property: The flag to indicate whether the tenant has the premium SKU required to + * access this connector. + * + * @param requiredSKUsPresent the requiredSKUsPresent value to set. + * @return the PremiumMicrosoftDefenderForThreatIntelligence object itself. + */ + public PremiumMicrosoftDefenderForThreatIntelligence withRequiredSKUsPresent(Boolean requiredSKUsPresent) { + if (this.innerProperties() == null) { + this.innerProperties = new PremiumMdtiDataConnectorProperties(); + } + this.innerProperties().withRequiredSKUsPresent(requiredSKUsPresent); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public PremiumMdtiDataConnectorDataTypes 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 PremiumMicrosoftDefenderForThreatIntelligence object itself. + */ + public PremiumMicrosoftDefenderForThreatIntelligence withDataTypes(PremiumMdtiDataConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new PremiumMdtiDataConnectorProperties(); + } + 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 PremiumMicrosoftDefenderForThreatIntelligence object itself. + */ + public PremiumMicrosoftDefenderForThreatIntelligence withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new PremiumMdtiDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PremiumMicrosoftDefenderForThreatIntelligence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PremiumMicrosoftDefenderForThreatIntelligence if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PremiumMicrosoftDefenderForThreatIntelligence. + */ + public static PremiumMicrosoftDefenderForThreatIntelligence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PremiumMicrosoftDefenderForThreatIntelligence deserializedPremiumMicrosoftDefenderForThreatIntelligence + = new PremiumMicrosoftDefenderForThreatIntelligence(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPremiumMicrosoftDefenderForThreatIntelligence.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPremiumMicrosoftDefenderForThreatIntelligence.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPremiumMicrosoftDefenderForThreatIntelligence.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPremiumMicrosoftDefenderForThreatIntelligence.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedPremiumMicrosoftDefenderForThreatIntelligence.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedPremiumMicrosoftDefenderForThreatIntelligence.kind + = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPremiumMicrosoftDefenderForThreatIntelligence.innerProperties + = PremiumMdtiDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPremiumMicrosoftDefenderForThreatIntelligence; + }); + } +} 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 index d70f30c172e2..3bb9e4563e1c 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -17,10 +17,12 @@ /** * Represents a process entity. */ -@Fluent +@Immutable public final class ProcessEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.PROCESS; @@ -52,11 +54,13 @@ public final class ProcessEntity extends Entity { /** * Creates an instance of ProcessEntity class. */ - public ProcessEntity() { + private ProcessEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -150,20 +154,6 @@ 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. * @@ -229,18 +219,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageModel.java new file mode 100644 index 000000000000..590e9dce14fc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageModel.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import java.time.LocalDate; +import java.util.List; + +/** + * An immutable client-side representation of ProductPackageModel. + */ +public interface ProductPackageModel { + /** + * 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: The content id of the package. + * + * @return the contentId value. + */ + String contentId(); + + /** + * Gets the contentProductId property: Unique ID for the content. It should be generated based on the contentId, + * contentKind and the contentVersion of the package. + * + * @return the contentProductId value. + */ + String contentProductId(); + + /** + * Gets the contentKind property: The package kind. + * + * @return the contentKind value. + */ + PackageKind contentKind(); + + /** + * Gets the contentSchemaVersion property: The version of the content schema. + * + * @return the contentSchemaVersion value. + */ + String contentSchemaVersion(); + + /** + * Gets the isNew property: Flag indicates if this is a newly published package. + * + * @return the isNew value. + */ + Flag isNew(); + + /** + * Gets the isPreview property: Flag indicates if this package is in preview. + * + * @return the isPreview value. + */ + Flag isPreview(); + + /** + * Gets the isFeatured property: Flag indicates if this package is among the featured list. + * + * @return the isFeatured value. + */ + Flag isFeatured(); + + /** + * Gets the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + Flag isDeprecated(); + + /** + * Gets the version property: the latest version number of the package. + * + * @return the version value. + */ + String version(); + + /** + * Gets the displayName property: The display name of the package. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The description of the package. + * + * @return the description value. + */ + String description(); + + /** + * Gets the publisherDisplayName property: The publisher display name of the package. + * + * @return the publisherDisplayName value. + */ + String publisherDisplayName(); + + /** + * Gets the source property: The source of the package. + * + * @return the source value. + */ + MetadataSource source(); + + /** + * Gets the author property: The author of the package. + * + * @return the author value. + */ + MetadataAuthor author(); + + /** + * Gets the support property: The support tier of the package. + * + * @return the support value. + */ + MetadataSupport support(); + + /** + * Gets the dependencies property: The support tier of the package. + * + * @return the dependencies value. + */ + MetadataDependencies dependencies(); + + /** + * Gets the providers property: Providers for the package item. + * + * @return the providers value. + */ + List providers(); + + /** + * Gets the firstPublishDate property: first publish date package item. + * + * @return the firstPublishDate value. + */ + LocalDate firstPublishDate(); + + /** + * Gets the lastPublishDate property: last publish date for the package item. + * + * @return the lastPublishDate value. + */ + LocalDate lastPublishDate(); + + /** + * Gets the categories property: The categories of the package. + * + * @return the categories value. + */ + MetadataCategories categories(); + + /** + * Gets the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + List threatAnalysisTactics(); + + /** + * Gets the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + List threatAnalysisTechniques(); + + /** + * Gets the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + String icon(); + + /** + * Gets the installedVersion property: The version of the installed package, null or absent means not installed. + * + * @return the installedVersion value. + */ + String installedVersion(); + + /** + * Gets the metadataResourceId property: The metadata resource id. + * + * @return the metadataResourceId value. + */ + String metadataResourceId(); + + /** + * Gets the packagedContent property: The json of the ARM template to deploy. Expandable. + * + * @return the packagedContent value. + */ + Object packagedContent(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner object. + * + * @return the inner object. + */ + ProductPackageModelInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackages.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackages.java new file mode 100644 index 000000000000..7efc11a4f72a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackages.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ProductPackages. + */ +public interface ProductPackages { + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String packageId, + Context context); + + /** + * Gets a package by its identifier from the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param packageId package 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 package by its identifier from the catalog. + */ + ProductPackageModel get(String resourceGroupName, String workspaceName, String packageId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackagesOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackagesOperations.java new file mode 100644 index 000000000000..b0ea375b30c1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackagesOperations.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ProductPackagesOperations. + */ +public interface ProductPackagesOperations { + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 search Searches for a substring in the response. 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 packages from the catalog. + * Expandable properties: + * - properties/installed + * - properties/packagedContent as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, Integer top, String skipToken, String search, Context context); +} 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..b8b6d5705de7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductSettings.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.SettingsInner; + +/** + * Resource collection API of ProductSettings. + */ +public interface ProductSettings { + /** + * 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String settingsName, + 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); + + /** + * 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 along with {@link Response}. + */ + Response updateWithResponse(String resourceGroupName, String workspaceName, String settingsName, + SettingsInner settings, 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); + + /** + * 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 {@link Response}. + */ + Response deleteWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateModel.java new file mode 100644 index 000000000000..fc8a48168df1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateModel.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import java.time.LocalDate; +import java.util.List; + +/** + * An immutable client-side representation of ProductTemplateModel. + */ +public interface ProductTemplateModel { + /** + * 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 contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @return the contentProductId value. + */ + String contentProductId(); + + /** + * Gets the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @return the packageVersion value. + */ + String packageVersion(); + + /** + * 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 metadata best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @return the version value. + */ + String version(); + + /** + * Gets the displayName property: The display name of the template. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the contentKind property: The kind of content the template is for. + * + * @return the contentKind value. + */ + Kind contentKind(); + + /** + * 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 template - 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 item. + * + * @return the categories value. + */ + MetadataCategories categories(); + + /** + * Gets the providers property: Providers for the content item. + * + * @return the providers value. + */ + List providers(); + + /** + * Gets the firstPublishDate property: first publish date content item. + * + * @return the firstPublishDate value. + */ + LocalDate firstPublishDate(); + + /** + * Gets the lastPublishDate property: last publish date for the content item. + * + * @return the lastPublishDate value. + */ + LocalDate lastPublishDate(); + + /** + * Gets the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + String customVersion(); + + /** + * Gets the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + String contentSchemaVersion(); + + /** + * Gets the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + String icon(); + + /** + * Gets the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + List threatAnalysisTactics(); + + /** + * Gets the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + List threatAnalysisTechniques(); + + /** + * Gets the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + List previewImages(); + + /** + * Gets the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + List previewImagesDark(); + + /** + * Gets the packageId property: the package Id contains this template. + * + * @return the packageId value. + */ + String packageId(); + + /** + * Gets the packageKind property: the packageKind of the package contains this template. + * + * @return the packageKind value. + */ + PackageKind packageKind(); + + /** + * Gets the packageName property: the name of the package contains this template. + * + * @return the packageName value. + */ + String packageName(); + + /** + * Gets the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + Flag isDeprecated(); + + /** + * Gets the packagedContent property: The json of the ARM template to deploy. + * + * @return the packagedContent value. + */ + Object packagedContent(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner object. + * + * @return the inner object. + */ + ProductTemplateModelInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplates.java new file mode 100644 index 000000000000..c09013f6049d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplates.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ProductTemplates. + */ +public interface ProductTemplates { + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String templateId, + Context context); + + /** + * Gets a template by its identifier. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param templateId 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 a template by its identifier. + */ + ProductTemplateModel get(String resourceGroupName, String workspaceName, String templateId); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplatesOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplatesOperations.java new file mode 100644 index 000000000000..05647c59b6fc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplatesOperations.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ProductTemplatesOperations. + */ +public interface ProductTemplatesOperations { + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 templates in the catalog as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all templates in the catalog. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor workspace. + * @param filter Filters the results, based on a Boolean condition. Optional. + * @param orderby Sorts the results. Optional. + * @param search Searches for a substring in the response. Optional. + * @param count Instructs the server to return only object count without actual body. 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 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 templates in the catalog as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String filter, + String orderby, String search, Boolean count, Integer top, Integer skip, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayChangedConditionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayChangedConditionProperties.java index 6989a56565f2..b89663173298 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayChangedConditionProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayChangedConditionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -62,18 +62,6 @@ public AutomationRulePropertyArrayChangedValuesCondition conditionProperties() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (conditionProperties() != null) { - conditionProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayConditionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayConditionProperties.java new file mode 100644 index 000000000000..c3c87ce13b88 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayConditionProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes an automation rule condition that evaluates an array property's value. + */ +@Fluent +public final class PropertyArrayConditionProperties extends AutomationRuleCondition { + /* + * The conditionType property. + */ + private ConditionType conditionType = ConditionType.PROPERTY_ARRAY; + + /* + * The conditionProperties property. + */ + private AutomationRulePropertyArrayValuesCondition conditionProperties; + + /** + * Creates an instance of PropertyArrayConditionProperties class. + */ + public PropertyArrayConditionProperties() { + } + + /** + * Get the conditionType property: The conditionType property. + * + * @return the conditionType value. + */ + @Override + public ConditionType conditionType() { + return this.conditionType; + } + + /** + * Get the conditionProperties property: The conditionProperties property. + * + * @return the conditionProperties value. + */ + public AutomationRulePropertyArrayValuesCondition conditionProperties() { + return this.conditionProperties; + } + + /** + * Set the conditionProperties property: The conditionProperties property. + * + * @param conditionProperties the conditionProperties value to set. + * @return the PropertyArrayConditionProperties object itself. + */ + public PropertyArrayConditionProperties + withConditionProperties(AutomationRulePropertyArrayValuesCondition conditionProperties) { + this.conditionProperties = conditionProperties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("conditionType", this.conditionType == null ? null : this.conditionType.toString()); + jsonWriter.writeJsonField("conditionProperties", this.conditionProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PropertyArrayConditionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PropertyArrayConditionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PropertyArrayConditionProperties. + */ + public static PropertyArrayConditionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PropertyArrayConditionProperties deserializedPropertyArrayConditionProperties + = new PropertyArrayConditionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("conditionType".equals(fieldName)) { + deserializedPropertyArrayConditionProperties.conditionType + = ConditionType.fromString(reader.getString()); + } else if ("conditionProperties".equals(fieldName)) { + deserializedPropertyArrayConditionProperties.conditionProperties + = AutomationRulePropertyArrayValuesCondition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPropertyArrayConditionProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyChangedConditionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyChangedConditionProperties.java index dbb06f7ef74c..8afaea870ed0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyChangedConditionProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyChangedConditionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -62,18 +62,6 @@ public AutomationRulePropertyValuesChangedCondition conditionProperties() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (conditionProperties() != null) { - conditionProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyConditionProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyConditionProperties.java index b628c039a8cc..681a05f14656 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyConditionProperties.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyConditionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -62,18 +62,6 @@ public AutomationRulePropertyValuesCondition conditionProperties() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (conditionProperties() != null) { - conditionProperties().validate(); - } - } - /** * {@inheritDoc} */ 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..e442b305aa0e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderName.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provider name. + */ +public final class ProviderName extends ExpandableStringEnum { + /** + * Microsoft.OperationalInsights/solutions. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS + = fromString("Microsoft.OperationalInsights/solutions"); + + /** + * Microsoft.OperationalInsights/workspaces. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES + = fromString("Microsoft.OperationalInsights/workspaces"); + + /** + * Microsoft.OperationalInsights/workspaces/datasources. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES + = fromString("Microsoft.OperationalInsights/workspaces/datasources"); + + /** + * microsoft.aadiam/diagnosticSettings. + */ + public static final ProviderName MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS + = fromString("microsoft.aadiam/diagnosticSettings"); + + /** + * Microsoft.OperationalInsights/workspaces/sharedKeys. + */ + public static final ProviderName MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_SHARED_KEYS + = fromString("Microsoft.OperationalInsights/workspaces/sharedKeys"); + + /** + * Microsoft.Authorization/policyAssignments. + */ + public static final ProviderName MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS + = fromString("Microsoft.Authorization/policyAssignments"); + + /** + * Creates a new instance of ProviderName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProviderName() { + } + + /** + * Creates or finds a ProviderName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProviderName. + */ + public static ProviderName fromString(String name) { + return fromString(name, ProviderName.class); + } + + /** + * Gets known ProviderName values. + * + * @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/ProviderPermissionsScope.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderPermissionsScope.java new file mode 100644 index 000000000000..84648f559606 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderPermissionsScope.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The scope on which the user should have permissions, in order to be able to create connections. + */ +public final class ProviderPermissionsScope extends ExpandableStringEnum { + /** + * Subscription. + */ + public static final ProviderPermissionsScope SUBSCRIPTION = fromString("Subscription"); + + /** + * ResourceGroup. + */ + public static final ProviderPermissionsScope RESOURCE_GROUP = fromString("ResourceGroup"); + + /** + * Workspace. + */ + public static final ProviderPermissionsScope WORKSPACE = fromString("Workspace"); + + /** + * Creates a new instance of ProviderPermissionsScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProviderPermissionsScope() { + } + + /** + * Creates or finds a ProviderPermissionsScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProviderPermissionsScope. + */ + public static ProviderPermissionsScope fromString(String name) { + return fromString(name, ProviderPermissionsScope.class); + } + + /** + * Gets known ProviderPermissionsScope values. + * + * @return known ProviderPermissionsScope values. + */ + public static Collection values() { + return values(ProviderPermissionsScope.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProvisioningState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProvisioningState.java new file mode 100644 index 000000000000..38970f6a39a2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The triggered analytics rule run provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Accepted. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * InProgress. + */ + public static final ProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Succeeded. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequest.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequest.java new file mode 100644 index 000000000000..7701d3123768 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequest.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information regarding pull request for protected branches. + */ +@Immutable +public final class PullRequest implements JsonSerializable { + /* + * URL of pull request + */ + private String url; + + /* + * State of the pull request + */ + private PullRequestState state; + + /** + * Creates an instance of PullRequest class. + */ + private PullRequest() { + } + + /** + * Get the url property: URL of pull request. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the state property: State of the pull request. + * + * @return the state value. + */ + public PullRequestState state() { + return this.state; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PullRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PullRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PullRequest. + */ + public static PullRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PullRequest deserializedPullRequest = new PullRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedPullRequest.url = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedPullRequest.state = PullRequestState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPullRequest; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequestState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequestState.java new file mode 100644 index 000000000000..e0d05c6ac966 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequestState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the pull request. + */ +public final class PullRequestState extends ExpandableStringEnum { + /** + * Open. + */ + public static final PullRequestState OPEN = fromString("Open"); + + /** + * Closed. + */ + public static final PullRequestState CLOSED = fromString("Closed"); + + /** + * Creates a new instance of PullRequestState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PullRequestState() { + } + + /** + * Creates or finds a PullRequestState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PullRequestState. + */ + public static PullRequestState fromString(String name) { + return fromString(name, PullRequestState.class); + } + + /** + * Gets known PullRequestState values. + * + * @return known PullRequestState values. + */ + public static Collection values() { + return values(PullRequestState.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditCheckRequirements.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditCheckRequirements.java new file mode 100644 index 000000000000..def49ccde3b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditCheckRequirements.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.PurviewAuditCheckRequirementsProperties; +import java.io.IOException; + +/** + * Represents PurviewAudit requirements check request. + */ +@Fluent +public final class PurviewAuditCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.PURVIEW_AUDIT; + + /* + * PurviewAudit requirements check properties. + */ + private PurviewAuditCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of PurviewAuditCheckRequirements class. + */ + public PurviewAuditCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: PurviewAudit requirements check properties. + * + * @return the innerProperties value. + */ + PurviewAuditCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 PurviewAuditCheckRequirements object itself. + */ + public PurviewAuditCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new PurviewAuditCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurviewAuditCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurviewAuditCheckRequirements if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PurviewAuditCheckRequirements. + */ + public static PurviewAuditCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurviewAuditCheckRequirements deserializedPurviewAuditCheckRequirements + = new PurviewAuditCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedPurviewAuditCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPurviewAuditCheckRequirements.innerProperties + = PurviewAuditCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPurviewAuditCheckRequirements; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypes.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypes.java new file mode 100644 index 000000000000..08a00048782f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypes.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for PurviewAudit data connector. + */ +@Fluent +public final class PurviewAuditConnectorDataTypes implements JsonSerializable { + /* + * Logs data type. + */ + private PurviewAuditConnectorDataTypesLogs logs; + + /** + * Creates an instance of PurviewAuditConnectorDataTypes class. + */ + public PurviewAuditConnectorDataTypes() { + } + + /** + * Get the logs property: Logs data type. + * + * @return the logs value. + */ + public PurviewAuditConnectorDataTypesLogs logs() { + return this.logs; + } + + /** + * Set the logs property: Logs data type. + * + * @param logs the logs value to set. + * @return the PurviewAuditConnectorDataTypes object itself. + */ + public PurviewAuditConnectorDataTypes withLogs(PurviewAuditConnectorDataTypesLogs logs) { + this.logs = logs; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logs", this.logs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurviewAuditConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurviewAuditConnectorDataTypes if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PurviewAuditConnectorDataTypes. + */ + public static PurviewAuditConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurviewAuditConnectorDataTypes deserializedPurviewAuditConnectorDataTypes + = new PurviewAuditConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logs".equals(fieldName)) { + deserializedPurviewAuditConnectorDataTypes.logs + = PurviewAuditConnectorDataTypesLogs.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPurviewAuditConnectorDataTypes; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypesLogs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypesLogs.java new file mode 100644 index 000000000000..9b0697a5c86a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypesLogs.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Logs data type. + */ +@Fluent +public final class PurviewAuditConnectorDataTypesLogs extends DataConnectorDataTypeCommon { + /** + * Creates an instance of PurviewAuditConnectorDataTypesLogs class. + */ + public PurviewAuditConnectorDataTypesLogs() { + } + + /** + * {@inheritDoc} + */ + @Override + public PurviewAuditConnectorDataTypesLogs withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurviewAuditConnectorDataTypesLogs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurviewAuditConnectorDataTypesLogs if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PurviewAuditConnectorDataTypesLogs. + */ + public static PurviewAuditConnectorDataTypesLogs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurviewAuditConnectorDataTypesLogs deserializedPurviewAuditConnectorDataTypesLogs + = new PurviewAuditConnectorDataTypesLogs(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedPurviewAuditConnectorDataTypesLogs + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPurviewAuditConnectorDataTypesLogs; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditDataConnector.java new file mode 100644 index 000000000000..f4bea7e314df --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditDataConnector.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.PurviewAuditDataConnectorProperties; +import java.io.IOException; + +/** + * Represents PurviewAudit data connector. + */ +@Fluent +public final class PurviewAuditDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.PURVIEW_AUDIT; + + /* + * PurviewAudit data connector properties. + */ + private PurviewAuditDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PurviewAuditDataConnector class. + */ + public PurviewAuditDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: PurviewAudit data connector properties. + * + * @return the innerProperties value. + */ + private PurviewAuditDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public PurviewAuditDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @return the connectorDefinitionName value. + */ + public String connectorDefinitionName() { + return this.innerProperties() == null ? null : this.innerProperties().connectorDefinitionName(); + } + + /** + * Set the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @param connectorDefinitionName the connectorDefinitionName value to set. + * @return the PurviewAuditDataConnector object itself. + */ + public PurviewAuditDataConnector withConnectorDefinitionName(String connectorDefinitionName) { + if (this.innerProperties() == null) { + this.innerProperties = new PurviewAuditDataConnectorProperties(); + } + this.innerProperties().withConnectorDefinitionName(connectorDefinitionName); + return this; + } + + /** + * Get the sourceType property: The source type indicates which kind of data is relevant for this connector. + * + * @return the sourceType value. + */ + public String sourceType() { + return this.innerProperties() == null ? null : this.innerProperties().sourceType(); + } + + /** + * Set the sourceType property: The source type indicates which kind of data is relevant for this connector. + * + * @param sourceType the sourceType value to set. + * @return the PurviewAuditDataConnector object itself. + */ + public PurviewAuditDataConnector withSourceType(String sourceType) { + if (this.innerProperties() == null) { + this.innerProperties = new PurviewAuditDataConnectorProperties(); + } + this.innerProperties().withSourceType(sourceType); + return this; + } + + /** + * Get the dcrConfig property: The DCR related properties. + * + * @return the dcrConfig value. + */ + public DCRConfiguration dcrConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dcrConfig(); + } + + /** + * Set the dcrConfig property: The DCR related properties. + * + * @param dcrConfig the dcrConfig value to set. + * @return the PurviewAuditDataConnector object itself. + */ + public PurviewAuditDataConnector withDcrConfig(DCRConfiguration dcrConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new PurviewAuditDataConnectorProperties(); + } + this.innerProperties().withDcrConfig(dcrConfig); + return this; + } + + /** + * Get the dataTypes property: The available data types for the connector. + * + * @return the dataTypes value. + */ + public PurviewAuditConnectorDataTypes 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 PurviewAuditDataConnector object itself. + */ + public PurviewAuditDataConnector withDataTypes(PurviewAuditConnectorDataTypes dataTypes) { + if (this.innerProperties() == null) { + this.innerProperties = new PurviewAuditDataConnectorProperties(); + } + 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 PurviewAuditDataConnector object itself. + */ + public PurviewAuditDataConnector withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new PurviewAuditDataConnectorProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PurviewAuditDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PurviewAuditDataConnector if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PurviewAuditDataConnector. + */ + public static PurviewAuditDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PurviewAuditDataConnector deserializedPurviewAuditDataConnector = new PurviewAuditDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPurviewAuditDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPurviewAuditDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPurviewAuditDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPurviewAuditDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedPurviewAuditDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedPurviewAuditDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPurviewAuditDataConnector.innerProperties + = PurviewAuditDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPurviewAuditDataConnector; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java new file mode 100644 index 000000000000..a8133fb3cdd4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a query to run on the TI objects in the workspace. + */ +@Fluent +public final class Query implements JsonSerializable { + /* + * Represents a condition used to query for TI objects. + */ + private QueryCondition condition; + + /* + * Specifies how to sort the query results. + */ + private QuerySortBy sortBy; + + /* + * Represents the maximum size of the page that will be returned from the query API. + */ + private Integer maxPageSize; + + /* + * Represents the minimum size of the page that will be returned from the query API. + */ + private Integer minPageSize; + + /** + * Creates an instance of Query class. + */ + public Query() { + } + + /** + * Get the condition property: Represents a condition used to query for TI objects. + * + * @return the condition value. + */ + public QueryCondition condition() { + return this.condition; + } + + /** + * Set the condition property: Represents a condition used to query for TI objects. + * + * @param condition the condition value to set. + * @return the Query object itself. + */ + public Query withCondition(QueryCondition condition) { + this.condition = condition; + return this; + } + + /** + * Get the sortBy property: Specifies how to sort the query results. + * + * @return the sortBy value. + */ + public QuerySortBy sortBy() { + return this.sortBy; + } + + /** + * Set the sortBy property: Specifies how to sort the query results. + * + * @param sortBy the sortBy value to set. + * @return the Query object itself. + */ + public Query withSortBy(QuerySortBy sortBy) { + this.sortBy = sortBy; + return this; + } + + /** + * Get the maxPageSize property: Represents the maximum size of the page that will be returned from the query API. + * + * @return the maxPageSize value. + */ + public Integer maxPageSize() { + return this.maxPageSize; + } + + /** + * Set the maxPageSize property: Represents the maximum size of the page that will be returned from the query API. + * + * @param maxPageSize the maxPageSize value to set. + * @return the Query object itself. + */ + public Query withMaxPageSize(Integer maxPageSize) { + this.maxPageSize = maxPageSize; + return this; + } + + /** + * Get the minPageSize property: Represents the minimum size of the page that will be returned from the query API. + * + * @return the minPageSize value. + */ + public Integer minPageSize() { + return this.minPageSize; + } + + /** + * Set the minPageSize property: Represents the minimum size of the page that will be returned from the query API. + * + * @param minPageSize the minPageSize value to set. + * @return the Query object itself. + */ + public Query withMinPageSize(Integer minPageSize) { + this.minPageSize = minPageSize; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("condition", this.condition); + jsonWriter.writeJsonField("sortBy", this.sortBy); + jsonWriter.writeNumberField("maxPageSize", this.maxPageSize); + jsonWriter.writeNumberField("minPageSize", this.minPageSize); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Query from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Query if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Query. + */ + public static Query fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Query deserializedQuery = new Query(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("condition".equals(fieldName)) { + deserializedQuery.condition = QueryCondition.fromJson(reader); + } else if ("sortBy".equals(fieldName)) { + deserializedQuery.sortBy = QuerySortBy.fromJson(reader); + } else if ("maxPageSize".equals(fieldName)) { + deserializedQuery.maxPageSize = reader.getNullable(JsonReader::getInt); + } else if ("minPageSize".equals(fieldName)) { + deserializedQuery.minPageSize = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedQuery; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryCondition.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryCondition.java new file mode 100644 index 000000000000..1e762bb5f677 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QueryCondition.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a condition used to query for TI objects. + */ +@Fluent +public final class QueryCondition implements JsonSerializable { + /* + * The STIX type for the objects returned by this query. + */ + private String stixObjectType; + + /* + * The list of clauses to be evaluated in disjunction or conjunction base on the specified top level connective + * operator. + */ + private List clauses; + + /* + * The top level connective operator for this condition. + */ + private Connective conditionConnective; + + /** + * Creates an instance of QueryCondition class. + */ + public QueryCondition() { + } + + /** + * Get the stixObjectType property: The STIX type for the objects returned by this query. + * + * @return the stixObjectType value. + */ + public String stixObjectType() { + return this.stixObjectType; + } + + /** + * Set the stixObjectType property: The STIX type for the objects returned by this query. + * + * @param stixObjectType the stixObjectType value to set. + * @return the QueryCondition object itself. + */ + public QueryCondition withStixObjectType(String stixObjectType) { + this.stixObjectType = stixObjectType; + return this; + } + + /** + * Get the clauses property: The list of clauses to be evaluated in disjunction or conjunction base on the specified + * top level connective operator. + * + * @return the clauses value. + */ + public List clauses() { + return this.clauses; + } + + /** + * Set the clauses property: The list of clauses to be evaluated in disjunction or conjunction base on the specified + * top level connective operator. + * + * @param clauses the clauses value to set. + * @return the QueryCondition object itself. + */ + public QueryCondition withClauses(List clauses) { + this.clauses = clauses; + return this; + } + + /** + * Get the conditionConnective property: The top level connective operator for this condition. + * + * @return the conditionConnective value. + */ + public Connective conditionConnective() { + return this.conditionConnective; + } + + /** + * Set the conditionConnective property: The top level connective operator for this condition. + * + * @param conditionConnective the conditionConnective value to set. + * @return the QueryCondition object itself. + */ + public QueryCondition withConditionConnective(Connective conditionConnective) { + this.conditionConnective = conditionConnective; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("clauses", this.clauses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("stixObjectType", this.stixObjectType); + jsonWriter.writeStringField("conditionConnective", + this.conditionConnective == null ? null : this.conditionConnective.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryCondition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QueryCondition. + */ + public static QueryCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryCondition deserializedQueryCondition = new QueryCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clauses".equals(fieldName)) { + List clauses = reader.readArray(reader1 -> ConditionClause.fromJson(reader1)); + deserializedQueryCondition.clauses = clauses; + } else if ("stixObjectType".equals(fieldName)) { + deserializedQueryCondition.stixObjectType = reader.getString(); + } else if ("conditionConnective".equals(fieldName)) { + deserializedQueryCondition.conditionConnective = Connective.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryCondition; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QuerySortBy.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QuerySortBy.java new file mode 100644 index 000000000000..3d7274079e9f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/QuerySortBy.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specifies how to sort the query results. + */ +@Fluent +public final class QuerySortBy implements JsonSerializable { + /* + * The direction to sort the results by. + */ + private SortingDirection direction; + + /* + * Represents the field to sort the results by. + */ + private String field; + + /** + * Creates an instance of QuerySortBy class. + */ + public QuerySortBy() { + } + + /** + * Get the direction property: The direction to sort the results by. + * + * @return the direction value. + */ + public SortingDirection direction() { + return this.direction; + } + + /** + * Set the direction property: The direction to sort the results by. + * + * @param direction the direction value to set. + * @return the QuerySortBy object itself. + */ + public QuerySortBy withDirection(SortingDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the field property: Represents the field to sort the results by. + * + * @return the field value. + */ + public String field() { + return this.field; + } + + /** + * Set the field property: Represents the field to sort the results by. + * + * @param field the field value to set. + * @return the QuerySortBy object itself. + */ + public QuerySortBy withField(String field) { + this.field = field; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("field", this.field); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuerySortBy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuerySortBy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QuerySortBy. + */ + public static QuerySortBy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuerySortBy deserializedQuerySortBy = new QuerySortBy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedQuerySortBy.direction = SortingDirection.fromString(reader.getString()); + } else if ("field".equals(fieldName)) { + deserializedQuerySortBy.field = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuerySortBy; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Recommendation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Recommendation.java new file mode 100644 index 000000000000..96bc4d144771 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Recommendation.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of Recommendation. + */ +public interface Recommendation { + /** + * 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 recommendationTypeId property: Id of the recommendation type. + * + * @return the recommendationTypeId value. + */ + String recommendationTypeId(); + + /** + * Gets the state property: State of the recommendation. + * + * @return the state value. + */ + State state(); + + /** + * Gets the title property: Title of the recommendation. + * + * @return the title value. + */ + String title(); + + /** + * Gets the description property: Description of the recommendation. + * + * @return the description value. + */ + String description(); + + /** + * Gets the creationTimeUtc property: The time stamp (UTC) when the recommendation was created. + * + * @return the creationTimeUtc value. + */ + OffsetDateTime creationTimeUtc(); + + /** + * Gets the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @return the lastEvaluatedTimeUtc value. + */ + OffsetDateTime lastEvaluatedTimeUtc(); + + /** + * Gets the lastModifiedTimeUtc property: The time stamp (UTC) when the recommendation was last modified. + * + * @return the lastModifiedTimeUtc value. + */ + OffsetDateTime lastModifiedTimeUtc(); + + /** + * Gets the suggestions property: List of suggestions to take for this recommendation. + * + * @return the suggestions value. + */ + List suggestions(); + + /** + * Gets the resourceId property: Id of the resource this recommendation refers to. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the additionalProperties property: Collection of additional properties for the recommendation. + * + * @return the additionalProperties value. + */ + Map additionalProperties(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner object. + * + * @return the inner object. + */ + RecommendationInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatch.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatch.java new file mode 100644 index 000000000000..b822b7d5d86a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatch.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Recommendation Fields to update. + */ +@Fluent +public final class RecommendationPatch implements JsonSerializable { + /* + * Recommendation Fields Properties to update. + */ + private RecommendationPatchProperties properties; + + /** + * Creates an instance of RecommendationPatch class. + */ + public RecommendationPatch() { + } + + /** + * Get the properties property: Recommendation Fields Properties to update. + * + * @return the properties value. + */ + public RecommendationPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Recommendation Fields Properties to update. + * + * @param properties the properties value to set. + * @return the RecommendationPatch object itself. + */ + public RecommendationPatch withProperties(RecommendationPatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RecommendationPatch. + */ + public static RecommendationPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationPatch deserializedRecommendationPatch = new RecommendationPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedRecommendationPatch.properties = RecommendationPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationPatch; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java new file mode 100644 index 000000000000..afd73b404abd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Recommendation Fields Properties to update. + */ +@Fluent +public final class RecommendationPatchProperties implements JsonSerializable { + /* + * State of the recommendation. + */ + private State state; + + /** + * Creates an instance of RecommendationPatchProperties class. + */ + public RecommendationPatchProperties() { + } + + /** + * Get the state property: State of the recommendation. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: State of the recommendation. + * + * @param state the state value to set. + * @return the RecommendationPatchProperties object itself. + */ + public RecommendationPatchProperties withState(State state) { + this.state = state; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendationPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendationPatchProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RecommendationPatchProperties. + */ + public static RecommendationPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendationPatchProperties deserializedRecommendationPatchProperties + = new RecommendationPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedRecommendationPatchProperties.state = State.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendationPatchProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java new file mode 100644 index 000000000000..1488eabd66cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * What suggestions should be taken to complete the recommendation. + */ +@Immutable +public final class RecommendedSuggestion implements JsonSerializable { + /* + * Id of the suggestion type. + */ + private String suggestionTypeId; + + /* + * Title of the suggestion. + */ + private String title; + + /* + * Description of the suggestion. + */ + private String description; + + /* + * Action of the suggestion. + */ + private String action; + + /* + * Collection of additional properties for the suggestion. + */ + private Map additionalProperties; + + /** + * Creates an instance of RecommendedSuggestion class. + */ + private RecommendedSuggestion() { + } + + /** + * Get the suggestionTypeId property: Id of the suggestion type. + * + * @return the suggestionTypeId value. + */ + public String suggestionTypeId() { + return this.suggestionTypeId; + } + + /** + * Get the title property: Title of the suggestion. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the description property: Description of the suggestion. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the action property: Action of the suggestion. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Get the additionalProperties property: Collection of additional properties for the suggestion. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("suggestionTypeId", this.suggestionTypeId); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("action", this.action); + jsonWriter.writeMapField("additionalProperties", this.additionalProperties, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecommendedSuggestion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecommendedSuggestion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecommendedSuggestion. + */ + public static RecommendedSuggestion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecommendedSuggestion deserializedRecommendedSuggestion = new RecommendedSuggestion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("suggestionTypeId".equals(fieldName)) { + deserializedRecommendedSuggestion.suggestionTypeId = reader.getString(); + } else if ("title".equals(fieldName)) { + deserializedRecommendedSuggestion.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedRecommendedSuggestion.description = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedRecommendedSuggestion.action = reader.getString(); + } else if ("additionalProperties".equals(fieldName)) { + Map additionalProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedRecommendedSuggestion.additionalProperties = additionalProperties; + } else { + reader.skipChildren(); + } + } + + return deserializedRecommendedSuggestion; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ReevaluateResponse.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ReevaluateResponse.java new file mode 100644 index 000000000000..ac11fb8ba144 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ReevaluateResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of ReevaluateResponse. + */ +public interface ReevaluateResponse { + /** + * Gets the lastEvaluatedTimeUtc property: The time stamp (UTC) when the recommendation was last evaluated. + * + * @return the lastEvaluatedTimeUtc value. + */ + OffsetDateTime lastEvaluatedTimeUtc(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner object. + * + * @return the inner object. + */ + ReevaluateResponseInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Reevaluates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Reevaluates.java new file mode 100644 index 000000000000..b0eb3f8e86af --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Reevaluates.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Reevaluates. + */ +public interface Reevaluates { + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object along with {@link Response}. + */ + Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, Context context); + + /** + * Reevaluate a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation 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 reevaluate response object. + */ + ReevaluateResponse recommendation(String resourceGroupName, String workspaceName, String recommendationId); +} 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 index eb2e22e67c27..2d3ca232fb01 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,52 +12,52 @@ */ public final class RegistryHive extends ExpandableStringEnum { /** - * Static value HKEY_LOCAL_MACHINE for RegistryHive. + * HKEY_LOCAL_MACHINE. */ public static final RegistryHive HKEY_LOCAL_MACHINE = fromString("HKEY_LOCAL_MACHINE"); /** - * Static value HKEY_CLASSES_ROOT for RegistryHive. + * HKEY_CLASSES_ROOT. */ public static final RegistryHive HKEY_CLASSES_ROOT = fromString("HKEY_CLASSES_ROOT"); /** - * Static value HKEY_CURRENT_CONFIG for RegistryHive. + * HKEY_CURRENT_CONFIG. */ public static final RegistryHive HKEY_CURRENT_CONFIG = fromString("HKEY_CURRENT_CONFIG"); /** - * Static value HKEY_USERS for RegistryHive. + * HKEY_USERS. */ public static final RegistryHive HKEY_USERS = fromString("HKEY_USERS"); /** - * Static value HKEY_CURRENT_USER_LOCAL_SETTINGS for RegistryHive. + * HKEY_CURRENT_USER_LOCAL_SETTINGS. */ public static final RegistryHive HKEY_CURRENT_USER_LOCAL_SETTINGS = fromString("HKEY_CURRENT_USER_LOCAL_SETTINGS"); /** - * Static value HKEY_PERFORMANCE_DATA for RegistryHive. + * HKEY_PERFORMANCE_DATA. */ public static final RegistryHive HKEY_PERFORMANCE_DATA = fromString("HKEY_PERFORMANCE_DATA"); /** - * Static value HKEY_PERFORMANCE_NLSTEXT for RegistryHive. + * HKEY_PERFORMANCE_NLSTEXT. */ public static final RegistryHive HKEY_PERFORMANCE_NLSTEXT = fromString("HKEY_PERFORMANCE_NLSTEXT"); /** - * Static value HKEY_PERFORMANCE_TEXT for RegistryHive. + * HKEY_PERFORMANCE_TEXT. */ public static final RegistryHive HKEY_PERFORMANCE_TEXT = fromString("HKEY_PERFORMANCE_TEXT"); /** - * Static value HKEY_A for RegistryHive. + * HKEY_A. */ public static final RegistryHive HKEY_A = fromString("HKEY_A"); /** - * Static value HKEY_CURRENT_USER for RegistryHive. + * HKEY_CURRENT_USER. */ public static final RegistryHive HKEY_CURRENT_USER = fromString("HKEY_CURRENT_USER"); 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 index 0b69e96c3018..448d196aa717 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Immutable public final class RegistryKeyEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.REGISTRY_KEY; @@ -51,11 +53,13 @@ public final class RegistryKeyEntity extends Entity { /** * Creates an instance of RegistryKeyEntity class. */ - public RegistryKeyEntity() { + private RegistryKeyEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -151,18 +155,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index e42000be1a60..45791d6b1253 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Immutable public final class RegistryValueEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.REGISTRY_VALUE; @@ -51,11 +53,13 @@ public final class RegistryValueEntity extends Entity { /** * Creates an instance of RegistryValueEntity class. */ - public RegistryValueEntity() { + private RegistryValueEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -170,18 +174,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index 1e84a2d70b2c..cacc2581d46f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,42 +13,42 @@ */ public final class RegistryValueKind extends ExpandableStringEnum { /** - * Static value None for RegistryValueKind. + * None. */ public static final RegistryValueKind NONE = fromString("None"); /** - * Static value Unknown for RegistryValueKind. + * Unknown value type. */ public static final RegistryValueKind UNKNOWN = fromString("Unknown"); /** - * Static value String for RegistryValueKind. + * String value type. */ public static final RegistryValueKind STRING = fromString("String"); /** - * Static value ExpandString for RegistryValueKind. + * ExpandString value type. */ public static final RegistryValueKind EXPAND_STRING = fromString("ExpandString"); /** - * Static value Binary for RegistryValueKind. + * Binary value type. */ public static final RegistryValueKind BINARY = fromString("Binary"); /** - * Static value DWord for RegistryValueKind. + * DWord value type. */ public static final RegistryValueKind DWORD = fromString("DWord"); /** - * Static value MultiString for RegistryValueKind. + * MultiString value type. */ public static final RegistryValueKind MULTI_STRING = fromString("MultiString"); /** - * Static value QWord for RegistryValueKind. + * QWord value type. */ public static final RegistryValueKind QWORD = fromString("QWord"); 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 index df89699fb98f..a1456f8e8d40 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -111,14 +111,14 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, incidentId. + * 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 incidentId Incident ID. + * @param bookmarkId Bookmark ID. * @return the next definition stage. */ - WithCreate withExistingIncident(String resourceGroupName, String workspaceName, String incidentId); + WithCreate withExistingBookmark(String resourceGroupName, String workspaceName, String bookmarkId); } /** diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java new file mode 100644 index 000000000000..762391a7f71a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents a relationship in Azure Security Insights. + */ +@Immutable +public final class Relationship extends TIObjectInner { + /* + * The kind of the TI object + */ + private TIObjectKind kind = TIObjectKind.RELATIONSHIP; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The properties of the TI object + */ + private TIObjectCommonProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Relationship class. + */ + private Relationship() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: The properties of the TI object. + * + * @return the innerProperties value. + */ + private TIObjectCommonProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + public Map data() { + return this.innerProperties() == null ? null : this.innerProperties().data(); + } + + /** + * Get the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the source property: The source name for this TI object. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + public OffsetDateTime firstIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstIngestedTimeUtc(); + } + + /** + * Get the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + public OffsetDateTime lastIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastIngestedTimeUtc(); + } + + /** + * Get the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + public String ingestionRulesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionRulesVersion(); + } + + /** + * Get the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + public String lastUpdateMethod() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdateMethod(); + } + + /** + * Get the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + public UserInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateTimeUtc(); + } + + /** + * Get the relationshipHints property: A dictionary used to help follow relationships from this object to other STIX + * objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of sources + * that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + public List relationshipHints() { + return this.innerProperties() == null ? null : this.innerProperties().relationshipHints(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Relationship from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Relationship if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Relationship. + */ + public static Relationship fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Relationship deserializedRelationship = new Relationship(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRelationship.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRelationship.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRelationship.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRelationship.innerProperties = TIObjectCommonProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRelationship.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedRelationship.kind = TIObjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRelationship; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.java new file mode 100644 index 000000000000..dfeddd748413 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An object used to help follow relationships from this object to other STIX objects. + */ +@Immutable +public final class RelationshipHint implements JsonSerializable { + /* + * The fieldName property. + */ + private String fieldName; + + /* + * The source property. + */ + private String source; + + /** + * Creates an instance of RelationshipHint class. + */ + private RelationshipHint() { + } + + /** + * Get the fieldName property: The fieldName property. + * + * @return the fieldName value. + */ + public String fieldName() { + return this.fieldName; + } + + /** + * Get the source property: The source property. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fieldName", this.fieldName); + jsonWriter.writeStringField("source", this.source); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RelationshipHint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RelationshipHint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RelationshipHint. + */ + public static RelationshipHint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RelationshipHint deserializedRelationshipHint = new RelationshipHint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String jsonFieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fieldName".equals(jsonFieldName)) { + deserializedRelationshipHint.fieldName = reader.getString(); + } else if ("source".equals(jsonFieldName)) { + deserializedRelationshipHint.source = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRelationshipHint; + }); + } +} 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..7c203bc33faf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 installationId property: The installation id of the repository. + * + * @return the installationId value. + */ + Long installationId(); + + /** + * 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/RepoType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java new file mode 100644 index 000000000000..8aab76ac646b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of repository. + */ +public final class RepoType extends ExpandableStringEnum { + /** + * Github. + */ + public static final RepoType GITHUB = fromString("Github"); + + /** + * AzureDevOps. + */ + public static final RepoType AZURE_DEV_OPS = fromString("AzureDevOps"); + + /** + * Creates a new instance of RepoType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RepoType() { + } + + /** + * Creates or finds a RepoType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RepoType. + */ + public static RepoType fromString(String name) { + return fromString(name, RepoType.class); + } + + /** + * Gets known RepoType values. + * + * @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..d830007b3a44 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * metadata of a repository. + */ +@Fluent +public final class Repository implements JsonSerializable { + /* + * Url of repository. + */ + private String url; + + /* + * Branch name of repository. + */ + private String branch; + + /* + * Display url of repository. + */ + private String displayUrl; + + /* + * Url to access repository action logs. + */ + private String deploymentLogsUrl; + + /** + * Creates an instance of Repository class. + */ + public Repository() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("branch", this.branch); + jsonWriter.writeStringField("displayUrl", this.displayUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Repository from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Repository if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Repository. + */ + public static Repository fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Repository deserializedRepository = new Repository(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + deserializedRepository.url = reader.getString(); + } else if ("branch".equals(fieldName)) { + deserializedRepository.branch = reader.getString(); + } else if ("displayUrl".equals(fieldName)) { + deserializedRepository.displayUrl = reader.getString(); + } else if ("deploymentLogsUrl".equals(fieldName)) { + deserializedRepository.deploymentLogsUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRepository; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessKind.java new file mode 100644 index 000000000000..7f9d8ef9a620 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessKind.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of repository access credentials. + */ +public final class RepositoryAccessKind extends ExpandableStringEnum { + /** + * OAuth. + */ + public static final RepositoryAccessKind OAUTH = fromString("OAuth"); + + /** + * PAT. + */ + public static final RepositoryAccessKind PAT = fromString("PAT"); + + /** + * App. + */ + public static final RepositoryAccessKind APP = fromString("App"); + + /** + * Creates a new instance of RepositoryAccessKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RepositoryAccessKind() { + } + + /** + * Creates or finds a RepositoryAccessKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding RepositoryAccessKind. + */ + public static RepositoryAccessKind fromString(String name) { + return fromString(name, RepositoryAccessKind.class); + } + + /** + * Gets known RepositoryAccessKind values. + * + * @return known RepositoryAccessKind values. + */ + public static Collection values() { + return values(RepositoryAccessKind.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessProperties.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessProperties.java new file mode 100644 index 000000000000..23d3013f0322 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessProperties.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccessObject; +import java.io.IOException; + +/** + * Credentials to access repository. + */ +@Fluent +public final class RepositoryAccessProperties implements JsonSerializable { + /* + * RepositoryAccess properties + */ + private RepositoryAccessObject innerProperties = new RepositoryAccessObject(); + + /** + * Creates an instance of RepositoryAccessProperties class. + */ + public RepositoryAccessProperties() { + } + + /** + * Get the innerProperties property: RepositoryAccess properties. + * + * @return the innerProperties value. + */ + private RepositoryAccessObject innerProperties() { + return this.innerProperties; + } + + /** + * Get the kind property: The kind of repository access credentials. + * + * @return the kind value. + */ + public RepositoryAccessKind kind() { + return this.innerProperties() == null ? null : this.innerProperties().kind(); + } + + /** + * Set the kind property: The kind of repository access credentials. + * + * @param kind the kind value to set. + * @return the RepositoryAccessProperties object itself. + */ + public RepositoryAccessProperties withKind(RepositoryAccessKind kind) { + if (this.innerProperties() == null) { + this.innerProperties = new RepositoryAccessObject(); + } + this.innerProperties().withKind(kind); + return this; + } + + /** + * Get the code property: OAuth Code. Required when `kind` is `OAuth`. + * + * @return the code value. + */ + public String code() { + return this.innerProperties() == null ? null : this.innerProperties().code(); + } + + /** + * Set the code property: OAuth Code. Required when `kind` is `OAuth`. + * + * @param code the code value to set. + * @return the RepositoryAccessProperties object itself. + */ + public RepositoryAccessProperties withCode(String code) { + if (this.innerProperties() == null) { + this.innerProperties = new RepositoryAccessObject(); + } + this.innerProperties().withCode(code); + return this; + } + + /** + * Get the state property: OAuth State. Required when `kind` is `OAuth`. + * + * @return the state value. + */ + public String state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: OAuth State. Required when `kind` is `OAuth`. + * + * @param state the state value to set. + * @return the RepositoryAccessProperties object itself. + */ + public RepositoryAccessProperties withState(String state) { + if (this.innerProperties() == null) { + this.innerProperties = new RepositoryAccessObject(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the clientId property: OAuth ClientId. Required when `kind` is `OAuth`. + * + * @return the clientId value. + */ + public String clientId() { + return this.innerProperties() == null ? null : this.innerProperties().clientId(); + } + + /** + * Set the clientId property: OAuth ClientId. Required when `kind` is `OAuth`. + * + * @param clientId the clientId value to set. + * @return the RepositoryAccessProperties object itself. + */ + public RepositoryAccessProperties withClientId(String clientId) { + if (this.innerProperties() == null) { + this.innerProperties = new RepositoryAccessObject(); + } + this.innerProperties().withClientId(clientId); + return this; + } + + /** + * Get the token property: Personal Access Token. Required when `kind` is `PAT`. + * + * @return the token value. + */ + public String token() { + return this.innerProperties() == null ? null : this.innerProperties().token(); + } + + /** + * Set the token property: Personal Access Token. Required when `kind` is `PAT`. + * + * @param token the token value to set. + * @return the RepositoryAccessProperties object itself. + */ + public RepositoryAccessProperties withToken(String token) { + if (this.innerProperties() == null) { + this.innerProperties = new RepositoryAccessObject(); + } + this.innerProperties().withToken(token); + return this; + } + + /** + * Get the installationId property: Application installation ID. Required when `kind` is `App`. Supported by + * `GitHub` only. + * + * @return the installationId value. + */ + public String installationId() { + return this.innerProperties() == null ? null : this.innerProperties().installationId(); + } + + /** + * Set the installationId property: Application installation ID. Required when `kind` is `App`. Supported by + * `GitHub` only. + * + * @param installationId the installationId value to set. + * @return the RepositoryAccessProperties object itself. + */ + public RepositoryAccessProperties withInstallationId(String installationId) { + if (this.innerProperties() == null) { + this.innerProperties = new RepositoryAccessObject(); + } + this.innerProperties().withInstallationId(installationId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepositoryAccessProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepositoryAccessProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RepositoryAccessProperties. + */ + public static RepositoryAccessProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepositoryAccessProperties deserializedRepositoryAccessProperties = new RepositoryAccessProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedRepositoryAccessProperties.innerProperties = RepositoryAccessObject.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRepositoryAccessProperties; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryResourceInfo.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryResourceInfo.java new file mode 100644 index 000000000000..c62263deb68b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryResourceInfo.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resources created in user's repository for the source-control. + */ +@Fluent +public final class RepositoryResourceInfo implements JsonSerializable { + /* + * The webhook object created for the source-control. + */ + private Webhook webhook; + + /* + * Resources created in GitHub for this source-control. + */ + private GitHubResourceInfo gitHubResourceInfo; + + /* + * Resources created in Azure DevOps for this source-control. + */ + private AzureDevOpsResourceInfo azureDevOpsResourceInfo; + + /** + * Creates an instance of RepositoryResourceInfo class. + */ + public RepositoryResourceInfo() { + } + + /** + * Get the webhook property: The webhook object created for the source-control. + * + * @return the webhook value. + */ + public Webhook webhook() { + return this.webhook; + } + + /** + * Set the webhook property: The webhook object created for the source-control. + * + * @param webhook the webhook value to set. + * @return the RepositoryResourceInfo object itself. + */ + public RepositoryResourceInfo withWebhook(Webhook webhook) { + this.webhook = webhook; + return this; + } + + /** + * Get the gitHubResourceInfo property: Resources created in GitHub for this source-control. + * + * @return the gitHubResourceInfo value. + */ + public GitHubResourceInfo gitHubResourceInfo() { + return this.gitHubResourceInfo; + } + + /** + * Get the azureDevOpsResourceInfo property: Resources created in Azure DevOps for this source-control. + * + * @return the azureDevOpsResourceInfo value. + */ + public AzureDevOpsResourceInfo azureDevOpsResourceInfo() { + return this.azureDevOpsResourceInfo; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("webhook", this.webhook); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RepositoryResourceInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RepositoryResourceInfo if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RepositoryResourceInfo. + */ + public static RepositoryResourceInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RepositoryResourceInfo deserializedRepositoryResourceInfo = new RepositoryResourceInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webhook".equals(fieldName)) { + deserializedRepositoryResourceInfo.webhook = Webhook.fromJson(reader); + } else if ("gitHubResourceInfo".equals(fieldName)) { + deserializedRepositoryResourceInfo.gitHubResourceInfo = GitHubResourceInfo.fromJson(reader); + } else if ("azureDevOpsResourceInfo".equals(fieldName)) { + deserializedRepositoryResourceInfo.azureDevOpsResourceInfo + = AzureDevOpsResourceInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRepositoryResourceInfo; + }); + } +} 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..681aae425141 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Required permissions for the connector. + */ +@Fluent +public final class RequiredPermissions implements JsonSerializable { + /* + * action permission + */ + private Boolean action; + + /* + * write permission + */ + private Boolean write; + + /* + * read permission + */ + private Boolean read; + + /* + * delete permission + */ + private Boolean delete; + + /** + * Creates an instance of RequiredPermissions class. + */ + public RequiredPermissions() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("action", this.action); + jsonWriter.writeBooleanField("write", this.write); + jsonWriter.writeBooleanField("read", this.read); + jsonWriter.writeBooleanField("delete", this.delete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RequiredPermissions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RequiredPermissions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RequiredPermissions. + */ + public static RequiredPermissions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RequiredPermissions deserializedRequiredPermissions = new RequiredPermissions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedRequiredPermissions.action = reader.getNullable(JsonReader::getBoolean); + } else if ("write".equals(fieldName)) { + deserializedRequiredPermissions.write = reader.getNullable(JsonReader::getBoolean); + } else if ("read".equals(fieldName)) { + deserializedRequiredPermissions.read = reader.getNullable(JsonReader::getBoolean); + } else if ("delete".equals(fieldName)) { + deserializedRequiredPermissions.delete = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRequiredPermissions; + }); + } +} 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..79935fc5092e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resource provider permissions required for the connector. + */ +@Fluent +public class ResourceProvider implements JsonSerializable { + /* + * Provider name + */ + private ProviderName provider; + + /* + * Permission description text + */ + private String permissionsDisplayText; + + /* + * Permission provider display name + */ + private String providerDisplayName; + + /* + * Permission provider scope + */ + private PermissionProviderScope scope; + + /* + * Required permissions for the connector + */ + private RequiredPermissions requiredPermissions; + + /** + * Creates an instance of ResourceProvider class. + */ + public ResourceProvider() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider == null ? null : this.provider.toString()); + jsonWriter.writeStringField("permissionsDisplayText", this.permissionsDisplayText); + jsonWriter.writeStringField("providerDisplayName", this.providerDisplayName); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeJsonField("requiredPermissions", this.requiredPermissions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProvider from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProvider if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceProvider. + */ + public static ResourceProvider fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProvider deserializedResourceProvider = new ResourceProvider(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedResourceProvider.provider = ProviderName.fromString(reader.getString()); + } else if ("permissionsDisplayText".equals(fieldName)) { + deserializedResourceProvider.permissionsDisplayText = reader.getString(); + } else if ("providerDisplayName".equals(fieldName)) { + deserializedResourceProvider.providerDisplayName = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedResourceProvider.scope = PermissionProviderScope.fromString(reader.getString()); + } else if ("requiredPermissions".equals(fieldName)) { + deserializedResourceProvider.requiredPermissions = RequiredPermissions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProvider; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviderRequiredPermissions.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviderRequiredPermissions.java new file mode 100644 index 000000000000..f195a1f46e49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviderRequiredPermissions.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Required permissions for the connector resource provider that define in ResourceProviders. + * For more information about the permissions see <see + * href="https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#actions-format">here</see>. + */ +@Fluent +public final class ResourceProviderRequiredPermissions + implements JsonSerializable { + /* + * Gets or sets a value indicating whether the permission is read action (GET). + */ + private Boolean read; + + /* + * Gets or sets a value indicating whether the permission is write action (PUT or PATCH). + */ + private Boolean write; + + /* + * Gets or sets a value indicating whether the permission is delete action (DELETE). + */ + private Boolean delete; + + /* + * Gets or sets a value indicating whether the permission is custom actions (POST). + */ + private Boolean action; + + /** + * Creates an instance of ResourceProviderRequiredPermissions class. + */ + public ResourceProviderRequiredPermissions() { + } + + /** + * Get the read property: Gets or sets a value indicating whether the permission is read action (GET). + * + * @return the read value. + */ + public Boolean read() { + return this.read; + } + + /** + * Set the read property: Gets or sets a value indicating whether the permission is read action (GET). + * + * @param read the read value to set. + * @return the ResourceProviderRequiredPermissions object itself. + */ + public ResourceProviderRequiredPermissions withRead(Boolean read) { + this.read = read; + return this; + } + + /** + * Get the write property: Gets or sets a value indicating whether the permission is write action (PUT or PATCH). + * + * @return the write value. + */ + public Boolean write() { + return this.write; + } + + /** + * Set the write property: Gets or sets a value indicating whether the permission is write action (PUT or PATCH). + * + * @param write the write value to set. + * @return the ResourceProviderRequiredPermissions object itself. + */ + public ResourceProviderRequiredPermissions withWrite(Boolean write) { + this.write = write; + return this; + } + + /** + * Get the delete property: Gets or sets a value indicating whether the permission is delete action (DELETE). + * + * @return the delete value. + */ + public Boolean delete() { + return this.delete; + } + + /** + * Set the delete property: Gets or sets a value indicating whether the permission is delete action (DELETE). + * + * @param delete the delete value to set. + * @return the ResourceProviderRequiredPermissions object itself. + */ + public ResourceProviderRequiredPermissions withDelete(Boolean delete) { + this.delete = delete; + return this; + } + + /** + * Get the action property: Gets or sets a value indicating whether the permission is custom actions (POST). + * + * @return the action value. + */ + public Boolean action() { + return this.action; + } + + /** + * Set the action property: Gets or sets a value indicating whether the permission is custom actions (POST). + * + * @param action the action value to set. + * @return the ResourceProviderRequiredPermissions object itself. + */ + public ResourceProviderRequiredPermissions withAction(Boolean action) { + this.action = action; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("read", this.read); + jsonWriter.writeBooleanField("write", this.write); + jsonWriter.writeBooleanField("delete", this.delete); + jsonWriter.writeBooleanField("action", this.action); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceProviderRequiredPermissions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceProviderRequiredPermissions if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceProviderRequiredPermissions. + */ + public static ResourceProviderRequiredPermissions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceProviderRequiredPermissions deserializedResourceProviderRequiredPermissions + = new ResourceProviderRequiredPermissions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("read".equals(fieldName)) { + deserializedResourceProviderRequiredPermissions.read = reader.getNullable(JsonReader::getBoolean); + } else if ("write".equals(fieldName)) { + deserializedResourceProviderRequiredPermissions.write = reader.getNullable(JsonReader::getBoolean); + } else if ("delete".equals(fieldName)) { + deserializedResourceProviderRequiredPermissions.delete = reader.getNullable(JsonReader::getBoolean); + } else if ("action".equals(fieldName)) { + deserializedResourceProviderRequiredPermissions.action = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceProviderRequiredPermissions; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviders.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviders.java new file mode 100644 index 000000000000..101885705aa2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviders.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ResourceProviders. + */ +public interface ResourceProviders { + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 along with {@link Response}. + */ + Response listGeodataByIpWithResponse(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentIpAddressBody ipAddressBody, Context context); + + /** + * Get geodata for a single IP address. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param ipAddressBody 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 listGeodataByIp(String resourceGroupName, String workspaceName, EnrichmentType enrichmentType, + EnrichmentIpAddressBody ipAddressBody); + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @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 along with {@link Response}. + */ + Response listWhoisByDomainWithResponse(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody, Context context); + + /** + * Get whois information for a single domain name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param enrichmentType Enrichment type. + * @param domainBody Domain name to be enriched. Only domain name is accepted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 listWhoisByDomain(String resourceGroupName, String workspaceName, + EnrichmentType enrichmentType, EnrichmentDomainBody domainBody); +} 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 index 3e560f541b60..458ebc1cff3d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -118,14 +118,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java new file mode 100644 index 000000000000..64d706f474f1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.RestApiPollerDataConnectorProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Represents Rest Api Poller data connector. + */ +@Fluent +public final class RestApiPollerDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.REST_API_POLLER; + + /* + * Rest Api Poller data connector properties. + */ + private RestApiPollerDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RestApiPollerDataConnector class. + */ + public RestApiPollerDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Rest Api Poller data connector properties. + * + * @return the innerProperties value. + */ + private RestApiPollerDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RestApiPollerDataConnector withEtag(String etag) { + super.withEtag(etag); + return this; + } + + /** + * Get the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @return the connectorDefinitionName value. + */ + public String connectorDefinitionName() { + return this.innerProperties() == null ? null : this.innerProperties().connectorDefinitionName(); + } + + /** + * Set the connectorDefinitionName property: The connector definition name (the dataConnectorDefinition resource + * id). + * + * @param connectorDefinitionName the connectorDefinitionName value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withConnectorDefinitionName(String connectorDefinitionName) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withConnectorDefinitionName(connectorDefinitionName); + return this; + } + + /** + * Get the auth property: The a authentication model. + * + * @return the auth value. + */ + public CcpAuthConfig auth() { + return this.innerProperties() == null ? null : this.innerProperties().auth(); + } + + /** + * Set the auth property: The a authentication model. + * + * @param auth the auth value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withAuth(CcpAuthConfig auth) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withAuth(auth); + return this; + } + + /** + * Get the request property: The request configuration. + * + * @return the request value. + */ + public RestApiPollerRequestConfig request() { + return this.innerProperties() == null ? null : this.innerProperties().request(); + } + + /** + * Set the request property: The request configuration. + * + * @param request the request value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withRequest(RestApiPollerRequestConfig request) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withRequest(request); + return this; + } + + /** + * Get the dcrConfig property: The DCR related properties. + * + * @return the dcrConfig value. + */ + public DCRConfiguration dcrConfig() { + return this.innerProperties() == null ? null : this.innerProperties().dcrConfig(); + } + + /** + * Set the dcrConfig property: The DCR related properties. + * + * @param dcrConfig the dcrConfig value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withDcrConfig(DCRConfiguration dcrConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withDcrConfig(dcrConfig); + return this; + } + + /** + * Get the isActive property: Indicates whether the connector is active or not. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.innerProperties() == null ? null : this.innerProperties().isActive(); + } + + /** + * Set the isActive property: Indicates whether the connector is active or not. + * + * @param isActive the isActive value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withIsActive(Boolean isActive) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withIsActive(isActive); + return this; + } + + /** + * Get the dataType property: The Log Analytics table destination. + * + * @return the dataType value. + */ + public String dataType() { + return this.innerProperties() == null ? null : this.innerProperties().dataType(); + } + + /** + * Set the dataType property: The Log Analytics table destination. + * + * @param dataType the dataType value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withDataType(String dataType) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withDataType(dataType); + return this; + } + + /** + * Get the response property: The response configuration. + * + * @return the response value. + */ + public CcpResponseConfig response() { + return this.innerProperties() == null ? null : this.innerProperties().response(); + } + + /** + * Set the response property: The response configuration. + * + * @param response the response value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withResponse(CcpResponseConfig response) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withResponse(response); + return this; + } + + /** + * Get the paging property: The paging configuration. + * + * @return the paging value. + */ + public RestApiPollerRequestPagingConfig paging() { + return this.innerProperties() == null ? null : this.innerProperties().paging(); + } + + /** + * Set the paging property: The paging configuration. + * + * @param paging the paging value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withPaging(RestApiPollerRequestPagingConfig paging) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withPaging(paging); + return this; + } + + /** + * Get the addOnAttributes property: The add on attributes. The key name will become attribute name (a column) and + * the value will become the attribute value in the payload. + * + * @return the addOnAttributes value. + */ + public Map addOnAttributes() { + return this.innerProperties() == null ? null : this.innerProperties().addOnAttributes(); + } + + /** + * Set the addOnAttributes property: The add on attributes. The key name will become attribute name (a column) and + * the value will become the attribute value in the payload. + * + * @param addOnAttributes the addOnAttributes value to set. + * @return the RestApiPollerDataConnector object itself. + */ + public RestApiPollerDataConnector withAddOnAttributes(Map addOnAttributes) { + if (this.innerProperties() == null) { + this.innerProperties = new RestApiPollerDataConnectorProperties(); + } + this.innerProperties().withAddOnAttributes(addOnAttributes); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestApiPollerDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestApiPollerDataConnector if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RestApiPollerDataConnector. + */ + public static RestApiPollerDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestApiPollerDataConnector deserializedRestApiPollerDataConnector = new RestApiPollerDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRestApiPollerDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRestApiPollerDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRestApiPollerDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRestApiPollerDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedRestApiPollerDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedRestApiPollerDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedRestApiPollerDataConnector.innerProperties + = RestApiPollerDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRestApiPollerDataConnector; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java new file mode 100644 index 000000000000..a1c6833c4761 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The request configuration. + */ +@Fluent +public final class RestApiPollerRequestConfig implements JsonSerializable { + /* + * The API endpoint. + */ + private String apiEndpoint; + + /* + * The Rate limit queries per second for the request.. + */ + private Integer rateLimitQPS; + + /* + * The query window in minutes for the request. + */ + private Integer queryWindowInMin; + + /* + * The HTTP method, default value GET. + */ + private HttpMethodVerb httpMethod; + + /* + * The query time format. A remote server can have a query to pull data from range 'start' to 'end'. This property + * indicate what is the expected time format the remote server know to parse. + */ + private String queryTimeFormat; + + /* + * The retry count. + */ + private Integer retryCount; + + /* + * The timeout in seconds. + */ + private Integer timeoutInSeconds; + + /* + * Flag to indicate if HTTP POST payload is in JSON format (vs form-urlencoded). + */ + private Boolean isPostPayloadJson; + + /* + * The header for the request for the remote server. + */ + private Map headers; + + /* + * The HTTP query parameters to RESTful API. + */ + private Map queryParameters; + + /* + * the query parameters template. Defines the query parameters template to use when passing query parameters in + * advanced scenarios. + */ + private String queryParametersTemplate; + + /* + * The query parameter name which the remote server expect to start query. This property goes hand to hand with + * `endTimeAttributeName`. + */ + private String startTimeAttributeName; + + /* + * The query parameter name which the remote server expect to end query. This property goes hand to hand with + * `startTimeAttributeName` + */ + private String endTimeAttributeName; + + /* + * The query parameter name which we need to send the server for query logs in time interval. Should be defined with + * `queryTimeIntervalPrepend` and `queryTimeIntervalDelimiter` + */ + private String queryTimeIntervalAttributeName; + + /* + * The string prepend to the value of the query parameter in `queryTimeIntervalAttributeName`. + */ + private String queryTimeIntervalPrepend; + + /* + * The delimiter string between 2 QueryTimeFormat in the query parameter `queryTimeIntervalAttributeName`. + */ + private String queryTimeIntervalDelimiter; + + /** + * Creates an instance of RestApiPollerRequestConfig class. + */ + public RestApiPollerRequestConfig() { + } + + /** + * Get the apiEndpoint property: The API endpoint. + * + * @return the apiEndpoint value. + */ + public String apiEndpoint() { + return this.apiEndpoint; + } + + /** + * Set the apiEndpoint property: The API endpoint. + * + * @param apiEndpoint the apiEndpoint value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withApiEndpoint(String apiEndpoint) { + this.apiEndpoint = apiEndpoint; + return this; + } + + /** + * Get the rateLimitQPS property: The Rate limit queries per second for the request.. + * + * @return the rateLimitQPS value. + */ + public Integer rateLimitQPS() { + return this.rateLimitQPS; + } + + /** + * Set the rateLimitQPS property: The Rate limit queries per second for the request.. + * + * @param rateLimitQPS the rateLimitQPS value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withRateLimitQPS(Integer rateLimitQPS) { + this.rateLimitQPS = rateLimitQPS; + return this; + } + + /** + * Get the queryWindowInMin property: The query window in minutes for the request. + * + * @return the queryWindowInMin value. + */ + public Integer queryWindowInMin() { + return this.queryWindowInMin; + } + + /** + * Set the queryWindowInMin property: The query window in minutes for the request. + * + * @param queryWindowInMin the queryWindowInMin value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withQueryWindowInMin(Integer queryWindowInMin) { + this.queryWindowInMin = queryWindowInMin; + return this; + } + + /** + * Get the httpMethod property: The HTTP method, default value GET. + * + * @return the httpMethod value. + */ + public HttpMethodVerb httpMethod() { + return this.httpMethod; + } + + /** + * Set the httpMethod property: The HTTP method, default value GET. + * + * @param httpMethod the httpMethod value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withHttpMethod(HttpMethodVerb httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Get the queryTimeFormat property: The query time format. A remote server can have a query to pull data from range + * 'start' to 'end'. This property indicate what is the expected time format the remote server know to parse. + * + * @return the queryTimeFormat value. + */ + public String queryTimeFormat() { + return this.queryTimeFormat; + } + + /** + * Set the queryTimeFormat property: The query time format. A remote server can have a query to pull data from range + * 'start' to 'end'. This property indicate what is the expected time format the remote server know to parse. + * + * @param queryTimeFormat the queryTimeFormat value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withQueryTimeFormat(String queryTimeFormat) { + this.queryTimeFormat = queryTimeFormat; + return this; + } + + /** + * Get the retryCount property: The retry count. + * + * @return the retryCount value. + */ + public Integer retryCount() { + return this.retryCount; + } + + /** + * Set the retryCount property: The retry count. + * + * @param retryCount the retryCount value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withRetryCount(Integer retryCount) { + this.retryCount = retryCount; + return this; + } + + /** + * Get the timeoutInSeconds property: The timeout in seconds. + * + * @return the timeoutInSeconds value. + */ + public Integer timeoutInSeconds() { + return this.timeoutInSeconds; + } + + /** + * Set the timeoutInSeconds property: The timeout in seconds. + * + * @param timeoutInSeconds the timeoutInSeconds value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withTimeoutInSeconds(Integer timeoutInSeconds) { + this.timeoutInSeconds = timeoutInSeconds; + return this; + } + + /** + * Get the isPostPayloadJson property: Flag to indicate if HTTP POST payload is in JSON format (vs form-urlencoded). + * + * @return the isPostPayloadJson value. + */ + public Boolean isPostPayloadJson() { + return this.isPostPayloadJson; + } + + /** + * Set the isPostPayloadJson property: Flag to indicate if HTTP POST payload is in JSON format (vs form-urlencoded). + * + * @param isPostPayloadJson the isPostPayloadJson value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withIsPostPayloadJson(Boolean isPostPayloadJson) { + this.isPostPayloadJson = isPostPayloadJson; + return this; + } + + /** + * Get the headers property: The header for the request for the remote server. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: The header for the request for the remote server. + * + * @param headers the headers value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the queryParameters property: The HTTP query parameters to RESTful API. + * + * @return the queryParameters value. + */ + public Map queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: The HTTP query parameters to RESTful API. + * + * @param queryParameters the queryParameters value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withQueryParameters(Map queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the queryParametersTemplate property: the query parameters template. Defines the query parameters template to + * use when passing query parameters in advanced scenarios. + * + * @return the queryParametersTemplate value. + */ + public String queryParametersTemplate() { + return this.queryParametersTemplate; + } + + /** + * Set the queryParametersTemplate property: the query parameters template. Defines the query parameters template to + * use when passing query parameters in advanced scenarios. + * + * @param queryParametersTemplate the queryParametersTemplate value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withQueryParametersTemplate(String queryParametersTemplate) { + this.queryParametersTemplate = queryParametersTemplate; + return this; + } + + /** + * Get the startTimeAttributeName property: The query parameter name which the remote server expect to start query. + * This property goes hand to hand with `endTimeAttributeName`. + * + * @return the startTimeAttributeName value. + */ + public String startTimeAttributeName() { + return this.startTimeAttributeName; + } + + /** + * Set the startTimeAttributeName property: The query parameter name which the remote server expect to start query. + * This property goes hand to hand with `endTimeAttributeName`. + * + * @param startTimeAttributeName the startTimeAttributeName value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withStartTimeAttributeName(String startTimeAttributeName) { + this.startTimeAttributeName = startTimeAttributeName; + return this; + } + + /** + * Get the endTimeAttributeName property: The query parameter name which the remote server expect to end query. This + * property goes hand to hand with `startTimeAttributeName`. + * + * @return the endTimeAttributeName value. + */ + public String endTimeAttributeName() { + return this.endTimeAttributeName; + } + + /** + * Set the endTimeAttributeName property: The query parameter name which the remote server expect to end query. This + * property goes hand to hand with `startTimeAttributeName`. + * + * @param endTimeAttributeName the endTimeAttributeName value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withEndTimeAttributeName(String endTimeAttributeName) { + this.endTimeAttributeName = endTimeAttributeName; + return this; + } + + /** + * Get the queryTimeIntervalAttributeName property: The query parameter name which we need to send the server for + * query logs in time interval. Should be defined with `queryTimeIntervalPrepend` and `queryTimeIntervalDelimiter`. + * + * @return the queryTimeIntervalAttributeName value. + */ + public String queryTimeIntervalAttributeName() { + return this.queryTimeIntervalAttributeName; + } + + /** + * Set the queryTimeIntervalAttributeName property: The query parameter name which we need to send the server for + * query logs in time interval. Should be defined with `queryTimeIntervalPrepend` and `queryTimeIntervalDelimiter`. + * + * @param queryTimeIntervalAttributeName the queryTimeIntervalAttributeName value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withQueryTimeIntervalAttributeName(String queryTimeIntervalAttributeName) { + this.queryTimeIntervalAttributeName = queryTimeIntervalAttributeName; + return this; + } + + /** + * Get the queryTimeIntervalPrepend property: The string prepend to the value of the query parameter in + * `queryTimeIntervalAttributeName`. + * + * @return the queryTimeIntervalPrepend value. + */ + public String queryTimeIntervalPrepend() { + return this.queryTimeIntervalPrepend; + } + + /** + * Set the queryTimeIntervalPrepend property: The string prepend to the value of the query parameter in + * `queryTimeIntervalAttributeName`. + * + * @param queryTimeIntervalPrepend the queryTimeIntervalPrepend value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withQueryTimeIntervalPrepend(String queryTimeIntervalPrepend) { + this.queryTimeIntervalPrepend = queryTimeIntervalPrepend; + return this; + } + + /** + * Get the queryTimeIntervalDelimiter property: The delimiter string between 2 QueryTimeFormat in the query + * parameter `queryTimeIntervalAttributeName`. + * + * @return the queryTimeIntervalDelimiter value. + */ + public String queryTimeIntervalDelimiter() { + return this.queryTimeIntervalDelimiter; + } + + /** + * Set the queryTimeIntervalDelimiter property: The delimiter string between 2 QueryTimeFormat in the query + * parameter `queryTimeIntervalAttributeName`. + * + * @param queryTimeIntervalDelimiter the queryTimeIntervalDelimiter value to set. + * @return the RestApiPollerRequestConfig object itself. + */ + public RestApiPollerRequestConfig withQueryTimeIntervalDelimiter(String queryTimeIntervalDelimiter) { + this.queryTimeIntervalDelimiter = queryTimeIntervalDelimiter; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("apiEndpoint", this.apiEndpoint); + jsonWriter.writeNumberField("rateLimitQPS", this.rateLimitQPS); + jsonWriter.writeNumberField("queryWindowInMin", this.queryWindowInMin); + jsonWriter.writeStringField("httpMethod", this.httpMethod == null ? null : this.httpMethod.toString()); + jsonWriter.writeStringField("queryTimeFormat", this.queryTimeFormat); + jsonWriter.writeNumberField("retryCount", this.retryCount); + jsonWriter.writeNumberField("timeoutInSeconds", this.timeoutInSeconds); + jsonWriter.writeBooleanField("isPostPayloadJson", this.isPostPayloadJson); + jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("queryParameters", this.queryParameters, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("queryParametersTemplate", this.queryParametersTemplate); + jsonWriter.writeStringField("startTimeAttributeName", this.startTimeAttributeName); + jsonWriter.writeStringField("endTimeAttributeName", this.endTimeAttributeName); + jsonWriter.writeStringField("queryTimeIntervalAttributeName", this.queryTimeIntervalAttributeName); + jsonWriter.writeStringField("queryTimeIntervalPrepend", this.queryTimeIntervalPrepend); + jsonWriter.writeStringField("queryTimeIntervalDelimiter", this.queryTimeIntervalDelimiter); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestApiPollerRequestConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestApiPollerRequestConfig if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RestApiPollerRequestConfig. + */ + public static RestApiPollerRequestConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestApiPollerRequestConfig deserializedRestApiPollerRequestConfig = new RestApiPollerRequestConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("apiEndpoint".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.apiEndpoint = reader.getString(); + } else if ("rateLimitQPS".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.rateLimitQPS = reader.getNullable(JsonReader::getInt); + } else if ("queryWindowInMin".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.queryWindowInMin = reader.getNullable(JsonReader::getInt); + } else if ("httpMethod".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.httpMethod = HttpMethodVerb.fromString(reader.getString()); + } else if ("queryTimeFormat".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.queryTimeFormat = reader.getString(); + } else if ("retryCount".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.retryCount = reader.getNullable(JsonReader::getInt); + } else if ("timeoutInSeconds".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.timeoutInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("isPostPayloadJson".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.isPostPayloadJson + = reader.getNullable(JsonReader::getBoolean); + } else if ("headers".equals(fieldName)) { + Map headers = reader.readMap(reader1 -> reader1.getString()); + deserializedRestApiPollerRequestConfig.headers = headers; + } else if ("queryParameters".equals(fieldName)) { + Map queryParameters = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedRestApiPollerRequestConfig.queryParameters = queryParameters; + } else if ("queryParametersTemplate".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.queryParametersTemplate = reader.getString(); + } else if ("startTimeAttributeName".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.startTimeAttributeName = reader.getString(); + } else if ("endTimeAttributeName".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.endTimeAttributeName = reader.getString(); + } else if ("queryTimeIntervalAttributeName".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.queryTimeIntervalAttributeName = reader.getString(); + } else if ("queryTimeIntervalPrepend".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.queryTimeIntervalPrepend = reader.getString(); + } else if ("queryTimeIntervalDelimiter".equals(fieldName)) { + deserializedRestApiPollerRequestConfig.queryTimeIntervalDelimiter = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRestApiPollerRequestConfig; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingConfig.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingConfig.java new file mode 100644 index 000000000000..1db8674ea70e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingConfig.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The request paging configuration. + */ +@Fluent +public final class RestApiPollerRequestPagingConfig implements JsonSerializable { + /* + * Type of paging + */ + private RestApiPollerRequestPagingKind pagingType; + + /* + * Page size + */ + private Integer pageSize; + + /* + * Page size parameter name + */ + private String pageSizeParameterName; + + /** + * Creates an instance of RestApiPollerRequestPagingConfig class. + */ + public RestApiPollerRequestPagingConfig() { + } + + /** + * Get the pagingType property: Type of paging. + * + * @return the pagingType value. + */ + public RestApiPollerRequestPagingKind pagingType() { + return this.pagingType; + } + + /** + * Set the pagingType property: Type of paging. + * + * @param pagingType the pagingType value to set. + * @return the RestApiPollerRequestPagingConfig object itself. + */ + public RestApiPollerRequestPagingConfig withPagingType(RestApiPollerRequestPagingKind pagingType) { + this.pagingType = pagingType; + return this; + } + + /** + * 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 RestApiPollerRequestPagingConfig object itself. + */ + public RestApiPollerRequestPagingConfig withPageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Get the pageSizeParameterName property: Page size parameter name. + * + * @return the pageSizeParameterName value. + */ + public String pageSizeParameterName() { + return this.pageSizeParameterName; + } + + /** + * Set the pageSizeParameterName property: Page size parameter name. + * + * @param pageSizeParameterName the pageSizeParameterName value to set. + * @return the RestApiPollerRequestPagingConfig object itself. + */ + public RestApiPollerRequestPagingConfig withPageSizeParameterName(String pageSizeParameterName) { + this.pageSizeParameterName = pageSizeParameterName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pagingType", this.pagingType == null ? null : this.pagingType.toString()); + jsonWriter.writeNumberField("pageSize", this.pageSize); + jsonWriter.writeStringField("pageSizeParameterName", this.pageSizeParameterName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestApiPollerRequestPagingConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestApiPollerRequestPagingConfig if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RestApiPollerRequestPagingConfig. + */ + public static RestApiPollerRequestPagingConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestApiPollerRequestPagingConfig deserializedRestApiPollerRequestPagingConfig + = new RestApiPollerRequestPagingConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pagingType".equals(fieldName)) { + deserializedRestApiPollerRequestPagingConfig.pagingType + = RestApiPollerRequestPagingKind.fromString(reader.getString()); + } else if ("pageSize".equals(fieldName)) { + deserializedRestApiPollerRequestPagingConfig.pageSize = reader.getNullable(JsonReader::getInt); + } else if ("pageSizeParameterName".equals(fieldName)) { + deserializedRestApiPollerRequestPagingConfig.pageSizeParameterName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRestApiPollerRequestPagingConfig; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.java new file mode 100644 index 000000000000..c2ff7afee1bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of paging. + */ +public final class RestApiPollerRequestPagingKind extends ExpandableStringEnum { + /** + * LinkHeader. + */ + public static final RestApiPollerRequestPagingKind LINK_HEADER = fromString("LinkHeader"); + + /** + * NextPageToken. + */ + public static final RestApiPollerRequestPagingKind NEXT_PAGE_TOKEN = fromString("NextPageToken"); + + /** + * NextPageUrl. + */ + public static final RestApiPollerRequestPagingKind NEXT_PAGE_URL = fromString("NextPageUrl"); + + /** + * PersistentToken. + */ + public static final RestApiPollerRequestPagingKind PERSISTENT_TOKEN = fromString("PersistentToken"); + + /** + * PersistentLinkHeader. + */ + public static final RestApiPollerRequestPagingKind PERSISTENT_LINK_HEADER = fromString("PersistentLinkHeader"); + + /** + * Offset. + */ + public static final RestApiPollerRequestPagingKind OFFSET = fromString("Offset"); + + /** + * CountBasedPaging. + */ + public static final RestApiPollerRequestPagingKind COUNT_BASED_PAGING = fromString("CountBasedPaging"); + + /** + * Creates a new instance of RestApiPollerRequestPagingKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RestApiPollerRequestPagingKind() { + } + + /** + * Creates or finds a RestApiPollerRequestPagingKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding RestApiPollerRequestPagingKind. + */ + public static RestApiPollerRequestPagingKind fromString(String name) { + return fromString(name, RestApiPollerRequestPagingKind.class); + } + + /** + * Gets known RestApiPollerRequestPagingKind values. + * + * @return known RestApiPollerRequestPagingKind values. + */ + public static Collection values() { + return values(RestApiPollerRequestPagingKind.class); + } +} 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..4d6283026bbb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SampleQueries.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The sample queries for the connector. + */ +@Fluent +public class SampleQueries implements JsonSerializable { + /* + * The sample query description + */ + private String description; + + /* + * the sample query + */ + private String query; + + /** + * Creates an instance of SampleQueries class. + */ + public SampleQueries() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("query", this.query); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SampleQueries from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SampleQueries if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SampleQueries. + */ + public static SampleQueries fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SampleQueries deserializedSampleQueries = new SampleQueries(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedSampleQueries.description = reader.getString(); + } else if ("query".equals(fieldName)) { + deserializedSampleQueries.query = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSampleQueries; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapSolutionUsageStatistic.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapSolutionUsageStatistic.java new file mode 100644 index 000000000000..62ce1291cd8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SapSolutionUsageStatistic.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; +import com.azure.resourcemanager.securityinsights.fluent.models.SapSolutionUsageStatisticProperties; +import java.io.IOException; + +/** + * Billing statistic about the Microsoft Sentinel solution for SAP Usage. + */ +@Immutable +public final class SapSolutionUsageStatistic extends BillingStatisticInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private BillingStatisticKind kind = BillingStatisticKind.SAP_SOLUTION_USAGE; + + /* + * The SAP solution usage object + */ + private SapSolutionUsageStatisticProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Resource Etag. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SapSolutionUsageStatistic class. + */ + private SapSolutionUsageStatistic() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public BillingStatisticKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: The SAP solution usage object. + * + * @return the innerProperties value. + */ + private SapSolutionUsageStatisticProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the activeSystemIdCount property: The latest count of active SAP system IDs under the Microsoft Sentinel + * solution for SAP Usage. + * + * @return the activeSystemIdCount value. + */ + public Long activeSystemIdCount() { + return this.innerProperties() == null ? null : this.innerProperties().activeSystemIdCount(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SapSolutionUsageStatistic from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SapSolutionUsageStatistic if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SapSolutionUsageStatistic. + */ + public static SapSolutionUsageStatistic fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SapSolutionUsageStatistic deserializedSapSolutionUsageStatistic = new SapSolutionUsageStatistic(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSapSolutionUsageStatistic.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSapSolutionUsageStatistic.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSapSolutionUsageStatistic.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedSapSolutionUsageStatistic.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSapSolutionUsageStatistic.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedSapSolutionUsageStatistic.kind = BillingStatisticKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedSapSolutionUsageStatistic.innerProperties + = SapSolutionUsageStatisticProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSapSolutionUsageStatistic; + }); + } +} 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 index d199153e33c2..3dd2887cdcd1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -23,7 +23,9 @@ @Fluent public final class ScheduledAlertRule extends AlertRuleInner { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.SCHEDULED; @@ -59,7 +61,9 @@ public ScheduledAlertRule() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -348,6 +352,29 @@ public ScheduledAlertRule withTechniques(List techniques) { return this; } + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); + } + + /** + * Set the subTechniques property: The sub-techniques of the alert rule. + * + * @param subTechniques the subTechniques value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withSubTechniques(List subTechniques) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); + } + this.innerProperties().withSubTechniques(subTechniques); + return this; + } + /** * Get the incidentConfiguration property: The settings of the incidents that created from alerts triggered by this * analytics rule. @@ -604,15 +631,26 @@ public ScheduledAlertRule withAlertDetailsOverride(AlertDetailsOverride alertDet } /** - * Validates the instance. + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the sentinelEntitiesMappings value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public List sentinelEntitiesMappings() { + return this.innerProperties() == null ? null : this.innerProperties().sentinelEntitiesMappings(); + } + + /** + * Set the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @param sentinelEntitiesMappings the sentinelEntitiesMappings value to set. + * @return the ScheduledAlertRule object itself. + */ + public ScheduledAlertRule withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + if (this.innerProperties() == null) { + this.innerProperties = new ScheduledAlertRuleProperties(); } + this.innerProperties().withSentinelEntitiesMappings(sentinelEntitiesMappings); + return this; } /** 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 index e0a0ccfdb7eb..1ad1a3d84b1a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -70,6 +70,11 @@ public class ScheduledAlertRuleCommonProperties implements JsonSerializable sentinelEntitiesMappings; + /** * Creates an instance of ScheduledAlertRuleCommonProperties class. */ @@ -277,20 +282,24 @@ public ScheduledAlertRuleCommonProperties withAlertDetailsOverride(AlertDetailsO } /** - * Validates the instance. + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. + * + * @return the sentinelEntitiesMappings value. + */ + public List sentinelEntitiesMappings() { + return this.sentinelEntitiesMappings; + } + + /** + * Set the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (eventGroupingSettings() != null) { - eventGroupingSettings().validate(); - } - if (entityMappings() != null) { - entityMappings().forEach(e -> e.validate()); - } - if (alertDetailsOverride() != null) { - alertDetailsOverride().validate(); - } + * @param sentinelEntitiesMappings the sentinelEntitiesMappings value to set. + * @return the ScheduledAlertRuleCommonProperties object itself. + */ + public ScheduledAlertRuleCommonProperties + withSentinelEntitiesMappings(List sentinelEntitiesMappings) { + this.sentinelEntitiesMappings = sentinelEntitiesMappings; + return this; } /** @@ -311,6 +320,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("entityMappings", this.entityMappings, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("alertDetailsOverride", this.alertDetailsOverride); + jsonWriter.writeArrayField("sentinelEntitiesMappings", this.sentinelEntitiesMappings, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -359,6 +370,10 @@ public static ScheduledAlertRuleCommonProperties fromJson(JsonReader jsonReader) } else if ("alertDetailsOverride".equals(fieldName)) { deserializedScheduledAlertRuleCommonProperties.alertDetailsOverride = AlertDetailsOverride.fromJson(reader); + } else if ("sentinelEntitiesMappings".equals(fieldName)) { + List sentinelEntitiesMappings + = reader.readArray(reader1 -> SentinelEntityMapping.fromJson(reader1)); + deserializedScheduledAlertRuleCommonProperties.sentinelEntitiesMappings = sentinelEntitiesMappings; } else { reader.skipChildren(); } 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 index 69cca8631181..7d357c807358 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -20,10 +20,12 @@ /** * Represents scheduled alert rule template. */ -@Fluent +@Immutable public final class ScheduledAlertRuleTemplate extends AlertRuleTemplateInner { /* - * The alert rule kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private AlertRuleKind kind = AlertRuleKind.SCHEDULED; @@ -55,11 +57,13 @@ public final class ScheduledAlertRuleTemplate extends AlertRuleTemplateInner { /** * Creates an instance of ScheduledAlertRuleTemplate class. */ - public ScheduledAlertRuleTemplate() { + private ScheduledAlertRuleTemplate() { } /** - * Get the kind property: The alert rule kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -118,7 +122,7 @@ public String id() { } /** - * Get the alertRulesCreatedByTemplateCount property: the number of alert rules that were created by this template. + * Get the alertRulesCreatedByTemplateCount property: The number of alert rules that were created by this template. * * @return the alertRulesCreatedByTemplateCount value. */ @@ -126,20 +130,6 @@ 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 createdDateUtc property: The time that this alert rule template has been added. * @@ -167,20 +157,6 @@ 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. * @@ -190,20 +166,6 @@ 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 connectors for this template. * @@ -213,21 +175,6 @@ public List requiredDataConnectors() { return this.innerProperties() == null ? null : this.innerProperties().requiredDataConnectors(); } - /** - * Set the requiredDataConnectors property: The required data connectors 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. * @@ -237,20 +184,6 @@ 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; - } - /** * Get the query property: The query that creates alerts for this rule. * @@ -260,20 +193,6 @@ 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 queryFrequency property: The frequency (in ISO 8601 duration format) for this alert rule to run. * @@ -283,20 +202,6 @@ 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. * @@ -306,20 +211,6 @@ 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 severity property: The severity for alerts created by this alert rule. * @@ -329,20 +220,6 @@ 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 triggerOperator property: The operation against the threshold that triggers alert rule. * @@ -352,20 +229,6 @@ 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. * @@ -375,20 +238,6 @@ 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 tactics property: The tactics of the alert rule template. * @@ -399,21 +248,7 @@ public List tactics() { } /** - * Set the tactics property: The tactics of the alert rule template. - * - * @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 techniques property: The techniques of the alert rule template. + * Get the techniques property: The techniques of the alert rule. * * @return the techniques value. */ @@ -422,17 +257,12 @@ public List techniques() { } /** - * Set the techniques property: The techniques of the alert rule template. + * Get the subTechniques property: The sub-techniques of the alert rule. * - * @param techniques the techniques value to set. - * @return the ScheduledAlertRuleTemplate object itself. - */ - public ScheduledAlertRuleTemplate withTechniques(List techniques) { - if (this.innerProperties() == null) { - this.innerProperties = new ScheduledAlertRuleTemplateProperties(); - } - this.innerProperties().withTechniques(techniques); - return this; + * @return the subTechniques value. + */ + public List subTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); } /** @@ -445,21 +275,6 @@ 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 eventGroupingSettings property: The event grouping settings. * @@ -469,20 +284,6 @@ 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 customDetails property: Dictionary of string key-value pairs of columns to be attached to the alert. * @@ -492,20 +293,6 @@ 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. * @@ -515,20 +302,6 @@ 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. * @@ -539,29 +312,12 @@ public AlertDetailsOverride 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; - } - - /** - * Validates the instance. + * Get the sentinelEntitiesMappings property: Array of the sentinel entity mappings of the alert rule. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the sentinelEntitiesMappings value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } + public List sentinelEntitiesMappings() { + return this.innerProperties() == null ? null : this.innerProperties().sentinelEntitiesMappings(); } /** 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 index b2ca2bf368a3..dc91d0423b43 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -18,10 +18,12 @@ /** * Represents a security alert entity. */ -@Fluent +@Immutable public final class SecurityAlert extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.SECURITY_ALERT; @@ -53,11 +55,13 @@ public final class SecurityAlert extends Entity { /** * Creates an instance of SecurityAlert class. */ - public SecurityAlert() { + private SecurityAlert() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -270,20 +274,6 @@ 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). @@ -377,18 +367,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index 30f8a37cbd77..613e474c36c8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -30,7 +30,7 @@ public final class SecurityAlertPropertiesConfidenceReasonsItem /** * Creates an instance of SecurityAlertPropertiesConfidenceReasonsItem class. */ - public SecurityAlertPropertiesConfidenceReasonsItem() { + private SecurityAlertPropertiesConfidenceReasonsItem() { } /** @@ -51,14 +51,6 @@ public String reasonType() { return this.reasonType; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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..d118cc036abc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Represents security alert timeline item. + */ +@Immutable +public final class SecurityAlertTimelineItem extends EntityTimelineItem { + /* + * The entity query kind type. + */ + private EntityTimelineKind kind = EntityTimelineKind.SECURITY_ALERT; + + /* + * The alert azure resource id. + */ + private String azureResourceId; + + /* + * The alert product name. + */ + private String productName; + + /* + * The alert description. + */ + private String description; + + /* + * The alert name. + */ + private String displayName; + + /* + * The alert severity. + */ + private AlertSeverity severity; + + /* + * The alert end time. + */ + private OffsetDateTime endTimeUtc; + + /* + * The alert start time. + */ + private OffsetDateTime startTimeUtc; + + /* + * The alert generated time. + */ + private OffsetDateTime timeGenerated; + + /* + * The name of the alert type. + */ + private String alertType; + + /* + * The intent of the alert. + */ + private KillChainIntent intent; + + /* + * The techniques of the alert. + */ + private List techniques; + + /** + * Creates an instance of SecurityAlertTimelineItem class. + */ + private SecurityAlertTimelineItem() { + } + + /** + * Get the kind property: The entity query kind type. + * + * @return the kind value. + */ + @Override + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * Get the azureResourceId property: The alert azure resource id. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Get the productName property: The alert product name. + * + * @return the productName value. + */ + public String productName() { + return this.productName; + } + + /** + * Get the description property: The alert description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the displayName property: The alert name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the severity property: The alert severity. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Get the endTimeUtc property: The alert end time. + * + * @return the endTimeUtc value. + */ + public OffsetDateTime endTimeUtc() { + return this.endTimeUtc; + } + + /** + * Get the startTimeUtc property: The alert start time. + * + * @return the startTimeUtc value. + */ + public OffsetDateTime startTimeUtc() { + return this.startTimeUtc; + } + + /** + * Get the timeGenerated property: The alert generated time. + * + * @return the timeGenerated value. + */ + public OffsetDateTime timeGenerated() { + return this.timeGenerated; + } + + /** + * Get the alertType property: The name of the alert type. + * + * @return the alertType value. + */ + public String alertType() { + return this.alertType; + } + + /** + * Get the intent property: The intent of the alert. + * + * @return the intent value. + */ + public KillChainIntent intent() { + return this.intent; + } + + /** + * Get the techniques property: The techniques of the alert. + * + * @return the techniques value. + */ + public List techniques() { + return this.techniques; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeStringField("endTimeUtc", + this.endTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTimeUtc)); + jsonWriter.writeStringField("startTimeUtc", + this.startTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimeUtc)); + jsonWriter.writeStringField("timeGenerated", + this.timeGenerated == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timeGenerated)); + jsonWriter.writeStringField("alertType", this.alertType); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("productName", this.productName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("techniques", this.techniques, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityAlertTimelineItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityAlertTimelineItem if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityAlertTimelineItem. + */ + public static SecurityAlertTimelineItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityAlertTimelineItem deserializedSecurityAlertTimelineItem = new SecurityAlertTimelineItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureResourceId".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.azureResourceId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.displayName = reader.getString(); + } else if ("severity".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.severity = AlertSeverity.fromString(reader.getString()); + } else if ("endTimeUtc".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.endTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startTimeUtc".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.startTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("timeGenerated".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.timeGenerated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("alertType".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.alertType = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.kind = EntityTimelineKind.fromString(reader.getString()); + } else if ("productName".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.productName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.description = reader.getString(); + } else if ("intent".equals(fieldName)) { + deserializedSecurityAlertTimelineItem.intent = KillChainIntent.fromString(reader.getString()); + } else if ("techniques".equals(fieldName)) { + List techniques = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityAlertTimelineItem.techniques = techniques; + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityAlertTimelineItem; + }); + } +} 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 index 67006853c1a5..37eef0214f9d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,7 +12,6 @@ import com.azure.resourcemanager.securityinsights.fluent.models.SecurityGroupEntityProperties; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Represents a security group entity. @@ -20,7 +19,9 @@ @Immutable public final class SecurityGroupEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.SECURITY_GROUP; @@ -52,11 +53,13 @@ public final class SecurityGroupEntity extends Entity { /** * Creates an instance of SecurityGroupEntity class. */ - public SecurityGroupEntity() { + private SecurityGroupEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -129,7 +132,7 @@ public String distinguishedName() { * * @return the objectGuid value. */ - public UUID objectGuid() { + public String objectGuid() { return this.innerProperties() == null ? null : this.innerProperties().objectGuid(); } @@ -163,18 +166,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSetting.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSetting.java index 4215a5fe8c2d..51ee366f0fc8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSetting.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSetting.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -32,6 +32,15 @@ public interface SecurityMLAnalyticsSetting { */ String type(); + /** + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + SecurityMLAnalyticsSettingsKind kind(); + /** * Gets the etag property: Etag of the azure resource. * @@ -46,13 +55,6 @@ public interface SecurityMLAnalyticsSetting { */ SystemData systemData(); - /** - * Gets the kind property: The kind of security ML Analytics Settings. - * - * @return the kind value. - */ - SecurityMLAnalyticsSettingsKind kind(); - /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner object. * diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettings.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettings.java index f9981890b193..7d9383da82ed 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettings.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,36 +13,11 @@ * Resource collection API of SecurityMLAnalyticsSettings. */ public interface SecurityMLAnalyticsSettings { - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String workspaceName); - - /** - * Gets all Security ML Analytics 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 all Security ML Analytics Settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String workspaceName, Context context); - /** * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -57,7 +32,7 @@ Response getWithResponse(String resourceGroupName, S * Gets the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -70,7 +45,7 @@ Response getWithResponse(String resourceGroupName, S * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @param context The context to associate with this operation. @@ -86,7 +61,7 @@ Response createOrUpdateWithResponse(String resourceG * Creates or updates the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param securityMLAnalyticsSetting The security ML Analytics setting. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -101,7 +76,7 @@ SecurityMLAnalyticsSetting createOrUpdate(String resourceGroupName, String works * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -116,11 +91,36 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * Delete the Security ML Analytics Settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param settingsResourceName Security ML Analytics Settings resource 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 settingsResourceName); + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all Security ML Analytics Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the monitor 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 Security ML Analytics Settings as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsDataSource.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsDataSource.java index 6113418e4711..0233356fc743 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsDataSource.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsDataSource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -74,14 +74,6 @@ public SecurityMLAnalyticsSettingsDataSource withDataTypes(List dataType return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsKind.java index 6cee8238af6e..2d54674ef2d3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsKind.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,7 +12,7 @@ */ public final class SecurityMLAnalyticsSettingsKind extends ExpandableStringEnum { /** - * Static value Anomaly for SecurityMLAnalyticsSettingsKind. + * Anomaly. */ public static final SecurityMLAnalyticsSettingsKind ANOMALY = fromString("Anomaly"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelEntityMapping.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelEntityMapping.java new file mode 100644 index 000000000000..24332583bce4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelEntityMapping.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A single sentinel entity mapping. + */ +@Fluent +public final class SentinelEntityMapping implements JsonSerializable { + /* + * the column name to be mapped to the SentinelEntities + */ + private String columnName; + + /** + * Creates an instance of SentinelEntityMapping class. + */ + public SentinelEntityMapping() { + } + + /** + * Get the columnName property: the column name to be mapped to the SentinelEntities. + * + * @return the columnName value. + */ + public String columnName() { + return this.columnName; + } + + /** + * Set the columnName property: the column name to be mapped to the SentinelEntities. + * + * @param columnName the columnName value to set. + * @return the SentinelEntityMapping object itself. + */ + public SentinelEntityMapping withColumnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("columnName", this.columnName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SentinelEntityMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SentinelEntityMapping if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SentinelEntityMapping. + */ + public static SentinelEntityMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SentinelEntityMapping deserializedSentinelEntityMapping = new SentinelEntityMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("columnName".equals(fieldName)) { + deserializedSentinelEntityMapping.columnName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSentinelEntityMapping; + }); + } +} 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 index 1541cd338f0e..09f4e0a6b577 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; 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 index 42189b8ee81a..b1f3cf3f62e3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -15,7 +15,7 @@ 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 workspaceName The name of the monitor 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. @@ -30,7 +30,7 @@ Response getWithResponse(String resourceGroupName, Stri * 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 workspaceName The name of the monitor 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. @@ -43,7 +43,7 @@ Response getWithResponse(String resourceGroupName, Stri * 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 workspaceName The name of the monitor 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. @@ -58,7 +58,7 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * 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 workspaceName The name of the monitor 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. 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 index e6f44913572f..ad437cfcc6d2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java new file mode 100644 index 000000000000..a6fe9452613c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Service principal metadata. + */ +@Fluent +public final class ServicePrincipal implements JsonSerializable { + /* + * Id of service principal. + */ + private String id; + + /* + * Tenant id of service principal. + */ + private String tenantId; + + /* + * App id of service principal. + */ + private String appId; + + /* + * Expiration time of service principal credentials. + */ + private OffsetDateTime credentialsExpireOn; + + /** + * Creates an instance of ServicePrincipal class. + */ + public ServicePrincipal() { + } + + /** + * Get the id property: Id of service principal. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the tenantId property: Tenant id of service principal. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the appId property: App id of service principal. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Get the credentialsExpireOn property: Expiration time of service principal credentials. + * + * @return the credentialsExpireOn value. + */ + public OffsetDateTime credentialsExpireOn() { + return this.credentialsExpireOn; + } + + /** + * Set the credentialsExpireOn property: Expiration time of service principal credentials. + * + * @param credentialsExpireOn the credentialsExpireOn value to set. + * @return the ServicePrincipal object itself. + */ + public ServicePrincipal withCredentialsExpireOn(OffsetDateTime credentialsExpireOn) { + this.credentialsExpireOn = credentialsExpireOn; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("credentialsExpireOn", + this.credentialsExpireOn == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.credentialsExpireOn)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServicePrincipal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServicePrincipal if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ServicePrincipal. + */ + public static ServicePrincipal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServicePrincipal deserializedServicePrincipal = new ServicePrincipal(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServicePrincipal.id = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedServicePrincipal.tenantId = reader.getString(); + } else if ("appId".equals(fieldName)) { + deserializedServicePrincipal.appId = reader.getString(); + } else if ("credentialsExpireOn".equals(fieldName)) { + deserializedServicePrincipal.credentialsExpireOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedServicePrincipal; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.java new file mode 100644 index 000000000000..b3f07f1a0e86 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Model for API authentication with session cookie. + */ +@Fluent +public final class SessionAuthModel extends CcpAuthConfig { + /* + * The auth type + */ + private CcpAuthType type = CcpAuthType.SESSION; + + /* + * The user name attribute key value. + */ + private Map userName; + + /* + * The password attribute name. + */ + private Map password; + + /* + * Query parameters to session service endpoint. + */ + private Map queryParameters; + + /* + * Indicating whether API key is set in HTTP POST payload. + */ + private Boolean isPostPayloadJson; + + /* + * HTTP request headers to session service endpoint. + */ + private Map headers; + + /* + * Session timeout in minutes. + */ + private Integer sessionTimeoutInMinutes; + + /* + * Session id attribute name from HTTP response header. + */ + private String sessionIdName; + + /* + * HTTP request URL to session service endpoint. + */ + private String sessionLoginRequestUri; + + /** + * Creates an instance of SessionAuthModel class. + */ + public SessionAuthModel() { + } + + /** + * Get the type property: The auth type. + * + * @return the type value. + */ + @Override + public CcpAuthType type() { + return this.type; + } + + /** + * Get the userName property: The user name attribute key value. + * + * @return the userName value. + */ + public Map userName() { + return this.userName; + } + + /** + * Set the userName property: The user name attribute key value. + * + * @param userName the userName value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withUserName(Map userName) { + this.userName = userName; + return this; + } + + /** + * Get the password property: The password attribute name. + * + * @return the password value. + */ + public Map password() { + return this.password; + } + + /** + * Set the password property: The password attribute name. + * + * @param password the password value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withPassword(Map password) { + this.password = password; + return this; + } + + /** + * Get the queryParameters property: Query parameters to session service endpoint. + * + * @return the queryParameters value. + */ + public Map queryParameters() { + return this.queryParameters; + } + + /** + * Set the queryParameters property: Query parameters to session service endpoint. + * + * @param queryParameters the queryParameters value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withQueryParameters(Map queryParameters) { + this.queryParameters = queryParameters; + return this; + } + + /** + * Get the isPostPayloadJson property: Indicating whether API key is set in HTTP POST payload. + * + * @return the isPostPayloadJson value. + */ + public Boolean isPostPayloadJson() { + return this.isPostPayloadJson; + } + + /** + * Set the isPostPayloadJson property: Indicating whether API key is set in HTTP POST payload. + * + * @param isPostPayloadJson the isPostPayloadJson value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withIsPostPayloadJson(Boolean isPostPayloadJson) { + this.isPostPayloadJson = isPostPayloadJson; + return this; + } + + /** + * Get the headers property: HTTP request headers to session service endpoint. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: HTTP request headers to session service endpoint. + * + * @param headers the headers value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the sessionTimeoutInMinutes property: Session timeout in minutes. + * + * @return the sessionTimeoutInMinutes value. + */ + public Integer sessionTimeoutInMinutes() { + return this.sessionTimeoutInMinutes; + } + + /** + * Set the sessionTimeoutInMinutes property: Session timeout in minutes. + * + * @param sessionTimeoutInMinutes the sessionTimeoutInMinutes value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withSessionTimeoutInMinutes(Integer sessionTimeoutInMinutes) { + this.sessionTimeoutInMinutes = sessionTimeoutInMinutes; + return this; + } + + /** + * Get the sessionIdName property: Session id attribute name from HTTP response header. + * + * @return the sessionIdName value. + */ + public String sessionIdName() { + return this.sessionIdName; + } + + /** + * Set the sessionIdName property: Session id attribute name from HTTP response header. + * + * @param sessionIdName the sessionIdName value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withSessionIdName(String sessionIdName) { + this.sessionIdName = sessionIdName; + return this; + } + + /** + * Get the sessionLoginRequestUri property: HTTP request URL to session service endpoint. + * + * @return the sessionLoginRequestUri value. + */ + public String sessionLoginRequestUri() { + return this.sessionLoginRequestUri; + } + + /** + * Set the sessionLoginRequestUri property: HTTP request URL to session service endpoint. + * + * @param sessionLoginRequestUri the sessionLoginRequestUri value to set. + * @return the SessionAuthModel object itself. + */ + public SessionAuthModel withSessionLoginRequestUri(String sessionLoginRequestUri) { + this.sessionLoginRequestUri = sessionLoginRequestUri; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("userName", this.userName, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("password", this.password, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("queryParameters", this.queryParameters, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeBooleanField("isPostPayloadJson", this.isPostPayloadJson); + jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("sessionTimeoutInMinutes", this.sessionTimeoutInMinutes); + jsonWriter.writeStringField("sessionIdName", this.sessionIdName); + jsonWriter.writeStringField("sessionLoginRequestUri", this.sessionLoginRequestUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionAuthModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionAuthModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SessionAuthModel. + */ + public static SessionAuthModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionAuthModel deserializedSessionAuthModel = new SessionAuthModel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userName".equals(fieldName)) { + Map userName = reader.readMap(reader1 -> reader1.getString()); + deserializedSessionAuthModel.userName = userName; + } else if ("password".equals(fieldName)) { + Map password = reader.readMap(reader1 -> reader1.getString()); + deserializedSessionAuthModel.password = password; + } else if ("type".equals(fieldName)) { + deserializedSessionAuthModel.type = CcpAuthType.fromString(reader.getString()); + } else if ("queryParameters".equals(fieldName)) { + Map queryParameters = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedSessionAuthModel.queryParameters = queryParameters; + } else if ("isPostPayloadJson".equals(fieldName)) { + deserializedSessionAuthModel.isPostPayloadJson = reader.getNullable(JsonReader::getBoolean); + } else if ("headers".equals(fieldName)) { + Map headers = reader.readMap(reader1 -> reader1.getString()); + deserializedSessionAuthModel.headers = headers; + } else if ("sessionTimeoutInMinutes".equals(fieldName)) { + deserializedSessionAuthModel.sessionTimeoutInMinutes = reader.getNullable(JsonReader::getInt); + } else if ("sessionIdName".equals(fieldName)) { + deserializedSessionAuthModel.sessionIdName = reader.getString(); + } else if ("sessionLoginRequestUri".equals(fieldName)) { + deserializedSessionAuthModel.sessionLoginRequestUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSessionAuthModel; + }); + } +} 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..e26cc3bb7156 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingKind.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the setting. + */ +public final class SettingKind extends ExpandableStringEnum { + /** + * Anomalies. + */ + public static final SettingKind ANOMALIES = fromString("Anomalies"); + + /** + * EyesOn. + */ + public static final SettingKind EYES_ON = fromString("EyesOn"); + + /** + * EntityAnalytics. + */ + public static final SettingKind ENTITY_ANALYTICS = fromString("EntityAnalytics"); + + /** + * Ueba. + */ + public static final SettingKind UEBA = fromString("Ueba"); + + /** + * Creates a new instance of SettingKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingKind() { + } + + /** + * Creates or finds a SettingKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingKind. + */ + public static SettingKind fromString(String name) { + return fromString(name, SettingKind.class); + } + + /** + * Gets known SettingKind values. + * + * @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/SettingType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java new file mode 100644 index 000000000000..15837274d9eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the setting. + */ +public final class SettingType extends ExpandableStringEnum { + /** + * CopyableLabel. + */ + public static final SettingType COPYABLE_LABEL = fromString("CopyableLabel"); + + /** + * InstructionStepsGroup. + */ + public static final SettingType INSTRUCTION_STEPS_GROUP = fromString("InstructionStepsGroup"); + + /** + * InfoMessage. + */ + public static final SettingType INFO_MESSAGE = fromString("InfoMessage"); + + /** + * Creates a new instance of SettingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SettingType() { + } + + /** + * Creates or finds a SettingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SettingType. + */ + public static SettingType fromString(String name) { + return fromString(name, SettingType.class); + } + + /** + * Gets known SettingType values. + * + * @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..5e1c53206088 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Settings.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + SettingKind kind(); + + /** + * 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/SettingsStatus.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingsStatus.java index 23709c097036..8cf6d9c3585d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingsStatus.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SettingsStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,12 +12,12 @@ */ public final class SettingsStatus extends ExpandableStringEnum { /** - * Static value Production for SettingsStatus. + * Anomaly settings status in Production mode. */ public static final SettingsStatus PRODUCTION = fromString("Production"); /** - * Static value Flighting for SettingsStatus. + * Anomaly settings status in Flighting mode. */ public static final SettingsStatus FLIGHTING = fromString("Flighting"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SortingDirection.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SortingDirection.java new file mode 100644 index 000000000000..eccb74caa551 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SortingDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The direction to sort the results by. + */ +public final class SortingDirection extends ExpandableStringEnum { + /** + * Indicates that the query should be sorted from lowest-to-highest value. + */ + public static final SortingDirection ASC = fromString("ASC"); + + /** + * Indicates that the query should be sorted from lowest-to-highest value. + */ + public static final SortingDirection DESC = fromString("DESC"); + + /** + * Creates a new instance of SortingDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SortingDirection() { + } + + /** + * Creates or finds a SortingDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding SortingDirection. + */ + public static SortingDirection fromString(String name) { + return fromString(name, SortingDirection.class); + } + + /** + * Gets known SortingDirection values. + * + * @return known SortingDirection values. + */ + public static Collection values() { + return values(SortingDirection.class); + } +} 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 deleted file mode 100644 index e0c50875065b..000000000000 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Source.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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 java.util.Collection; - -/** - * The source of the watchlist. - */ -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 a new instance of Source value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Source() { - } - - /** - * Creates or finds a Source from its string representation. - * - * @param name a name to look for. - * @return the corresponding Source. - */ - public static Source fromString(String name) { - return fromString(name, Source.class); - } - - /** - * Gets known Source values. - * - * @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..62facf87bdae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControl.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.RepositoryAccess; +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 version property: The version number associated with the source control. + * + * @return the version value. + */ + Version version(); + + /** + * 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 servicePrincipal property: Service principal metadata. + * + * @return the servicePrincipal value. + */ + ServicePrincipal servicePrincipal(); + + /** + * Gets the workloadIdentityFederation property: Workload Identity metadata. + * + * @return the workloadIdentityFederation value. + */ + WorkloadIdentityFederation workloadIdentityFederation(); + + /** + * Gets the repositoryAccess property: Repository access credentials. This is write-only object and it never returns + * back to a user. + * + * @return the repositoryAccess value. + */ + RepositoryAccess repositoryAccess(); + + /** + * Gets the repositoryResourceInfo property: Information regarding the resources created in user's repository. + * + * @return the repositoryResourceInfo value. + */ + RepositoryResourceInfo repositoryResourceInfo(); + + /** + * Gets the lastDeploymentInfo property: Information regarding the latest deployment for the source control. + * + * @return the lastDeploymentInfo value. + */ + DeploymentInfo lastDeploymentInfo(); + + /** + * Gets the pullRequest property: Information regarding the pull request of the source control. + * + * @return the pullRequest value. + */ + PullRequest pullRequest(); + + /** + * 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.WithDisplayName, DefinitionStages.WithRepoType, DefinitionStages.WithContentTypes, + DefinitionStages.WithRepository, 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 monitor workspace. + * @return the next definition stage. + */ + WithDisplayName withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * 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. + */ + WithRepoType withDisplayName(String displayName); + } + + /** + * 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. + */ + WithContentTypes 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. + */ + WithRepository 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); + } + + /** + * 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.WithDescription, DefinitionStages.WithServicePrincipal, + DefinitionStages.WithRepositoryAccess, DefinitionStages.WithRepositoryResourceInfo { + /** + * 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 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 servicePrincipal. + */ + interface WithServicePrincipal { + /** + * Specifies the servicePrincipal property: Service principal metadata.. + * + * @param servicePrincipal Service principal metadata. + * @return the next definition stage. + */ + WithCreate withServicePrincipal(ServicePrincipal servicePrincipal); + } + + /** + * The stage of the SourceControl definition allowing to specify repositoryAccess. + */ + interface WithRepositoryAccess { + /** + * Specifies the repositoryAccess property: Repository access credentials. This is write-only object and it + * never returns back to a user.. + * + * @param repositoryAccess Repository access credentials. This is write-only object and it never returns + * back to a user. + * @return the next definition stage. + */ + WithCreate withRepositoryAccess(RepositoryAccess repositoryAccess); + } + + /** + * The stage of the SourceControl definition allowing to specify repositoryResourceInfo. + */ + interface WithRepositoryResourceInfo { + /** + * Specifies the repositoryResourceInfo property: Information regarding the resources created in user's + * repository.. + * + * @param repositoryResourceInfo Information regarding the resources created in user's repository. + * @return the next definition stage. + */ + WithCreate withRepositoryResourceInfo(RepositoryResourceInfo repositoryResourceInfo); + } + } + + /** + * 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); + + /** + * Delete a source control. + * + * @param repositoryAccess The repository access credentials. + * @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 warning response structure along with {@link Response}. + */ + Response deleteWithResponse(RepositoryAccessProperties repositoryAccess, Context context); + + /** + * Delete a source control. + * + * @param repositoryAccess The repository access credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return warning response structure. + */ + Warning delete(RepositoryAccessProperties repositoryAccess); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlOperations.java new file mode 100644 index 000000000000..99017c8b2789 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlOperations.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 SourceControlOperations. + */ +public interface SourceControlOperations { + /** + * 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 repositoryAccess The content of the action 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 a list of repositories metadata as paginated response with {@link PagedIterable}. + */ + PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess); + + /** + * 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 repositoryAccess The content of the action 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 a list of repositories metadata as paginated response with {@link PagedIterable}. + */ + PagedIterable listRepositories(String resourceGroupName, String workspaceName, + RepositoryAccessProperties repositoryAccess, Context context); +} 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..42c482b556b9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 SourceControls. + */ +public interface SourceControls { + /** + * 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 monitor 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String sourceControlId, + 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 monitor 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 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + 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 monitor 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, 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 monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @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 warning response structure along with {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess, 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 monitor workspace. + * @param sourceControlId Source control Id. + * @param repositoryAccess The repository access credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return warning response structure. + */ + Warning delete(String resourceGroupName, String workspaceName, String sourceControlId, + RepositoryAccessProperties repositoryAccess); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + Response getByIdWithResponse(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..c74f94b3f3b0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceKind.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Source type of the content. + */ +public final class SourceKind extends ExpandableStringEnum { + /** + * LocalWorkspace. + */ + public static final SourceKind LOCAL_WORKSPACE = fromString("LocalWorkspace"); + + /** + * Community. + */ + public static final SourceKind COMMUNITY = fromString("Community"); + + /** + * Solution. + */ + public static final SourceKind SOLUTION = fromString("Solution"); + + /** + * SourceRepository. + */ + public static final SourceKind SOURCE_REPOSITORY = fromString("SourceRepository"); + + /** + * Creates a new instance of SourceKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceKind() { + } + + /** + * Creates or finds a SourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceKind. + */ + public static SourceKind fromString(String name) { + return fromString(name, SourceKind.class); + } + + /** + * Gets known SourceKind values. + * + * @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/SourceType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceType.java new file mode 100644 index 000000000000..b53b3b28b3ce --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SourceType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The sourceType of the watchlist. + */ +public final class SourceType extends ExpandableStringEnum { + /** + * The source from local file. + */ + public static final SourceType LOCAL = fromString("Local"); + + /** + * The source from Azure storage. + */ + public static final SourceType AZURE_STORAGE = fromString("AzureStorage"); + + /** + * Creates a new instance of SourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SourceType() { + } + + /** + * Creates or finds a SourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceType. + */ + public static SourceType fromString(String name) { + return fromString(name, SourceType.class); + } + + /** + * Gets known SourceType values. + * + * @return known SourceType values. + */ + public static Collection values() { + return values(SourceType.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/State.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/State.java new file mode 100644 index 000000000000..61f15e46dd87 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/State.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of recommendation. + */ +public final class State extends ExpandableStringEnum { + /** + * Recommendation is active. + */ + public static final State ACTIVE = fromString("Active"); + + /** + * Recommendation is in progress. + */ + public static final State IN_PROGRESS = fromString("InProgress"); + + /** + * Recommendation has been dismissed. + */ + public static final State DISMISSED = fromString("Dismissed"); + + /** + * Recommendation has been completed by user. + */ + public static final State COMPLETED_BY_USER = fromString("CompletedByUser"); + + /** + * Recommendation has been completed by the system. + */ + public static final State COMPLETED_BY_SYSTEM = fromString("CompletedBySystem"); + + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Status.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Status.java new file mode 100644 index 000000000000..bfa142dcde0b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Status.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the hunt. + */ +public final class Status extends ExpandableStringEnum { + /** + * New. + */ + public static final Status NEW = fromString("New"); + + /** + * Active. + */ + public static final Status ACTIVE = fromString("Active"); + + /** + * Closed. + */ + public static final Status CLOSED = fromString("Closed"); + + /** + * Backlog. + */ + public static final Status BACKLOG = fromString("Backlog"); + + /** + * Approved. + */ + public static final Status APPROVED = fromString("Approved"); + + /** + * Succeeded. + */ + public static final Status SUCCEEDED = fromString("Succeeded"); + + /** + * Failed. + */ + public static final Status FAILED = fromString("Failed"); + + /** + * InProgress. + */ + public static final Status IN_PROGRESS = fromString("InProgress"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.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 index 09a339fb75f9..3b20b65fd087 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,7 +13,6 @@ import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; -import java.util.UUID; /** * Represents a submission mail entity. @@ -21,7 +20,9 @@ @Immutable public final class SubmissionMailEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.SUBMISSION_MAIL; @@ -53,11 +54,13 @@ public final class SubmissionMailEntity extends Entity { /** * Creates an instance of SubmissionMailEntity class. */ - public SubmissionMailEntity() { + private SubmissionMailEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -120,7 +123,7 @@ public String id() { * * @return the networkMessageId value. */ - public UUID networkMessageId() { + public String networkMessageId() { return this.innerProperties() == null ? null : this.innerProperties().networkMessageId(); } @@ -129,7 +132,7 @@ public UUID networkMessageId() { * * @return the submissionId value. */ - public UUID submissionId() { + public String submissionId() { return this.innerProperties() == null ? null : this.innerProperties().submissionId(); } @@ -226,18 +229,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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..000528fdf703 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/SupportTier.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of support for content item. + */ +public final class SupportTier extends ExpandableStringEnum { + /** + * Microsoft. + */ + public static final SupportTier MICROSOFT = fromString("Microsoft"); + + /** + * Partner. + */ + public static final SupportTier PARTNER = fromString("Partner"); + + /** + * Community. + */ + public static final SupportTier COMMUNITY = fromString("Community"); + + /** + * Creates a new instance of SupportTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SupportTier() { + } + + /** + * Creates or finds a SupportTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportTier. + */ + public static SupportTier fromString(String name) { + return fromString(name, SupportTier.class); + } + + /** + * Gets known SupportTier values. + * + * @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..3fcb906c0b7b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TICheckRequirements.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TICheckRequirementsProperties; +import java.io.IOException; + +/** + * Threat Intelligence Platforms data connector check requirements. + */ +@Fluent +public final class TICheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE; + + /* + * Threat Intelligence Platforms data connector check required properties + */ + private TICheckRequirementsProperties innerProperties; + + /** + * Creates an instance of TICheckRequirements class. + */ + public TICheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Threat Intelligence Platforms data connector check required properties. + * + * @return the innerProperties value. + */ + TICheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 TICheckRequirements object itself. + */ + public TICheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new TICheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TICheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TICheckRequirements if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TICheckRequirements. + */ + public static TICheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TICheckRequirements deserializedTICheckRequirements = new TICheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTICheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedTICheckRequirements.innerProperties = TICheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTICheckRequirements; + }); + } +} 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 index 0b5f3f6ffcb4..ef3850016c1c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -20,7 +20,9 @@ @Fluent public final class TIDataConnector extends DataConnectorInner { /* - * The data connector kind + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE; @@ -56,7 +58,9 @@ public TIDataConnector() { } /** - * Get the kind property: The data connector kind. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -123,29 +127,6 @@ public TIDataConnector withEtag(String etag) { 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; - } - /** * Get the tipLookbackPeriod property: The lookback period for the feed to be imported. * @@ -193,15 +174,26 @@ public TIDataConnector withDataTypes(TIDataConnectorDataTypes dataTypes) { } /** - * Validates the instance. + * Get the tenantId property: The tenant id to connect to, and get the data from. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the tenantId value. */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + 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; } /** 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 index 908aab912187..ba50e851147a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -47,17 +47,6 @@ public TIDataConnectorDataTypes withIndicators(TIDataConnectorDataTypesIndicator return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (indicators() != null) { - indicators().validate(); - } - } - /** * {@inheritDoc} */ @@ -74,6 +63,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of TIDataConnectorDataTypes if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the TIDataConnectorDataTypes. */ public static TIDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { 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 index 65f0c7145e1b..9344a20282b1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -30,15 +30,6 @@ public TIDataConnectorDataTypesIndicators withState(DataTypeState state) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -55,6 +46,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of TIDataConnectorDataTypesIndicators if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the TIDataConnectorDataTypesIndicators. */ public static TIDataConnectorDataTypesIndicators fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObject.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObject.java new file mode 100644 index 000000000000..e1fa515c6259 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObject.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of TIObject. + */ +public interface TIObject { + /** + * 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 kind property: The kind of the TI object. + * + * @return the kind value. + */ + TIObjectKind kind(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + Map data(); + + /** + * Gets the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + UserInfo createdBy(); + + /** + * Gets the source property: The source name for this TI object. + * + * @return the source value. + */ + String source(); + + /** + * Gets the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + OffsetDateTime firstIngestedTimeUtc(); + + /** + * Gets the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + OffsetDateTime lastIngestedTimeUtc(); + + /** + * Gets the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + String ingestionRulesVersion(); + + /** + * Gets the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + String lastUpdateMethod(); + + /** + * Gets the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + UserInfo lastModifiedBy(); + + /** + * Gets the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + OffsetDateTime lastUpdatedDateTimeUtc(); + + /** + * Gets the relationshipHints property: A dictionary used to help follow relationships from this object to other + * STIX objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of + * sources that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + List relationshipHints(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner object. + * + * @return the inner object. + */ + TIObjectInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObjectKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObjectKind.java new file mode 100644 index 000000000000..2f3ef30d0b3e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TIObjectKind.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the TI object. + */ +public final class TIObjectKind extends ExpandableStringEnum { + /** + * A TI object that represents an attack pattern. + */ + public static final TIObjectKind ATTACK_PATTERN = fromString("AttackPattern"); + + /** + * A TI object that represents an identity. + */ + public static final TIObjectKind IDENTITY = fromString("Identity"); + + /** + * A TI object that represents an indicator. + */ + public static final TIObjectKind INDICATOR = fromString("Indicator"); + + /** + * A TI object that represents a relationship between two TI objects. + */ + public static final TIObjectKind RELATIONSHIP = fromString("Relationship"); + + /** + * A TI object that represents a threat actor. + */ + public static final TIObjectKind THREAT_ACTOR = fromString("ThreatActor"); + + /** + * Creates a new instance of TIObjectKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TIObjectKind() { + } + + /** + * Creates or finds a TIObjectKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding TIObjectKind. + */ + public static TIObjectKind fromString(String name) { + return fromString(name, TIObjectKind.class); + } + + /** + * Gets known TIObjectKind values. + * + * @return known TIObjectKind values. + */ + public static Collection values() { + return values(TIObjectKind.class); + } +} 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..9a9e0a4a725b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TeamInformation.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Describes team information. + */ +@Immutable +public final class TeamInformation implements JsonSerializable { + /* + * Team ID + */ + private String teamId; + + /* + * The primary channel URL of the team + */ + private String primaryChannelUrl; + + /* + * The time the team was created + */ + private OffsetDateTime teamCreationTimeUtc; + + /* + * The name of the team + */ + private String name; + + /* + * The description of the team + */ + private String description; + + /** + * Creates an instance of TeamInformation class. + */ + public TeamInformation() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TeamInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TeamInformation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TeamInformation. + */ + public static TeamInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TeamInformation deserializedTeamInformation = new TeamInformation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("teamId".equals(fieldName)) { + deserializedTeamInformation.teamId = reader.getString(); + } else if ("primaryChannelUrl".equals(fieldName)) { + deserializedTeamInformation.primaryChannelUrl = reader.getString(); + } else if ("teamCreationTimeUtc".equals(fieldName)) { + deserializedTeamInformation.teamCreationTimeUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedTeamInformation.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedTeamInformation.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTeamInformation; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateModel.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateModel.java new file mode 100644 index 000000000000..ac093068e8a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateModel.java @@ -0,0 +1,1112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.TemplateModelInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateProperties; +import java.time.LocalDate; +import java.util.List; + +/** + * An immutable client-side representation of TemplateModel. + */ +public interface TemplateModel { + /** + * 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 contentProductId property: Unique ID for the content. It should be generated based on the contentId of + * the package, contentId of the template, contentKind of the template and the contentVersion of the template. + * + * @return the contentProductId value. + */ + String contentProductId(); + + /** + * Gets the packageVersion property: Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot guarantee any + * version checks. + * + * @return the packageVersion value. + */ + String packageVersion(); + + /** + * 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 metadata best practices. Can also be any string, but then we cannot guarantee any version + * checks. + * + * @return the version value. + */ + String version(); + + /** + * Gets the displayName property: The display name of the template. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the contentKind property: The kind of content the template is for. + * + * @return the contentKind value. + */ + Kind contentKind(); + + /** + * 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 template - 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 item. + * + * @return the categories value. + */ + MetadataCategories categories(); + + /** + * Gets the providers property: Providers for the content item. + * + * @return the providers value. + */ + List providers(); + + /** + * Gets the firstPublishDate property: first publish date content item. + * + * @return the firstPublishDate value. + */ + LocalDate firstPublishDate(); + + /** + * Gets the lastPublishDate property: last publish date for the content item. + * + * @return the lastPublishDate value. + */ + LocalDate lastPublishDate(); + + /** + * Gets the customVersion property: The custom version of the content. A optional free text. + * + * @return the customVersion value. + */ + String customVersion(); + + /** + * Gets the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between + * different flow based on the schema version. + * + * @return the contentSchemaVersion value. + */ + String contentSchemaVersion(); + + /** + * Gets the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @return the icon value. + */ + String icon(); + + /** + * Gets the threatAnalysisTactics property: the tactics the resource covers. + * + * @return the threatAnalysisTactics value. + */ + List threatAnalysisTactics(); + + /** + * Gets the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the + * tactics being used. + * + * @return the threatAnalysisTechniques value. + */ + List threatAnalysisTechniques(); + + /** + * Gets the previewImages property: preview image file names. These will be taken from the solution artifacts. + * + * @return the previewImages value. + */ + List previewImages(); + + /** + * Gets the previewImagesDark property: preview image file names. These will be taken from the solution artifacts. + * used for dark theme support. + * + * @return the previewImagesDark value. + */ + List previewImagesDark(); + + /** + * Gets the packageId property: the package Id contains this template. + * + * @return the packageId value. + */ + String packageId(); + + /** + * Gets the packageKind property: the packageKind of the package contains this template. + * + * @return the packageKind value. + */ + PackageKind packageKind(); + + /** + * Gets the packageName property: the name of the package contains this template. + * + * @return the packageName value. + */ + String packageName(); + + /** + * Gets the isDeprecated property: Flag indicates if this template is deprecated. + * + * @return the isDeprecated value. + */ + Flag isDeprecated(); + + /** + * Gets the mainTemplate property: The JSON of the ARM template to deploy active content. Expandable. + * + * @return the mainTemplate value. + */ + Object mainTemplate(); + + /** + * Gets the dependantTemplates property: Dependant templates. Expandable. + * + * @return the dependantTemplates value. + */ + List dependantTemplates(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner object. + * + * @return the inner object. + */ + TemplateModelInner innerModel(); + + /** + * The entirety of the TemplateModel definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The TemplateModel definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the TemplateModel definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the TemplateModel 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 monitor workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the TemplateModel 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.WithContentProductId, + DefinitionStages.WithPackageVersion, DefinitionStages.WithVersion, DefinitionStages.WithDisplayName, + DefinitionStages.WithContentKind, DefinitionStages.WithSource, DefinitionStages.WithAuthor, + DefinitionStages.WithSupport, DefinitionStages.WithDependencies, DefinitionStages.WithCategories, + DefinitionStages.WithProviders, DefinitionStages.WithFirstPublishDate, DefinitionStages.WithLastPublishDate, + DefinitionStages.WithCustomVersion, DefinitionStages.WithContentSchemaVersion, DefinitionStages.WithIcon, + DefinitionStages.WithThreatAnalysisTactics, DefinitionStages.WithThreatAnalysisTechniques, + DefinitionStages.WithPreviewImages, DefinitionStages.WithPreviewImagesDark, DefinitionStages.WithPackageId, + DefinitionStages.WithPackageKind, DefinitionStages.WithPackageName, DefinitionStages.WithMainTemplate { + /** + * Executes the create request. + * + * @return the created resource. + */ + TemplateModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TemplateModel create(Context context); + } + + /** + * The stage of the TemplateModel 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 TemplateModel 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 TemplateModel definition allowing to specify contentProductId. + */ + interface WithContentProductId { + /** + * Specifies the contentProductId property: Unique ID for the content. It should be generated based on the + * contentId of the package, contentId of the template, contentKind of the template and the contentVersion + * of the template. + * + * @param contentProductId Unique ID for the content. It should be generated based on the contentId of the + * package, contentId of the template, contentKind of the template and the contentVersion of the template. + * @return the next definition stage. + */ + WithCreate withContentProductId(String contentProductId); + } + + /** + * The stage of the TemplateModel definition allowing to specify packageVersion. + */ + interface WithPackageVersion { + /** + * Specifies the packageVersion property: Version of the package. Default and recommended format is numeric + * (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we + * cannot guarantee any version checks. + * + * @param packageVersion Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot + * guarantee any version checks. + * @return the next definition stage. + */ + WithCreate withPackageVersion(String packageVersion); + } + + /** + * The stage of the TemplateModel 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 metadata 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 metadata 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 TemplateModel definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the template. + * + * @param displayName The display name of the template. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the TemplateModel definition allowing to specify contentKind. + */ + interface WithContentKind { + /** + * Specifies the contentKind property: The kind of content the template is for.. + * + * @param contentKind The kind of content the template is for. + * @return the next definition stage. + */ + WithCreate withContentKind(Kind contentKind); + } + + /** + * The stage of the TemplateModel 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 TemplateModel 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 TemplateModel definition allowing to specify support. + */ + interface WithSupport { + /** + * Specifies the support property: Support information for the template - type, name, contact information. + * + * @param support Support information for the template - type, name, contact information. + * @return the next definition stage. + */ + WithCreate withSupport(MetadataSupport support); + } + + /** + * The stage of the TemplateModel 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 TemplateModel definition allowing to specify categories. + */ + interface WithCategories { + /** + * Specifies the categories property: Categories for the item. + * + * @param categories Categories for the item. + * @return the next definition stage. + */ + WithCreate withCategories(MetadataCategories categories); + } + + /** + * The stage of the TemplateModel definition allowing to specify providers. + */ + interface WithProviders { + /** + * Specifies the providers property: Providers for the content item. + * + * @param providers Providers for the content item. + * @return the next definition stage. + */ + WithCreate withProviders(List providers); + } + + /** + * The stage of the TemplateModel definition allowing to specify firstPublishDate. + */ + interface WithFirstPublishDate { + /** + * Specifies the firstPublishDate property: first publish date content item. + * + * @param firstPublishDate first publish date content item. + * @return the next definition stage. + */ + WithCreate withFirstPublishDate(LocalDate firstPublishDate); + } + + /** + * The stage of the TemplateModel definition allowing to specify lastPublishDate. + */ + interface WithLastPublishDate { + /** + * Specifies the lastPublishDate property: last publish date for the content item. + * + * @param lastPublishDate last publish date for the content item. + * @return the next definition stage. + */ + WithCreate withLastPublishDate(LocalDate lastPublishDate); + } + + /** + * The stage of the TemplateModel definition allowing to specify customVersion. + */ + interface WithCustomVersion { + /** + * Specifies the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion The custom version of the content. A optional free text. + * @return the next definition stage. + */ + WithCreate withCustomVersion(String customVersion); + } + + /** + * The stage of the TemplateModel definition allowing to specify contentSchemaVersion. + */ + interface WithContentSchemaVersion { + /** + * Specifies the contentSchemaVersion property: Schema version of the content. Can be used to distinguish + * between different flow based on the schema version. + * + * @param contentSchemaVersion Schema version of the content. Can be used to distinguish between different + * flow based on the schema version. + * @return the next definition stage. + */ + WithCreate withContentSchemaVersion(String contentSchemaVersion); + } + + /** + * The stage of the TemplateModel definition allowing to specify icon. + */ + interface WithIcon { + /** + * Specifies the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon identifier. this id can later be fetched from the content metadata. + * @return the next definition stage. + */ + WithCreate withIcon(String icon); + } + + /** + * The stage of the TemplateModel definition allowing to specify threatAnalysisTactics. + */ + interface WithThreatAnalysisTactics { + /** + * Specifies the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the tactics the resource covers. + * @return the next definition stage. + */ + WithCreate withThreatAnalysisTactics(List threatAnalysisTactics); + } + + /** + * The stage of the TemplateModel definition allowing to specify threatAnalysisTechniques. + */ + interface WithThreatAnalysisTechniques { + /** + * Specifies the threatAnalysisTechniques property: the techniques the resource covers, these have to be + * aligned with the tactics being used. + * + * @param threatAnalysisTechniques the techniques the resource covers, these have to be aligned with the + * tactics being used. + * @return the next definition stage. + */ + WithCreate withThreatAnalysisTechniques(List threatAnalysisTechniques); + } + + /** + * The stage of the TemplateModel definition allowing to specify previewImages. + */ + interface WithPreviewImages { + /** + * Specifies the previewImages property: preview image file names. These will be taken from the solution + * artifacts. + * + * @param previewImages preview image file names. These will be taken from the solution artifacts. + * @return the next definition stage. + */ + WithCreate withPreviewImages(List previewImages); + } + + /** + * The stage of the TemplateModel definition allowing to specify previewImagesDark. + */ + interface WithPreviewImagesDark { + /** + * Specifies the previewImagesDark property: preview image file names. These will be taken from the solution + * artifacts. used for dark theme support. + * + * @param previewImagesDark preview image file names. These will be taken from the solution artifacts. used + * for dark theme support. + * @return the next definition stage. + */ + WithCreate withPreviewImagesDark(List previewImagesDark); + } + + /** + * The stage of the TemplateModel definition allowing to specify packageId. + */ + interface WithPackageId { + /** + * Specifies the packageId property: the package Id contains this template. + * + * @param packageId the package Id contains this template. + * @return the next definition stage. + */ + WithCreate withPackageId(String packageId); + } + + /** + * The stage of the TemplateModel definition allowing to specify packageKind. + */ + interface WithPackageKind { + /** + * Specifies the packageKind property: the packageKind of the package contains this template. + * + * @param packageKind the packageKind of the package contains this template. + * @return the next definition stage. + */ + WithCreate withPackageKind(PackageKind packageKind); + } + + /** + * The stage of the TemplateModel definition allowing to specify packageName. + */ + interface WithPackageName { + /** + * Specifies the packageName property: the name of the package contains this template. + * + * @param packageName the name of the package contains this template. + * @return the next definition stage. + */ + WithCreate withPackageName(String packageName); + } + + /** + * The stage of the TemplateModel definition allowing to specify mainTemplate. + */ + interface WithMainTemplate { + /** + * Specifies the mainTemplate property: The JSON of the ARM template to deploy active content. Expandable.. + * + * @param mainTemplate The JSON of the ARM template to deploy active content. Expandable. + * @return the next definition stage. + */ + WithCreate withMainTemplate(Object mainTemplate); + } + } + + /** + * Begins update for the TemplateModel resource. + * + * @return the stage of resource update. + */ + TemplateModel.Update update(); + + /** + * The template for TemplateModel update. + */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithContentId, UpdateStages.WithContentProductId, + UpdateStages.WithPackageVersion, UpdateStages.WithVersion, UpdateStages.WithDisplayName, + UpdateStages.WithContentKind, UpdateStages.WithSource, UpdateStages.WithAuthor, UpdateStages.WithSupport, + UpdateStages.WithDependencies, UpdateStages.WithCategories, UpdateStages.WithProviders, + UpdateStages.WithFirstPublishDate, UpdateStages.WithLastPublishDate, UpdateStages.WithCustomVersion, + UpdateStages.WithContentSchemaVersion, UpdateStages.WithIcon, UpdateStages.WithThreatAnalysisTactics, + UpdateStages.WithThreatAnalysisTechniques, UpdateStages.WithPreviewImages, UpdateStages.WithPreviewImagesDark, + UpdateStages.WithPackageId, UpdateStages.WithPackageKind, UpdateStages.WithPackageName, + UpdateStages.WithMainTemplate { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TemplateModel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TemplateModel apply(Context context); + } + + /** + * The TemplateModel update stages. + */ + interface UpdateStages { + /** + * The stage of the TemplateModel 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 TemplateModel 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 TemplateModel update allowing to specify contentProductId. + */ + interface WithContentProductId { + /** + * Specifies the contentProductId property: Unique ID for the content. It should be generated based on the + * contentId of the package, contentId of the template, contentKind of the template and the contentVersion + * of the template. + * + * @param contentProductId Unique ID for the content. It should be generated based on the contentId of the + * package, contentId of the template, contentKind of the template and the contentVersion of the template. + * @return the next definition stage. + */ + Update withContentProductId(String contentProductId); + } + + /** + * The stage of the TemplateModel update allowing to specify packageVersion. + */ + interface WithPackageVersion { + /** + * Specifies the packageVersion property: Version of the package. Default and recommended format is numeric + * (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we + * cannot guarantee any version checks. + * + * @param packageVersion Version of the package. Default and recommended format is numeric (e.g. 1, 1.0, + * 1.0.0, 1.0.0.0), following ARM metadata best practices. Can also be any string, but then we cannot + * guarantee any version checks. + * @return the next definition stage. + */ + Update withPackageVersion(String packageVersion); + } + + /** + * The stage of the TemplateModel 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 metadata 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 metadata 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 TemplateModel update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the template. + * + * @param displayName The display name of the template. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the TemplateModel update allowing to specify contentKind. + */ + interface WithContentKind { + /** + * Specifies the contentKind property: The kind of content the template is for.. + * + * @param contentKind The kind of content the template is for. + * @return the next definition stage. + */ + Update withContentKind(Kind contentKind); + } + + /** + * The stage of the TemplateModel 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 TemplateModel 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 TemplateModel update allowing to specify support. + */ + interface WithSupport { + /** + * Specifies the support property: Support information for the template - type, name, contact information. + * + * @param support Support information for the template - type, name, contact information. + * @return the next definition stage. + */ + Update withSupport(MetadataSupport support); + } + + /** + * The stage of the TemplateModel 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 TemplateModel update allowing to specify categories. + */ + interface WithCategories { + /** + * Specifies the categories property: Categories for the item. + * + * @param categories Categories for the item. + * @return the next definition stage. + */ + Update withCategories(MetadataCategories categories); + } + + /** + * The stage of the TemplateModel update allowing to specify providers. + */ + interface WithProviders { + /** + * Specifies the providers property: Providers for the content item. + * + * @param providers Providers for the content item. + * @return the next definition stage. + */ + Update withProviders(List providers); + } + + /** + * The stage of the TemplateModel update allowing to specify firstPublishDate. + */ + interface WithFirstPublishDate { + /** + * Specifies the firstPublishDate property: first publish date content item. + * + * @param firstPublishDate first publish date content item. + * @return the next definition stage. + */ + Update withFirstPublishDate(LocalDate firstPublishDate); + } + + /** + * The stage of the TemplateModel update allowing to specify lastPublishDate. + */ + interface WithLastPublishDate { + /** + * Specifies the lastPublishDate property: last publish date for the content item. + * + * @param lastPublishDate last publish date for the content item. + * @return the next definition stage. + */ + Update withLastPublishDate(LocalDate lastPublishDate); + } + + /** + * The stage of the TemplateModel update allowing to specify customVersion. + */ + interface WithCustomVersion { + /** + * Specifies the customVersion property: The custom version of the content. A optional free text. + * + * @param customVersion The custom version of the content. A optional free text. + * @return the next definition stage. + */ + Update withCustomVersion(String customVersion); + } + + /** + * The stage of the TemplateModel update allowing to specify contentSchemaVersion. + */ + interface WithContentSchemaVersion { + /** + * Specifies the contentSchemaVersion property: Schema version of the content. Can be used to distinguish + * between different flow based on the schema version. + * + * @param contentSchemaVersion Schema version of the content. Can be used to distinguish between different + * flow based on the schema version. + * @return the next definition stage. + */ + Update withContentSchemaVersion(String contentSchemaVersion); + } + + /** + * The stage of the TemplateModel update allowing to specify icon. + */ + interface WithIcon { + /** + * Specifies the icon property: the icon identifier. this id can later be fetched from the content metadata. + * + * @param icon the icon identifier. this id can later be fetched from the content metadata. + * @return the next definition stage. + */ + Update withIcon(String icon); + } + + /** + * The stage of the TemplateModel update allowing to specify threatAnalysisTactics. + */ + interface WithThreatAnalysisTactics { + /** + * Specifies the threatAnalysisTactics property: the tactics the resource covers. + * + * @param threatAnalysisTactics the tactics the resource covers. + * @return the next definition stage. + */ + Update withThreatAnalysisTactics(List threatAnalysisTactics); + } + + /** + * The stage of the TemplateModel update allowing to specify threatAnalysisTechniques. + */ + interface WithThreatAnalysisTechniques { + /** + * Specifies the threatAnalysisTechniques property: the techniques the resource covers, these have to be + * aligned with the tactics being used. + * + * @param threatAnalysisTechniques the techniques the resource covers, these have to be aligned with the + * tactics being used. + * @return the next definition stage. + */ + Update withThreatAnalysisTechniques(List threatAnalysisTechniques); + } + + /** + * The stage of the TemplateModel update allowing to specify previewImages. + */ + interface WithPreviewImages { + /** + * Specifies the previewImages property: preview image file names. These will be taken from the solution + * artifacts. + * + * @param previewImages preview image file names. These will be taken from the solution artifacts. + * @return the next definition stage. + */ + Update withPreviewImages(List previewImages); + } + + /** + * The stage of the TemplateModel update allowing to specify previewImagesDark. + */ + interface WithPreviewImagesDark { + /** + * Specifies the previewImagesDark property: preview image file names. These will be taken from the solution + * artifacts. used for dark theme support. + * + * @param previewImagesDark preview image file names. These will be taken from the solution artifacts. used + * for dark theme support. + * @return the next definition stage. + */ + Update withPreviewImagesDark(List previewImagesDark); + } + + /** + * The stage of the TemplateModel update allowing to specify packageId. + */ + interface WithPackageId { + /** + * Specifies the packageId property: the package Id contains this template. + * + * @param packageId the package Id contains this template. + * @return the next definition stage. + */ + Update withPackageId(String packageId); + } + + /** + * The stage of the TemplateModel update allowing to specify packageKind. + */ + interface WithPackageKind { + /** + * Specifies the packageKind property: the packageKind of the package contains this template. + * + * @param packageKind the packageKind of the package contains this template. + * @return the next definition stage. + */ + Update withPackageKind(PackageKind packageKind); + } + + /** + * The stage of the TemplateModel update allowing to specify packageName. + */ + interface WithPackageName { + /** + * Specifies the packageName property: the name of the package contains this template. + * + * @param packageName the name of the package contains this template. + * @return the next definition stage. + */ + Update withPackageName(String packageName); + } + + /** + * The stage of the TemplateModel update allowing to specify mainTemplate. + */ + interface WithMainTemplate { + /** + * Specifies the mainTemplate property: The JSON of the ARM template to deploy active content. Expandable.. + * + * @param mainTemplate The JSON of the ARM template to deploy active content. Expandable. + * @return the next definition stage. + */ + Update withMainTemplate(Object mainTemplate); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TemplateModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TemplateModel refresh(Context context); +} 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 index 80f01ee6de5a..a4724ce8fc19 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,17 +12,17 @@ */ public final class TemplateStatus extends ExpandableStringEnum { /** - * Static value Installed for TemplateStatus. + * Alert rule template installed. and can not use more then once. */ public static final TemplateStatus INSTALLED = fromString("Installed"); /** - * Static value Available for TemplateStatus. + * Alert rule template is available. */ public static final TemplateStatus AVAILABLE = fromString("Available"); /** - * Static value NotAvailable for TemplateStatus. + * Alert rule template is not available. */ public static final TemplateStatus NOT_AVAILABLE = fromString("NotAvailable"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatActor.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatActor.java new file mode 100644 index 000000000000..ff96ea2ef154 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatActor.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Represents a threat actor in Azure Security Insights. + */ +@Immutable +public final class ThreatActor extends TIObjectInner { + /* + * The kind of the TI object + */ + private TIObjectKind kind = TIObjectKind.THREAT_ACTOR; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The properties of the TI object + */ + private TIObjectCommonProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ThreatActor class. + */ + private ThreatActor() { + } + + /** + * Get the kind property: The kind of the TI object. + * + * @return the kind value. + */ + @Override + public TIObjectKind kind() { + return this.kind; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the innerProperties property: The properties of the TI object. + * + * @return the innerProperties value. + */ + private TIObjectCommonProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the data property: The core STIX object that this TI object represents. + * + * @return the data value. + */ + public Map data() { + return this.innerProperties() == null ? null : this.innerProperties().data(); + } + + /** + * Get the createdBy property: The UserInfo of the user/entity which originally created this TI object. + * + * @return the createdBy value. + */ + public UserInfo createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the source property: The source name for this TI object. + * + * @return the source value. + */ + public String source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the firstIngestedTimeUtc property: The timestamp for the first time this object was ingested. + * + * @return the firstIngestedTimeUtc value. + */ + public OffsetDateTime firstIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().firstIngestedTimeUtc(); + } + + /** + * Get the lastIngestedTimeUtc property: The timestamp for the last time this object was ingested. + * + * @return the lastIngestedTimeUtc value. + */ + public OffsetDateTime lastIngestedTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastIngestedTimeUtc(); + } + + /** + * Get the ingestionRulesVersion property: The ID of the rules version that was active when this TI object was last + * ingested. + * + * @return the ingestionRulesVersion value. + */ + public String ingestionRulesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ingestionRulesVersion(); + } + + /** + * Get the lastUpdateMethod property: The name of the method/application that initiated the last write to this TI + * object. + * + * @return the lastUpdateMethod value. + */ + public String lastUpdateMethod() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdateMethod(); + } + + /** + * Get the lastModifiedBy property: The UserInfo of the user/entity which last modified this TI object. + * + * @return the lastModifiedBy value. + */ + public UserInfo lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the lastUpdatedDateTimeUtc property: The timestamp for the last time this TI object was updated. + * + * @return the lastUpdatedDateTimeUtc value. + */ + public OffsetDateTime lastUpdatedDateTimeUtc() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedDateTimeUtc(); + } + + /** + * Get the relationshipHints property: A dictionary used to help follow relationships from this object to other STIX + * objects. The keys are field names from the STIX object (in the 'data' field), and the values are lists of sources + * that can be prepended to the object ID in order to efficiently locate the target TI object. + * + * @return the relationshipHints value. + */ + public List relationshipHints() { + return this.innerProperties() == null ? null : this.innerProperties().relationshipHints(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreatActor from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreatActor if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreatActor. + */ + public static ThreatActor fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreatActor deserializedThreatActor = new ThreatActor(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThreatActor.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedThreatActor.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThreatActor.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedThreatActor.innerProperties = TIObjectCommonProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedThreatActor.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedThreatActor.kind = TIObjectKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedThreatActor; + }); + } +} 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 index 939aab8f2bdf..91ddc4517584 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -49,7 +49,7 @@ public final class ThreatIntelligence implements JsonSerializable tactics() { + return this.innerProperties() == null ? null : this.innerProperties().tactics(); + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * Get the subTechniques property: The sub-techniques of the alert rule. + * + * @return the subTechniques value. + */ + public List subTechniques() { + return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreatIntelligenceAlertRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreatIntelligenceAlertRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreatIntelligenceAlertRule. + */ + public static ThreatIntelligenceAlertRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreatIntelligenceAlertRule deserializedThreatIntelligenceAlertRule = new ThreatIntelligenceAlertRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThreatIntelligenceAlertRule.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedThreatIntelligenceAlertRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThreatIntelligenceAlertRule.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedThreatIntelligenceAlertRule.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedThreatIntelligenceAlertRule.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedThreatIntelligenceAlertRule.kind = AlertRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedThreatIntelligenceAlertRule.innerProperties + = ThreatIntelligenceAlertRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThreatIntelligenceAlertRule; + }); + } +} 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..f89ba83c676f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRuleTemplate.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleTemplateProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Represents Threat Intelligence alert rule template. + */ +@Immutable +public final class ThreatIntelligenceAlertRuleTemplate extends AlertRuleTemplateInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private AlertRuleKind kind = AlertRuleKind.THREAT_INTELLIGENCE; + + /* + * Threat Intelligence alert rule template properties + */ + private ThreatIntelligenceAlertRuleTemplateProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ThreatIntelligenceAlertRuleTemplate class. + */ + private ThreatIntelligenceAlertRuleTemplate() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public AlertRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Threat Intelligence alert rule template properties. + * + * @return the innerProperties value. + */ + private ThreatIntelligenceAlertRuleTemplateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * Get the techniques property: The techniques of the alert rule. + * + * @return the techniques value. + */ + public List techniques() { + return this.innerProperties() == null ? null : this.innerProperties().techniques(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * Get the status property: The alert rule template status. + * + * @return the status value. + */ + public TemplateStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThreatIntelligenceAlertRuleTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThreatIntelligenceAlertRuleTemplate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThreatIntelligenceAlertRuleTemplate. + */ + public static ThreatIntelligenceAlertRuleTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThreatIntelligenceAlertRuleTemplate deserializedThreatIntelligenceAlertRuleTemplate + = new ThreatIntelligenceAlertRuleTemplate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplate.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplate.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplate.kind = AlertRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedThreatIntelligenceAlertRuleTemplate.innerProperties + = ThreatIntelligenceAlertRuleTemplateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThreatIntelligenceAlertRuleTemplate; + }); + } +} 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 index d61b1aa72756..2895b4c09ad3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -48,14 +48,6 @@ public ThreatIntelligenceAppendTags withThreatIntelligenceTags(List thre return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceCount.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceCount.java new file mode 100644 index 000000000000..3a0dbdafc354 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceCount.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; + +/** + * An immutable client-side representation of ThreatIntelligenceCount. + */ +public interface ThreatIntelligenceCount { + /** + * Gets the count property: Count of all the threat intelligence objects on the workspace that match the provided + * query. + * + * @return the count value. + */ + int count(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner object. + * + * @return the inner object. + */ + ThreatIntelligenceCountInner innerModel(); +} 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 index 86e20c6de637..7dfda823ecdc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -149,14 +149,6 @@ public ThreatIntelligenceExternalReference withHashes(Map hashes return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 05ab867e8855..c63e0a9938e1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -349,17 +349,6 @@ public ThreatIntelligenceFilteringCriteria withSkipToken(String 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()); - } - } - /** * {@inheritDoc} */ 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 index 09599a0bcd95..5a2410425978 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -99,14 +99,6 @@ public ThreatIntelligenceGranularMarkingModel withSelectors(List selecto return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index c38e82b5539a..7a66ecd98e2c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -15,7 +15,7 @@ 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. + * @param workspaceName The name of the monitor 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. @@ -30,7 +30,7 @@ Response listWithResponse(String resourceGroupNam * 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 workspaceName The name of the monitor 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. 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 index 0e0f8d7177da..4e44a4b497e3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -21,7 +21,9 @@ @Fluent public final class ThreatIntelligenceIndicatorModel extends ThreatIntelligenceInformationInner { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private ThreatIntelligenceResourceInnerKind kind = ThreatIntelligenceResourceInnerKind.INDICATOR; @@ -57,7 +59,9 @@ public ThreatIntelligenceIndicatorModel() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -791,18 +795,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index 357b2b99efda..44d126fc7f58 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,40 +12,11 @@ * 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. - * @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 along with {@link Response}. - */ - Response createIndicatorWithResponse(String resourceGroupName, String workspaceName, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties, 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 com.azure.core.management.exception.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, - ThreatIntelligenceIndicatorModel threatIntelligenceProperties); - /** * 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 workspaceName The name of the monitor 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. @@ -60,7 +31,7 @@ Response getWithResponse(String resourceGroupName * 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 workspaceName The name of the monitor 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. @@ -73,7 +44,7 @@ Response getWithResponse(String resourceGroupName * 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 workspaceName The name of the monitor 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. @@ -89,7 +60,7 @@ Response createWithResponse(String resourceGroupN * 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 workspaceName The name of the monitor 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. @@ -104,7 +75,7 @@ ThreatIntelligenceInformation create(String resourceGroupName, String workspaceN * 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 workspaceName The name of the monitor 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. @@ -118,7 +89,7 @@ ThreatIntelligenceInformation create(String resourceGroupName, String workspaceN * 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 workspaceName The name of the monitor 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. @@ -126,40 +97,11 @@ ThreatIntelligenceInformation create(String resourceGroupName, String workspaceN */ void delete(String resourceGroupName, String workspaceName, String name); - /** - * 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 as paginated response with {@link PagedIterable}. - */ - 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 as paginated response with {@link PagedIterable}. - */ - 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 workspaceName The name of the monitor 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. @@ -175,7 +117,7 @@ Response appendTagsWithResponse(String resourceGroupName, String workspace * 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 workspaceName The name of the monitor 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. @@ -189,7 +131,7 @@ void appendTags(String resourceGroupName, String workspaceName, String name, * 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 workspaceName The name of the monitor 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. @@ -205,7 +147,7 @@ Response replaceTagsWithResponse(String resourceG * 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 workspaceName The name of the monitor 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. @@ -215,4 +157,62 @@ Response replaceTagsWithResponse(String resourceG */ ThreatIntelligenceInformation replaceTags(String resourceGroupName, String workspaceName, String name, ThreatIntelligenceIndicatorModel threatIntelligenceReplaceTags); + + /** + * 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 monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 threat intelligence information object along with {@link Response}. + */ + Response createIndicatorWithResponse(String resourceGroupName, String workspaceName, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties, 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 monitor workspace. + * @param threatIntelligenceProperties The content of the action 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 threat intelligence information object. + */ + ThreatIntelligenceInformation createIndicator(String resourceGroupName, String workspaceName, + ThreatIntelligenceIndicatorModel threatIntelligenceProperties); + + /** + * 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 monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. + */ + 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 monitor workspace. + * @param threatIntelligenceFilteringCriteria The content of the action 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 list of all the threat intelligence information objects as paginated response with {@link PagedIterable}. + */ + PagedIterable queryIndicators(String resourceGroupName, String workspaceName, + ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, 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 index 523496c26c30..1569043994a7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -15,7 +15,7 @@ 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. + * @param workspaceName The name of the monitor 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. @@ -27,7 +27,7 @@ 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. + * @param workspaceName The name of the monitor workspace. * @param filter Filters the results, based on a Boolean condition. 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 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 index ab7279512d3c..3237ef3dce9c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -32,6 +32,15 @@ public interface ThreatIntelligenceInformation { */ String type(); + /** + * Gets the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + ThreatIntelligenceResourceInnerKind kind(); + /** * Gets the etag property: Etag of the azure resource. * @@ -46,13 +55,6 @@ public interface ThreatIntelligenceInformation { */ SystemData systemData(); - /** - * Gets the kind property: The kind of the entity. - * - * @return the kind value. - */ - ThreatIntelligenceResourceInnerKind kind(); - /** * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner * object. 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 index 97a7f89756b7..d403af5294ff 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -72,14 +72,6 @@ public ThreatIntelligenceKillChainPhase withPhaseName(String phaseName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 index 09bc7293a692..c64ee6a1773f 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Describes threat intelligence metric. */ -@Fluent +@Immutable public final class ThreatIntelligenceMetric implements JsonSerializable { /* * Last updated indicator metric @@ -40,7 +40,7 @@ public final class ThreatIntelligenceMetric implements JsonSerializable 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. * @@ -92,17 +70,6 @@ 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. * @@ -112,34 +79,6 @@ 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()); - } - } - /** * {@inheritDoc} */ 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 index 8a7f82b39e07..c571ff46f4e3 100644 --- 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Describes threat intelligence metric entity. */ -@Fluent +@Immutable public final class ThreatIntelligenceMetricEntity implements JsonSerializable { /* * Metric name @@ -29,7 +29,7 @@ public final class ThreatIntelligenceMetricEntity implements JsonSerializable { /* * Threat intelligence metrics. @@ -24,7 +24,7 @@ public final class ThreatIntelligenceMetrics implements JsonSerializable 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()); - } - } - /** * {@inheritDoc} */ 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 index e00d88181bcb..41a598843f26 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -73,14 +73,6 @@ public ThreatIntelligenceParsedPatternTypeValue withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java index 41b0d52a81a3..bb1559705c5d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,7 +13,7 @@ public final class ThreatIntelligenceResourceInnerKind extends ExpandableStringEnum { /** - * Static value indicator for ThreatIntelligenceResourceInnerKind. + * Entity represents threat intelligence indicator in the system. */ public static final ThreatIntelligenceResourceInnerKind INDICATOR = fromString("indicator"); 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 index 263f39389a4b..9f62612ae457 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -72,14 +72,6 @@ public ThreatIntelligenceSortingCriteria withSortOrder(ThreatIntelligenceSorting return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java index 9849d655ca9b..86cad29cd856 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,17 +12,17 @@ */ public final class ThreatIntelligenceSortingOrder extends ExpandableStringEnum { /** - * Static value unsorted for ThreatIntelligenceSortingOrder. + * unsorted. */ public static final ThreatIntelligenceSortingOrder UNSORTED = fromString("unsorted"); /** - * Static value ascending for ThreatIntelligenceSortingOrder. + * ascending. */ public static final ThreatIntelligenceSortingOrder ASCENDING = fromString("ascending"); /** - * Static value descending for ThreatIntelligenceSortingOrder. + * descending. */ public static final ThreatIntelligenceSortingOrder DESCENDING = fromString("descending"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligences.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligences.java new file mode 100644 index 000000000000..5f715f133132 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligences.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ThreatIntelligences. + */ +public interface ThreatIntelligences { + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 the count of all TI objects for the workspace along with {@link Response}. + */ + Response countWithResponse(String resourceGroupName, String workspaceName, TiType tiType, + CountQuery query, Context context); + + /** + * Gets the count of all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 the count of all TI objects for the workspace. + */ + ThreatIntelligenceCount count(String resourceGroupName, String workspaceName, TiType tiType); + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI 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 all TI objects for the workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType); + + /** + * Gets all TI objects for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tiType TI type. + * @param query The query to run on the TI objects in 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 TI objects for the workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable query(String resourceGroupName, String workspaceName, TiType tiType, Query query, + Context context); +} 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..efaa4516ed38 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiCheckRequirements.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiCheckRequirementsProperties; +import java.io.IOException; + +/** + * Threat Intelligence TAXII data connector check requirements. + */ +@Fluent +public final class TiTaxiiCheckRequirements extends DataConnectorsCheckRequirements { + /* + * Describes the kind of connector to be checked. + */ + private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE_TAXII; + + /* + * Threat Intelligence TAXII check required properties. + */ + private TiTaxiiCheckRequirementsProperties innerProperties; + + /** + * Creates an instance of TiTaxiiCheckRequirements class. + */ + public TiTaxiiCheckRequirements() { + } + + /** + * Get the kind property: Describes the kind of connector to be checked. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Threat Intelligence TAXII check required properties. + * + * @return the innerProperties value. + */ + TiTaxiiCheckRequirementsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 TiTaxiiCheckRequirements object itself. + */ + public TiTaxiiCheckRequirements withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new TiTaxiiCheckRequirementsProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TiTaxiiCheckRequirements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TiTaxiiCheckRequirements if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TiTaxiiCheckRequirements. + */ + public static TiTaxiiCheckRequirements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TiTaxiiCheckRequirements deserializedTiTaxiiCheckRequirements = new TiTaxiiCheckRequirements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTiTaxiiCheckRequirements.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedTiTaxiiCheckRequirements.innerProperties + = TiTaxiiCheckRequirementsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTiTaxiiCheckRequirements; + }); + } +} 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..f50fef37f395 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnector.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; +import com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiDataConnectorProperties; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Data connector to pull Threat intelligence data from TAXII 2.0/2.1 server. + */ +@Fluent +public final class TiTaxiiDataConnector extends DataConnectorInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private DataConnectorKind kind = DataConnectorKind.THREAT_INTELLIGENCE_TAXII; + + /* + * Threat intelligence TAXII data connector properties. + */ + private TiTaxiiDataConnectorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TiTaxiiDataConnector class. + */ + public TiTaxiiDataConnector() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public DataConnectorKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Threat intelligence TAXII data connector properties. + * + * @return the innerProperties value. + */ + private TiTaxiiDataConnectorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TiTaxiiDataConnector from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TiTaxiiDataConnector if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TiTaxiiDataConnector. + */ + public static TiTaxiiDataConnector fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TiTaxiiDataConnector deserializedTiTaxiiDataConnector = new TiTaxiiDataConnector(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTiTaxiiDataConnector.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTiTaxiiDataConnector.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTiTaxiiDataConnector.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedTiTaxiiDataConnector.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedTiTaxiiDataConnector.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedTiTaxiiDataConnector.kind = DataConnectorKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedTiTaxiiDataConnector.innerProperties = TiTaxiiDataConnectorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTiTaxiiDataConnector; + }); + } +} 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..e6804e9363ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypes.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available data types for Threat Intelligence TAXII data connector. + */ +@Fluent +public final class TiTaxiiDataConnectorDataTypes implements JsonSerializable { + /* + * Data type for TAXII connector. + */ + private TiTaxiiDataConnectorDataTypesTaxiiClient taxiiClient; + + /** + * Creates an instance of TiTaxiiDataConnectorDataTypes class. + */ + public TiTaxiiDataConnectorDataTypes() { + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("taxiiClient", this.taxiiClient); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TiTaxiiDataConnectorDataTypes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TiTaxiiDataConnectorDataTypes if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TiTaxiiDataConnectorDataTypes. + */ + public static TiTaxiiDataConnectorDataTypes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TiTaxiiDataConnectorDataTypes deserializedTiTaxiiDataConnectorDataTypes + = new TiTaxiiDataConnectorDataTypes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taxiiClient".equals(fieldName)) { + deserializedTiTaxiiDataConnectorDataTypes.taxiiClient + = TiTaxiiDataConnectorDataTypesTaxiiClient.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTiTaxiiDataConnectorDataTypes; + }); + } +} 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..8891820a8474 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Data type for TAXII connector. + */ +@Fluent +public final class TiTaxiiDataConnectorDataTypesTaxiiClient extends DataConnectorDataTypeCommon { + /** + * Creates an instance of TiTaxiiDataConnectorDataTypesTaxiiClient class. + */ + public TiTaxiiDataConnectorDataTypesTaxiiClient() { + } + + /** + * {@inheritDoc} + */ + @Override + public TiTaxiiDataConnectorDataTypesTaxiiClient withState(DataTypeState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TiTaxiiDataConnectorDataTypesTaxiiClient from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TiTaxiiDataConnectorDataTypesTaxiiClient if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TiTaxiiDataConnectorDataTypesTaxiiClient. + */ + public static TiTaxiiDataConnectorDataTypesTaxiiClient fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TiTaxiiDataConnectorDataTypesTaxiiClient deserializedTiTaxiiDataConnectorDataTypesTaxiiClient + = new TiTaxiiDataConnectorDataTypesTaxiiClient(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedTiTaxiiDataConnectorDataTypesTaxiiClient + .withState(DataTypeState.fromString(reader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTiTaxiiDataConnectorDataTypesTaxiiClient; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiType.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiType.java new file mode 100644 index 000000000000..5e6c88c31beb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TiType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for TiType. + */ +public final class TiType extends ExpandableStringEnum { + /** + * main. + */ + public static final TiType MAIN = fromString("main"); + + /** + * Creates a new instance of TiType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TiType() { + } + + /** + * Creates or finds a TiType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TiType. + */ + public static TiType fromString(String name) { + return fromString(name, TiType.class); + } + + /** + * Gets known TiType values. + * + * @return known TiType values. + */ + public static Collection values() { + return values(TiType.class); + } +} 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..3c096f5bf16a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineAggregation.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * timeline aggregation information per kind. + */ +@Immutable +public final class TimelineAggregation implements JsonSerializable { + /* + * the total items found for a kind + */ + private int count; + + /* + * the query kind + */ + private EntityTimelineKind kind; + + /** + * Creates an instance of TimelineAggregation class. + */ + private TimelineAggregation() { + } + + /** + * Get the count property: the total items found for a kind. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Get the kind property: the query kind. + * + * @return the kind value. + */ + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("count", this.count); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimelineAggregation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimelineAggregation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TimelineAggregation. + */ + public static TimelineAggregation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimelineAggregation deserializedTimelineAggregation = new TimelineAggregation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("count".equals(fieldName)) { + deserializedTimelineAggregation.count = reader.getInt(); + } else if ("kind".equals(fieldName)) { + deserializedTimelineAggregation.kind = EntityTimelineKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTimelineAggregation; + }); + } +} 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..1575435a44be --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Timeline Query Errors. + */ +@Immutable +public final class TimelineError implements JsonSerializable { + /* + * the query kind + */ + private EntityTimelineKind kind; + + /* + * the query id + */ + private String queryId; + + /* + * the error message + */ + private String errorMessage; + + /** + * Creates an instance of TimelineError class. + */ + private TimelineError() { + } + + /** + * Get the kind property: the query kind. + * + * @return the kind value. + */ + public EntityTimelineKind kind() { + return this.kind; + } + + /** + * Get the queryId property: the query id. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Get the errorMessage property: the error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + jsonWriter.writeStringField("queryId", this.queryId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimelineError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimelineError if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TimelineError. + */ + public static TimelineError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimelineError deserializedTimelineError = new TimelineError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedTimelineError.kind = EntityTimelineKind.fromString(reader.getString()); + } else if ("errorMessage".equals(fieldName)) { + deserializedTimelineError.errorMessage = reader.getString(); + } else if ("queryId".equals(fieldName)) { + deserializedTimelineError.queryId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTimelineError; + }); + } +} 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..0d468f4ef3f1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Expansion result metadata. + */ +@Immutable +public final class TimelineResultsMetadata implements JsonSerializable { + /* + * the total items found for the timeline request + */ + private int totalCount; + + /* + * timeline aggregation per kind + */ + private List aggregations; + + /* + * information about the failure queries + */ + private List errors; + + /** + * Creates an instance of TimelineResultsMetadata class. + */ + private TimelineResultsMetadata() { + } + + /** + * Get the totalCount property: the total items found for the timeline request. + * + * @return the totalCount value. + */ + public int totalCount() { + return this.totalCount; + } + + /** + * Get the aggregations property: timeline aggregation per kind. + * + * @return the aggregations value. + */ + public List aggregations() { + return this.aggregations; + } + + /** + * Get the errors property: information about the failure queries. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("totalCount", this.totalCount); + jsonWriter.writeArrayField("aggregations", this.aggregations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimelineResultsMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimelineResultsMetadata if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TimelineResultsMetadata. + */ + public static TimelineResultsMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimelineResultsMetadata deserializedTimelineResultsMetadata = new TimelineResultsMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedTimelineResultsMetadata.totalCount = reader.getInt(); + } else if ("aggregations".equals(fieldName)) { + List aggregations + = reader.readArray(reader1 -> TimelineAggregation.fromJson(reader1)); + deserializedTimelineResultsMetadata.aggregations = aggregations; + } else if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> TimelineError.fromJson(reader1)); + deserializedTimelineResultsMetadata.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedTimelineResultsMetadata; + }); + } +} 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 index 1667e482de97..9ed5878f0fd1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -9,22 +9,22 @@ */ public enum TriggerOperator { /** - * Enum value GreaterThan. + * GreaterThan. */ GREATER_THAN("GreaterThan"), /** - * Enum value LessThan. + * LessThan. */ LESS_THAN("LessThan"), /** - * Enum value Equal. + * Equal. */ EQUAL("Equal"), /** - * Enum value NotEqual. + * NotEqual. */ NOT_EQUAL("NotEqual"); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRun.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRun.java new file mode 100644 index 000000000000..893f37021c92 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRun.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * An immutable client-side representation of TriggeredAnalyticsRuleRun. + */ +public interface TriggeredAnalyticsRuleRun { + /** + * 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 executionTimeUtc property: The executionTimeUtc property. + * + * @return the executionTimeUtc value. + */ + OffsetDateTime executionTimeUtc(); + + /** + * Gets the ruleId property: The ruleId property. + * + * @return the ruleId value. + */ + String ruleId(); + + /** + * Gets the triggeredAnalyticsRuleRunId property: The triggeredAnalyticsRuleRunId property. + * + * @return the triggeredAnalyticsRuleRunId value. + */ + String triggeredAnalyticsRuleRunId(); + + /** + * Gets the provisioningState property: The triggered analytics rule run provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the ruleRunAdditionalData property: Dictionary of <any>. + * + * @return the ruleRunAdditionalData value. + */ + Map ruleRunAdditionalData(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner object. + * + * @return the inner object. + */ + TriggeredAnalyticsRuleRunInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRunOperations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRunOperations.java new file mode 100644 index 000000000000..e33fcd3b8084 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRunOperations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 TriggeredAnalyticsRuleRunOperations. + */ +public interface TriggeredAnalyticsRuleRunOperations { + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String ruleRunId, Context context); + + /** + * Gets the triggered analytics rule run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleRunId the triggered 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 triggered analytics rule run. + */ + TriggeredAnalyticsRuleRun get(String resourceGroupName, String workspaceName, String ruleRunId); +} 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 index ebcc1abe6ada..2d0f2af233d5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,12 +12,12 @@ */ public final class TriggersOn extends ExpandableStringEnum { /** - * Static value Incidents for TriggersOn. + * Trigger on Incidents. */ public static final TriggersOn INCIDENTS = fromString("Incidents"); /** - * Static value Alerts for TriggersOn. + * Trigger on Alerts. */ public static final TriggersOn ALERTS = fromString("Alerts"); 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 index 072fdf47ea10..dcdfcb635645 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -12,12 +12,12 @@ */ public final class TriggersWhen extends ExpandableStringEnum { /** - * Static value Created for TriggersWhen. + * Trigger on created objects. */ public static final TriggersWhen CREATED = fromString("Created"); /** - * Static value Updated for TriggersWhen. + * Trigger on updated objects. */ public static final TriggersWhen UPDATED = fromString("Updated"); 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..752576305f1e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Ueba.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.fluent.models.UebaProperties; +import java.io.IOException; +import java.util.List; + +/** + * Settings with single toggle. + */ +@Fluent +public final class Ueba extends SettingsInner { + /* + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. + */ + private SettingKind kind = SettingKind.UEBA; + + /* + * Ueba properties + */ + private UebaProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of Ueba class. + */ + public Ueba() { + } + + /** + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. + * + * @return the kind value. + */ + @Override + public SettingKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Ueba properties. + * + * @return the innerProperties value. + */ + private UebaProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("etag", etag()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ueba from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ueba if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Ueba. + */ + public static Ueba fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ueba deserializedUeba = new Ueba(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedUeba.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedUeba.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedUeba.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedUeba.withEtag(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedUeba.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedUeba.kind = SettingKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedUeba.innerProperties = UebaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUeba; + }); + } +} 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..2d1adf2b18aa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/UebaDataSources.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The data source that enriched by ueba. + */ +public final class UebaDataSources extends ExpandableStringEnum { + /** + * AuditLogs. + */ + public static final UebaDataSources AUDIT_LOGS = fromString("AuditLogs"); + + /** + * AzureActivity. + */ + public static final UebaDataSources AZURE_ACTIVITY = fromString("AzureActivity"); + + /** + * SecurityEvent. + */ + public static final UebaDataSources SECURITY_EVENT = fromString("SecurityEvent"); + + /** + * SigninLogs. + */ + public static final UebaDataSources SIGNIN_LOGS = fromString("SigninLogs"); + + /** + * Creates a new instance of UebaDataSources value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UebaDataSources() { + } + + /** + * Creates or finds a UebaDataSources from its string representation. + * + * @param name a name to look for. + * @return the corresponding UebaDataSources. + */ + public static UebaDataSources fromString(String name) { + return fromString(name, UebaDataSources.class); + } + + /** + * Gets known UebaDataSources values. + * + * @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/Updates.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Updates.java new file mode 100644 index 000000000000..242a9fb40416 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Updates.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 Updates. + */ +public interface Updates { + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object along with {@link Response}. + */ + Response recommendationWithResponse(String resourceGroupName, String workspaceName, + String recommendationId, RecommendationPatch recommendationPatch, Context context); + + /** + * Patch a recommendation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param recommendationId Recommendation Id. + * @param recommendationPatch Recommendation Fields to 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 recommendation object. + */ + Recommendation recommendation(String resourceGroupName, String workspaceName, String recommendationId, + RecommendationPatch recommendationPatch); +} 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 index c6ea788a480b..65708be2945f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -19,7 +19,9 @@ @Immutable public final class UrlEntity extends Entity { /* - * The kind of the entity. + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. + * ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist + * this value. */ private EntityKindEnum kind = EntityKindEnum.URL; @@ -51,11 +53,13 @@ public final class UrlEntity extends Entity { /** * Creates an instance of UrlEntity class. */ - public UrlEntity() { + private UrlEntity() { } /** - * Get the kind property: The kind of the entity. + * Get the kind property: Metadata used by portal/tooling/etc to render different UX experiences for resources of + * the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must + * validate and persist this value. * * @return the kind value. */ @@ -142,18 +146,6 @@ 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() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 index d3f178d7b600..6b27a78b3ef5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -10,8 +10,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Objects; -import java.util.UUID; /** * User information that made some action. @@ -31,7 +29,7 @@ public final class UserInfo implements JsonSerializable { /* * The object id of the user. */ - private UUID objectId; + private String objectId; /** * Creates an instance of UserInfo class. @@ -62,7 +60,7 @@ public String name() { * * @return the objectId value. */ - public UUID objectId() { + public String objectId() { return this.objectId; } @@ -72,26 +70,18 @@ public UUID objectId() { * @param objectId the objectId value to set. * @return the UserInfo object itself. */ - public UserInfo withObjectId(UUID objectId) { + public UserInfo withObjectId(String objectId) { this.objectId = objectId; return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectId", Objects.toString(this.objectId, null)); + jsonWriter.writeStringField("objectId", this.objectId); return jsonWriter.writeEndObject(); } @@ -115,8 +105,7 @@ public static UserInfo fromJson(JsonReader jsonReader) throws IOException { } else if ("name".equals(fieldName)) { deserializedUserInfo.name = reader.getString(); } else if ("objectId".equals(fieldName)) { - deserializedUserInfo.objectId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedUserInfo.objectId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ValidationError.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ValidationError.java new file mode 100644 index 000000000000..9a71f9a46ffe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/ValidationError.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes an error encountered in the file during validation. + */ +@Immutable +public final class ValidationError implements JsonSerializable { + /* + * The number of the record that has the error. + */ + private Integer recordIndex; + + /* + * A list of descriptions of the error. + */ + private List errorMessages; + + /** + * Creates an instance of ValidationError class. + */ + private ValidationError() { + } + + /** + * Get the recordIndex property: The number of the record that has the error. + * + * @return the recordIndex value. + */ + public Integer recordIndex() { + return this.recordIndex; + } + + /** + * Get the errorMessages property: A list of descriptions of the error. + * + * @return the errorMessages value. + */ + public List errorMessages() { + return this.errorMessages; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("recordIndex", this.recordIndex); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationError if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationError. + */ + public static ValidationError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationError deserializedValidationError = new ValidationError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recordIndex".equals(fieldName)) { + deserializedValidationError.recordIndex = reader.getNullable(JsonReader::getInt); + } else if ("errorMessages".equals(fieldName)) { + List errorMessages = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationError.errorMessages = errorMessages; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationError; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Version.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Version.java new file mode 100644 index 000000000000..4cb279d6513a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Version.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The version of the source control. + */ +public final class Version extends ExpandableStringEnum { + /** + * V1. + */ + public static final Version V1 = fromString("V1"); + + /** + * V2. + */ + public static final Version V2 = fromString("V2"); + + /** + * Creates a new instance of Version value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Version() { + } + + /** + * Creates or finds a Version from its string representation. + * + * @param name a name to look for. + * @return the corresponding Version. + */ + public static Version fromString(String name) { + return fromString(name, Version.class); + } + + /** + * Gets known Version values. + * + * @return known Version values. + */ + public static Collection values() { + return values(Version.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Warning.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Warning.java new file mode 100644 index 000000000000..d7ca94d43bc3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Warning.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.resourcemanager.securityinsights.fluent.models.WarningInner; + +/** + * An immutable client-side representation of Warning. + */ +public interface Warning { + /** + * Gets the warning property: Warning data. + * + * @return the warning value. + */ + WarningBody warning(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WarningInner object. + * + * @return the inner object. + */ + WarningInner innerModel(); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningBody.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningBody.java new file mode 100644 index 000000000000..2ff12913e514 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningBody.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Warning details. + */ +@Immutable +public final class WarningBody implements JsonSerializable { + /* + * An identifier for the warning. Codes are invariant and are intended to be consumed programmatically. + */ + private WarningCode code; + + /* + * A message describing the warning, intended to be suitable for display in a user interface. + */ + private String message; + + /* + * The details property. + */ + private List details; + + /** + * Creates an instance of WarningBody class. + */ + private WarningBody() { + } + + /** + * Get the code property: An identifier for the warning. Codes are invariant and are intended to be consumed + * programmatically. + * + * @return the code value. + */ + public WarningCode code() { + return this.code; + } + + /** + * Get the message property: A message describing the warning, intended to be suitable for display in a user + * interface. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the details property: The details property. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WarningBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WarningBody if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the WarningBody. + */ + public static WarningBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WarningBody deserializedWarningBody = new WarningBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedWarningBody.code = WarningCode.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedWarningBody.message = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> WarningBody.fromJson(reader1)); + deserializedWarningBody.details = details; + } else { + reader.skipChildren(); + } + } + + return deserializedWarningBody; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningCode.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningCode.java new file mode 100644 index 000000000000..e686c241985e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WarningCode.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of repository. + */ +public final class WarningCode extends ExpandableStringEnum { + /** + * SourceControlWarning_DeleteServicePrincipal. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_SERVICE_PRINCIPAL + = fromString("SourceControlWarning_DeleteServicePrincipal"); + + /** + * SourceControlWarning_DeletePipelineFromAzureDevOps. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_PIPELINE_FROM_AZURE_DEV_OPS + = fromString("SourceControlWarning_DeletePipelineFromAzureDevOps"); + + /** + * SourceControlWarning_DeleteWorkflowAndSecretFromGitHub. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_WORKFLOW_AND_SECRET_FROM_GIT_HUB + = fromString("SourceControlWarning_DeleteWorkflowAndSecretFromGitHub"); + + /** + * SourceControlWarning_DeleteRoleAssignment. + */ + public static final WarningCode SOURCE_CONTROL_WARNING_DELETE_ROLE_ASSIGNMENT + = fromString("SourceControlWarning_DeleteRoleAssignment"); + + /** + * SourceControl_DeletedWithWarnings. + */ + public static final WarningCode SOURCE_CONTROL_DELETED_WITH_WARNINGS + = fromString("SourceControl_DeletedWithWarnings"); + + /** + * Creates a new instance of WarningCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WarningCode() { + } + + /** + * Creates or finds a WarningCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WarningCode. + */ + public static WarningCode fromString(String name) { + return fromString(name, WarningCode.class); + } + + /** + * Gets known WarningCode values. + * + * @return known WarningCode values. + */ + public static Collection values() { + return values(WarningCode.class); + } +} 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 index 88127a5662c8..7acb299e1f69 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -72,11 +72,18 @@ public interface Watchlist { String provider(); /** - * Gets the source property: The source of the watchlist. + * Gets the source property: The filename of the watchlist, called 'source'. * * @return the source value. */ - Source source(); + String source(); + + /** + * Gets the sourceType property: The sourceType of the watchlist. + * + * @return the sourceType value. + */ + SourceType sourceType(); /** * Gets the created property: The time the watchlist was created. @@ -156,17 +163,15 @@ public interface Watchlist { String tenantId(); /** - * Gets the numberOfLinesToSkip property: The number of lines in a csv content to skip before the header. + * 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. Example : This line - * will be skipped - * header1,header2 - * value1,value2. + * 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. */ @@ -182,7 +187,7 @@ public interface Watchlist { String itemsSearchKey(); /** - * Gets the contentType property: The content type of the raw content. For now, only text/csv is valid. + * Gets the contentType property: The content type of the raw content. Example : text/csv or text/tsv. * * @return the contentType value. */ @@ -196,6 +201,13 @@ public interface Watchlist { */ String uploadStatus(); + /** + * Gets the provisioningState property: Describes provisioning state. + * + * @return the provisioningState value. + */ + WatchlistProvisioningState provisioningState(); + /** * Gets the name of the resource group. * @@ -235,7 +247,7 @@ 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. + * @param workspaceName The name of the monitor workspace. * @return the next definition stage. */ WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); @@ -245,13 +257,13 @@ interface WithParentResource { * 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, + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithWatchlistId, + DefinitionStages.WithDisplayName, DefinitionStages.WithProvider, DefinitionStages.WithSource, + DefinitionStages.WithSourceType, 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 { /** * Executes the create request. @@ -326,12 +338,25 @@ interface WithProvider { */ interface WithSource { /** - * Specifies the source property: The source of the watchlist. + * Specifies the source property: The filename of the watchlist, called 'source'. + * + * @param source The filename of the watchlist, called 'source'. + * @return the next definition stage. + */ + WithCreate withSource(String source); + } + + /** + * The stage of the Watchlist definition allowing to specify sourceType. + */ + interface WithSourceType { + /** + * Specifies the sourceType property: The sourceType of the watchlist. * - * @param source The source of the watchlist. + * @param sourceType The sourceType of the watchlist. * @return the next definition stage. */ - WithCreate withSource(Source source); + WithCreate withSourceType(SourceType sourceType); } /** @@ -483,10 +508,10 @@ interface WithTenantId { */ interface WithNumberOfLinesToSkip { /** - * Specifies the numberOfLinesToSkip property: The number of lines in a csv content to skip before the + * 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 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); @@ -497,15 +522,11 @@ interface WithNumberOfLinesToSkip { */ interface WithRawContent { /** - * Specifies the rawContent property: The raw content that represents to watchlist items to create. Example - * : This line will be skipped - * header1,header2 - * value1,value2. + * 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. Example : This line will - * be skipped - * header1,header2 - * value1,value2. + * @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); @@ -533,9 +554,9 @@ interface WithItemsSearchKey { */ interface WithContentType { /** - * Specifies the contentType property: The content type of the raw content. For now, only text/csv is valid. + * 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. For now, only text/csv is valid. + * @param contentType The content type of the raw content. Example : text/csv or text/tsv. * @return the next definition stage. */ WithCreate withContentType(String contentType); @@ -568,8 +589,8 @@ interface WithUploadStatus { * 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.WithProvider, UpdateStages.WithSource, UpdateStages.WithSourceType, 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, @@ -651,12 +672,25 @@ interface WithProvider { */ interface WithSource { /** - * Specifies the source property: The source of the watchlist. + * Specifies the source property: The filename of the watchlist, called 'source'. + * + * @param source The filename of the watchlist, called 'source'. + * @return the next definition stage. + */ + Update withSource(String source); + } + + /** + * The stage of the Watchlist update allowing to specify sourceType. + */ + interface WithSourceType { + /** + * Specifies the sourceType property: The sourceType of the watchlist. * - * @param source The source of the watchlist. + * @param sourceType The sourceType of the watchlist. * @return the next definition stage. */ - Update withSource(Source source); + Update withSourceType(SourceType sourceType); } /** @@ -808,10 +842,10 @@ interface WithTenantId { */ interface WithNumberOfLinesToSkip { /** - * Specifies the numberOfLinesToSkip property: The number of lines in a csv content to skip before the + * 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 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); @@ -822,15 +856,11 @@ interface WithNumberOfLinesToSkip { */ interface WithRawContent { /** - * Specifies the rawContent property: The raw content that represents to watchlist items to create. Example - * : This line will be skipped - * header1,header2 - * value1,value2. + * 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. Example : This line will - * be skipped - * header1,header2 - * value1,value2. + * @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); @@ -858,9 +888,9 @@ interface WithItemsSearchKey { */ interface WithContentType { /** - * Specifies the contentType property: The content type of the raw content. For now, only text/csv is valid. + * 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. For now, only text/csv is valid. + * @param contentType The content type of the raw content. Example : text/csv or text/tsv. * @return the next definition stage. */ Update withContentType(String contentType); 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 index af231efc49c9..d40007b7bbf7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -157,7 +157,7 @@ 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @return the next definition stage. */ 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 index e91a9a81e84f..c073f133a843 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,94 +13,94 @@ */ public interface WatchlistItems { /** - * Get all watchlist Items. + * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. + * @param watchlistItemId The 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 all watchlist Items as paginated response with {@link PagedIterable}. + * @return a watchlist item along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias); + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + String watchlistItemId, Context context); /** - * Get all watchlist Items. + * Get a watchlist item. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @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. + * @param watchlistItemId The 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 all watchlist Items as paginated response with {@link PagedIterable}. + * @return a watchlist item. */ - PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, - String skipToken, Context context); + WatchlistItem get(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); /** - * Get a watchlist item. + * 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 item along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId, Context context); /** - * Get a watchlist item. + * 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 workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. * @param watchlistItemId The 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 item. */ - WatchlistItem get(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); /** - * Delete a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The 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 {@link Response}. + * @return all watchlist Items as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - String watchlistItemId, Context context); + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias); /** - * Delete a watchlist item. + * Get all watchlist Items. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The watchlist alias. - * @param watchlistItemId The watchlist item id (GUID). + * @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 watchlist Items as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String workspaceName, String watchlistAlias, String watchlistItemId); + PagedIterable list(String resourceGroupName, String workspaceName, String watchlistAlias, + String skipToken, Context context); /** * Get a watchlist item. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistProvisioningState.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistProvisioningState.java new file mode 100644 index 000000000000..8208fbfbe9ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistProvisioningState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the watchlist. + */ +public final class WatchlistProvisioningState extends ExpandableStringEnum { + /** + * New. + */ + public static final WatchlistProvisioningState NEW = fromString("New"); + + /** + * InProgress. + */ + public static final WatchlistProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** + * Uploading. + */ + public static final WatchlistProvisioningState UPLOADING = fromString("Uploading"); + + /** + * Deleting. + */ + public static final WatchlistProvisioningState DELETING = fromString("Deleting"); + + /** + * Succeeded. + */ + public static final WatchlistProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Failed. + */ + public static final WatchlistProvisioningState FAILED = fromString("Failed"); + + /** + * Canceled. + */ + public static final WatchlistProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of WatchlistProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WatchlistProvisioningState() { + } + + /** + * Creates or finds a WatchlistProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WatchlistProvisioningState. + */ + public static WatchlistProvisioningState fromString(String name) { + return fromString(name, WatchlistProvisioningState.class); + } + + /** + * Gets known WatchlistProvisioningState values. + * + * @return known WatchlistProvisioningState values. + */ + public static Collection values() { + return values(WatchlistProvisioningState.class); + } +} 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 index 8be909784bad..73e91f5017fc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.models; @@ -13,87 +13,85 @@ */ public interface Watchlists { /** - * Get all watchlists, without watchlist items. + * Get 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 workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 watchlists, without watchlist items as paginated response with {@link PagedIterable}. + * @return a watchlist, without its watchlist items along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String workspaceName); + Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, + Context context); /** - * Get all watchlists, without watchlist items. + * Get 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 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. + * @param workspaceName The name of the monitor workspace. + * @param watchlistAlias The 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 watchlists, without watchlist items as paginated response with {@link PagedIterable}. + * @return a watchlist, without its watchlist items. */ - PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, Context context); + Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias); /** - * Get a watchlist, without its watchlist items. + * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The 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 along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - Context context); + void delete(String resourceGroupName, String workspaceName, String watchlistAlias); /** - * Get a watchlist, without its watchlist items. + * Delete a watchlist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. + * @param workspaceName The name of the monitor workspace. * @param watchlistAlias The 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. */ - Watchlist get(String resourceGroupName, String workspaceName, String watchlistAlias); + void delete(String resourceGroupName, String workspaceName, String watchlistAlias, Context context); /** - * Delete a watchlist. + * Get 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 watchlistAlias The watchlist alias. - * @param context The context to associate with this operation. + * @param workspaceName The name of the monitor 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 the {@link Response}. + * @return all watchlists, without watchlist items as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String workspaceName, String watchlistAlias, - Context context); + PagedIterable list(String resourceGroupName, String workspaceName); /** - * Delete a watchlist. + * Get 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 watchlistAlias The watchlist alias. + * @param workspaceName The name of the monitor workspace. + * @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 watchlists, without watchlist items as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String workspaceName, String watchlistAlias); + PagedIterable list(String resourceGroupName, String workspaceName, String skipToken, Context context); /** * Get a watchlist, without its watchlist items. @@ -136,9 +134,8 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 {@link Response}. */ - Response deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new Watchlist resource. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Webhook.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Webhook.java new file mode 100644 index 000000000000..2f5d08fb10ee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Webhook.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Detail about the webhook object. + */ +@Fluent +public final class Webhook implements JsonSerializable { + /* + * Unique identifier for the webhook. + */ + private String webhookId; + + /* + * URL that gets invoked by the webhook. + */ + private String webhookUrl; + + /* + * Time when the webhook secret was updated. + */ + private OffsetDateTime webhookSecretUpdateTime; + + /* + * A flag to instruct the backend service to rotate webhook secret. + */ + private Boolean rotateWebhookSecret; + + /** + * Creates an instance of Webhook class. + */ + public Webhook() { + } + + /** + * Get the webhookId property: Unique identifier for the webhook. + * + * @return the webhookId value. + */ + public String webhookId() { + return this.webhookId; + } + + /** + * Get the webhookUrl property: URL that gets invoked by the webhook. + * + * @return the webhookUrl value. + */ + public String webhookUrl() { + return this.webhookUrl; + } + + /** + * Get the webhookSecretUpdateTime property: Time when the webhook secret was updated. + * + * @return the webhookSecretUpdateTime value. + */ + public OffsetDateTime webhookSecretUpdateTime() { + return this.webhookSecretUpdateTime; + } + + /** + * Get the rotateWebhookSecret property: A flag to instruct the backend service to rotate webhook secret. + * + * @return the rotateWebhookSecret value. + */ + public Boolean rotateWebhookSecret() { + return this.rotateWebhookSecret; + } + + /** + * Set the rotateWebhookSecret property: A flag to instruct the backend service to rotate webhook secret. + * + * @param rotateWebhookSecret the rotateWebhookSecret value to set. + * @return the Webhook object itself. + */ + public Webhook withRotateWebhookSecret(Boolean rotateWebhookSecret) { + this.rotateWebhookSecret = rotateWebhookSecret; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("rotateWebhookSecret", this.rotateWebhookSecret); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Webhook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Webhook if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Webhook. + */ + public static Webhook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Webhook deserializedWebhook = new Webhook(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webhookId".equals(fieldName)) { + deserializedWebhook.webhookId = reader.getString(); + } else if ("webhookUrl".equals(fieldName)) { + deserializedWebhook.webhookUrl = reader.getString(); + } else if ("webhookSecretUpdateTime".equals(fieldName)) { + deserializedWebhook.webhookSecretUpdateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("rotateWebhookSecret".equals(fieldName)) { + deserializedWebhook.rotateWebhookSecret = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedWebhook; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkloadIdentityFederation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkloadIdentityFederation.java new file mode 100644 index 000000000000..48adb57dadb2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkloadIdentityFederation.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Workload Identity Federation metadata. + */ +@Immutable +public final class WorkloadIdentityFederation implements JsonSerializable { + /* + * Id of Workload Identity Federation. + */ + private String id; + + /* + * Tenant id of Workload Identity Federation. + */ + private String tenantId; + + /* + * App id of Workload Identity Federation. + */ + private String appId; + + /* + * Subject of Workload Identity Federation. + */ + private String subject; + + /* + * Issuer of Workload Identity Federation. + */ + private String issuer; + + /** + * Creates an instance of WorkloadIdentityFederation class. + */ + private WorkloadIdentityFederation() { + } + + /** + * Get the id property: Id of Workload Identity Federation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the tenantId property: Tenant id of Workload Identity Federation. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the appId property: App id of Workload Identity Federation. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Get the subject property: Subject of Workload Identity Federation. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Get the issuer property: Issuer of Workload Identity Federation. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkloadIdentityFederation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkloadIdentityFederation if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WorkloadIdentityFederation. + */ + public static WorkloadIdentityFederation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkloadIdentityFederation deserializedWorkloadIdentityFederation = new WorkloadIdentityFederation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedWorkloadIdentityFederation.id = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedWorkloadIdentityFederation.tenantId = reader.getString(); + } else if ("appId".equals(fieldName)) { + deserializedWorkloadIdentityFederation.appId = reader.getString(); + } else if ("subject".equals(fieldName)) { + deserializedWorkloadIdentityFederation.subject = reader.getString(); + } else if ("issuer".equals(fieldName)) { + deserializedWorkloadIdentityFederation.issuer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkloadIdentityFederation; + }); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignment.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignment.java new file mode 100644 index 000000000000..b9e2d7a13e4d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignment.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerAssignmentInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of WorkspaceManagerAssignment. + */ +public interface WorkspaceManagerAssignment { + /** + * 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: Resource Etag. + * + * @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 targetResourceName property: The resource name of the workspace manager group targeted by the workspace + * manager assignment. + * + * @return the targetResourceName value. + */ + String targetResourceName(); + + /** + * Gets the lastJobEndTime property: The time the last job associated to this assignment ended at. + * + * @return the lastJobEndTime value. + */ + OffsetDateTime lastJobEndTime(); + + /** + * Gets the lastJobProvisioningState property: State of the last job associated to this assignment. + * + * @return the lastJobProvisioningState value. + */ + JobProvisioningState lastJobProvisioningState(); + + /** + * Gets the items property: List of resources included in this workspace manager assignment. + * + * @return the items value. + */ + List items(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner object. + * + * @return the inner object. + */ + WorkspaceManagerAssignmentInner innerModel(); + + /** + * The entirety of the WorkspaceManagerAssignment definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The WorkspaceManagerAssignment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WorkspaceManagerAssignment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the WorkspaceManagerAssignment 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 WorkspaceManagerAssignment 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.WithTargetResourceName, DefinitionStages.WithItems { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkspaceManagerAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkspaceManagerAssignment create(Context context); + } + + /** + * The stage of the WorkspaceManagerAssignment definition allowing to specify targetResourceName. + */ + interface WithTargetResourceName { + /** + * Specifies the targetResourceName property: The resource name of the workspace manager group targeted by + * the workspace manager assignment. + * + * @param targetResourceName The resource name of the workspace manager group targeted by the workspace + * manager assignment. + * @return the next definition stage. + */ + WithCreate withTargetResourceName(String targetResourceName); + } + + /** + * The stage of the WorkspaceManagerAssignment definition allowing to specify items. + */ + interface WithItems { + /** + * Specifies the items property: List of resources included in this workspace manager assignment. + * + * @param items List of resources included in this workspace manager assignment. + * @return the next definition stage. + */ + WithCreate withItems(List items); + } + } + + /** + * Begins update for the WorkspaceManagerAssignment resource. + * + * @return the stage of resource update. + */ + WorkspaceManagerAssignment.Update update(); + + /** + * The template for WorkspaceManagerAssignment update. + */ + interface Update extends UpdateStages.WithTargetResourceName, UpdateStages.WithItems { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkspaceManagerAssignment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkspaceManagerAssignment apply(Context context); + } + + /** + * The WorkspaceManagerAssignment update stages. + */ + interface UpdateStages { + /** + * The stage of the WorkspaceManagerAssignment update allowing to specify targetResourceName. + */ + interface WithTargetResourceName { + /** + * Specifies the targetResourceName property: The resource name of the workspace manager group targeted by + * the workspace manager assignment. + * + * @param targetResourceName The resource name of the workspace manager group targeted by the workspace + * manager assignment. + * @return the next definition stage. + */ + Update withTargetResourceName(String targetResourceName); + } + + /** + * The stage of the WorkspaceManagerAssignment update allowing to specify items. + */ + interface WithItems { + /** + * Specifies the items property: List of resources included in this workspace manager assignment. + * + * @param items List of resources included in this workspace manager assignment. + * @return the next definition stage. + */ + Update withItems(List items); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkspaceManagerAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkspaceManagerAssignment refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentJobs.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentJobs.java new file mode 100644 index 000000000000..c7b2d3c99880 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentJobs.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 WorkspaceManagerAssignmentJobs. + */ +public interface WorkspaceManagerAssignmentJobs { + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 assignment job along with {@link Response}. + */ + Response createWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context); + + /** + * Create a job for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 assignment job. + */ + Job create(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName); + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, + String jobName, Context context); + + /** + * Gets a job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 job. + */ + Job get(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, String jobName); + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, String jobName, Context context); + + /** + * Deletes the specified job from the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @param jobName The job 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 workspaceManagerAssignmentName, String jobName); + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 jobs for the specified workspace manager assignment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName); + + /** + * Get all jobs for the specified workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 jobs for the specified workspace manager assignment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String workspaceManagerAssignmentName, + String orderby, Integer top, String skipToken, Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignments.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignments.java new file mode 100644 index 000000000000..8aab1df29689 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignments.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 WorkspaceManagerAssignments. + */ +public interface WorkspaceManagerAssignments { + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 workspace manager assignment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context); + + /** + * Gets a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager assignment. + */ + WorkspaceManagerAssignment get(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName); + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerAssignmentName, Context context); + + /** + * Deletes a workspace manager assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerAssignmentName The name of the workspace manager assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerAssignmentName); + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get all workspace manager assignments for the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager assignments for the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context); + + /** + * Gets a workspace manager assignment. + * + * @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 workspace manager assignment along with {@link Response}. + */ + WorkspaceManagerAssignment getById(String id); + + /** + * Gets a workspace manager assignment. + * + * @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 workspace manager assignment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a workspace manager assignment. + * + * @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); + + /** + * Deletes a workspace manager assignment. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkspaceManagerAssignment resource. + * + * @param name resource name. + * @return the first stage of the new WorkspaceManagerAssignment definition. + */ + WorkspaceManagerAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfiguration.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfiguration.java new file mode 100644 index 000000000000..8cf1f37d9962 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfiguration.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerConfigurationInner; + +/** + * An immutable client-side representation of WorkspaceManagerConfiguration. + */ +public interface WorkspaceManagerConfiguration { + /** + * 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: Resource Etag. + * + * @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 mode property: The current mode of the workspace manager configuration. + * + * @return the mode value. + */ + Mode mode(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner + * object. + * + * @return the inner object. + */ + WorkspaceManagerConfigurationInner innerModel(); + + /** + * The entirety of the WorkspaceManagerConfiguration definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The WorkspaceManagerConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WorkspaceManagerConfiguration definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the WorkspaceManagerConfiguration 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 WorkspaceManagerConfiguration 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.WithMode { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkspaceManagerConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkspaceManagerConfiguration create(Context context); + } + + /** + * The stage of the WorkspaceManagerConfiguration definition allowing to specify mode. + */ + interface WithMode { + /** + * Specifies the mode property: The current mode of the workspace manager configuration. + * + * @param mode The current mode of the workspace manager configuration. + * @return the next definition stage. + */ + WithCreate withMode(Mode mode); + } + } + + /** + * Begins update for the WorkspaceManagerConfiguration resource. + * + * @return the stage of resource update. + */ + WorkspaceManagerConfiguration.Update update(); + + /** + * The template for WorkspaceManagerConfiguration update. + */ + interface Update extends UpdateStages.WithMode { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkspaceManagerConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkspaceManagerConfiguration apply(Context context); + } + + /** + * The WorkspaceManagerConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the WorkspaceManagerConfiguration update allowing to specify mode. + */ + interface WithMode { + /** + * Specifies the mode property: The current mode of the workspace manager configuration. + * + * @param mode The current mode of the workspace manager configuration. + * @return the next definition stage. + */ + Update withMode(Mode mode); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkspaceManagerConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkspaceManagerConfiguration refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfigurations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfigurations.java new file mode 100644 index 000000000000..844ae3c7b406 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfigurations.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 WorkspaceManagerConfigurations. + */ +public interface WorkspaceManagerConfigurations { + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @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 workspace manager configuration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context); + + /** + * Gets a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager configuration. + */ + WorkspaceManagerConfiguration get(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName); + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerConfigurationName, Context context); + + /** + * Deletes a workspace manager configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerConfigurationName The name of the workspace manager configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerConfigurationName); + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all workspace manager configurations for a Sentinel workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager configurations for a Sentinel workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context); + + /** + * Gets a workspace manager configuration. + * + * @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 workspace manager configuration along with {@link Response}. + */ + WorkspaceManagerConfiguration getById(String id); + + /** + * Gets a workspace manager configuration. + * + * @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 workspace manager configuration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a workspace manager configuration. + * + * @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); + + /** + * Deletes a workspace manager configuration. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkspaceManagerConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new WorkspaceManagerConfiguration definition. + */ + WorkspaceManagerConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroup.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroup.java new file mode 100644 index 000000000000..d111f726bd94 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroup.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerGroupInner; +import java.util.List; + +/** + * An immutable client-side representation of WorkspaceManagerGroup. + */ +public interface WorkspaceManagerGroup { + /** + * 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: Resource Etag. + * + * @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 description property: The description of the workspace manager group. + * + * @return the description value. + */ + String description(); + + /** + * Gets the displayName property: The display name of the workspace manager group. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the memberResourceNames property: The names of the workspace manager members participating in this group. + * + * @return the memberResourceNames value. + */ + List memberResourceNames(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner object. + * + * @return the inner object. + */ + WorkspaceManagerGroupInner innerModel(); + + /** + * The entirety of the WorkspaceManagerGroup definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The WorkspaceManagerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WorkspaceManagerGroup definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the WorkspaceManagerGroup 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 WorkspaceManagerGroup 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.WithDescription, DefinitionStages.WithDisplayName, + DefinitionStages.WithMemberResourceNames { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkspaceManagerGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkspaceManagerGroup create(Context context); + } + + /** + * The stage of the WorkspaceManagerGroup definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the workspace manager group. + * + * @param description The description of the workspace manager group. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the WorkspaceManagerGroup definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the workspace manager group. + * + * @param displayName The display name of the workspace manager group. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the WorkspaceManagerGroup definition allowing to specify memberResourceNames. + */ + interface WithMemberResourceNames { + /** + * Specifies the memberResourceNames property: The names of the workspace manager members participating in + * this group.. + * + * @param memberResourceNames The names of the workspace manager members participating in this group. + * @return the next definition stage. + */ + WithCreate withMemberResourceNames(List memberResourceNames); + } + } + + /** + * Begins update for the WorkspaceManagerGroup resource. + * + * @return the stage of resource update. + */ + WorkspaceManagerGroup.Update update(); + + /** + * The template for WorkspaceManagerGroup update. + */ + interface Update + extends UpdateStages.WithDescription, UpdateStages.WithDisplayName, UpdateStages.WithMemberResourceNames { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkspaceManagerGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkspaceManagerGroup apply(Context context); + } + + /** + * The WorkspaceManagerGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the WorkspaceManagerGroup update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the workspace manager group. + * + * @param description The description of the workspace manager group. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the WorkspaceManagerGroup update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the workspace manager group. + * + * @param displayName The display name of the workspace manager group. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the WorkspaceManagerGroup update allowing to specify memberResourceNames. + */ + interface WithMemberResourceNames { + /** + * Specifies the memberResourceNames property: The names of the workspace manager members participating in + * this group.. + * + * @param memberResourceNames The names of the workspace manager members participating in this group. + * @return the next definition stage. + */ + Update withMemberResourceNames(List memberResourceNames); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkspaceManagerGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkspaceManagerGroup refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroups.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroups.java new file mode 100644 index 000000000000..8ab8e7c2fcbe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroups.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 WorkspaceManagerGroups. + */ +public interface WorkspaceManagerGroups { + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @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 workspace manager group along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerGroupName, Context context); + + /** + * Gets a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager group. + */ + WorkspaceManagerGroup get(String resourceGroupName, String workspaceName, String workspaceManagerGroupName); + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String workspaceManagerGroupName, + Context context); + + /** + * Deletes a workspace manager group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerGroupName The name of the workspace manager group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerGroupName); + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all workspace manager groups in the Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager groups in the Sentinel workspace manager as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context); + + /** + * Gets a workspace manager group. + * + * @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 workspace manager group along with {@link Response}. + */ + WorkspaceManagerGroup getById(String id); + + /** + * Gets a workspace manager group. + * + * @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 workspace manager group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a workspace manager group. + * + * @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); + + /** + * Deletes a workspace manager group. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkspaceManagerGroup resource. + * + * @param name resource name. + * @return the first stage of the new WorkspaceManagerGroup definition. + */ + WorkspaceManagerGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMember.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMember.java new file mode 100644 index 000000000000..8fa34b3e7d1b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMember.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.WorkspaceManagerMemberInner; + +/** + * An immutable client-side representation of WorkspaceManagerMember. + */ +public interface WorkspaceManagerMember { + /** + * 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: Resource Etag. + * + * @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 targetWorkspaceResourceId property: Fully qualified resource ID of the target Sentinel workspace joining + * the given Sentinel workspace manager. + * + * @return the targetWorkspaceResourceId value. + */ + String targetWorkspaceResourceId(); + + /** + * Gets the targetWorkspaceTenantId property: Tenant id of the target Sentinel workspace joining the given Sentinel + * workspace manager. + * + * @return the targetWorkspaceTenantId value. + */ + String targetWorkspaceTenantId(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner object. + * + * @return the inner object. + */ + WorkspaceManagerMemberInner innerModel(); + + /** + * The entirety of the WorkspaceManagerMember definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The WorkspaceManagerMember definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the WorkspaceManagerMember definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the WorkspaceManagerMember 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 WorkspaceManagerMember 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.WithTargetWorkspaceResourceId, DefinitionStages.WithTargetWorkspaceTenantId { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkspaceManagerMember create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkspaceManagerMember create(Context context); + } + + /** + * The stage of the WorkspaceManagerMember definition allowing to specify targetWorkspaceResourceId. + */ + interface WithTargetWorkspaceResourceId { + /** + * Specifies the targetWorkspaceResourceId property: Fully qualified resource ID of the target Sentinel + * workspace joining the given Sentinel workspace manager. + * + * @param targetWorkspaceResourceId Fully qualified resource ID of the target Sentinel workspace joining the + * given Sentinel workspace manager. + * @return the next definition stage. + */ + WithCreate withTargetWorkspaceResourceId(String targetWorkspaceResourceId); + } + + /** + * The stage of the WorkspaceManagerMember definition allowing to specify targetWorkspaceTenantId. + */ + interface WithTargetWorkspaceTenantId { + /** + * Specifies the targetWorkspaceTenantId property: Tenant id of the target Sentinel workspace joining the + * given Sentinel workspace manager. + * + * @param targetWorkspaceTenantId Tenant id of the target Sentinel workspace joining the given Sentinel + * workspace manager. + * @return the next definition stage. + */ + WithCreate withTargetWorkspaceTenantId(String targetWorkspaceTenantId); + } + } + + /** + * Begins update for the WorkspaceManagerMember resource. + * + * @return the stage of resource update. + */ + WorkspaceManagerMember.Update update(); + + /** + * The template for WorkspaceManagerMember update. + */ + interface Update extends UpdateStages.WithTargetWorkspaceResourceId, UpdateStages.WithTargetWorkspaceTenantId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkspaceManagerMember apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkspaceManagerMember apply(Context context); + } + + /** + * The WorkspaceManagerMember update stages. + */ + interface UpdateStages { + /** + * The stage of the WorkspaceManagerMember update allowing to specify targetWorkspaceResourceId. + */ + interface WithTargetWorkspaceResourceId { + /** + * Specifies the targetWorkspaceResourceId property: Fully qualified resource ID of the target Sentinel + * workspace joining the given Sentinel workspace manager. + * + * @param targetWorkspaceResourceId Fully qualified resource ID of the target Sentinel workspace joining the + * given Sentinel workspace manager. + * @return the next definition stage. + */ + Update withTargetWorkspaceResourceId(String targetWorkspaceResourceId); + } + + /** + * The stage of the WorkspaceManagerMember update allowing to specify targetWorkspaceTenantId. + */ + interface WithTargetWorkspaceTenantId { + /** + * Specifies the targetWorkspaceTenantId property: Tenant id of the target Sentinel workspace joining the + * given Sentinel workspace manager. + * + * @param targetWorkspaceTenantId Tenant id of the target Sentinel workspace joining the given Sentinel + * workspace manager. + * @return the next definition stage. + */ + Update withTargetWorkspaceTenantId(String targetWorkspaceTenantId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkspaceManagerMember refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkspaceManagerMember refresh(Context context); +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMembers.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMembers.java new file mode 100644 index 000000000000..d17e631a8703 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMembers.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 WorkspaceManagerMembers. + */ +public interface WorkspaceManagerMembers { + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @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 workspace manager member along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, + String workspaceManagerMemberName, Context context); + + /** + * Gets a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 workspace manager member. + */ + WorkspaceManagerMember get(String resourceGroupName, String workspaceName, String workspaceManagerMemberName); + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String workspaceManagerMemberName, + Context context); + + /** + * Deletes a workspace manager member. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceManagerMemberName The name of the workspace manager member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceManagerMemberName); + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Gets all workspace manager members that exist for the given Sentinel workspace manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspace manager members that exist for the given Sentinel workspace manager as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String orderby, + Integer top, String skipToken, Context context); + + /** + * Gets a workspace manager member. + * + * @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 workspace manager member along with {@link Response}. + */ + WorkspaceManagerMember getById(String id); + + /** + * Gets a workspace manager member. + * + * @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 workspace manager member along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a workspace manager member. + * + * @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); + + /** + * Deletes a workspace manager member. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkspaceManagerMember resource. + * + * @param name resource name. + * @return the first stage of the new WorkspaceManagerMember definition. + */ + WorkspaceManagerMember.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 index 45d88111a38b..21c2340c83f5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the data models for SecurityInsights. 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 index a3c2300976d5..697a9d0fb324 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the classes for 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 index 46831c11b0b8..5ae3347a3568 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.securityinsights { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.securityinsights.fluent.models to com.azure.core; opens com.azure.resourcemanager.securityinsights.models to com.azure.core; + opens com.azure.resourcemanager.securityinsights.implementation.models to com.azure.core; } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/azure-resourcemanager-securityinsights_metadata.json b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/azure-resourcemanager-securityinsights_metadata.json new file mode 100644 index 000000000000..37b1cb0937d0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/azure-resourcemanager-securityinsights_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.SecurityInsights":"2025-10-01-preview"},"crossLanguagePackageId":"Microsoft.SecurityInsights","crossLanguageVersion":"5e2df49c528c","crossLanguageDefinitions":{"com.azure.resourcemanager.securityinsights.fluent.ActionsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ActionsClient.createOrUpdate":"Microsoft.SecurityInsights.ActionResponses.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.ActionsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.ActionResponses.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.ActionsClient.delete":"Microsoft.SecurityInsights.ActionResponses.delete","com.azure.resourcemanager.securityinsights.fluent.ActionsClient.deleteWithResponse":"Microsoft.SecurityInsights.ActionResponses.delete","com.azure.resourcemanager.securityinsights.fluent.ActionsClient.get":"Microsoft.SecurityInsights.ActionResponses.get","com.azure.resourcemanager.securityinsights.fluent.ActionsClient.getWithResponse":"Microsoft.SecurityInsights.ActionResponses.get","com.azure.resourcemanager.securityinsights.fluent.ActionsClient.listByAlertRule":"Microsoft.SecurityInsights.ActionResponses.listByAlertRule","com.azure.resourcemanager.securityinsights.fluent.AlertRuleOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.AlertRuleOperationsClient.beginTriggerRuleRun":"Microsoft.SecurityInsights.AlertRules.triggerRuleRun","com.azure.resourcemanager.securityinsights.fluent.AlertRuleOperationsClient.triggerRuleRun":"Microsoft.SecurityInsights.AlertRules.triggerRuleRun","com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient":"Microsoft.SecurityInsights.AlertRuleTemplates","com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient.get":"Microsoft.SecurityInsights.AlertRuleTemplates.get","com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient.getWithResponse":"Microsoft.SecurityInsights.AlertRuleTemplates.get","com.azure.resourcemanager.securityinsights.fluent.AlertRuleTemplatesClient.list":"Microsoft.SecurityInsights.AlertRuleTemplates.list","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient":"Microsoft.SecurityInsights.AlertRules","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient.createOrUpdate":"Microsoft.SecurityInsights.AlertRules.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.AlertRules.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient.delete":"Microsoft.SecurityInsights.AlertRules.delete","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient.deleteWithResponse":"Microsoft.SecurityInsights.AlertRules.delete","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient.get":"Microsoft.SecurityInsights.AlertRules.get","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient.getWithResponse":"Microsoft.SecurityInsights.AlertRules.get","com.azure.resourcemanager.securityinsights.fluent.AlertRulesClient.list":"Microsoft.SecurityInsights.AlertRules.list","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient":"Microsoft.SecurityInsights.AutomationRules","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient.createOrUpdate":"Microsoft.SecurityInsights.AutomationRules.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.AutomationRules.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient.delete":"Microsoft.SecurityInsights.AutomationRules.delete","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient.deleteWithResponse":"Microsoft.SecurityInsights.AutomationRules.delete","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient.get":"Microsoft.SecurityInsights.AutomationRules.get","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient.getWithResponse":"Microsoft.SecurityInsights.AutomationRules.get","com.azure.resourcemanager.securityinsights.fluent.AutomationRulesClient.list":"Microsoft.SecurityInsights.AutomationRules.list","com.azure.resourcemanager.securityinsights.fluent.BillingStatisticsClient":"Microsoft.SecurityInsights.BillingStatistics","com.azure.resourcemanager.securityinsights.fluent.BillingStatisticsClient.get":"Microsoft.SecurityInsights.BillingStatistics.get","com.azure.resourcemanager.securityinsights.fluent.BillingStatisticsClient.getWithResponse":"Microsoft.SecurityInsights.BillingStatistics.get","com.azure.resourcemanager.securityinsights.fluent.BillingStatisticsClient.list":"Microsoft.SecurityInsights.BillingStatistics.list","com.azure.resourcemanager.securityinsights.fluent.BookmarkOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.BookmarkOperationsClient.expand":"Microsoft.SecurityInsights.Bookmarks.expand","com.azure.resourcemanager.securityinsights.fluent.BookmarkOperationsClient.expandWithResponse":"Microsoft.SecurityInsights.Bookmarks.expand","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient":"Microsoft.SecurityInsights.BookmarkRelations","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient.createOrUpdate":"Microsoft.SecurityInsights.BookmarkRelations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.BookmarkRelations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient.delete":"Microsoft.SecurityInsights.BookmarkRelations.delete","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient.deleteWithResponse":"Microsoft.SecurityInsights.BookmarkRelations.delete","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient.get":"Microsoft.SecurityInsights.BookmarkRelations.get","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient.getWithResponse":"Microsoft.SecurityInsights.BookmarkRelations.get","com.azure.resourcemanager.securityinsights.fluent.BookmarkRelationsClient.list":"Microsoft.SecurityInsights.BookmarkRelations.list","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient":"Microsoft.SecurityInsights.Bookmarks","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient.createOrUpdate":"Microsoft.SecurityInsights.Bookmarks.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.Bookmarks.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient.delete":"Microsoft.SecurityInsights.Bookmarks.delete","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient.deleteWithResponse":"Microsoft.SecurityInsights.Bookmarks.delete","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient.get":"Microsoft.SecurityInsights.Bookmarks.get","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient.getWithResponse":"Microsoft.SecurityInsights.Bookmarks.get","com.azure.resourcemanager.securityinsights.fluent.BookmarksClient.list":"Microsoft.SecurityInsights.Bookmarks.list","com.azure.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient.install":"Microsoft.SecurityInsights.PackageModels.install","com.azure.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient.installWithResponse":"Microsoft.SecurityInsights.PackageModels.install","com.azure.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient.uninstall":"Microsoft.SecurityInsights.PackageModels.uninstall","com.azure.resourcemanager.securityinsights.fluent.ContentPackageOperationsClient.uninstallWithResponse":"Microsoft.SecurityInsights.PackageModels.uninstall","com.azure.resourcemanager.securityinsights.fluent.ContentPackagesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ContentPackagesClient.get":"Microsoft.SecurityInsights.PackageModels.get","com.azure.resourcemanager.securityinsights.fluent.ContentPackagesClient.getWithResponse":"Microsoft.SecurityInsights.PackageModels.get","com.azure.resourcemanager.securityinsights.fluent.ContentPackagesClient.list":"Microsoft.SecurityInsights.PackageModels.list","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient.delete":"Microsoft.SecurityInsights.TemplateModels.delete","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient.deleteWithResponse":"Microsoft.SecurityInsights.TemplateModels.delete","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient.get":"Microsoft.SecurityInsights.TemplateModels.get","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient.getWithResponse":"Microsoft.SecurityInsights.TemplateModels.get","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient.install":"Microsoft.SecurityInsights.TemplateModels.install","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesClient.installWithResponse":"Microsoft.SecurityInsights.TemplateModels.install","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ContentTemplatesOperationsClient.list":"Microsoft.SecurityInsights.TemplateModels.list","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient":"Microsoft.SecurityInsights.DataConnectorDefinitions","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient.createOrUpdate":"Microsoft.SecurityInsights.DataConnectorDefinitions.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.DataConnectorDefinitions.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient.delete":"Microsoft.SecurityInsights.DataConnectorDefinitions.delete","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient.deleteWithResponse":"Microsoft.SecurityInsights.DataConnectorDefinitions.delete","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient.get":"Microsoft.SecurityInsights.DataConnectorDefinitions.get","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient.getWithResponse":"Microsoft.SecurityInsights.DataConnectorDefinitions.get","com.azure.resourcemanager.securityinsights.fluent.DataConnectorDefinitionsClient.list":"Microsoft.SecurityInsights.DataConnectorDefinitions.list","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsCheckRequirementsOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsCheckRequirementsOperationsClient.post":"Microsoft.SecurityInsights.DataConnectorsCheckRequirementsOperationGroup.post","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsCheckRequirementsOperationsClient.postWithResponse":"Microsoft.SecurityInsights.DataConnectorsCheckRequirementsOperationGroup.post","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient":"Microsoft.SecurityInsights.DataConnectors","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.connect":"Microsoft.SecurityInsights.DataConnectors.connect","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.connectWithResponse":"Microsoft.SecurityInsights.DataConnectors.connect","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.createOrUpdate":"Microsoft.SecurityInsights.DataConnectors.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.DataConnectors.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.delete":"Microsoft.SecurityInsights.DataConnectors.delete","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.deleteWithResponse":"Microsoft.SecurityInsights.DataConnectors.delete","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.disconnect":"Microsoft.SecurityInsights.DataConnectors.disconnect","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.disconnectWithResponse":"Microsoft.SecurityInsights.DataConnectors.disconnect","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.get":"Microsoft.SecurityInsights.DataConnectors.get","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.getWithResponse":"Microsoft.SecurityInsights.DataConnectors.get","com.azure.resourcemanager.securityinsights.fluent.DataConnectorsClient.list":"Microsoft.SecurityInsights.DataConnectors.list","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient":"Microsoft.SecurityInsights.Entities","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.expand":"Microsoft.SecurityInsights.Entities.expand","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.expandWithResponse":"Microsoft.SecurityInsights.Entities.expand","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.get":"Microsoft.SecurityInsights.Entities.get","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.getInsights":"Microsoft.SecurityInsights.Entities.getInsights","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.getInsightsWithResponse":"Microsoft.SecurityInsights.Entities.getInsights","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.getWithResponse":"Microsoft.SecurityInsights.Entities.get","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.list":"Microsoft.SecurityInsights.Entities.list","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.queries":"Microsoft.SecurityInsights.Entities.queries","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.runPlaybook":"Microsoft.SecurityInsights.Entities.runPlaybook","com.azure.resourcemanager.securityinsights.fluent.EntitiesClient.runPlaybookWithResponse":"Microsoft.SecurityInsights.Entities.runPlaybook","com.azure.resourcemanager.securityinsights.fluent.EntitiesGetTimelinesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.EntitiesGetTimelinesClient.list":"Microsoft.SecurityInsights.Entities.entitiesGetTimelineList","com.azure.resourcemanager.securityinsights.fluent.EntitiesGetTimelinesClient.listWithResponse":"Microsoft.SecurityInsights.Entities.entitiesGetTimelineList","com.azure.resourcemanager.securityinsights.fluent.EntitiesRelationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.EntitiesRelationsClient.list":"Microsoft.SecurityInsights.EntityRelations.list","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient":"Microsoft.SecurityInsights.EntityQueries","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient.createOrUpdate":"Microsoft.SecurityInsights.EntityQueries.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.EntityQueries.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient.delete":"Microsoft.SecurityInsights.EntityQueries.delete","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient.deleteWithResponse":"Microsoft.SecurityInsights.EntityQueries.delete","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient.get":"Microsoft.SecurityInsights.EntityQueries.get","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient.getWithResponse":"Microsoft.SecurityInsights.EntityQueries.get","com.azure.resourcemanager.securityinsights.fluent.EntityQueriesClient.list":"Microsoft.SecurityInsights.EntityQueries.list","com.azure.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient":"Microsoft.SecurityInsights.EntityQueryTemplates","com.azure.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient.get":"Microsoft.SecurityInsights.EntityQueryTemplates.get","com.azure.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient.getWithResponse":"Microsoft.SecurityInsights.EntityQueryTemplates.get","com.azure.resourcemanager.securityinsights.fluent.EntityQueryTemplatesClient.list":"Microsoft.SecurityInsights.EntityQueryTemplates.list","com.azure.resourcemanager.securityinsights.fluent.EntityRelationsClient":"Microsoft.SecurityInsights.EntityRelations","com.azure.resourcemanager.securityinsights.fluent.EntityRelationsClient.getRelation":"Microsoft.SecurityInsights.EntityRelations.getRelation","com.azure.resourcemanager.securityinsights.fluent.EntityRelationsClient.getRelationWithResponse":"Microsoft.SecurityInsights.EntityRelations.getRelation","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient":"Microsoft.SecurityInsights.FileImports","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient.beginDelete":"Microsoft.SecurityInsights.FileImports.delete","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient.create":"Microsoft.SecurityInsights.FileImports.create","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient.createWithResponse":"Microsoft.SecurityInsights.FileImports.create","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient.delete":"Microsoft.SecurityInsights.FileImports.delete","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient.get":"Microsoft.SecurityInsights.FileImports.get","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient.getWithResponse":"Microsoft.SecurityInsights.FileImports.get","com.azure.resourcemanager.securityinsights.fluent.FileImportsClient.list":"Microsoft.SecurityInsights.FileImports.list","com.azure.resourcemanager.securityinsights.fluent.GetRecommendationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.GetRecommendationsClient.list":"Microsoft.SecurityInsights.Recommendations.list","com.azure.resourcemanager.securityinsights.fluent.GetTriggeredAnalyticsRuleRunsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.GetTriggeredAnalyticsRuleRunsClient.list":"Microsoft.SecurityInsights.triggeredAnalyticsRuleRun.list","com.azure.resourcemanager.securityinsights.fluent.GetsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.GetsClient.singleRecommendation":"Microsoft.SecurityInsights.Recommendations.singleRecommendation","com.azure.resourcemanager.securityinsights.fluent.GetsClient.singleRecommendationWithResponse":"Microsoft.SecurityInsights.Recommendations.singleRecommendation","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient":"Microsoft.SecurityInsights.HuntComments","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient.createOrUpdate":"Microsoft.SecurityInsights.HuntComments.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.HuntComments.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient.delete":"Microsoft.SecurityInsights.HuntComments.delete","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient.deleteWithResponse":"Microsoft.SecurityInsights.HuntComments.delete","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient.get":"Microsoft.SecurityInsights.HuntComments.get","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient.getWithResponse":"Microsoft.SecurityInsights.HuntComments.get","com.azure.resourcemanager.securityinsights.fluent.HuntCommentsClient.list":"Microsoft.SecurityInsights.HuntComments.list","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient":"Microsoft.SecurityInsights.HuntRelations","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient.createOrUpdate":"Microsoft.SecurityInsights.HuntRelations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.HuntRelations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient.delete":"Microsoft.SecurityInsights.HuntRelations.delete","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient.deleteWithResponse":"Microsoft.SecurityInsights.HuntRelations.delete","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient.get":"Microsoft.SecurityInsights.HuntRelations.get","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient.getWithResponse":"Microsoft.SecurityInsights.HuntRelations.get","com.azure.resourcemanager.securityinsights.fluent.HuntRelationsClient.list":"Microsoft.SecurityInsights.HuntRelations.list","com.azure.resourcemanager.securityinsights.fluent.HuntsClient":"Microsoft.SecurityInsights.Hunts","com.azure.resourcemanager.securityinsights.fluent.HuntsClient.createOrUpdate":"Microsoft.SecurityInsights.Hunts.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.HuntsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.Hunts.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.HuntsClient.delete":"Microsoft.SecurityInsights.Hunts.delete","com.azure.resourcemanager.securityinsights.fluent.HuntsClient.deleteWithResponse":"Microsoft.SecurityInsights.Hunts.delete","com.azure.resourcemanager.securityinsights.fluent.HuntsClient.get":"Microsoft.SecurityInsights.Hunts.get","com.azure.resourcemanager.securityinsights.fluent.HuntsClient.getWithResponse":"Microsoft.SecurityInsights.Hunts.get","com.azure.resourcemanager.securityinsights.fluent.HuntsClient.list":"Microsoft.SecurityInsights.Hunts.list","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient":"Microsoft.SecurityInsights.IncidentComments","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient.createOrUpdate":"Microsoft.SecurityInsights.IncidentComments.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.IncidentComments.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient.delete":"Microsoft.SecurityInsights.IncidentComments.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient.deleteWithResponse":"Microsoft.SecurityInsights.IncidentComments.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient.get":"Microsoft.SecurityInsights.IncidentComments.get","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient.getWithResponse":"Microsoft.SecurityInsights.IncidentComments.get","com.azure.resourcemanager.securityinsights.fluent.IncidentCommentsClient.list":"Microsoft.SecurityInsights.IncidentComments.list","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient.createOrUpdate":"Microsoft.SecurityInsights.Relations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.Relations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient.delete":"Microsoft.SecurityInsights.Relations.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient.deleteWithResponse":"Microsoft.SecurityInsights.Relations.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient.get":"Microsoft.SecurityInsights.Relations.get","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient.getWithResponse":"Microsoft.SecurityInsights.Relations.get","com.azure.resourcemanager.securityinsights.fluent.IncidentRelationsClient.list":"Microsoft.SecurityInsights.Relations.list","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient":"Microsoft.SecurityInsights.IncidentTasks","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient.createOrUpdate":"Microsoft.SecurityInsights.IncidentTasks.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.IncidentTasks.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient.delete":"Microsoft.SecurityInsights.IncidentTasks.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient.deleteWithResponse":"Microsoft.SecurityInsights.IncidentTasks.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient.get":"Microsoft.SecurityInsights.IncidentTasks.get","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient.getWithResponse":"Microsoft.SecurityInsights.IncidentTasks.get","com.azure.resourcemanager.securityinsights.fluent.IncidentTasksClient.list":"Microsoft.SecurityInsights.IncidentTasks.list","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient":"Microsoft.SecurityInsights.Incidents","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.createOrUpdate":"Microsoft.SecurityInsights.Incidents.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.Incidents.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.delete":"Microsoft.SecurityInsights.Incidents.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.deleteWithResponse":"Microsoft.SecurityInsights.Incidents.delete","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.get":"Microsoft.SecurityInsights.Incidents.get","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.getWithResponse":"Microsoft.SecurityInsights.Incidents.get","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.list":"Microsoft.SecurityInsights.Incidents.list","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.listAlerts":"Microsoft.SecurityInsights.Incidents.listAlerts","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.listAlertsWithResponse":"Microsoft.SecurityInsights.Incidents.listAlerts","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.listBookmarks":"Microsoft.SecurityInsights.Incidents.listBookmarks","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.listBookmarksWithResponse":"Microsoft.SecurityInsights.Incidents.listBookmarks","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.listEntities":"Microsoft.SecurityInsights.Incidents.listEntities","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.listEntitiesWithResponse":"Microsoft.SecurityInsights.Incidents.listEntities","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.runPlaybook":"Microsoft.SecurityInsights.Incidents.runPlaybook","com.azure.resourcemanager.securityinsights.fluent.IncidentsClient.runPlaybookWithResponse":"Microsoft.SecurityInsights.Incidents.runPlaybook","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.create":"Microsoft.SecurityInsights.MetadataModels.create","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.createWithResponse":"Microsoft.SecurityInsights.MetadataModels.create","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.delete":"Microsoft.SecurityInsights.MetadataModels.delete","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.deleteWithResponse":"Microsoft.SecurityInsights.MetadataModels.delete","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.get":"Microsoft.SecurityInsights.MetadataModels.get","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.getWithResponse":"Microsoft.SecurityInsights.MetadataModels.get","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.list":"Microsoft.SecurityInsights.MetadataModels.list","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.update":"Microsoft.SecurityInsights.MetadataModels.update","com.azure.resourcemanager.securityinsights.fluent.MetadatasClient.updateWithResponse":"Microsoft.SecurityInsights.MetadataModels.update","com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient":"Microsoft.SecurityInsights.OfficeConsents","com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient.delete":"Microsoft.SecurityInsights.OfficeConsents.delete","com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient.deleteWithResponse":"Microsoft.SecurityInsights.OfficeConsents.delete","com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient.get":"Microsoft.SecurityInsights.OfficeConsents.get","com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient.getWithResponse":"Microsoft.SecurityInsights.OfficeConsents.get","com.azure.resourcemanager.securityinsights.fluent.OfficeConsentsClient.list":"Microsoft.SecurityInsights.OfficeConsents.list","com.azure.resourcemanager.securityinsights.fluent.OperationsClient":"Microsoft.SecurityInsights.Operations","com.azure.resourcemanager.securityinsights.fluent.OperationsClient.list":"Azure.ResourceManager.Legacy.Operations.list","com.azure.resourcemanager.securityinsights.fluent.ProductPackagesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ProductPackagesClient.get":"Microsoft.SecurityInsights.ProductPackageModels.get","com.azure.resourcemanager.securityinsights.fluent.ProductPackagesClient.getWithResponse":"Microsoft.SecurityInsights.ProductPackageModels.get","com.azure.resourcemanager.securityinsights.fluent.ProductPackagesOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ProductPackagesOperationsClient.list":"Microsoft.SecurityInsights.ProductPackageModels.list","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient":"Microsoft.SecurityInsights.ProductSettings","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient.delete":"Microsoft.SecurityInsights.ProductSettings.delete","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient.deleteWithResponse":"Microsoft.SecurityInsights.ProductSettings.delete","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient.get":"Microsoft.SecurityInsights.ProductSettings.get","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient.getWithResponse":"Microsoft.SecurityInsights.ProductSettings.get","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient.list":"Microsoft.SecurityInsights.ProductSettings.list","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient.update":"Microsoft.SecurityInsights.ProductSettings.update","com.azure.resourcemanager.securityinsights.fluent.ProductSettingsClient.updateWithResponse":"Microsoft.SecurityInsights.ProductSettings.update","com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesClient.get":"Microsoft.SecurityInsights.ProductTemplateModels.get","com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesClient.getWithResponse":"Microsoft.SecurityInsights.ProductTemplateModels.get","com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ProductTemplatesOperationsClient.list":"Microsoft.SecurityInsights.ProductTemplateModels.list","com.azure.resourcemanager.securityinsights.fluent.ReevaluatesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ReevaluatesClient.recommendation":"Microsoft.SecurityInsights.Recommendations.reevaluateRecommendation","com.azure.resourcemanager.securityinsights.fluent.ReevaluatesClient.recommendationWithResponse":"Microsoft.SecurityInsights.Recommendations.reevaluateRecommendation","com.azure.resourcemanager.securityinsights.fluent.ResourceProvidersClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ResourceProvidersClient.listGeodataByIp":"Microsoft.SecurityInsights.listGeodataByIp","com.azure.resourcemanager.securityinsights.fluent.ResourceProvidersClient.listGeodataByIpWithResponse":"Microsoft.SecurityInsights.listGeodataByIp","com.azure.resourcemanager.securityinsights.fluent.ResourceProvidersClient.listWhoisByDomain":"Microsoft.SecurityInsights.listWhoisByDomain","com.azure.resourcemanager.securityinsights.fluent.ResourceProvidersClient.listWhoisByDomainWithResponse":"Microsoft.SecurityInsights.listWhoisByDomain","com.azure.resourcemanager.securityinsights.fluent.SecurityInsightsManagementClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient.createOrUpdate":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient.delete":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings.delete","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient.deleteWithResponse":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings.delete","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient.get":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings.get","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient.getWithResponse":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings.get","com.azure.resourcemanager.securityinsights.fluent.SecurityMLAnalyticsSettingsClient.list":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettings.list","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient":"Microsoft.SecurityInsights.SentinelOnboardingStates","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.create":"Microsoft.SecurityInsights.SentinelOnboardingStates.create","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.createWithResponse":"Microsoft.SecurityInsights.SentinelOnboardingStates.create","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.delete":"Microsoft.SecurityInsights.SentinelOnboardingStates.delete","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.deleteWithResponse":"Microsoft.SecurityInsights.SentinelOnboardingStates.delete","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.get":"Microsoft.SecurityInsights.SentinelOnboardingStates.get","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.getWithResponse":"Microsoft.SecurityInsights.SentinelOnboardingStates.get","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.list":"Microsoft.SecurityInsights.SentinelOnboardingStates.list","com.azure.resourcemanager.securityinsights.fluent.SentinelOnboardingStatesClient.listWithResponse":"Microsoft.SecurityInsights.SentinelOnboardingStates.list","com.azure.resourcemanager.securityinsights.fluent.SourceControlOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.SourceControlOperationsClient.listRepositories":"Microsoft.SecurityInsights.SourceControlOperationGroup.listRepositories","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient":"Microsoft.SecurityInsights.SourceControls","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient.create":"Microsoft.SecurityInsights.SourceControls.create","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient.createWithResponse":"Microsoft.SecurityInsights.SourceControls.create","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient.delete":"Microsoft.SecurityInsights.SourceControls.delete","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient.deleteWithResponse":"Microsoft.SecurityInsights.SourceControls.delete","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient.get":"Microsoft.SecurityInsights.SourceControls.get","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient.getWithResponse":"Microsoft.SecurityInsights.SourceControls.get","com.azure.resourcemanager.securityinsights.fluent.SourceControlsClient.list":"Microsoft.SecurityInsights.SourceControls.list","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorMetricsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorMetricsClient.list":"Microsoft.SecurityInsights.ThreatIntelligenceIndicatorMetricsOperationGroup.list","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorMetricsClient.listWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceIndicatorMetricsOperationGroup.list","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.appendTags":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.appendTags","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.appendTagsWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.appendTags","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.create":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.create","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.createIndicator":"Microsoft.SecurityInsights.ThreatIntelligenceIndicatorOperationGroup.createIndicator","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.createIndicatorWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceIndicatorOperationGroup.createIndicator","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.createWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.create","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.delete":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.delete","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.deleteWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.delete","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.get":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.get","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.getWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.get","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.queryIndicators":"Microsoft.SecurityInsights.ThreatIntelligenceIndicatorOperationGroup.queryIndicators","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.replaceTags":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.replaceTags","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsClient.replaceTagsWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.replaceTags","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsOperationsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligenceIndicatorsOperationsClient.list":"Microsoft.SecurityInsights.ThreatIntelligenceInformationOperations.list","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligencesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligencesClient.count":"Microsoft.SecurityInsights.ThreatIntelligenceOperationGroup.count","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligencesClient.countWithResponse":"Microsoft.SecurityInsights.ThreatIntelligenceOperationGroup.count","com.azure.resourcemanager.securityinsights.fluent.ThreatIntelligencesClient.query":"Microsoft.SecurityInsights.ThreatIntelligenceOperationGroup.query","com.azure.resourcemanager.securityinsights.fluent.TriggeredAnalyticsRuleRunOperationsClient":"Microsoft.SecurityInsights.triggeredAnalyticsRuleRun","com.azure.resourcemanager.securityinsights.fluent.TriggeredAnalyticsRuleRunOperationsClient.get":"Microsoft.SecurityInsights.triggeredAnalyticsRuleRun.get","com.azure.resourcemanager.securityinsights.fluent.TriggeredAnalyticsRuleRunOperationsClient.getWithResponse":"Microsoft.SecurityInsights.triggeredAnalyticsRuleRun.get","com.azure.resourcemanager.securityinsights.fluent.UpdatesClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.UpdatesClient.recommendation":"Microsoft.SecurityInsights.Recommendations.recommendation","com.azure.resourcemanager.securityinsights.fluent.UpdatesClient.recommendationWithResponse":"Microsoft.SecurityInsights.Recommendations.recommendation","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient":"Microsoft.SecurityInsights.WatchlistItems","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient.createOrUpdate":"Microsoft.SecurityInsights.WatchlistItems.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.WatchlistItems.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient.delete":"Microsoft.SecurityInsights.WatchlistItems.delete","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient.deleteWithResponse":"Microsoft.SecurityInsights.WatchlistItems.delete","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient.get":"Microsoft.SecurityInsights.WatchlistItems.get","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient.getWithResponse":"Microsoft.SecurityInsights.WatchlistItems.get","com.azure.resourcemanager.securityinsights.fluent.WatchlistItemsClient.list":"Microsoft.SecurityInsights.WatchlistItems.list","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient":"Microsoft.SecurityInsights.Watchlists","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient.beginCreateOrUpdate":"Microsoft.SecurityInsights.Watchlists.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient.beginDelete":"Microsoft.SecurityInsights.Watchlists.delete","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient.createOrUpdate":"Microsoft.SecurityInsights.Watchlists.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient.delete":"Microsoft.SecurityInsights.Watchlists.delete","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient.get":"Microsoft.SecurityInsights.Watchlists.get","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient.getWithResponse":"Microsoft.SecurityInsights.Watchlists.get","com.azure.resourcemanager.securityinsights.fluent.WatchlistsClient.list":"Microsoft.SecurityInsights.Watchlists.list","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient.create":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.create","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient.createWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.create","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient.delete":"Microsoft.SecurityInsights.Jobs.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient.deleteWithResponse":"Microsoft.SecurityInsights.Jobs.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient.get":"Microsoft.SecurityInsights.Jobs.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient.getWithResponse":"Microsoft.SecurityInsights.Jobs.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentJobsClient.list":"Microsoft.SecurityInsights.Jobs.list","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient":"Microsoft.SecurityInsights.WorkspaceManagerAssignments","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient.createOrUpdate":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient.delete":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient.deleteWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient.get":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient.getWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerAssignmentsClient.list":"Microsoft.SecurityInsights.WorkspaceManagerAssignments.list","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient.createOrUpdate":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient.delete":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient.deleteWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient.get":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient.getWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerConfigurationsClient.list":"Microsoft.SecurityInsights.WorkspaceManagerConfigurations.list","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient":"Microsoft.SecurityInsights.WorkspaceManagerGroups","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient.createOrUpdate":"Microsoft.SecurityInsights.WorkspaceManagerGroups.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerGroups.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient.delete":"Microsoft.SecurityInsights.WorkspaceManagerGroups.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient.deleteWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerGroups.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient.get":"Microsoft.SecurityInsights.WorkspaceManagerGroups.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient.getWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerGroups.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerGroupsClient.list":"Microsoft.SecurityInsights.WorkspaceManagerGroups.list","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient":"Microsoft.SecurityInsights.WorkspaceManagerMembers","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient.createOrUpdate":"Microsoft.SecurityInsights.WorkspaceManagerMembers.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient.createOrUpdateWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerMembers.createOrUpdate","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient.delete":"Microsoft.SecurityInsights.WorkspaceManagerMembers.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient.deleteWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerMembers.delete","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient.get":"Microsoft.SecurityInsights.WorkspaceManagerMembers.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient.getWithResponse":"Microsoft.SecurityInsights.WorkspaceManagerMembers.get","com.azure.resourcemanager.securityinsights.fluent.WorkspaceManagerMembersClient.list":"Microsoft.SecurityInsights.WorkspaceManagerMembers.list","com.azure.resourcemanager.securityinsights.fluent.models.AADCheckRequirementsProperties":"Microsoft.SecurityInsights.AADCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.AADDataConnectorProperties":"Microsoft.SecurityInsights.AADDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.AATPCheckRequirementsProperties":"Microsoft.SecurityInsights.AatpCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.AATPDataConnectorProperties":"Microsoft.SecurityInsights.AATPDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.ASCCheckRequirementsProperties":"Microsoft.SecurityInsights.ASCCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.ASCDataConnectorProperties":"Microsoft.SecurityInsights.ASCDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.AccountEntityProperties":"Microsoft.SecurityInsights.AccountEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.ActionRequestProperties":"Microsoft.SecurityInsights.ActionRequestProperties","com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner":"Microsoft.SecurityInsights.ActionResponse","com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseProperties":"Microsoft.SecurityInsights.ActionResponseProperties","com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties":"Microsoft.SecurityInsights.ActivityEntityQueriesProperties","com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueryTemplateProperties":"Microsoft.SecurityInsights.ActivityEntityQueryTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner":"Microsoft.SecurityInsights.AlertRule","com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner":"Microsoft.SecurityInsights.AlertRuleTemplate","com.azure.resourcemanager.securityinsights.fluent.models.AnalyticsRuleRunTriggerProperties":"Microsoft.SecurityInsights.AnalyticsRuleRunTriggerProperties","com.azure.resourcemanager.securityinsights.fluent.models.AnomaliesSettingsProperties":"Microsoft.SecurityInsights.AnomaliesSettingsProperties","com.azure.resourcemanager.securityinsights.fluent.models.AnomalySecurityMLAnalyticsSettingsProperties":"Microsoft.SecurityInsights.AnomalySecurityMLAnalyticsSettingsProperties","com.azure.resourcemanager.securityinsights.fluent.models.ApiPollingParameters":"Microsoft.SecurityInsights.ApiPollingParameters","com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner":"Microsoft.SecurityInsights.AutomationRule","com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleProperties":"Microsoft.SecurityInsights.AutomationRuleProperties","com.azure.resourcemanager.securityinsights.fluent.models.AwsCloudTrailDataConnectorProperties":"Microsoft.SecurityInsights.AwsCloudTrailDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.AwsS3DataConnectorProperties":"Microsoft.SecurityInsights.AwsS3DataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.AzureResourceEntityProperties":"Microsoft.SecurityInsights.AzureResourceEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner":"Microsoft.SecurityInsights.BillingStatistic","com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner":"Microsoft.SecurityInsights.BookmarkExpandResponse","com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner":"Microsoft.SecurityInsights.Bookmark","com.azure.resourcemanager.securityinsights.fluent.models.BookmarkProperties":"Microsoft.SecurityInsights.BookmarkProperties","com.azure.resourcemanager.securityinsights.fluent.models.CloudApplicationEntityProperties":"Microsoft.SecurityInsights.CloudApplicationEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.CodelessParameters":"Microsoft.SecurityInsights.CodelessParameters","com.azure.resourcemanager.securityinsights.fluent.models.CustomizableConnectorDefinitionProperties":"Microsoft.SecurityInsights.CustomizableConnectorDefinitionProperties","com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner":"Microsoft.SecurityInsights.DataConnectorDefinition","com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner":"Microsoft.SecurityInsights.DataConnector","com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorRequirementsStateInner":"Microsoft.SecurityInsights.DataConnectorRequirementsState","com.azure.resourcemanager.securityinsights.fluent.models.DnsEntityProperties":"Microsoft.SecurityInsights.DnsEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365CheckRequirementsProperties":"Microsoft.SecurityInsights.Dynamics365CheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365DataConnectorProperties":"Microsoft.SecurityInsights.Dynamics365DataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner":"Microsoft.SecurityInsights.EnrichmentDomainWhois","com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentIpGeodataInner":"Microsoft.SecurityInsights.EnrichmentIpGeodata","com.azure.resourcemanager.securityinsights.fluent.models.EntityAnalyticsProperties":"Microsoft.SecurityInsights.EntityAnalyticsProperties","com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner":"Microsoft.SecurityInsights.EntityExpandResponse","com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner":"Microsoft.SecurityInsights.EntityGetInsightsResponse","com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner":"Microsoft.SecurityInsights.EntityQuery","com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryItemInner":"Microsoft.SecurityInsights.EntityQueryItem","com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner":"Microsoft.SecurityInsights.EntityQueryTemplate","com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner":"Microsoft.SecurityInsights.EntityTimelineResponse","com.azure.resourcemanager.securityinsights.fluent.models.ExpansionEntityQueriesProperties":"Microsoft.SecurityInsights.ExpansionEntityQueriesProperties","com.azure.resourcemanager.securityinsights.fluent.models.EyesOnSettingsProperties":"Microsoft.SecurityInsights.EyesOnSettingsProperties","com.azure.resourcemanager.securityinsights.fluent.models.FileEntityProperties":"Microsoft.SecurityInsights.FileEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.FileHashEntityProperties":"Microsoft.SecurityInsights.FileHashEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner":"Microsoft.SecurityInsights.FileImport","com.azure.resourcemanager.securityinsights.fluent.models.FileImportProperties":"Microsoft.SecurityInsights.FileImportProperties","com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleProperties":"Microsoft.SecurityInsights.FusionAlertRuleProperties","com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleTemplateProperties":"Microsoft.SecurityInsights.FusionAlertRuleTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.GCPDataConnectorProperties":"Microsoft.SecurityInsights.GCPDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.HostEntityProperties":"Microsoft.SecurityInsights.HostEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner":"Microsoft.SecurityInsights.HuntComment","com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentProperties":"Microsoft.SecurityInsights.HuntCommentProperties","com.azure.resourcemanager.securityinsights.fluent.models.HuntInner":"Microsoft.SecurityInsights.Hunt","com.azure.resourcemanager.securityinsights.fluent.models.HuntProperties":"Microsoft.SecurityInsights.HuntProperties","com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner":"Microsoft.SecurityInsights.HuntRelation","com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationProperties":"Microsoft.SecurityInsights.HuntRelationProperties","com.azure.resourcemanager.securityinsights.fluent.models.HuntingBookmarkProperties":"Microsoft.SecurityInsights.HuntingBookmarkProperties","com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner":"Microsoft.SecurityInsights.IncidentAlertList","com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner":"Microsoft.SecurityInsights.IncidentBookmarkList","com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner":"Microsoft.SecurityInsights.IncidentComment","com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentProperties":"Microsoft.SecurityInsights.IncidentCommentProperties","com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner":"Microsoft.SecurityInsights.IncidentEntitiesResponse","com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner":"Microsoft.SecurityInsights.Incident","com.azure.resourcemanager.securityinsights.fluent.models.IncidentProperties":"Microsoft.SecurityInsights.IncidentProperties","com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner":"Microsoft.SecurityInsights.IncidentTask","com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskProperties":"Microsoft.SecurityInsights.IncidentTaskProperties","com.azure.resourcemanager.securityinsights.fluent.models.IoTCheckRequirementsProperties":"Microsoft.SecurityInsights.IoTCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.IoTDataConnectorProperties":"Microsoft.SecurityInsights.IoTDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.IoTDeviceEntityProperties":"Microsoft.SecurityInsights.IoTDeviceEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.IpEntityProperties":"Microsoft.SecurityInsights.IpEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.JobInner":"Microsoft.SecurityInsights.Job","com.azure.resourcemanager.securityinsights.fluent.models.JobProperties":"Microsoft.SecurityInsights.JobProperties","com.azure.resourcemanager.securityinsights.fluent.models.MCASCheckRequirementsProperties":"Microsoft.SecurityInsights.McasCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.MCASDataConnectorProperties":"Microsoft.SecurityInsights.MCASDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.MDATPCheckRequirementsProperties":"Microsoft.SecurityInsights.MdatpCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.MDATPDataConnectorProperties":"Microsoft.SecurityInsights.MDATPDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleProperties":"Microsoft.SecurityInsights.MLBehaviorAnalyticsAlertRuleProperties","com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleTemplateProperties":"Microsoft.SecurityInsights.MLBehaviorAnalyticsAlertRuleTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.MSTICheckRequirementsProperties":"Microsoft.SecurityInsights.MstiCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.MSTIDataConnectorProperties":"Microsoft.SecurityInsights.MstiDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.MTPCheckRequirementsProperties":"Microsoft.SecurityInsights.MTPCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.MTPDataConnectorProperties":"Microsoft.SecurityInsights.MTPDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.MailClusterEntityProperties":"Microsoft.SecurityInsights.MailClusterEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.MailMessageEntityProperties":"Microsoft.SecurityInsights.MailMessageEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.MailboxEntityProperties":"Microsoft.SecurityInsights.MailboxEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.MalwareEntityProperties":"Microsoft.SecurityInsights.MalwareEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.MetadataModelInner":"Microsoft.SecurityInsights.MetadataModel","com.azure.resourcemanager.securityinsights.fluent.models.MetadataProperties":"Microsoft.SecurityInsights.MetadataProperties","com.azure.resourcemanager.securityinsights.fluent.models.MetadataPropertiesPatch":"Microsoft.SecurityInsights.MetadataPropertiesPatch","com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionCheckRequirementsProperties":"Microsoft.SecurityInsights.MicrosoftPurviewInformationProtectionCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionDataConnectorProperties":"Microsoft.SecurityInsights.MicrosoftPurviewInformationProtectionDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleProperties":"Microsoft.SecurityInsights.MicrosoftSecurityIncidentCreationAlertRuleProperties","com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties":"Microsoft.SecurityInsights.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.NicEntityProperties":"Microsoft.SecurityInsights.NicEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleProperties":"Microsoft.SecurityInsights.NrtAlertRuleProperties","com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleTemplateProperties":"Microsoft.SecurityInsights.NrtAlertRuleTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectCheckRequirementsProperties":"Microsoft.SecurityInsights.Office365ProjectCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectDataConnectorProperties":"Microsoft.SecurityInsights.Office365ProjectDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficeATPCheckRequirementsProperties":"Microsoft.SecurityInsights.OfficeATPCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficeATPDataConnectorProperties":"Microsoft.SecurityInsights.OfficeATPDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner":"Microsoft.SecurityInsights.OfficeConsent","com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentProperties":"Microsoft.SecurityInsights.OfficeConsentProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficeDataConnectorProperties":"Microsoft.SecurityInsights.OfficeDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficeIRMCheckRequirementsProperties":"Microsoft.SecurityInsights.OfficeIRMCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficeIRMDataConnectorProperties":"Microsoft.SecurityInsights.OfficeIRMDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBICheckRequirementsProperties":"Microsoft.SecurityInsights.OfficePowerBICheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBIDataConnectorProperties":"Microsoft.SecurityInsights.OfficePowerBIDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.OperationInner":"Microsoft.SecurityInsights.Operation","com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner":"Microsoft.SecurityInsights.PackageModel","com.azure.resourcemanager.securityinsights.fluent.models.PackageProperties":"Microsoft.SecurityInsights.PackageProperties","com.azure.resourcemanager.securityinsights.fluent.models.PremiumMdtiDataConnectorProperties":"Microsoft.SecurityInsights.PremiumMdtiDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.ProcessEntityProperties":"Microsoft.SecurityInsights.ProcessEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner":"Microsoft.SecurityInsights.ProductPackageModel","com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageProperties":"Microsoft.SecurityInsights.ProductPackageProperties","com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner":"Microsoft.SecurityInsights.ProductTemplateModel","com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateProperties":"Microsoft.SecurityInsights.ProductTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.PurviewAuditCheckRequirementsProperties":"Microsoft.SecurityInsights.PurviewAuditCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.PurviewAuditDataConnectorProperties":"Microsoft.SecurityInsights.PurviewAuditDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.QueryProperties":"Microsoft.SecurityInsights.QueryProperties","com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner":"Microsoft.SecurityInsights.Recommendation","com.azure.resourcemanager.securityinsights.fluent.models.RecommendationProperties":"Microsoft.SecurityInsights.RecommendationProperties","com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner":"Microsoft.SecurityInsights.ReevaluateResponse","com.azure.resourcemanager.securityinsights.fluent.models.RegistryKeyEntityProperties":"Microsoft.SecurityInsights.RegistryKeyEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.RegistryValueEntityProperties":"Microsoft.SecurityInsights.RegistryValueEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.RelationInner":"Microsoft.SecurityInsights.Relation","com.azure.resourcemanager.securityinsights.fluent.models.RelationProperties":"Microsoft.SecurityInsights.RelationProperties","com.azure.resourcemanager.securityinsights.fluent.models.RepoInner":"Microsoft.SecurityInsights.Repo","com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccess":"Microsoft.SecurityInsights.RepositoryAccess","com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccessObject":"Microsoft.SecurityInsights.RepositoryAccessObject","com.azure.resourcemanager.securityinsights.fluent.models.RestApiPollerDataConnectorProperties":"Microsoft.SecurityInsights.RestApiPollerDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.SapSolutionUsageStatisticProperties":"Microsoft.SecurityInsights.SapSolutionUsageStatisticProperties","com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleProperties":"Microsoft.SecurityInsights.ScheduledAlertRuleProperties","com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleTemplateProperties":"Microsoft.SecurityInsights.ScheduledAlertRuleTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.SecurityAlertProperties":"Microsoft.SecurityInsights.SecurityAlertProperties","com.azure.resourcemanager.securityinsights.fluent.models.SecurityGroupEntityProperties":"Microsoft.SecurityInsights.SecurityGroupEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner":"Microsoft.SecurityInsights.SecurityMLAnalyticsSetting","com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateInner":"Microsoft.SecurityInsights.SentinelOnboardingState","com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStateProperties":"Microsoft.SecurityInsights.SentinelOnboardingStateProperties","com.azure.resourcemanager.securityinsights.fluent.models.SentinelOnboardingStatesListInner":"Microsoft.SecurityInsights.SentinelOnboardingStatesList","com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner":"Microsoft.SecurityInsights.Settings","com.azure.resourcemanager.securityinsights.fluent.models.SourceControlInner":"Microsoft.SecurityInsights.SourceControl","com.azure.resourcemanager.securityinsights.fluent.models.SourceControlProperties":"Microsoft.SecurityInsights.SourceControlProperties","com.azure.resourcemanager.securityinsights.fluent.models.SubmissionMailEntityProperties":"Microsoft.SecurityInsights.SubmissionMailEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.TICheckRequirementsProperties":"Microsoft.SecurityInsights.TICheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.TIDataConnectorProperties":"Microsoft.SecurityInsights.TIDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties":"Microsoft.SecurityInsights.TIObjectCommonProperties","com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner":"Microsoft.SecurityInsights.TIObject","com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner":"Microsoft.SecurityInsights.TemplateModel","com.azure.resourcemanager.securityinsights.fluent.models.TemplateProperties":"Microsoft.SecurityInsights.TemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleProperties":"Microsoft.SecurityInsights.ThreatIntelligenceAlertRuleProperties","com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleTemplateProperties":"Microsoft.SecurityInsights.ThreatIntelligenceAlertRuleTemplateProperties","com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner":"Microsoft.SecurityInsights.ThreatIntelligenceCount","com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceIndicatorProperties":"Microsoft.SecurityInsights.ThreatIntelligenceIndicatorProperties","com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner":"Microsoft.SecurityInsights.ThreatIntelligenceInformation","com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner":"Microsoft.SecurityInsights.ThreatIntelligenceMetricsList","com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiCheckRequirementsProperties":"Microsoft.SecurityInsights.TiTaxiiCheckRequirementsProperties","com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiDataConnectorProperties":"Microsoft.SecurityInsights.TiTaxiiDataConnectorProperties","com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner":"Microsoft.SecurityInsights.TriggeredAnalyticsRuleRun","com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunProperties":"Microsoft.SecurityInsights.TriggeredAnalyticsRuleRunProperties","com.azure.resourcemanager.securityinsights.fluent.models.UebaProperties":"Microsoft.SecurityInsights.UebaProperties","com.azure.resourcemanager.securityinsights.fluent.models.UrlEntityProperties":"Microsoft.SecurityInsights.UrlEntityProperties","com.azure.resourcemanager.securityinsights.fluent.models.WarningInner":"Microsoft.SecurityInsights.Warning","com.azure.resourcemanager.securityinsights.fluent.models.WatchlistInner":"Microsoft.SecurityInsights.Watchlist","com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemInner":"Microsoft.SecurityInsights.WatchlistItem","com.azure.resourcemanager.securityinsights.fluent.models.WatchlistItemProperties":"Microsoft.SecurityInsights.WatchlistItemProperties","com.azure.resourcemanager.securityinsights.fluent.models.WatchlistProperties":"Microsoft.SecurityInsights.WatchlistProperties","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner":"Microsoft.SecurityInsights.WorkspaceManagerAssignment","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentProperties":"Microsoft.SecurityInsights.WorkspaceManagerAssignmentProperties","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner":"Microsoft.SecurityInsights.WorkspaceManagerConfiguration","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationProperties":"Microsoft.SecurityInsights.WorkspaceManagerConfigurationProperties","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner":"Microsoft.SecurityInsights.WorkspaceManagerGroup","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupProperties":"Microsoft.SecurityInsights.WorkspaceManagerGroupProperties","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner":"Microsoft.SecurityInsights.WorkspaceManagerMember","com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberProperties":"Microsoft.SecurityInsights.WorkspaceManagerMemberProperties","com.azure.resourcemanager.securityinsights.implementation.SecurityInsightsManagementClientBuilder":"Microsoft.SecurityInsights","com.azure.resourcemanager.securityinsights.implementation.models.ActionsList":"Microsoft.SecurityInsights.ActionsList","com.azure.resourcemanager.securityinsights.implementation.models.AlertRuleTemplatesList":"Microsoft.SecurityInsights.AlertRuleTemplatesList","com.azure.resourcemanager.securityinsights.implementation.models.AlertRulesList":"Microsoft.SecurityInsights.AlertRulesList","com.azure.resourcemanager.securityinsights.implementation.models.AutomationRulesList":"Microsoft.SecurityInsights.AutomationRulesList","com.azure.resourcemanager.securityinsights.implementation.models.BillingStatisticList":"Microsoft.SecurityInsights.BillingStatisticList","com.azure.resourcemanager.securityinsights.implementation.models.BookmarkList":"Microsoft.SecurityInsights.BookmarkList","com.azure.resourcemanager.securityinsights.implementation.models.DataConnectorDefinitionArmCollectionWrapper":"Microsoft.SecurityInsights.DataConnectorDefinitionArmCollectionWrapper","com.azure.resourcemanager.securityinsights.implementation.models.DataConnectorList":"Microsoft.SecurityInsights.DataConnectorList","com.azure.resourcemanager.securityinsights.implementation.models.EntityList":"Microsoft.SecurityInsights.EntityList","com.azure.resourcemanager.securityinsights.implementation.models.EntityQueryList":"Microsoft.SecurityInsights.EntityQueryList","com.azure.resourcemanager.securityinsights.implementation.models.EntityQueryTemplateList":"Microsoft.SecurityInsights.EntityQueryTemplateList","com.azure.resourcemanager.securityinsights.implementation.models.FileImportList":"Microsoft.SecurityInsights.FileImportList","com.azure.resourcemanager.securityinsights.implementation.models.GetQueriesResponse":"Microsoft.SecurityInsights.GetQueriesResponse","com.azure.resourcemanager.securityinsights.implementation.models.HuntCommentList":"Microsoft.SecurityInsights.HuntCommentList","com.azure.resourcemanager.securityinsights.implementation.models.HuntList":"Microsoft.SecurityInsights.HuntList","com.azure.resourcemanager.securityinsights.implementation.models.HuntRelationList":"Microsoft.SecurityInsights.HuntRelationList","com.azure.resourcemanager.securityinsights.implementation.models.IncidentCommentList":"Microsoft.SecurityInsights.IncidentCommentList","com.azure.resourcemanager.securityinsights.implementation.models.IncidentList":"Microsoft.SecurityInsights.IncidentList","com.azure.resourcemanager.securityinsights.implementation.models.IncidentTaskList":"Microsoft.SecurityInsights.IncidentTaskList","com.azure.resourcemanager.securityinsights.implementation.models.JobList":"Microsoft.SecurityInsights.JobList","com.azure.resourcemanager.securityinsights.implementation.models.MetadataList":"Microsoft.SecurityInsights.MetadataList","com.azure.resourcemanager.securityinsights.implementation.models.OfficeConsentList":"Microsoft.SecurityInsights.OfficeConsentList","com.azure.resourcemanager.securityinsights.implementation.models.OperationsList":"Microsoft.SecurityInsights.OperationsList","com.azure.resourcemanager.securityinsights.implementation.models.PackageList":"Microsoft.SecurityInsights.PackageList","com.azure.resourcemanager.securityinsights.implementation.models.ProductPackageList":"Microsoft.SecurityInsights.ProductPackageList","com.azure.resourcemanager.securityinsights.implementation.models.ProductTemplateList":"Microsoft.SecurityInsights.ProductTemplateList","com.azure.resourcemanager.securityinsights.implementation.models.RecommendationList":"Microsoft.SecurityInsights.RecommendationList","com.azure.resourcemanager.securityinsights.implementation.models.RelationList":"Microsoft.SecurityInsights.RelationList","com.azure.resourcemanager.securityinsights.implementation.models.RepoList":"Microsoft.SecurityInsights.RepoList","com.azure.resourcemanager.securityinsights.implementation.models.SecurityMLAnalyticsSettingsList":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettingsList","com.azure.resourcemanager.securityinsights.implementation.models.SettingList":"Microsoft.SecurityInsights.SettingList","com.azure.resourcemanager.securityinsights.implementation.models.SourceControlList":"Microsoft.SecurityInsights.SourceControlList","com.azure.resourcemanager.securityinsights.implementation.models.TemplateList":"Microsoft.SecurityInsights.TemplateList","com.azure.resourcemanager.securityinsights.implementation.models.ThreatIntelligenceInformationList":"Microsoft.SecurityInsights.ThreatIntelligenceInformationList","com.azure.resourcemanager.securityinsights.implementation.models.ThreatIntelligenceList":"Microsoft.SecurityInsights.ThreatIntelligenceList","com.azure.resourcemanager.securityinsights.implementation.models.TriggeredAnalyticsRuleRuns":"Microsoft.SecurityInsights.TriggeredAnalyticsRuleRuns","com.azure.resourcemanager.securityinsights.implementation.models.WatchlistItemList":"Microsoft.SecurityInsights.WatchlistItemList","com.azure.resourcemanager.securityinsights.implementation.models.WatchlistList":"Microsoft.SecurityInsights.WatchlistList","com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerAssignmentList":"Microsoft.SecurityInsights.WorkspaceManagerAssignmentList","com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerConfigurationList":"Microsoft.SecurityInsights.WorkspaceManagerConfigurationList","com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerGroupList":"Microsoft.SecurityInsights.WorkspaceManagerGroupList","com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerMembersList":"Microsoft.SecurityInsights.WorkspaceManagerMembersList","com.azure.resourcemanager.securityinsights.models.AADCheckRequirements":"Microsoft.SecurityInsights.AADCheckRequirements","com.azure.resourcemanager.securityinsights.models.AATPCheckRequirements":"Microsoft.SecurityInsights.AatpCheckRequirements","com.azure.resourcemanager.securityinsights.models.ASCCheckRequirements":"Microsoft.SecurityInsights.ASCCheckRequirements","com.azure.resourcemanager.securityinsights.models.AWSAuthModel":"Microsoft.SecurityInsights.AWSAuthModel","com.azure.resourcemanager.securityinsights.models.AadDataConnector":"Microsoft.SecurityInsights.AADDataConnector","com.azure.resourcemanager.securityinsights.models.AatpDataConnector":"Microsoft.SecurityInsights.AATPDataConnector","com.azure.resourcemanager.securityinsights.models.AccountEntity":"Microsoft.SecurityInsights.AccountEntity","com.azure.resourcemanager.securityinsights.models.ActionPropertiesBase":"Microsoft.SecurityInsights.ActionPropertiesBase","com.azure.resourcemanager.securityinsights.models.ActionRequest":"Microsoft.SecurityInsights.ActionRequest","com.azure.resourcemanager.securityinsights.models.ActionType":"Microsoft.SecurityInsights.ActionType","com.azure.resourcemanager.securityinsights.models.ActivityCustomEntityQuery":"Microsoft.SecurityInsights.ActivityCustomEntityQuery","com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions":"Microsoft.SecurityInsights.ActivityEntityQueriesPropertiesQueryDefinitions","com.azure.resourcemanager.securityinsights.models.ActivityEntityQuery":"Microsoft.SecurityInsights.ActivityEntityQuery","com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplate":"Microsoft.SecurityInsights.ActivityEntityQueryTemplate","com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplatePropertiesQueryDefinitions":"Microsoft.SecurityInsights.ActivityEntityQueryTemplatePropertiesQueryDefinitions","com.azure.resourcemanager.securityinsights.models.ActivityTimelineItem":"Microsoft.SecurityInsights.ActivityTimelineItem","com.azure.resourcemanager.securityinsights.models.AddIncidentTaskActionProperties":"Microsoft.SecurityInsights.AddIncidentTaskActionProperties","com.azure.resourcemanager.securityinsights.models.AlertDetail":"Microsoft.SecurityInsights.AlertDetail","com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride":"Microsoft.SecurityInsights.AlertDetailsOverride","com.azure.resourcemanager.securityinsights.models.AlertProperty":"Microsoft.SecurityInsights.AlertProperty","com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping":"Microsoft.SecurityInsights.AlertPropertyMapping","com.azure.resourcemanager.securityinsights.models.AlertRuleKind":"Microsoft.SecurityInsights.AlertRuleKind","com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource":"Microsoft.SecurityInsights.AlertRuleTemplateDataSource","com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase":"Microsoft.SecurityInsights.AlertRuleTemplatePropertiesBase","com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateWithMitreProperties":"Microsoft.SecurityInsights.AlertRuleTemplateWithMitreProperties","com.azure.resourcemanager.securityinsights.models.AlertSeverity":"Microsoft.SecurityInsights.AlertSeverity","com.azure.resourcemanager.securityinsights.models.AlertStatus":"Microsoft.SecurityInsights.AlertStatus","com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector":"Microsoft.SecurityInsights.AlertsDataTypeOfDataConnector","com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger":"Microsoft.SecurityInsights.AnalyticsRuleRunTrigger","com.azure.resourcemanager.securityinsights.models.Anomalies":"Microsoft.SecurityInsights.Anomalies","com.azure.resourcemanager.securityinsights.models.AnomalySecurityMLAnalyticsSettings":"Microsoft.SecurityInsights.AnomalySecurityMLAnalyticsSettings","com.azure.resourcemanager.securityinsights.models.AnomalyTimelineItem":"Microsoft.SecurityInsights.AnomalyTimelineItem","com.azure.resourcemanager.securityinsights.models.AntispamMailDirection":"Microsoft.SecurityInsights.AntispamMailDirection","com.azure.resourcemanager.securityinsights.models.ApiKeyAuthModel":"Microsoft.SecurityInsights.ApiKeyAuthModel","com.azure.resourcemanager.securityinsights.models.AscDataConnector":"Microsoft.SecurityInsights.ASCDataConnector","com.azure.resourcemanager.securityinsights.models.AssignmentItem":"Microsoft.SecurityInsights.AssignmentItem","com.azure.resourcemanager.securityinsights.models.AttackPattern":"Microsoft.SecurityInsights.AttackPattern","com.azure.resourcemanager.securityinsights.models.AttackTactic":"Microsoft.SecurityInsights.AttackTactic","com.azure.resourcemanager.securityinsights.models.AutomationRuleAction":"Microsoft.SecurityInsights.AutomationRuleAction","com.azure.resourcemanager.securityinsights.models.AutomationRuleAddIncidentTaskAction":"Microsoft.SecurityInsights.AutomationRuleAddIncidentTaskAction","com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanCondition":"Microsoft.SecurityInsights.AutomationRuleBooleanCondition","com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanConditionSupportedOperator":"Microsoft.SecurityInsights.AutomationRuleBooleanConditionSupportedOperator","com.azure.resourcemanager.securityinsights.models.AutomationRuleCondition":"Microsoft.SecurityInsights.AutomationRuleCondition","com.azure.resourcemanager.securityinsights.models.AutomationRuleModifyPropertiesAction":"Microsoft.SecurityInsights.AutomationRuleModifyPropertiesAction","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayChangedConditionSupportedArrayType":"Microsoft.SecurityInsights.AutomationRulePropertyArrayChangedConditionSupportedArrayType","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayChangedConditionSupportedChangeType":"Microsoft.SecurityInsights.AutomationRulePropertyArrayChangedConditionSupportedChangeType","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayChangedValuesCondition":"Microsoft.SecurityInsights.AutomationRulePropertyArrayChangedValuesCondition","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType":"Microsoft.SecurityInsights.AutomationRulePropertyArrayConditionSupportedArrayConditionType","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayType":"Microsoft.SecurityInsights.AutomationRulePropertyArrayConditionSupportedArrayType","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayValuesCondition":"Microsoft.SecurityInsights.AutomationRulePropertyArrayValuesCondition","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyChangedConditionSupportedChangedType":"Microsoft.SecurityInsights.AutomationRulePropertyChangedConditionSupportedChangedType","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyChangedConditionSupportedPropertyType":"Microsoft.SecurityInsights.AutomationRulePropertyChangedConditionSupportedPropertyType","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedOperator":"Microsoft.SecurityInsights.AutomationRulePropertyConditionSupportedOperator","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyConditionSupportedProperty":"Microsoft.SecurityInsights.AutomationRulePropertyConditionSupportedProperty","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesChangedCondition":"Microsoft.SecurityInsights.AutomationRulePropertyValuesChangedCondition","com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyValuesCondition":"Microsoft.SecurityInsights.AutomationRulePropertyValuesCondition","com.azure.resourcemanager.securityinsights.models.AutomationRuleRunPlaybookAction":"Microsoft.SecurityInsights.AutomationRuleRunPlaybookAction","com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic":"Microsoft.SecurityInsights.AutomationRuleTriggeringLogic","com.azure.resourcemanager.securityinsights.models.Availability":"Microsoft.SecurityInsights.Availability","com.azure.resourcemanager.securityinsights.models.AvailabilityStatus":null,"com.azure.resourcemanager.securityinsights.models.AwsCloudTrailCheckRequirements":"Microsoft.SecurityInsights.AwsCloudTrailCheckRequirements","com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnector":"Microsoft.SecurityInsights.AwsCloudTrailDataConnector","com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnectorDataTypes":"Microsoft.SecurityInsights.AwsCloudTrailDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.AwsCloudTrailDataConnectorDataTypesLogs":"Microsoft.SecurityInsights.AwsCloudTrailDataConnectorDataTypesLogs","com.azure.resourcemanager.securityinsights.models.AwsS3CheckRequirements":"Microsoft.SecurityInsights.AwsS3CheckRequirements","com.azure.resourcemanager.securityinsights.models.AwsS3DataConnector":"Microsoft.SecurityInsights.AwsS3DataConnector","com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypes":"Microsoft.SecurityInsights.AwsS3DataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypesLogs":"Microsoft.SecurityInsights.AwsS3DataConnectorDataTypesLogs","com.azure.resourcemanager.securityinsights.models.AzureDevOpsResourceInfo":"Microsoft.SecurityInsights.AzureDevOpsResourceInfo","com.azure.resourcemanager.securityinsights.models.AzureResourceEntity":"Microsoft.SecurityInsights.AzureResourceEntity","com.azure.resourcemanager.securityinsights.models.BasicAuthModel":"Microsoft.SecurityInsights.BasicAuthModel","com.azure.resourcemanager.securityinsights.models.BillingStatisticKind":"Microsoft.SecurityInsights.BillingStatisticKind","com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings":"Microsoft.SecurityInsights.BookmarkEntityMappings","com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters":"Microsoft.SecurityInsights.BookmarkExpandParameters","com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponseValue":"Microsoft.SecurityInsights.BookmarkExpandResponseValue","com.azure.resourcemanager.securityinsights.models.BookmarkTimelineItem":"Microsoft.SecurityInsights.BookmarkTimelineItem","com.azure.resourcemanager.securityinsights.models.BooleanConditionProperties":"Microsoft.SecurityInsights.BooleanConditionProperties","com.azure.resourcemanager.securityinsights.models.CcpAuthConfig":"Microsoft.SecurityInsights.CcpAuthConfig","com.azure.resourcemanager.securityinsights.models.CcpAuthType":"Microsoft.SecurityInsights.CcpAuthType","com.azure.resourcemanager.securityinsights.models.CcpResponseConfig":"Microsoft.SecurityInsights.CcpResponseConfig","com.azure.resourcemanager.securityinsights.models.ClientInfo":"Microsoft.SecurityInsights.ClientInfo","com.azure.resourcemanager.securityinsights.models.CloudApplicationEntity":"Microsoft.SecurityInsights.CloudApplicationEntity","com.azure.resourcemanager.securityinsights.models.CodelessApiPollingDataConnector":"Microsoft.SecurityInsights.CodelessApiPollingDataConnector","com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingAuthProperties":"Microsoft.SecurityInsights.CodelessConnectorPollingAuthProperties","com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingConfigProperties":"Microsoft.SecurityInsights.CodelessConnectorPollingConfigProperties","com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingPagingProperties":"Microsoft.SecurityInsights.CodelessConnectorPollingPagingProperties","com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingRequestProperties":"Microsoft.SecurityInsights.CodelessConnectorPollingRequestProperties","com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingResponseProperties":"Microsoft.SecurityInsights.CodelessConnectorPollingResponseProperties","com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties":"Microsoft.SecurityInsights.CodelessUiConnectorConfigProperties","com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem":"Microsoft.SecurityInsights.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem","com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesDataTypesItem":"Microsoft.SecurityInsights.CodelessUiConnectorConfigPropertiesDataTypesItem","com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem":"Microsoft.SecurityInsights.CodelessUiConnectorConfigPropertiesGraphQueriesItem","com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem":"Microsoft.SecurityInsights.CodelessUiConnectorConfigPropertiesInstructionStepsItem","com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem":"Microsoft.SecurityInsights.CodelessUiConnectorConfigPropertiesSampleQueriesItem","com.azure.resourcemanager.securityinsights.models.CodelessUiDataConnector":"Microsoft.SecurityInsights.CodelessUiDataConnector","com.azure.resourcemanager.securityinsights.models.ConditionClause":"Microsoft.SecurityInsights.ConditionClause","com.azure.resourcemanager.securityinsights.models.ConditionProperties":"Microsoft.SecurityInsights.ConditionProperties","com.azure.resourcemanager.securityinsights.models.ConditionType":"Microsoft.SecurityInsights.ConditionType","com.azure.resourcemanager.securityinsights.models.ConfidenceLevel":"Microsoft.SecurityInsights.ConfidenceLevel","com.azure.resourcemanager.securityinsights.models.ConfidenceScoreStatus":"Microsoft.SecurityInsights.ConfidenceScoreStatus","com.azure.resourcemanager.securityinsights.models.ConnectAuthKind":"Microsoft.SecurityInsights.ConnectAuthKind","com.azure.resourcemanager.securityinsights.models.ConnectedEntity":"Microsoft.SecurityInsights.ConnectedEntity","com.azure.resourcemanager.securityinsights.models.Connective":"Microsoft.SecurityInsights.Connective","com.azure.resourcemanager.securityinsights.models.ConnectivityCriteria":"Microsoft.SecurityInsights.ConnectivityCriteria","com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion":"Microsoft.SecurityInsights.ConnectivityCriterion","com.azure.resourcemanager.securityinsights.models.ConnectivityType":"Microsoft.SecurityInsights.ConnectivityType","com.azure.resourcemanager.securityinsights.models.ConnectorDataType":"Microsoft.SecurityInsights.ConnectorDataType","com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability":"Microsoft.SecurityInsights.ConnectorDefinitionsAvailability","com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions":"Microsoft.SecurityInsights.ConnectorDefinitionsPermissions","com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider":"Microsoft.SecurityInsights.ConnectorDefinitionsResourceProvider","com.azure.resourcemanager.securityinsights.models.ConnectorInstructionModelBase":"Microsoft.SecurityInsights.ConnectorInstructionModelBase","com.azure.resourcemanager.securityinsights.models.ContentType":"Microsoft.SecurityInsights.ContentType","com.azure.resourcemanager.securityinsights.models.CountQuery":"Microsoft.SecurityInsights.CountQuery","com.azure.resourcemanager.securityinsights.models.CustomEntityQuery":"Microsoft.SecurityInsights.CustomEntityQuery","com.azure.resourcemanager.securityinsights.models.CustomEntityQueryKind":"Microsoft.SecurityInsights.CustomEntityQueryKind","com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails":"Microsoft.SecurityInsights.CustomPermissionDetails","com.azure.resourcemanager.securityinsights.models.CustomizableConnectionsConfig":"Microsoft.SecurityInsights.CustomizableConnectionsConfig","com.azure.resourcemanager.securityinsights.models.CustomizableConnectorDefinition":"Microsoft.SecurityInsights.CustomizableConnectorDefinition","com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig":"Microsoft.SecurityInsights.CustomizableConnectorUiConfig","com.azure.resourcemanager.securityinsights.models.Customs":"Microsoft.SecurityInsights.Customs","com.azure.resourcemanager.securityinsights.models.CustomsPermission":"Microsoft.SecurityInsights.CustomsPermission","com.azure.resourcemanager.securityinsights.models.DCRConfiguration":"Microsoft.SecurityInsights.DCRConfiguration","com.azure.resourcemanager.securityinsights.models.DataConnectorAuthorizationState":"Microsoft.SecurityInsights.DataConnectorAuthorizationState","com.azure.resourcemanager.securityinsights.models.DataConnectorConnectBody":"Microsoft.SecurityInsights.DataConnectorConnectBody","com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon":"Microsoft.SecurityInsights.DataConnectorDataTypeCommon","com.azure.resourcemanager.securityinsights.models.DataConnectorDefinitionKind":"Microsoft.SecurityInsights.DataConnectorDefinitionKind","com.azure.resourcemanager.securityinsights.models.DataConnectorKind":"Microsoft.SecurityInsights.DataConnectorKind","com.azure.resourcemanager.securityinsights.models.DataConnectorLicenseState":"Microsoft.SecurityInsights.DataConnectorLicenseState","com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId":"Microsoft.SecurityInsights.DataConnectorTenantId","com.azure.resourcemanager.securityinsights.models.DataConnectorWithAlertsProperties":"Microsoft.SecurityInsights.DataConnectorWithAlertsProperties","com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirements":"Microsoft.SecurityInsights.DataConnectorsCheckRequirements","com.azure.resourcemanager.securityinsights.models.DataTypeDefinitions":"Microsoft.SecurityInsights.DataTypeDefinitions","com.azure.resourcemanager.securityinsights.models.DataTypeState":"Microsoft.SecurityInsights.DataTypeState","com.azure.resourcemanager.securityinsights.models.DeleteStatus":"Microsoft.SecurityInsights.DeleteStatus","com.azure.resourcemanager.securityinsights.models.DeliveryAction":"Microsoft.SecurityInsights.DeliveryAction","com.azure.resourcemanager.securityinsights.models.DeliveryLocation":"Microsoft.SecurityInsights.DeliveryLocation","com.azure.resourcemanager.securityinsights.models.Deployment":"Microsoft.SecurityInsights.Deployment","com.azure.resourcemanager.securityinsights.models.DeploymentFetchStatus":"Microsoft.SecurityInsights.DeploymentFetchStatus","com.azure.resourcemanager.securityinsights.models.DeploymentInfo":"Microsoft.SecurityInsights.DeploymentInfo","com.azure.resourcemanager.securityinsights.models.DeploymentResult":"Microsoft.SecurityInsights.DeploymentResult","com.azure.resourcemanager.securityinsights.models.DeploymentState":"Microsoft.SecurityInsights.DeploymentState","com.azure.resourcemanager.securityinsights.models.DeviceImportance":"Microsoft.SecurityInsights.DeviceImportance","com.azure.resourcemanager.securityinsights.models.DnsEntity":"Microsoft.SecurityInsights.DnsEntity","com.azure.resourcemanager.securityinsights.models.Dynamics365CheckRequirements":"Microsoft.SecurityInsights.Dynamics365CheckRequirements","com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnector":"Microsoft.SecurityInsights.Dynamics365DataConnector","com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes":"Microsoft.SecurityInsights.Dynamics365DataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities":"Microsoft.SecurityInsights.Dynamics365DataConnectorDataTypesDynamics365CdsActivities","com.azure.resourcemanager.securityinsights.models.ElevationToken":"Microsoft.SecurityInsights.ElevationToken","com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody":"Microsoft.SecurityInsights.EnrichmentDomainBody","com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisContact":"Microsoft.SecurityInsights.EnrichmentDomainWhoisContact","com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisContacts":"Microsoft.SecurityInsights.EnrichmentDomainWhoisContacts","com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisDetails":"Microsoft.SecurityInsights.EnrichmentDomainWhoisDetails","com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisRegistrarDetails":"Microsoft.SecurityInsights.EnrichmentDomainWhoisRegistrarDetails","com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody":"Microsoft.SecurityInsights.EnrichmentIpAddressBody","com.azure.resourcemanager.securityinsights.models.EnrichmentType":"Microsoft.SecurityInsights.EnrichmentType","com.azure.resourcemanager.securityinsights.models.Entity":"Microsoft.SecurityInsights.Entity","com.azure.resourcemanager.securityinsights.models.EntityAnalytics":"Microsoft.SecurityInsights.EntityAnalytics","com.azure.resourcemanager.securityinsights.models.EntityCommonProperties":"Microsoft.SecurityInsights.EntityCommonProperties","com.azure.resourcemanager.securityinsights.models.EntityEdges":"Microsoft.SecurityInsights.EntityEdges","com.azure.resourcemanager.securityinsights.models.EntityExpandParameters":"Microsoft.SecurityInsights.EntityExpandParameters","com.azure.resourcemanager.securityinsights.models.EntityExpandResponseValue":"Microsoft.SecurityInsights.EntityExpandResponseValue","com.azure.resourcemanager.securityinsights.models.EntityFieldMapping":"Microsoft.SecurityInsights.EntityFieldMapping","com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters":"Microsoft.SecurityInsights.EntityGetInsightsParameters","com.azure.resourcemanager.securityinsights.models.EntityInsightItem":"Microsoft.SecurityInsights.EntityInsightItem","com.azure.resourcemanager.securityinsights.models.EntityInsightItemQueryTimeInterval":"Microsoft.SecurityInsights.EntityInsightItemQueryTimeInterval","com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind":"Microsoft.SecurityInsights.EntityItemQueryKind","com.azure.resourcemanager.securityinsights.models.EntityKindEnum":"Microsoft.SecurityInsights.EntityKindEnum","com.azure.resourcemanager.securityinsights.models.EntityManualTriggerRequestBody":"Microsoft.SecurityInsights.EntityManualTriggerRequestBody","com.azure.resourcemanager.securityinsights.models.EntityMapping":"Microsoft.SecurityInsights.EntityMapping","com.azure.resourcemanager.securityinsights.models.EntityMappingType":"Microsoft.SecurityInsights.EntityMappingType","com.azure.resourcemanager.securityinsights.models.EntityProviders":"Microsoft.SecurityInsights.EntityProviders","com.azure.resourcemanager.securityinsights.models.EntityQueryItemProperties":"Microsoft.SecurityInsights.EntityQueryItemProperties","com.azure.resourcemanager.securityinsights.models.EntityQueryItemPropertiesDataTypesItem":"Microsoft.SecurityInsights.EntityQueryItemPropertiesDataTypesItem","com.azure.resourcemanager.securityinsights.models.EntityQueryKind":"Microsoft.SecurityInsights.EntityQueryKind","com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind":"Microsoft.SecurityInsights.EntityQueryTemplateKind","com.azure.resourcemanager.securityinsights.models.EntityTimelineItem":"Microsoft.SecurityInsights.EntityTimelineItem","com.azure.resourcemanager.securityinsights.models.EntityTimelineKind":"Microsoft.SecurityInsights.EntityTimelineKind","com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters":"Microsoft.SecurityInsights.EntityTimelineParameters","com.azure.resourcemanager.securityinsights.models.EntityType":"Microsoft.SecurityInsights.EntityType","com.azure.resourcemanager.securityinsights.models.Error":"Microsoft.SecurityInsights.Error","com.azure.resourcemanager.securityinsights.models.EventGroupingAggregationKind":"Microsoft.SecurityInsights.EventGroupingAggregationKind","com.azure.resourcemanager.securityinsights.models.EventGroupingSettings":"Microsoft.SecurityInsights.EventGroupingSettings","com.azure.resourcemanager.securityinsights.models.ExpansionEntityQuery":"Microsoft.SecurityInsights.ExpansionEntityQuery","com.azure.resourcemanager.securityinsights.models.ExpansionResultAggregation":"Microsoft.SecurityInsights.ExpansionResultAggregation","com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata":"Microsoft.SecurityInsights.ExpansionResultsMetadata","com.azure.resourcemanager.securityinsights.models.EyesOn":"Microsoft.SecurityInsights.EyesOn","com.azure.resourcemanager.securityinsights.models.FieldMapping":"Microsoft.SecurityInsights.FieldMapping","com.azure.resourcemanager.securityinsights.models.FileEntity":"Microsoft.SecurityInsights.FileEntity","com.azure.resourcemanager.securityinsights.models.FileFormat":"Microsoft.SecurityInsights.FileFormat","com.azure.resourcemanager.securityinsights.models.FileHashAlgorithm":"Microsoft.SecurityInsights.FileHashAlgorithm","com.azure.resourcemanager.securityinsights.models.FileHashEntity":"Microsoft.SecurityInsights.FileHashEntity","com.azure.resourcemanager.securityinsights.models.FileImportContentType":"Microsoft.SecurityInsights.FileImportContentType","com.azure.resourcemanager.securityinsights.models.FileImportState":"Microsoft.SecurityInsights.FileImportState","com.azure.resourcemanager.securityinsights.models.FileMetadata":"Microsoft.SecurityInsights.FileMetadata","com.azure.resourcemanager.securityinsights.models.Flag":"Microsoft.SecurityInsights.Flag","com.azure.resourcemanager.securityinsights.models.FusionAlertRule":"Microsoft.SecurityInsights.FusionAlertRule","com.azure.resourcemanager.securityinsights.models.FusionAlertRuleTemplate":"Microsoft.SecurityInsights.FusionAlertRuleTemplate","com.azure.resourcemanager.securityinsights.models.FusionScenarioExclusionPattern":"Microsoft.SecurityInsights.FusionScenarioExclusionPattern","com.azure.resourcemanager.securityinsights.models.FusionSourceSettings":"Microsoft.SecurityInsights.FusionSourceSettings","com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting":"Microsoft.SecurityInsights.FusionSourceSubTypeSetting","com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter":"Microsoft.SecurityInsights.FusionSubTypeSeverityFilter","com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem":"Microsoft.SecurityInsights.FusionSubTypeSeverityFiltersItem","com.azure.resourcemanager.securityinsights.models.FusionTemplateSourceSetting":"Microsoft.SecurityInsights.FusionTemplateSourceSetting","com.azure.resourcemanager.securityinsights.models.FusionTemplateSourceSubType":"Microsoft.SecurityInsights.FusionTemplateSourceSubType","com.azure.resourcemanager.securityinsights.models.FusionTemplateSubTypeSeverityFilter":"Microsoft.SecurityInsights.FusionTemplateSubTypeSeverityFilter","com.azure.resourcemanager.securityinsights.models.GCPAuthModel":"Microsoft.SecurityInsights.GCPAuthModel","com.azure.resourcemanager.securityinsights.models.GCPAuthProperties":"Microsoft.SecurityInsights.GCPAuthProperties","com.azure.resourcemanager.securityinsights.models.GCPDataConnector":"Microsoft.SecurityInsights.GCPDataConnector","com.azure.resourcemanager.securityinsights.models.GCPRequestProperties":"Microsoft.SecurityInsights.GCPRequestProperties","com.azure.resourcemanager.securityinsights.models.GenericBlobSbsAuthModel":"Microsoft.SecurityInsights.GenericBlobSbsAuthModel","com.azure.resourcemanager.securityinsights.models.GeoLocation":"Microsoft.SecurityInsights.GeoLocation","com.azure.resourcemanager.securityinsights.models.GetInsightsError":"Microsoft.SecurityInsights.GetInsightsError","com.azure.resourcemanager.securityinsights.models.GetInsightsErrorKind":"Microsoft.SecurityInsights.GetInsightsErrorKind","com.azure.resourcemanager.securityinsights.models.GetInsightsResultsMetadata":"Microsoft.SecurityInsights.GetInsightsResultsMetadata","com.azure.resourcemanager.securityinsights.models.GitHubAuthModel":"Microsoft.SecurityInsights.GitHubAuthModel","com.azure.resourcemanager.securityinsights.models.GitHubResourceInfo":"Microsoft.SecurityInsights.GitHubResourceInfo","com.azure.resourcemanager.securityinsights.models.GraphQueries":"Microsoft.SecurityInsights.GraphQueries","com.azure.resourcemanager.securityinsights.models.GraphQuery":"Microsoft.SecurityInsights.GraphQuery","com.azure.resourcemanager.securityinsights.models.GroupingConfiguration":"Microsoft.SecurityInsights.GroupingConfiguration","com.azure.resourcemanager.securityinsights.models.HostEntity":"Microsoft.SecurityInsights.HostEntity","com.azure.resourcemanager.securityinsights.models.HttpMethodVerb":"Microsoft.SecurityInsights.HttpMethodVerb","com.azure.resourcemanager.securityinsights.models.HuntOwner":"Microsoft.SecurityInsights.HuntOwner","com.azure.resourcemanager.securityinsights.models.HuntingBookmark":"Microsoft.SecurityInsights.HuntingBookmark","com.azure.resourcemanager.securityinsights.models.HypothesisStatus":"Microsoft.SecurityInsights.HypothesisStatus","com.azure.resourcemanager.securityinsights.models.Identity":"Microsoft.SecurityInsights.Identity","com.azure.resourcemanager.securityinsights.models.IncidentAdditionalData":"Microsoft.SecurityInsights.IncidentAdditionalData","com.azure.resourcemanager.securityinsights.models.IncidentClassification":"Microsoft.SecurityInsights.IncidentClassification","com.azure.resourcemanager.securityinsights.models.IncidentClassificationReason":"Microsoft.SecurityInsights.IncidentClassificationReason","com.azure.resourcemanager.securityinsights.models.IncidentConfiguration":"Microsoft.SecurityInsights.IncidentConfiguration","com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResultsMetadata":"Microsoft.SecurityInsights.IncidentEntitiesResultsMetadata","com.azure.resourcemanager.securityinsights.models.IncidentInfo":"Microsoft.SecurityInsights.IncidentInfo","com.azure.resourcemanager.securityinsights.models.IncidentLabel":"Microsoft.SecurityInsights.IncidentLabel","com.azure.resourcemanager.securityinsights.models.IncidentLabelType":"Microsoft.SecurityInsights.IncidentLabelType","com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo":"Microsoft.SecurityInsights.IncidentOwnerInfo","com.azure.resourcemanager.securityinsights.models.IncidentPropertiesAction":"Microsoft.SecurityInsights.IncidentPropertiesAction","com.azure.resourcemanager.securityinsights.models.IncidentSeverity":"Microsoft.SecurityInsights.IncidentSeverity","com.azure.resourcemanager.securityinsights.models.IncidentStatus":"Microsoft.SecurityInsights.IncidentStatus","com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus":"Microsoft.SecurityInsights.IncidentTaskStatus","com.azure.resourcemanager.securityinsights.models.Indicator":"Microsoft.SecurityInsights.Indicator","com.azure.resourcemanager.securityinsights.models.IndicatorObservablesItem":"Microsoft.SecurityInsights.IndicatorObservablesItem","com.azure.resourcemanager.securityinsights.models.IngestionMode":"Microsoft.SecurityInsights.IngestionMode","com.azure.resourcemanager.securityinsights.models.InsightQueryItem":"Microsoft.SecurityInsights.InsightQueryItem","com.azure.resourcemanager.securityinsights.models.InsightQueryItemProperties":"Microsoft.SecurityInsights.InsightQueryItemProperties","com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesAdditionalQuery":"Microsoft.SecurityInsights.InsightQueryItemPropertiesAdditionalQuery","com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesDefaultTimeRange":"Microsoft.SecurityInsights.InsightQueryItemPropertiesDefaultTimeRange","com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesReferenceTimeRange":"Microsoft.SecurityInsights.InsightQueryItemPropertiesReferenceTimeRange","com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQuery":"Microsoft.SecurityInsights.InsightQueryItemPropertiesTableQuery","com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem":"Microsoft.SecurityInsights.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem","com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem":"Microsoft.SecurityInsights.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem","com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem":"Microsoft.SecurityInsights.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem","com.azure.resourcemanager.securityinsights.models.InsightsTableResult":"Microsoft.SecurityInsights.InsightsTableResult","com.azure.resourcemanager.securityinsights.models.InsightsTableResultColumnsItem":"Microsoft.SecurityInsights.InsightsTableResultColumnsItem","com.azure.resourcemanager.securityinsights.models.InstructionStep":"Microsoft.SecurityInsights.InstructionStep","com.azure.resourcemanager.securityinsights.models.InstructionStepDetails":"Microsoft.SecurityInsights.InstructionStepDetails","com.azure.resourcemanager.securityinsights.models.InstructionSteps":"Microsoft.SecurityInsights.InstructionSteps","com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem":"Microsoft.SecurityInsights.InstructionStepsInstructionsItem","com.azure.resourcemanager.securityinsights.models.IoTCheckRequirements":"Microsoft.SecurityInsights.IoTCheckRequirements","com.azure.resourcemanager.securityinsights.models.IoTDataConnector":"Microsoft.SecurityInsights.IoTDataConnector","com.azure.resourcemanager.securityinsights.models.IoTDeviceEntity":"Microsoft.SecurityInsights.IoTDeviceEntity","com.azure.resourcemanager.securityinsights.models.IpEntity":"Microsoft.SecurityInsights.IpEntity","com.azure.resourcemanager.securityinsights.models.JobItem":"Microsoft.SecurityInsights.JobItem","com.azure.resourcemanager.securityinsights.models.JobProvisioningState":"Microsoft.SecurityInsights.JobProvisioningState","com.azure.resourcemanager.securityinsights.models.JwtAuthModel":"Microsoft.SecurityInsights.JwtAuthModel","com.azure.resourcemanager.securityinsights.models.KillChainIntent":"Microsoft.SecurityInsights.KillChainIntent","com.azure.resourcemanager.securityinsights.models.Kind":"Microsoft.SecurityInsights.Kind","com.azure.resourcemanager.securityinsights.models.LastDataReceivedDataType":"Microsoft.SecurityInsights.LastDataReceivedDataType","com.azure.resourcemanager.securityinsights.models.MCASCheckRequirements":"Microsoft.SecurityInsights.McasCheckRequirements","com.azure.resourcemanager.securityinsights.models.MDATPCheckRequirements":"Microsoft.SecurityInsights.MdatpCheckRequirements","com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRule":"Microsoft.SecurityInsights.MLBehaviorAnalyticsAlertRule","com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRuleTemplate":"Microsoft.SecurityInsights.MLBehaviorAnalyticsAlertRuleTemplate","com.azure.resourcemanager.securityinsights.models.MSTICheckRequirements":"Microsoft.SecurityInsights.MstiCheckRequirements","com.azure.resourcemanager.securityinsights.models.MSTIDataConnector":"Microsoft.SecurityInsights.MstiDataConnector","com.azure.resourcemanager.securityinsights.models.MSTIDataConnectorDataTypes":"Microsoft.SecurityInsights.MstiDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.MTPDataConnector":"Microsoft.SecurityInsights.MTPDataConnector","com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypes":"Microsoft.SecurityInsights.MTPDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesAlerts":"Microsoft.SecurityInsights.MTPDataConnectorDataTypesAlerts","com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesIncidents":"Microsoft.SecurityInsights.MTPDataConnectorDataTypesIncidents","com.azure.resourcemanager.securityinsights.models.MailClusterEntity":"Microsoft.SecurityInsights.MailClusterEntity","com.azure.resourcemanager.securityinsights.models.MailMessageEntity":"Microsoft.SecurityInsights.MailMessageEntity","com.azure.resourcemanager.securityinsights.models.MailboxEntity":"Microsoft.SecurityInsights.MailboxEntity","com.azure.resourcemanager.securityinsights.models.MalwareEntity":"Microsoft.SecurityInsights.MalwareEntity","com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody":"Microsoft.SecurityInsights.ManualTriggerRequestBody","com.azure.resourcemanager.securityinsights.models.MatchingMethod":"Microsoft.SecurityInsights.MatchingMethod","com.azure.resourcemanager.securityinsights.models.McasDataConnector":"Microsoft.SecurityInsights.MCASDataConnector","com.azure.resourcemanager.securityinsights.models.McasDataConnectorDataTypes":"Microsoft.SecurityInsights.MCASDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.MdatpDataConnector":"Microsoft.SecurityInsights.MDATPDataConnector","com.azure.resourcemanager.securityinsights.models.MetadataAuthor":"Microsoft.SecurityInsights.MetadataAuthor","com.azure.resourcemanager.securityinsights.models.MetadataCategories":"Microsoft.SecurityInsights.MetadataCategories","com.azure.resourcemanager.securityinsights.models.MetadataDependencies":"Microsoft.SecurityInsights.MetadataDependencies","com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator":"Microsoft.SecurityInsights.MetadataDependencyOperator","com.azure.resourcemanager.securityinsights.models.MetadataPatch":"Microsoft.SecurityInsights.MetadataPatch","com.azure.resourcemanager.securityinsights.models.MetadataSource":"Microsoft.SecurityInsights.MetadataSource","com.azure.resourcemanager.securityinsights.models.MetadataSupport":"Microsoft.SecurityInsights.MetadataSupport","com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionCheckRequirements":"Microsoft.SecurityInsights.MicrosoftPurviewInformationProtectionCheckRequirements","com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes":"Microsoft.SecurityInsights.MicrosoftPurviewInformationProtectionConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs":"Microsoft.SecurityInsights.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs","com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector":"Microsoft.SecurityInsights.MicrosoftPurviewInformationProtectionDataConnector","com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRule":"Microsoft.SecurityInsights.MicrosoftSecurityIncidentCreationAlertRule","com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRuleCommonProperties":"Microsoft.SecurityInsights.MicrosoftSecurityIncidentCreationAlertRuleCommonProperties","com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRuleTemplate":"Microsoft.SecurityInsights.MicrosoftSecurityIncidentCreationAlertRuleTemplate","com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName":"Microsoft.SecurityInsights.MicrosoftSecurityProductName","com.azure.resourcemanager.securityinsights.models.Mode":"Microsoft.SecurityInsights.Mode","com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed":"Microsoft.SecurityInsights.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed","com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements":"Microsoft.SecurityInsights.MtpCheckRequirements","com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders":"Microsoft.SecurityInsights.MtpFilteredProviders","com.azure.resourcemanager.securityinsights.models.MtpProvider":"Microsoft.SecurityInsights.MtpProvider","com.azure.resourcemanager.securityinsights.models.NicEntity":"Microsoft.SecurityInsights.NicEntity","com.azure.resourcemanager.securityinsights.models.NoneAuthModel":"Microsoft.SecurityInsights.NoneAuthModel","com.azure.resourcemanager.securityinsights.models.NrtAlertRule":"Microsoft.SecurityInsights.NrtAlertRule","com.azure.resourcemanager.securityinsights.models.NrtAlertRuleTemplate":"Microsoft.SecurityInsights.NrtAlertRuleTemplate","com.azure.resourcemanager.securityinsights.models.OAuthModel":"Microsoft.SecurityInsights.OAuthModel","com.azure.resourcemanager.securityinsights.models.OSFamily":"Microsoft.SecurityInsights.OSFamily","com.azure.resourcemanager.securityinsights.models.Office365ProjectCheckRequirements":"Microsoft.SecurityInsights.Office365ProjectCheckRequirements","com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes":"Microsoft.SecurityInsights.Office365ProjectConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs":"Microsoft.SecurityInsights.Office365ProjectConnectorDataTypesLogs","com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector":"Microsoft.SecurityInsights.Office365ProjectDataConnector","com.azure.resourcemanager.securityinsights.models.OfficeATPCheckRequirements":"Microsoft.SecurityInsights.OfficeATPCheckRequirements","com.azure.resourcemanager.securityinsights.models.OfficeATPDataConnector":"Microsoft.SecurityInsights.OfficeATPDataConnector","com.azure.resourcemanager.securityinsights.models.OfficeDataConnector":"Microsoft.SecurityInsights.OfficeDataConnector","com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypes":"Microsoft.SecurityInsights.OfficeDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesExchange":"Microsoft.SecurityInsights.OfficeDataConnectorDataTypesExchange","com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesSharePoint":"Microsoft.SecurityInsights.OfficeDataConnectorDataTypesSharePoint","com.azure.resourcemanager.securityinsights.models.OfficeDataConnectorDataTypesTeams":"Microsoft.SecurityInsights.OfficeDataConnectorDataTypesTeams","com.azure.resourcemanager.securityinsights.models.OfficeIRMCheckRequirements":"Microsoft.SecurityInsights.OfficeIRMCheckRequirements","com.azure.resourcemanager.securityinsights.models.OfficeIRMDataConnector":"Microsoft.SecurityInsights.OfficeIRMDataConnector","com.azure.resourcemanager.securityinsights.models.OfficePowerBICheckRequirements":"Microsoft.SecurityInsights.OfficePowerBICheckRequirements","com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypes":"Microsoft.SecurityInsights.OfficePowerBIConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs":"Microsoft.SecurityInsights.OfficePowerBIConnectorDataTypesLogs","com.azure.resourcemanager.securityinsights.models.OfficePowerBIDataConnector":"Microsoft.SecurityInsights.OfficePowerBIDataConnector","com.azure.resourcemanager.securityinsights.models.OperationDisplay":"Microsoft.SecurityInsights.OperationDisplay","com.azure.resourcemanager.securityinsights.models.Operator":"Microsoft.SecurityInsights.Operator","com.azure.resourcemanager.securityinsights.models.OracleAuthModel":"Microsoft.SecurityInsights.OracleAuthModel","com.azure.resourcemanager.securityinsights.models.OutputType":"Microsoft.SecurityInsights.OutputType","com.azure.resourcemanager.securityinsights.models.OwnerType":"Microsoft.SecurityInsights.OwnerType","com.azure.resourcemanager.securityinsights.models.PackageBaseProperties":"Microsoft.SecurityInsights.PackageBaseProperties","com.azure.resourcemanager.securityinsights.models.PackageKind":"Microsoft.SecurityInsights.PackageKind","com.azure.resourcemanager.securityinsights.models.PermissionProviderScope":"Microsoft.SecurityInsights.PermissionProviderScope","com.azure.resourcemanager.securityinsights.models.Permissions":"Microsoft.SecurityInsights.Permissions","com.azure.resourcemanager.securityinsights.models.PermissionsCustomsItem":"Microsoft.SecurityInsights.PermissionsCustomsItem","com.azure.resourcemanager.securityinsights.models.PermissionsResourceProviderItem":"Microsoft.SecurityInsights.PermissionsResourceProviderItem","com.azure.resourcemanager.securityinsights.models.PlaybookActionProperties":"Microsoft.SecurityInsights.PlaybookActionProperties","com.azure.resourcemanager.securityinsights.models.PollingFrequency":"Microsoft.SecurityInsights.PollingFrequency","com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypes":"Microsoft.SecurityInsights.PremiumMdtiDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypesConnector":"Microsoft.SecurityInsights.PremiumMdtiDataConnectorDataTypesConnector","com.azure.resourcemanager.securityinsights.models.PremiumMicrosoftDefenderForThreatIntelligence":"Microsoft.SecurityInsights.PremiumMicrosoftDefenderForThreatIntelligence","com.azure.resourcemanager.securityinsights.models.ProcessEntity":"Microsoft.SecurityInsights.ProcessEntity","com.azure.resourcemanager.securityinsights.models.PropertyArrayChangedConditionProperties":"Microsoft.SecurityInsights.PropertyArrayChangedConditionProperties","com.azure.resourcemanager.securityinsights.models.PropertyArrayConditionProperties":"Microsoft.SecurityInsights.PropertyArrayConditionProperties","com.azure.resourcemanager.securityinsights.models.PropertyChangedConditionProperties":"Microsoft.SecurityInsights.PropertyChangedConditionProperties","com.azure.resourcemanager.securityinsights.models.PropertyConditionProperties":"Microsoft.SecurityInsights.PropertyConditionProperties","com.azure.resourcemanager.securityinsights.models.ProviderName":"Microsoft.SecurityInsights.ProviderName","com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope":"Microsoft.SecurityInsights.ProviderPermissionsScope","com.azure.resourcemanager.securityinsights.models.ProvisioningState":"Microsoft.SecurityInsights.ProvisioningState","com.azure.resourcemanager.securityinsights.models.PullRequest":"Microsoft.SecurityInsights.PullRequest","com.azure.resourcemanager.securityinsights.models.PullRequestState":"Microsoft.SecurityInsights.PullRequestState","com.azure.resourcemanager.securityinsights.models.PurviewAuditCheckRequirements":"Microsoft.SecurityInsights.PurviewAuditCheckRequirements","com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypes":"Microsoft.SecurityInsights.PurviewAuditConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypesLogs":"Microsoft.SecurityInsights.PurviewAuditConnectorDataTypesLogs","com.azure.resourcemanager.securityinsights.models.PurviewAuditDataConnector":"Microsoft.SecurityInsights.PurviewAuditDataConnector","com.azure.resourcemanager.securityinsights.models.Query":"Microsoft.SecurityInsights.Query","com.azure.resourcemanager.securityinsights.models.QueryCondition":"Microsoft.SecurityInsights.QueryCondition","com.azure.resourcemanager.securityinsights.models.QuerySortBy":"Microsoft.SecurityInsights.QuerySortBy","com.azure.resourcemanager.securityinsights.models.RecommendationPatch":"Microsoft.SecurityInsights.RecommendationPatch","com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties":"Microsoft.SecurityInsights.RecommendationPatchProperties","com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion":"Microsoft.SecurityInsights.RecommendedSuggestion","com.azure.resourcemanager.securityinsights.models.RegistryHive":"Microsoft.SecurityInsights.RegistryHive","com.azure.resourcemanager.securityinsights.models.RegistryKeyEntity":"Microsoft.SecurityInsights.RegistryKeyEntity","com.azure.resourcemanager.securityinsights.models.RegistryValueEntity":"Microsoft.SecurityInsights.RegistryValueEntity","com.azure.resourcemanager.securityinsights.models.RegistryValueKind":"Microsoft.SecurityInsights.RegistryValueKind","com.azure.resourcemanager.securityinsights.models.Relationship":"Microsoft.SecurityInsights.Relationship","com.azure.resourcemanager.securityinsights.models.RelationshipHint":"Microsoft.SecurityInsights.RelationshipHint","com.azure.resourcemanager.securityinsights.models.RepoType":"Microsoft.SecurityInsights.RepoType","com.azure.resourcemanager.securityinsights.models.Repository":"Microsoft.SecurityInsights.Repository","com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind":"Microsoft.SecurityInsights.RepositoryAccessKind","com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties":"Microsoft.SecurityInsights.RepositoryAccessProperties","com.azure.resourcemanager.securityinsights.models.RepositoryResourceInfo":"Microsoft.SecurityInsights.RepositoryResourceInfo","com.azure.resourcemanager.securityinsights.models.RequiredPermissions":"Microsoft.SecurityInsights.RequiredPermissions","com.azure.resourcemanager.securityinsights.models.ResourceProvider":"Microsoft.SecurityInsights.ResourceProvider","com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions":"Microsoft.SecurityInsights.ResourceProviderRequiredPermissions","com.azure.resourcemanager.securityinsights.models.ResourceWithEtag":"Microsoft.SecurityInsights.ResourceWithEtag","com.azure.resourcemanager.securityinsights.models.RestApiPollerDataConnector":"Microsoft.SecurityInsights.RestApiPollerDataConnector","com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestConfig":"Microsoft.SecurityInsights.RestApiPollerRequestConfig","com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingConfig":"Microsoft.SecurityInsights.RestApiPollerRequestPagingConfig","com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingKind":"Microsoft.SecurityInsights.RestApiPollerRequestPagingKind","com.azure.resourcemanager.securityinsights.models.SampleQueries":"Microsoft.SecurityInsights.SampleQueries","com.azure.resourcemanager.securityinsights.models.SapSolutionUsageStatistic":"Microsoft.SecurityInsights.SapSolutionUsageStatistic","com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule":"Microsoft.SecurityInsights.ScheduledAlertRule","com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleCommonProperties":"Microsoft.SecurityInsights.ScheduledAlertRuleCommonProperties","com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleTemplate":"Microsoft.SecurityInsights.ScheduledAlertRuleTemplate","com.azure.resourcemanager.securityinsights.models.SecurityAlert":"Microsoft.SecurityInsights.SecurityAlert","com.azure.resourcemanager.securityinsights.models.SecurityAlertPropertiesConfidenceReasonsItem":"Microsoft.SecurityInsights.SecurityAlertPropertiesConfidenceReasonsItem","com.azure.resourcemanager.securityinsights.models.SecurityAlertTimelineItem":"Microsoft.SecurityInsights.SecurityAlertTimelineItem","com.azure.resourcemanager.securityinsights.models.SecurityGroupEntity":"Microsoft.SecurityInsights.SecurityGroupEntity","com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsDataSource":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettingsDataSource","com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsKind":"Microsoft.SecurityInsights.SecurityMLAnalyticsSettingsKind","com.azure.resourcemanager.securityinsights.models.SentinelEntityMapping":"Microsoft.SecurityInsights.SentinelEntityMapping","com.azure.resourcemanager.securityinsights.models.ServicePrincipal":"Microsoft.SecurityInsights.ServicePrincipal","com.azure.resourcemanager.securityinsights.models.SessionAuthModel":"Microsoft.SecurityInsights.SessionAuthModel","com.azure.resourcemanager.securityinsights.models.SettingKind":"Microsoft.SecurityInsights.SettingKind","com.azure.resourcemanager.securityinsights.models.SettingType":"Microsoft.SecurityInsights.SettingType","com.azure.resourcemanager.securityinsights.models.SettingsStatus":"Microsoft.SecurityInsights.SettingsStatus","com.azure.resourcemanager.securityinsights.models.SortingDirection":"Microsoft.SecurityInsights.SortingDirection","com.azure.resourcemanager.securityinsights.models.SourceKind":"Microsoft.SecurityInsights.SourceKind","com.azure.resourcemanager.securityinsights.models.SourceType":"Microsoft.SecurityInsights.SourceType","com.azure.resourcemanager.securityinsights.models.State":"Microsoft.SecurityInsights.State","com.azure.resourcemanager.securityinsights.models.Status":"Microsoft.SecurityInsights.Status","com.azure.resourcemanager.securityinsights.models.SubmissionMailEntity":"Microsoft.SecurityInsights.SubmissionMailEntity","com.azure.resourcemanager.securityinsights.models.SupportTier":"Microsoft.SecurityInsights.SupportTier","com.azure.resourcemanager.securityinsights.models.TICheckRequirements":"Microsoft.SecurityInsights.TICheckRequirements","com.azure.resourcemanager.securityinsights.models.TIDataConnector":"Microsoft.SecurityInsights.TIDataConnector","com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypes":"Microsoft.SecurityInsights.TIDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.TIDataConnectorDataTypesIndicators":"Microsoft.SecurityInsights.TIDataConnectorDataTypesIndicators","com.azure.resourcemanager.securityinsights.models.TIObjectKind":"Microsoft.SecurityInsights.TIObjectKind","com.azure.resourcemanager.securityinsights.models.TeamInformation":"Microsoft.SecurityInsights.TeamInformation","com.azure.resourcemanager.securityinsights.models.TemplateStatus":"Microsoft.SecurityInsights.TemplateStatus","com.azure.resourcemanager.securityinsights.models.ThreatActor":"Microsoft.SecurityInsights.ThreatActor","com.azure.resourcemanager.securityinsights.models.ThreatIntelligence":"Microsoft.SecurityInsights.ThreatIntelligence","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRule":"Microsoft.SecurityInsights.ThreatIntelligenceAlertRule","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRuleTemplate":"Microsoft.SecurityInsights.ThreatIntelligenceAlertRuleTemplate","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags":"Microsoft.SecurityInsights.ThreatIntelligenceAppendTags","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceExternalReference":"Microsoft.SecurityInsights.ThreatIntelligenceExternalReference","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceFilteringCriteria":"Microsoft.SecurityInsights.ThreatIntelligenceFilteringCriteria","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceGranularMarkingModel":"Microsoft.SecurityInsights.ThreatIntelligenceGranularMarkingModel","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceIndicatorModel":"Microsoft.SecurityInsights.ThreatIntelligenceIndicatorModel","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceKillChainPhase":"Microsoft.SecurityInsights.ThreatIntelligenceKillChainPhase","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetric":"Microsoft.SecurityInsights.ThreatIntelligenceMetric","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricEntity":"Microsoft.SecurityInsights.ThreatIntelligenceMetricEntity","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetrics":"Microsoft.SecurityInsights.ThreatIntelligenceMetrics","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceParsedPattern":"Microsoft.SecurityInsights.ThreatIntelligenceParsedPattern","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceParsedPatternTypeValue":"Microsoft.SecurityInsights.ThreatIntelligenceParsedPatternTypeValue","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceResourceInnerKind":"Microsoft.SecurityInsights.ThreatIntelligenceResourceInnerKind","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingCriteria":"Microsoft.SecurityInsights.ThreatIntelligenceSortingCriteria","com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceSortingOrder":"Microsoft.SecurityInsights.ThreatIntelligenceSortingOrder","com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements":"Microsoft.SecurityInsights.TiTaxiiCheckRequirements","com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnector":"Microsoft.SecurityInsights.TiTaxiiDataConnector","com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes":"Microsoft.SecurityInsights.TiTaxiiDataConnectorDataTypes","com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient":"Microsoft.SecurityInsights.TiTaxiiDataConnectorDataTypesTaxiiClient","com.azure.resourcemanager.securityinsights.models.TiType":"Microsoft.SecurityInsights.TiType","com.azure.resourcemanager.securityinsights.models.TimelineAggregation":"Microsoft.SecurityInsights.TimelineAggregation","com.azure.resourcemanager.securityinsights.models.TimelineError":"Microsoft.SecurityInsights.TimelineError","com.azure.resourcemanager.securityinsights.models.TimelineResultsMetadata":"Microsoft.SecurityInsights.TimelineResultsMetadata","com.azure.resourcemanager.securityinsights.models.TriggerOperator":"Microsoft.SecurityInsights.TriggerOperator","com.azure.resourcemanager.securityinsights.models.TriggersOn":"Microsoft.SecurityInsights.TriggersOn","com.azure.resourcemanager.securityinsights.models.TriggersWhen":"Microsoft.SecurityInsights.TriggersWhen","com.azure.resourcemanager.securityinsights.models.Ueba":"Microsoft.SecurityInsights.Ueba","com.azure.resourcemanager.securityinsights.models.UebaDataSources":"Microsoft.SecurityInsights.UebaDataSources","com.azure.resourcemanager.securityinsights.models.UrlEntity":"Microsoft.SecurityInsights.UrlEntity","com.azure.resourcemanager.securityinsights.models.UserInfo":"Microsoft.SecurityInsights.UserInfo","com.azure.resourcemanager.securityinsights.models.ValidationError":"Microsoft.SecurityInsights.ValidationError","com.azure.resourcemanager.securityinsights.models.Version":"Microsoft.SecurityInsights.Version","com.azure.resourcemanager.securityinsights.models.WarningBody":"Microsoft.SecurityInsights.WarningBody","com.azure.resourcemanager.securityinsights.models.WarningCode":"Microsoft.SecurityInsights.WarningCode","com.azure.resourcemanager.securityinsights.models.WatchlistProvisioningState":"Microsoft.SecurityInsights.WatchlistProvisioningState","com.azure.resourcemanager.securityinsights.models.Webhook":"Microsoft.SecurityInsights.Webhook","com.azure.resourcemanager.securityinsights.models.WorkloadIdentityFederation":"Microsoft.SecurityInsights.WorkloadIdentityFederation"},"generatedFiles":["src/main/java/com/azure/resourcemanager/securityinsights/SecurityInsightsManager.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ActionsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRuleTemplatesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/AlertRulesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/AutomationRulesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/BillingStatisticsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarkRelationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/BookmarksClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackageOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentPackagesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ContentTemplatesOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorDefinitionsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsCheckRequirementsOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/DataConnectorsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesGetTimelinesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntitiesRelationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueriesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityQueryTemplatesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/EntityRelationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/FileImportsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetRecommendationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetTriggeredAnalyticsRuleRunsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/GetsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntCommentsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntRelationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/HuntsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentCommentsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentRelationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentTasksClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/IncidentsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/MetadatasClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/OfficeConsentsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductPackagesOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductSettingsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ProductTemplatesOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ReevaluatesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ResourceProvidersClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityInsightsManagementClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/SecurityMLAnalyticsSettingsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/SentinelOnboardingStatesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/SourceControlsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorMetricsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligenceIndicatorsOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/ThreatIntelligencesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/TriggeredAnalyticsRuleRunOperationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/UpdatesClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistItemsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/WatchlistsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentJobsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerAssignmentsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerConfigurationsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerGroupsClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/WorkspaceManagerMembersClient.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AADCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AADDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AATPCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AATPDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ASCCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ASCDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AccountEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionRequestProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActionResponseProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueriesProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ActivityEntityQueryTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AlertRuleTemplateInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnalyticsRuleRunTriggerProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomaliesSettingsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AnomalySecurityMLAnalyticsSettingsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ApiPollingParameters.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AutomationRuleProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsCloudTrailDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AwsS3DataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/AzureResourceEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BillingStatisticInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkExpandResponseInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/BookmarkProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CloudApplicationEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CodelessParameters.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/CustomizableConnectorDefinitionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorDefinitionInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DataConnectorRequirementsStateInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/DnsEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365CheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Dynamics365DataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentDomainWhoisInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EnrichmentIpGeodataInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityAnalyticsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityExpandResponseInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityGetInsightsResponseInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryItemInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityQueryTemplateInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EntityTimelineResponseInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ExpansionEntityQueriesProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/EyesOnSettingsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileHashEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FileImportProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/FusionAlertRuleTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/GCPDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HostEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntCommentProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntRelationProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/HuntingBookmarkProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentAlertListInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentBookmarkListInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentCommentProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentEntitiesResponseInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IncidentTaskProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IoTDeviceEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/IpEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/JobProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MCASCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MCASDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MDATPCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MDATPDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MLBehaviorAnalyticsAlertRuleTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MSTICheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MSTIDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MTPCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MTPDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailClusterEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailMessageEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MailboxEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MalwareEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataModelInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MetadataPropertiesPatch.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftPurviewInformationProtectionDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NicEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/NrtAlertRuleTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/Office365ProjectDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeATPCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeATPDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeConsentProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIRMCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficeIRMDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBICheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OfficePowerBIDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageModelInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PackageProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PremiumMdtiDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProcessEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageModelInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductPackageProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateModelInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ProductTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/PurviewAuditDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/QueryProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RecommendationProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ReevaluateResponseInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryKeyEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RegistryValueEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RelationProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepoInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccess.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RepositoryAccessObject.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/RestApiPollerDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SapSolutionUsageStatisticProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ScheduledAlertRuleTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityAlertProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityGroupEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SecurityMLAnalyticsSettingInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SentinelOnboardingStatesListInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SettingsInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SourceControlProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/SubmissionMailEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TICheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectCommonProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TIObjectInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateModelInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceAlertRuleTemplateProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceCountInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceIndicatorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceInformationInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/ThreatIntelligenceMetricsListInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiCheckRequirementsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TiTaxiiDataConnectorProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/TriggeredAnalyticsRuleRunProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UebaProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/UrlEntityProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WarningInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistItemProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WatchlistProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerAssignmentProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerConfigurationProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerGroupProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberInner.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/WorkspaceManagerMemberProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/securityinsights/fluent/package-info.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionResponseImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ActionsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplateImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRuleTemplatesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AlertRulesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRuleImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/AutomationRulesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BillingStatisticsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkExpandResponseImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarkRelationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/BookmarksImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackageOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentPackagesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ContentTemplatesOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorDefinitionsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorRequirementsStateImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsCheckRequirementsOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/DataConnectorsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentDomainWhoisImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EnrichmentIpGeodataImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesGetTimelinesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntitiesRelationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityExpandResponseImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityGetInsightsResponseImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueriesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryItemImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplateImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityQueryTemplatesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityRelationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/EntityTimelineResponseImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/FileImportsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetRecommendationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetTriggeredAnalyticsRuleRunsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/GetsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntCommentsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntRelationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/HuntsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentAlertListImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentBookmarkListImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentCommentsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentEntitiesResponseImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTaskImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentTasksImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/JobImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadataModelImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/MetadatasImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/OfficeConsentsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/PackageModelImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackageModelImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductPackagesOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductSettingsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplateModelImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ProductTemplatesOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/RecommendationImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluateResponseImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ReevaluatesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/RelationImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/RepoImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ResourceProvidersImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityInsightsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SecurityMLAnalyticsSettingsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStateImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SentinelOnboardingStatesListImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SettingsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/SourceControlsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/TIObjectImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/TemplateModelImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceCountImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorMetricsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceIndicatorsOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceInformationImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligenceMetricsListImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/ThreatIntelligencesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/TriggeredAnalyticsRuleRunOperationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/UpdatesImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WarningImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistItemsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WatchlistsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentJobsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerAssignmentsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerConfigurationsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerGroupsImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMemberImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersClientImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/WorkspaceManagerMembersImpl.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ActionsList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/AlertRuleTemplatesList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/AlertRulesList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/AutomationRulesList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/BillingStatisticList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/BookmarkList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/DataConnectorDefinitionArmCollectionWrapper.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/DataConnectorList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/EntityQueryTemplateList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/FileImportList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/GetQueriesResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntCommentList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/HuntRelationList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentCommentList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/IncidentTaskList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/JobList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/MetadataList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/OfficeConsentList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/OperationsList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/PackageList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductPackageList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ProductTemplateList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RecommendationList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RelationList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/RepoList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SecurityMLAnalyticsSettingsList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SettingList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/SourceControlList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TemplateList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ThreatIntelligenceInformationList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/ThreatIntelligenceList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/TriggeredAnalyticsRuleRuns.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WatchlistItemList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WatchlistList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerAssignmentList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerConfigurationList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerGroupList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/models/WorkspaceManagerMembersList.java","src/main/java/com/azure/resourcemanager/securityinsights/implementation/package-info.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AADCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AATPCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ASCCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AWSAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AadDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AatpDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AccountEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActionPropertiesBase.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActionRequest.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActionResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActionType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Actions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityCustomEntityQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueriesPropertiesQueryDefinitions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ActivityTimelineItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AddIncidentTaskActionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetail.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertDetailsOverride.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertProperty.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertPropertyMapping.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateDataSource.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplatePropertiesBase.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplateWithMitreProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRuleTemplates.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertRules.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertSeverity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AlertsDataTypeOfDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AnalyticsRuleRunTrigger.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Anomalies.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalySecurityMLAnalyticsSettings.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AnomalyTimelineItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AntispamMailDirection.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ApiKeyAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AscDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AssignmentItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AttackPattern.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AttackTactic.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAction.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleAddIncidentTaskAction.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanCondition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleBooleanConditionSupportedOperator.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleCondition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleModifyPropertiesAction.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayChangedValuesCondition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayConditionSupportedArrayType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyArrayValuesCondition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedChangedType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyChangedConditionSupportedPropertyType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedOperator.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyConditionSupportedProperty.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesChangedCondition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRulePropertyValuesCondition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleRunPlaybookAction.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRuleTriggeringLogic.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AutomationRules.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Availability.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AvailabilityStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsCloudTrailDataConnectorDataTypesLogs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3CheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AwsS3DataConnectorDataTypesLogs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AzureDevOpsResourceInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/AzureResourceEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BasicAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistic.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatisticKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BillingStatistics.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmark.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkEntityMappings.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandParameters.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkExpandResponseValue.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkRelations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BookmarkTimelineItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Bookmarks.java","src/main/java/com/azure/resourcemanager/securityinsights/models/BooleanConditionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthConfig.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CcpAuthType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CcpResponseConfig.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ClientInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CloudApplicationEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessApiPollingDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingAuthProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingConfigProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingPagingProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingRequestProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessConnectorPollingResponseProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesDataTypesItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CodelessUiDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionClause.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConditionType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceLevel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConfidenceScoreStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectAuthKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectedEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Connective.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriteria.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityCriterion.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectivityType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDataType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsAvailability.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsPermissions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorDefinitionsResourceProvider.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ConnectorInstructionModelBase.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackageOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ContentPackages.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplates.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ContentTemplatesOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ContentType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CountQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CustomEntityQueryKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CustomPermissionDetails.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectionsConfig.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorDefinition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CustomizableConnectorUiConfig.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Customs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/CustomsPermission.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DCRConfiguration.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorAuthorizationState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorConnectBody.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDataTypeCommon.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitionKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorDefinitions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorLicenseState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorRequirementsState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorTenantId.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorWithAlertsProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectors.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataConnectorsCheckRequirementsOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeDefinitions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DataTypeState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeleteStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryAction.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeliveryLocation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Deployment.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentFetchStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentResult.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeploymentState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DeviceImportance.java","src/main/java/com/azure/resourcemanager/securityinsights/models/DnsEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365CheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ElevationToken.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainBody.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhois.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContact.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisContacts.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisDetails.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentDomainWhoisRegistrarDetails.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpAddressBody.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentIpGeodata.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EnrichmentType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Entities.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesGetTimelines.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntitiesRelations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Entity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityAnalytics.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityCommonProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityEdges.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandParameters.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityExpandResponseValue.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityFieldMapping.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsParameters.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityGetInsightsResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityInsightItemQueryTimeInterval.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityItemQueryKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityKindEnum.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityManualTriggerRequestBody.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMapping.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityMappingType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityProviders.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueries.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryItemPropertiesDataTypesItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplateKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityQueryTemplates.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityRelations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineParameters.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityTimelineResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EntityType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Error.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingAggregationKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EventGroupingSettings.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionEntityQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultAggregation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ExpansionResultsMetadata.java","src/main/java/com/azure/resourcemanager/securityinsights/models/EyesOn.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FieldMapping.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileFormat.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashAlgorithm.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileHashEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileImport.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportContentType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileImportState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileImports.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FileMetadata.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Flag.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionAlertRuleTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionScenarioExclusionPattern.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSettings.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSourceSubTypeSetting.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFilter.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionSubTypeSeverityFiltersItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSetting.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSourceSubType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/FusionTemplateSubTypeSeverityFilter.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GCPAuthProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GCPDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GCPRequestProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GenericBlobSbsAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GeoLocation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsError.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsErrorKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GetInsightsResultsMetadata.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GetRecommendations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GetTriggeredAnalyticsRuleRuns.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Gets.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GitHubResourceInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQueries.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GraphQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/GroupingConfiguration.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HostEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HttpMethodVerb.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Hunt.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComment.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HuntComments.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HuntOwner.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HuntRelations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HuntingBookmark.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Hunts.java","src/main/java/com/azure/resourcemanager/securityinsights/models/HypothesisStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Identity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Incident.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAdditionalData.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentAlertList.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentBookmarkList.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassification.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentClassificationReason.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComment.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentComments.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentConfiguration.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentEntitiesResultsMetadata.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentLabelType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentOwnerInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentPropertiesAction.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentSeverity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTask.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTaskStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentTasks.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Incidents.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Indicator.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IndicatorObservablesItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IngestionMode.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesAdditionalQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesDefaultTimeRange.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesReferenceTimeRange.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQuery.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResult.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InsightsTableResultColumnsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStep.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepDetails.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionSteps.java","src/main/java/com/azure/resourcemanager/securityinsights/models/InstructionStepsInstructionsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IoTCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IoTDeviceEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/IpEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Job.java","src/main/java/com/azure/resourcemanager/securityinsights/models/JobItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/JobProvisioningState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/JwtAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/KillChainIntent.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Kind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/LastDataReceivedDataType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MCASCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MDATPCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MLBehaviorAnalyticsAlertRuleTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MSTICheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MSTIDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MSTIDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypesAlerts.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MTPDataConnectorDataTypesIncidents.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MailClusterEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MailMessageEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MailboxEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MalwareEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ManualTriggerRequestBody.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MatchingMethod.java","src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/McasDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MdatpDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataAuthor.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataCategories.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencies.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataDependencyOperator.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataPatch.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSource.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MetadataSupport.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftPurviewInformationProtectionDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MicrosoftSecurityProductName.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Mode.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MtpCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MtpFilteredProviders.java","src/main/java/com/azure/resourcemanager/securityinsights/models/MtpProvider.java","src/main/java/com/azure/resourcemanager/securityinsights/models/NicEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/NoneAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/NrtAlertRuleTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OSFamily.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectConnectorDataTypesLogs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Office365ProjectDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeATPCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeATPDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsent.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeConsents.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesExchange.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesSharePoint.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeDataConnectorDataTypesTeams.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIRMCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficeIRMDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBICheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIConnectorDataTypesLogs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OfficePowerBIDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Operation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Operations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Operator.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OracleAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OutputType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/OwnerType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PackageBaseProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PackageKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PackageModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionProviderScope.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Permissions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsCustomsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PermissionsResourceProviderItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PlaybookActionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PollingFrequency.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMdtiDataConnectorDataTypesConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PremiumMicrosoftDefenderForThreatIntelligence.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProcessEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackageModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackages.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProductPackagesOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProductSettings.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplateModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplates.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProductTemplatesOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayChangedConditionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyArrayConditionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyChangedConditionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PropertyConditionProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderName.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProviderPermissionsScope.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequest.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PullRequestState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditConnectorDataTypesLogs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/PurviewAuditDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Query.java","src/main/java/com/azure/resourcemanager/securityinsights/models/QueryCondition.java","src/main/java/com/azure/resourcemanager/securityinsights/models/QuerySortBy.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Recommendation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatch.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendationPatchProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RecommendedSuggestion.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ReevaluateResponse.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Reevaluates.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryHive.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryKeyEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RegistryValueKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Relation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Relationship.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RelationshipHint.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Repo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RepoType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Repository.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryAccessProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RepositoryResourceInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RequiredPermissions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProvider.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviderRequiredPermissions.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceProviders.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ResourceWithEtag.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestConfig.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingConfig.java","src/main/java/com/azure/resourcemanager/securityinsights/models/RestApiPollerRequestPagingKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SampleQueries.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SapSolutionUsageStatistic.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleCommonProperties.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ScheduledAlertRuleTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlert.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertPropertiesConfidenceReasonsItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityAlertTimelineItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityGroupEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSetting.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettings.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsDataSource.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SecurityMLAnalyticsSettingsKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelEntityMapping.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStates.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SentinelOnboardingStatesList.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ServicePrincipal.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SessionAuthModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SettingKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SettingType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Settings.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SettingsStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SortingDirection.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControl.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControlOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SourceControls.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SourceKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SourceType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/State.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Status.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SubmissionMailEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/SupportTier.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TICheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TIDataConnectorDataTypesIndicators.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TIObject.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TIObjectKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TeamInformation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TemplateStatus.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatActor.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligence.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRule.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAlertRuleTemplate.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceAppendTags.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceCount.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceExternalReference.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceFilteringCriteria.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceGranularMarkingModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorMetrics.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorModel.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicators.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceIndicatorsOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceInformation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceKillChainPhase.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetric.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetrics.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceMetricsList.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPattern.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceParsedPatternTypeValue.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceResourceInnerKind.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingCriteria.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligenceSortingOrder.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ThreatIntelligences.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiCheckRequirements.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnector.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypes.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TiTaxiiDataConnectorDataTypesTaxiiClient.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TiType.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineAggregation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineError.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TimelineResultsMetadata.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TriggerOperator.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRun.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TriggeredAnalyticsRuleRunOperations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersOn.java","src/main/java/com/azure/resourcemanager/securityinsights/models/TriggersWhen.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Ueba.java","src/main/java/com/azure/resourcemanager/securityinsights/models/UebaDataSources.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Updates.java","src/main/java/com/azure/resourcemanager/securityinsights/models/UrlEntity.java","src/main/java/com/azure/resourcemanager/securityinsights/models/UserInfo.java","src/main/java/com/azure/resourcemanager/securityinsights/models/ValidationError.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Version.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Warning.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WarningBody.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WarningCode.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlist.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItem.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistItems.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WatchlistProvisioningState.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Watchlists.java","src/main/java/com/azure/resourcemanager/securityinsights/models/Webhook.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkloadIdentityFederation.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignment.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignmentJobs.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerAssignments.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfiguration.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerConfigurations.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroup.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerGroups.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMember.java","src/main/java/com/azure/resourcemanager/securityinsights/models/WorkspaceManagerMembers.java","src/main/java/com/azure/resourcemanager/securityinsights/models/package-info.java","src/main/java/com/azure/resourcemanager/securityinsights/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-securityinsights/proxy-config.json b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-securityinsights/proxy-config.json index e40df8530087..95b32c58c92b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-securityinsights/proxy-config.json +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-securityinsights/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.securityinsights.implementation.ActionsClientImpl$ActionsService"],["com.azure.resourcemanager.securityinsights.implementation.AlertRuleTemplatesClientImpl$AlertRuleTemplatesService"],["com.azure.resourcemanager.securityinsights.implementation.AlertRulesClientImpl$AlertRulesService"],["com.azure.resourcemanager.securityinsights.implementation.AutomationRulesClientImpl$AutomationRulesService"],["com.azure.resourcemanager.securityinsights.implementation.BookmarksClientImpl$BookmarksService"],["com.azure.resourcemanager.securityinsights.implementation.DataConnectorsClientImpl$DataConnectorsService"],["com.azure.resourcemanager.securityinsights.implementation.IncidentCommentsClientImpl$IncidentCommentsService"],["com.azure.resourcemanager.securityinsights.implementation.IncidentRelationsClientImpl$IncidentRelationsService"],["com.azure.resourcemanager.securityinsights.implementation.IncidentsClientImpl$IncidentsService"],["com.azure.resourcemanager.securityinsights.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.securityinsights.implementation.SecurityMLAnalyticsSettingsClientImpl$SecurityMLAnalyticsSettingsService"],["com.azure.resourcemanager.securityinsights.implementation.SentinelOnboardingStatesClientImpl$SentinelOnboardingStatesService"],["com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorMetricsClientImpl$ThreatIntelligenceIndicatorMetricsService"],["com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsClientImpl$ThreatIntelligenceIndicatorsService"],["com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsOperationsClientImpl$ThreatIntelligenceIndicatorsOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.WatchlistItemsClientImpl$WatchlistItemsService"],["com.azure.resourcemanager.securityinsights.implementation.WatchlistsClientImpl$WatchlistsService"]] \ No newline at end of file +[["com.azure.resourcemanager.securityinsights.implementation.ActionsClientImpl$ActionsService"],["com.azure.resourcemanager.securityinsights.implementation.AlertRuleOperationsClientImpl$AlertRuleOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.AlertRuleTemplatesClientImpl$AlertRuleTemplatesService"],["com.azure.resourcemanager.securityinsights.implementation.AlertRulesClientImpl$AlertRulesService"],["com.azure.resourcemanager.securityinsights.implementation.AutomationRulesClientImpl$AutomationRulesService"],["com.azure.resourcemanager.securityinsights.implementation.BillingStatisticsClientImpl$BillingStatisticsService"],["com.azure.resourcemanager.securityinsights.implementation.BookmarkOperationsClientImpl$BookmarkOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.BookmarkRelationsClientImpl$BookmarkRelationsService"],["com.azure.resourcemanager.securityinsights.implementation.BookmarksClientImpl$BookmarksService"],["com.azure.resourcemanager.securityinsights.implementation.ContentPackageOperationsClientImpl$ContentPackageOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.ContentPackagesClientImpl$ContentPackagesService"],["com.azure.resourcemanager.securityinsights.implementation.ContentTemplatesClientImpl$ContentTemplatesService"],["com.azure.resourcemanager.securityinsights.implementation.ContentTemplatesOperationsClientImpl$ContentTemplatesOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.DataConnectorDefinitionsClientImpl$DataConnectorDefinitionsService"],["com.azure.resourcemanager.securityinsights.implementation.DataConnectorsCheckRequirementsOperationsClientImpl$DataConnectorsCheckRequirementsOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.DataConnectorsClientImpl$DataConnectorsService"],["com.azure.resourcemanager.securityinsights.implementation.EntitiesClientImpl$EntitiesService"],["com.azure.resourcemanager.securityinsights.implementation.EntitiesGetTimelinesClientImpl$EntitiesGetTimelinesService"],["com.azure.resourcemanager.securityinsights.implementation.EntitiesRelationsClientImpl$EntitiesRelationsService"],["com.azure.resourcemanager.securityinsights.implementation.EntityQueriesClientImpl$EntityQueriesService"],["com.azure.resourcemanager.securityinsights.implementation.EntityQueryTemplatesClientImpl$EntityQueryTemplatesService"],["com.azure.resourcemanager.securityinsights.implementation.EntityRelationsClientImpl$EntityRelationsService"],["com.azure.resourcemanager.securityinsights.implementation.FileImportsClientImpl$FileImportsService"],["com.azure.resourcemanager.securityinsights.implementation.GetRecommendationsClientImpl$GetRecommendationsService"],["com.azure.resourcemanager.securityinsights.implementation.GetTriggeredAnalyticsRuleRunsClientImpl$GetTriggeredAnalyticsRuleRunsService"],["com.azure.resourcemanager.securityinsights.implementation.GetsClientImpl$GetsService"],["com.azure.resourcemanager.securityinsights.implementation.HuntCommentsClientImpl$HuntCommentsService"],["com.azure.resourcemanager.securityinsights.implementation.HuntRelationsClientImpl$HuntRelationsService"],["com.azure.resourcemanager.securityinsights.implementation.HuntsClientImpl$HuntsService"],["com.azure.resourcemanager.securityinsights.implementation.IncidentCommentsClientImpl$IncidentCommentsService"],["com.azure.resourcemanager.securityinsights.implementation.IncidentRelationsClientImpl$IncidentRelationsService"],["com.azure.resourcemanager.securityinsights.implementation.IncidentTasksClientImpl$IncidentTasksService"],["com.azure.resourcemanager.securityinsights.implementation.IncidentsClientImpl$IncidentsService"],["com.azure.resourcemanager.securityinsights.implementation.MetadatasClientImpl$MetadatasService"],["com.azure.resourcemanager.securityinsights.implementation.OfficeConsentsClientImpl$OfficeConsentsService"],["com.azure.resourcemanager.securityinsights.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.securityinsights.implementation.ProductPackagesClientImpl$ProductPackagesService"],["com.azure.resourcemanager.securityinsights.implementation.ProductPackagesOperationsClientImpl$ProductPackagesOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.ProductSettingsClientImpl$ProductSettingsService"],["com.azure.resourcemanager.securityinsights.implementation.ProductTemplatesClientImpl$ProductTemplatesService"],["com.azure.resourcemanager.securityinsights.implementation.ProductTemplatesOperationsClientImpl$ProductTemplatesOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.ReevaluatesClientImpl$ReevaluatesService"],["com.azure.resourcemanager.securityinsights.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.securityinsights.implementation.SecurityMLAnalyticsSettingsClientImpl$SecurityMLAnalyticsSettingsService"],["com.azure.resourcemanager.securityinsights.implementation.SentinelOnboardingStatesClientImpl$SentinelOnboardingStatesService"],["com.azure.resourcemanager.securityinsights.implementation.SourceControlOperationsClientImpl$SourceControlOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.SourceControlsClientImpl$SourceControlsService"],["com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorMetricsClientImpl$ThreatIntelligenceIndicatorMetricsService"],["com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsClientImpl$ThreatIntelligenceIndicatorsService"],["com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligenceIndicatorsOperationsClientImpl$ThreatIntelligenceIndicatorsOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.ThreatIntelligencesClientImpl$ThreatIntelligencesService"],["com.azure.resourcemanager.securityinsights.implementation.TriggeredAnalyticsRuleRunOperationsClientImpl$TriggeredAnalyticsRuleRunOperationsService"],["com.azure.resourcemanager.securityinsights.implementation.UpdatesClientImpl$UpdatesService"],["com.azure.resourcemanager.securityinsights.implementation.WatchlistItemsClientImpl$WatchlistItemsService"],["com.azure.resourcemanager.securityinsights.implementation.WatchlistsClientImpl$WatchlistsService"],["com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerAssignmentJobsClientImpl$WorkspaceManagerAssignmentJobsService"],["com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerAssignmentsClientImpl$WorkspaceManagerAssignmentsService"],["com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerConfigurationsClientImpl$WorkspaceManagerConfigurationsService"],["com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerGroupsClientImpl$WorkspaceManagerGroupsService"],["com.azure.resourcemanager.securityinsights.implementation.WorkspaceManagerMembersClientImpl$WorkspaceManagerMembersService"]] \ No newline at end of file diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/azure-resourcemanager-securityinsights.properties b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/azure-resourcemanager-securityinsights.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/resources/azure-resourcemanager-securityinsights.properties @@ -0,0 +1 @@ +version=${project.version} 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 index fd706a92d74b..d9eee2878cee 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ActionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * CreateActionOfAlertRule.json + * x-ms-original-file: 2025-10-01-preview/actions/CreateActionOfAlertRule.json */ /** * Sample code: Creates or updates an action of alert rule. 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 index e70fa3228b3d..ce955d8d114e 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ActionsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * DeleteActionOfAlertRule.json + * x-ms-original-file: 2025-10-01-preview/actions/DeleteActionOfAlertRule.json */ /** * Sample code: Delete an action of alert rule. 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 index ca712c031428..eab815380ff7 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ActionsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * GetActionOfAlertRuleById.json + * x-ms-original-file: 2025-10-01-preview/actions/GetActionOfAlertRuleById.json */ /** * Sample code: Get an action of alert rule. 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 index db2e1d02a5b2..a72a6b4eaf9d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ActionsListByAlertRuleSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/actions/ - * GetAllActionsByAlertRule.json + * x-ms-original-file: 2025-10-01-preview/actions/GetAllActionsByAlertRule.json */ /** * Sample code: Get all actions of alert rule. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleOperationTriggerRuleRunSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleOperationTriggerRuleRunSamples.java new file mode 100644 index 000000000000..748342e4fd2b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleOperationTriggerRuleRunSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger; +import java.time.OffsetDateTime; + +/** + * Samples for AlertRuleOperation TriggerRuleRun. + */ +public final class AlertRuleOperationTriggerRuleRunSamples { + /* + * x-ms-original-file: 2025-10-01-preview/triggeredAnalyticsRuleRuns/triggerRuleRun_Post.json + */ + /** + * Sample code: triggerRuleRun_Post. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void triggerRuleRunPost(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.alertRuleOperations() + .triggerRuleRun("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", + new AnalyticsRuleRunTrigger().withExecutionTimeUtc(OffsetDateTime.parse("2022-12-22T15:37:03.074Z")), + com.azure.core.util.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 index 68568bbbdc44..851e4f436d1d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AlertRuleTemplatesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * alertRuleTemplates/GetAlertRuleTemplateById.json + * x-ms-original-file: 2025-10-01-preview/alertRuleTemplates/GetAlertRuleTemplateById.json */ /** * Sample code: Get alert rule template by Id. 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 index 48ae592d8eaf..c16584905605 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AlertRuleTemplatesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * alertRuleTemplates/GetAlertRuleTemplates.json + * x-ms-original-file: 2025-10-01-preview/alertRuleTemplates/GetAlertRuleTemplates.json */ /** * Sample code: Get all alert rule templates. 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 index 828baed88798..88b49595c609 100644 --- 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 @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.resourcemanager.securityinsights.models.AlertDetail; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.EntityMapping; @@ -14,12 +16,18 @@ 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.FusionSourceSettings; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem; 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.SentinelEntityMapping; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.time.Duration; import java.util.Arrays; @@ -31,9 +39,7 @@ */ public final class AlertRulesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * CreateFusionAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateFusionAlertRule.json */ /** * Sample code: Creates or updates a Fusion alert rule. @@ -46,14 +52,121 @@ public final class AlertRulesCreateOrUpdateSamples { .createOrUpdateWithResponse("myRg", "myWorkspace", "myFirstFusionRule", new FusionAlertRule().withEtag("3d00c3ca-0000-0100-0000-5d42d5010000") .withAlertRuleTemplateName("f71aba3d-28fb-450b-b192-4e76a83015c8") - .withEnabled(true), + .withEnabled(true) + .withSourceSettings(Arrays.asList( + new FusionSourceSettings().withEnabled(true).withSourceName("Anomalies"), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Alert providers") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Active Directory Identity Protection") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender for IoT") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft 365 Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Cloud App Security") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Endpoint") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Identity") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Office 365") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Sentinel scheduled analytics rules") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))))), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Raw logs from other sources") + .withSourceSubTypes(Arrays.asList(new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Palo Alto Networks") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))))), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * CreateMicrosoftSecurityIncidentCreationAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Creates or updates a MicrosoftSecurityIncidentCreation rule. @@ -72,9 +185,7 @@ public static void createsOrUpdatesAMicrosoftSecurityIncidentCreationRule( } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * CreateScheduledAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateScheduledAlertRule.json */ /** * Sample code: Creates or updates a Scheduled alert rule. @@ -92,6 +203,7 @@ public static void createsOrUpdatesAScheduledAlertRule( .withSuppressionDuration(Duration.parse("PT1H")) .withSuppressionEnabled(false) .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) + .withTechniques(Arrays.asList("T1037", "T1021")) .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(true) .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) .withReopenClosedIncident(false) @@ -116,9 +228,178 @@ public static void createsOrUpdatesAScheduledAlertRule( 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}}")), + .withAlertDetailsOverride(new AlertDetailsOverride() + .withAlertDisplayNameFormat("Alert from {{Computer}}") + .withAlertDescriptionFormat("Suspicious activity was made by {{ComputerIP}}") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_COMPONENT_NAME) + .withValue("ProductComponentNameCustomColumn"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_NAME) + .withValue("ProductNameCustomColumn"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.ALERT_LINK).withValue("Link")))) + .withSentinelEntitiesMappings( + Arrays.asList(new SentinelEntityMapping().withColumnName("Entities"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.json + */ + /** + * Sample code: Creates or updates a Fusion alert rule with scenario exclusion pattern. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAFusionAlertRuleWithScenarioExclusionPattern( + 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) + .withSourceSettings(Arrays.asList( + new FusionSourceSettings().withEnabled(true).withSourceName("Anomalies"), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Alert providers") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Active Directory Identity Protection") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Defender for IoT") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft 365 Defender") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Cloud App Security") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Endpoint") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Identity") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Microsoft Defender for Office 365") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Azure Sentinel scheduled analytics rules") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true)))))), + new FusionSourceSettings().withEnabled(true) + .withSourceName("Raw logs from other sources") + .withSourceSubTypes(Arrays.asList(new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("Palo Alto Networks") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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\"") + .withDescription("") + .withQuery( + "ProtectionStatus | extend HostCustomEntity = Computer | extend IPCustomEntity = ComputerIP_Hidden") + .withTactics(Arrays.asList(AttackTactic.PERSISTENCE, AttackTactic.LATERAL_MOVEMENT)) + .withTechniques(Arrays.asList("T1037", "T1021")) + .withDisplayName("Rule2") + .withEnabled(true) + .withSuppressionDuration(Duration.parse("PT1H")) + .withSuppressionEnabled(false) + .withSeverity(AlertSeverity.HIGH) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(true) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) + .withReopenClosedIncident(false) + .withLookbackDuration(Duration.parse("PT5H")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.HOST, EntityMappingType.ACCOUNT)))) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)), com.azure.core.util.Context.NONE); } 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 index 908680c73e21..1bc1f93f7697 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AlertRulesDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * DeleteAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/DeleteAlertRule.json */ /** * Sample code: Delete an alert rule. 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 index e5d45b989808..f818f616fa98 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AlertRulesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetScheduledAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/GetScheduledAlertRule.json */ /** * Sample code: Get a Scheduled alert rule. @@ -26,9 +24,21 @@ public final class AlertRulesGetSamples { } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetFusionAlertRule.json + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/alertRules/GetFusionAlertRule.json */ /** * Sample code: Get a Fusion alert rule. @@ -41,9 +51,7 @@ public static void getAFusionAlertRule(com.azure.resourcemanager.securityinsight } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetMicrosoftSecurityIncidentCreationAlertRule.json + * x-ms-original-file: 2025-10-01-preview/alertRules/GetMicrosoftSecurityIncidentCreationAlertRule.json */ /** * Sample code: Get a MicrosoftSecurityIncidentCreation rule. 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 index 3c4b8ec5faea..30da0b19d9f1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AlertRulesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/alertRules/ - * GetAllAlertRules.json + * x-ms-original-file: 2025-10-01-preview/alertRules/GetAllAlertRules.json */ /** * Sample code: Get all alert rules. 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 index 81452ad72363..2d55837834e0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,9 +13,7 @@ */ public final class AutomationRulesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_CreateOrUpdate.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_CreateOrUpdate.json */ /** * Sample code: AutomationRules_CreateOrUpdate. 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 index 4bb2caff7701..226dea8a6b47 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AutomationRulesDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_Delete.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_Delete.json */ /** * Sample code: AutomationRules_Delete. 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 index c2a4c35bbef2..6f2208cf5bdb 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AutomationRulesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_Get.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_Get.json */ /** * Sample code: AutomationRules_Get. 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 index 350525fdb8b4..a501a94d1022 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class AutomationRulesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * automationRules/AutomationRules_List.json + * x-ms-original-file: 2025-10-01-preview/automationRules/AutomationRules_List.json */ /** * Sample code: AutomationRules_List. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetSamples.java new file mode 100644 index 000000000000..b41de985ff13 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BillingStatistics Get. + */ +public final class BillingStatisticsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/billingStatistics/GetBillingStatistic.json + */ + /** + * Sample code: Get a billing statistic. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getABillingStatistic(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.billingStatistics() + .getWithResponse("myRg", "myWorkspace", "sapSolutionUsage", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListSamples.java new file mode 100644 index 000000000000..5065804eefa8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BillingStatistics List. + */ +public final class BillingStatisticsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/billingStatistics/GetAllBillingStatistics.json + */ + /** + * Sample code: Get all Microsoft Sentinel billing statistics. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllMicrosoftSentinelBillingStatistics( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.billingStatistics().list("myRg", "myWorkspace", com.azure.core.util.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..28b8dad8985d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationExpandSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import java.time.OffsetDateTime; + +/** + * Samples for BookmarkOperation Expand. + */ +public final class BookmarkOperationExpandSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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("27f76e63-c41b-480f-bb18-12ad2e011d49") + .withStartTime(OffsetDateTime.parse("2019-12-25T17:21:00.000Z")), + com.azure.core.util.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..7e66f925a94e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BookmarkRelations CreateOrUpdate. + */ +public final class BookmarkRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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..af220bd29fb4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BookmarkRelations Delete. + */ +public final class BookmarkRelationsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.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..00e5f04d5ff9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BookmarkRelations Get. + */ +public final class BookmarkRelationsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.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..89e62c2973a1 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for BookmarkRelations List. + */ +public final class BookmarkRelationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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, + com.azure.core.util.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 index 07494d304755..326afe0fb5ee 100644 --- 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 @@ -1,22 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; +import com.azure.resourcemanager.securityinsights.models.EntityFieldMapping; 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/stable/2022-11-01/examples/bookmarks/ - * CreateBookmark.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/CreateBookmark.json */ /** * Sample code: Creates or updates a bookmark. @@ -29,15 +29,20 @@ public final class BookmarksCreateOrUpdateSamples { .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") .withExistingWorkspace("myRg", "myWorkspace") .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withCreated(OffsetDateTime.parse("2019-01-01T13:15:30Z")) - .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .withCreated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) + .withCreatedBy(new UserInfo().withObjectId("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("2019-01-01T13:15:30Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("2046feea-040d-4a46-9e2b-91c2941bfa70"))) + .withUpdated(OffsetDateTime.parse("2021-09-01T13:15:30Z")) + .withUpdatedBy(new UserInfo().withObjectId("2046feea-040d-4a46-9e2b-91c2941bfa70")) + .withEntityMappings(Arrays.asList(new BookmarkEntityMappings().withEntityType("Account") + .withFieldMappings(Arrays + .asList(new EntityFieldMapping().withIdentifier("Fullname").withValue("johndoe@microsoft.com"))))) + .withTactics(Arrays.asList(AttackTactic.EXECUTION)) + .withTechniques(Arrays.asList("T1609")) .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 index 106c4df6e57f..16243aeb9609 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class BookmarksDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/bookmarks/ - * DeleteBookmark.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/DeleteBookmark.json */ /** * Sample code: Delete a bookmark. 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 index c978501d0371..c768b75cdc96 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class BookmarksGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/bookmarks/ - * GetBookmarkById.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/GetBookmarkById.json */ /** * Sample code: Get a bookmark. 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 index 44ad5c604c26..d9d8c1cc26d1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class BookmarksListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/bookmarks/ - * GetBookmarks.json + * x-ms-original-file: 2025-10-01-preview/bookmarks/GetBookmarks.json */ /** * Sample code: Get all bookmarks. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationInstallSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationInstallSamples.java new file mode 100644 index 000000000000..93f4972278c1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationInstallSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.PackageKind; + +/** + * Samples for ContentPackageOperation Install. + */ +public final class ContentPackageOperationInstallSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/InstallPackage.json + */ + /** + * Sample code: Install a package to the workspace. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + installAPackageToTheWorkspace(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackageOperations() + .define("str.azure-sentinel-solution-str") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("str.azure-sentinel-solution-str") + .withContentProductId("str.azure-sentinel-solution-str-sl-igl6jawr4gwmu") + .withContentKind(PackageKind.SOLUTION) + .withVersion("2.0.0") + .withDisplayName("str") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationUninstallSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationUninstallSamples.java new file mode 100644 index 000000000000..4eef719f217c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationUninstallSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentPackageOperation Uninstall. + */ +public final class ContentPackageOperationUninstallSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/UninstallPackage.json + */ + /** + * Sample code: Uninstall a package from the workspace. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + uninstallAPackageFromTheWorkspace(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackageOperations() + .uninstallWithResponse("myRg", "myWorkspace", "str.azure-sentinel-solution-str", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetSamples.java new file mode 100644 index 000000000000..eefc7b336b5e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentPackages Get. + */ +public final class ContentPackagesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetPackageById.json + */ + /** + * Sample code: Get installed packages by id. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getInstalledPackagesById(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackages() + .getWithResponse("myRg", "myWorkspace", "str.azure-sentinel-solution-str", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListSamples.java new file mode 100644 index 000000000000..9c27289cfa7f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentPackages List. + */ +public final class ContentPackagesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetPackages.json + */ + /** + * Sample code: Get all available packages. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllAvailablePackages(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentPackages() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateDeleteSamples.java new file mode 100644 index 000000000000..52e0ef01319d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentTemplate Delete. + */ +public final class ContentTemplateDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/DeleteTemplate.json + */ + /** + * Sample code: Delete metadata. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteMetadata(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplates() + .deleteWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateGetSamples.java new file mode 100644 index 000000000000..12e9f9ba39c9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentTemplate Get. + */ +public final class ContentTemplateGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetTemplateById.json + */ + /** + * Sample code: Get a template. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplates() + .getWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateInstallSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateInstallSamples.java new file mode 100644 index 000000000000..5fee34c2b31f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplateInstallSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.io.IOException; + +/** + * Samples for ContentTemplate Install. + */ +public final class ContentTemplateInstallSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/InstallTemplate.json + */ + /** + * Sample code: Get a template. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) + throws IOException { + manager.contentTemplates() + .define("str.azure-sentinel-solution-str") + .withExistingWorkspace("myRg", "myWorkspace") + .withContentId("8365ebfe-a381-45b7-ad08-7d818070e11f") + .withContentProductId("str.azure-sentinel-solution-str-ar-cbfe4fndz66bi") + .withPackageVersion("1.0.0") + .withVersion("1.0.1") + .withDisplayName("API Protection workbook template") + .withContentKind(Kind.ANALYTICS_RULE) + .withSource(new MetadataSource().withKind(SourceKind.SOLUTION) + .withName("str") + .withSourceId("str.azure-sentinel-solution-str")) + .withAuthor(new MetadataAuthor().withName("Microsoft").withEmail("support@microsoft.com")) + .withSupport(new MetadataSupport().withTier(SupportTier.MICROSOFT) + .withName("Microsoft Corporation") + .withEmail("support@microsoft.com") + .withLink("https://support.microsoft.com/")) + .withPackageId("str.azure-sentinel-solution-str") + .withPackageKind(PackageKind.SOLUTION) + .withPackageName("str") + .withMainTemplate(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\"contentVersion\":\"1.0.1\",\"resources\":[{\"name\":\"8365ebfe-a381-45b7-ad08-7d818070e11f\",\"type\":\"Microsoft.SecurityInsights/AlertRuleTemplates\",\"apiVersion\":\"2022-04-01-preview\",\"kind\":\"Scheduled\",\"location\":\"[parameters('workspace-location')]\",\"properties\":{\"description\":\"Creates an incident when a large number of Critical/High severity CrowdStrike Falcon sensor detections is triggered by a single user\",\"displayName\":\"Critical or High Severity Detections by User\",\"enabled\":false,\"query\":\"...\",\"queryFrequency\":\"PT1H\",\"queryPeriod\":\"PT1H\",\"severity\":\"High\",\"status\":\"Available\",\"suppressionDuration\":\"PT1H\",\"suppressionEnabled\":false,\"triggerOperator\":\"GreaterThan\",\"triggerThreshold\":0}},{\"name\":\"[concat(parameters('workspace'),'/Microsoft.SecurityInsights/',concat('AnalyticsRule-', last(split([resourceId('Microsoft.SecurityInsights/AlertRuleTemplates', 8365ebfe-a381-45b7-ad08-7d818070e11f)],'/'))))]\",\"type\":\"Microsoft.OperationalInsights/workspaces/providers/metadata\",\"apiVersion\":\"2022-01-01-preview\",\"properties\":{\"description\":\"CrowdStrike Falcon Endpoint Protection Analytics Rule 1\",\"author\":{\"name\":\"Microsoft\",\"email\":\"support@microsoft.com\"},\"contentId\":\"4465ebde-b381-45f7-ad08-7d818070a11c\",\"kind\":\"AnalyticsRule\",\"parentId\":\"[resourceId('Microsoft.SecurityInsights/AlertRuleTemplates', 8365ebfe-a381-45b7-ad08-7d818070e11f)]\",\"source\":{\"name\":\"str\",\"kind\":\"Solution\",\"sourceId\":\"str.azure-sentinel-solution-str\"},\"support\":{\"name\":\"Microsoft Corporation\",\"email\":\"support@microsoft.com\",\"link\":\"https://support.microsoft.com/\",\"tier\":\"Microsoft\"},\"version\":\"1.0.0\"}}]}", + Object.class, SerializerEncoding.JSON)) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationListSamples.java new file mode 100644 index 000000000000..926469d37208 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ContentTemplatesOperation List. + */ +public final class ContentTemplatesOperationListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetTemplates.json + */ + /** + * Sample code: Get all installed templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllInstalledTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.contentTemplatesOperations() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..69ea579aa7da --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateSamples.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion; +import com.azure.resourcemanager.securityinsights.models.ConnectorDataType; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.azure.resourcemanager.securityinsights.models.GraphQuery; +import com.azure.resourcemanager.securityinsights.models.InstructionStep; +import com.azure.resourcemanager.securityinsights.models.InstructionStepDetails; +import com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import java.io.IOException; +import java.util.Arrays; + +/** + * Samples for DataConnectorDefinitions CreateOrUpdate. + */ +public final class DataConnectorDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/CreateCustomizableDataConnectorDefinition.json + */ + /** + * Sample code: Create data connector definition. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createDataConnectorDefinition( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager.dataConnectorDefinitions() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new CustomizableConnectorDefinition().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withConnectorUiConfig(new CustomizableConnectorUiConfig().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.") + .withGraphQueries(Arrays.asList(new GraphQuery().withMetricName("Total events received") + .withLegend("GitHub audit log events") + .withBaseQuery("GitHubAuditLogPolling_CL"))) + .withDataTypes(Arrays.asList(new ConnectorDataType().withName("GitHubAuditLogPolling_CL") + .withLastDataReceivedQuery( + "GitHubAuditLogPolling_CL \n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)"))) + .withConnectivityCriteria(Arrays.asList(new ConnectivityCriterion().withType("IsConnectedQuery") + .withValue(Arrays.asList( + "GitHubAuditLogPolling_CL \n | summarize LastLogReceived = max(TimeGenerated)\n | project IsConnected = LastLogReceived > ago(30d)")))) + .withAvailability(new ConnectorDefinitionsAvailability().withStatus(1).withIsPreview(false)) + .withPermissions(new ConnectorDefinitionsPermissions() + .withResourceProvider(Arrays.asList(new ConnectorDefinitionsResourceProvider() + .withProvider("Microsoft.OperationalInsights/workspaces") + .withPermissionsDisplayText("read and write permissions are required.") + .withProviderDisplayName("Workspace") + .withScope(ProviderPermissionsScope.WORKSPACE) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(false) + .withWrite(true) + .withDelete(false) + .withAction(false)))) + .withCustoms(Arrays.asList(new CustomPermissionDetails() + .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 InstructionStep() + .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 InstructionStepDetails() + .withParameters(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"clientIdLabel\":\"Client ID\",\"clientSecretLabel\":\"Client Secret\",\"connectButtonLabel\":\"Connect\",\"disconnectButtonLabel\":\"Disconnect\"}", + Object.class, SerializerEncoding.JSON)) + .withType("OAuthForm")))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteSamples.java new file mode 100644 index 000000000000..9ff94ed83706 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for DataConnectorDefinitions Delete. + */ +public final class DataConnectorDefinitionsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/DeleteDataConnectorDefinitionById.json + */ + /** + * Sample code: Delete data connector definition. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteDataConnectorDefinition(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorDefinitions() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetSamples.java new file mode 100644 index 000000000000..9d47549f9092 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for DataConnectorDefinitions Get. + */ +public final class DataConnectorDefinitionsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/GetCustomizableDataConnectorDefinitionById.json + */ + /** + * Sample code: Get customize data connector definition. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getCustomizeDataConnectorDefinition( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorDefinitions() + .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListSamples.java new file mode 100644 index 000000000000..d320ae8a0bc2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for DataConnectorDefinitions List. + */ +public final class DataConnectorDefinitionsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectorDefinitions/GetDataConnectorDefinitions.json + */ + /** + * Sample code: Get all data connector definitions. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllDataConnectorDefinitions(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorDefinitions().list("myRg", "myWorkspace", com.azure.core.util.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..c3090c080a3f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsOperationPostSamples.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +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.IoTCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MCASCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MSTICheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeATPCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficeIRMCheckRequirements; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBICheckRequirements; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditCheckRequirements; +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: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsOffice365Project.json + */ + /** + * Sample code: Check requirements for Office365Project. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForOffice365Project( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new Office365ProjectCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json + */ + /** + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no authorization. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtectionNoAuthorization( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AADCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsIoT.json + */ + /** + * Sample code: Check requirements for IoT. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + checkRequirementsForIoT(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new IoTCheckRequirements().withSubscriptionId("c0688291-89d7-4bed-87a2-a7b1bff43f4c"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsMicrosoftPurviewInformationProtection.json + */ + /** + * Sample code: Check requirements for MicrosoftPurviewInformationProtection. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForMicrosoftPurviewInformationProtection( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", new MicrosoftPurviewInformationProtectionCheckRequirements() + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsPurviewAudit.json + */ + /** + * Sample code: Check requirements for PurviewAudit. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + checkRequirementsForPurviewAudit(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new PurviewAuditCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsAzureActiveDirectory.json + */ + /** + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection). + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtection( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AADCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsOfficePowerBI.json + */ + /** + * Sample code: Check requirements for OfficePowerBI. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + checkRequirementsForOfficePowerBI(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new OfficePowerBICheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CheckRequirementsAzureActiveDirectoryNoLicense.json + */ + /** + * Sample code: Check requirements for AADIP (Azure Active Directory Identity Protection) - no license. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void checkRequirementsForAADIPAzureActiveDirectoryIdentityProtectionNoLicense( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectorsCheckRequirementsOperations() + .postWithResponse("myRg", "myWorkspace", + new AADCheckRequirements().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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().withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.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..5ad175484607 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsConnectSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.management.serializer.SerializerFactory; +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: 2025-10-01-preview/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("fakeTokenPlaceholder") + .withRequestConfigUserInputValues(Arrays.asList(SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"displayText\":\"Organization Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", + Object.class, SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/ConnectAPIPollingV2Logs.json + */ + /** + * Sample code: Connect an APIPolling V2 logs data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void connectAnAPIPollingV2LogsDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) throws IOException { + manager.dataConnectors() + .connectWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + new DataConnectorConnectBody().withKind(ConnectAuthKind.APIKEY) + .withApiKey("fakeTokenPlaceholder") + .withDataCollectionEndpoint("https://test.eastus.ingest.monitor.azure.com") + .withDataCollectionRuleImmutableId("dcr-34adsj9o7d6f9de204478b9cgb43b631") + .withOutputStream("Custom-MyTableRawData") + .withRequestConfigUserInputValues(Arrays.asList(SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"displayText\":\"Organization Name\",\"placeHolderName\":\"{{placeHolder1}}\",\"placeHolderValue\":\"somePlaceHolderValue\",\"requestObjectKey\":\"apiEndpoint\"}", + Object.class, SerializerEncoding.JSON))), + com.azure.core.util.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 index 32e7aa82e357..26e9ef9f6961 100644 --- 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 @@ -1,28 +1,371 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; +import com.azure.core.management.serializer.SerializerFactory; +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.DCRConfiguration; 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.GCPAuthProperties; +import com.azure.resourcemanager.securityinsights.models.GCPDataConnector; +import com.azure.resourcemanager.securityinsights.models.GCPRequestProperties; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnector; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnector; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesAlerts; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesIncidents; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +import com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders; +import com.azure.resourcemanager.securityinsights.models.MtpProvider; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector; 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.OfficePowerBIConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIDataConnector; +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.PremiumMdtiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypesConnector; +import com.azure.resourcemanager.securityinsights.models.PremiumMicrosoftDefenderForThreatIntelligence; +import com.azure.resourcemanager.securityinsights.models.ProviderName; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditDataConnector; +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: 2025-10-01-preview/dataConnectors/CreateMicrosoftThreatProtectionDataConnetor.json + */ + /** + * Sample code: Creates or updates a MicrosoftThreatProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAMicrosoftThreatProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new MTPDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new MTPDataConnectorDataTypes() + .withIncidents(new MTPDataConnectorDataTypesIncidents().withState(DataTypeState.DISABLED)) + .withAlerts(new MTPDataConnectorDataTypesAlerts().withState(DataTypeState.ENABLED))) + .withFilteredProviders(new MtpFilteredProviders() + .withAlerts(Arrays.asList(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS))) + .withTenantId("178265c4-3136-4ff6-8ed1-b5b62b4cb5f5"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreatePurviewAuditDataConnector.json + */ + /** + * Sample code: Creates or updates a PurviewAudit data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAPurviewAuditDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new PurviewAuditDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withConnectorDefinitionName("PowerAutomate") + .withSourceType("MicrosoftFlow") + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint( + "https://microsoft-sentinel-datacollectionendpoint-123m.westeurope-1.ingest.monitor.azure.com") + .withDataCollectionRuleImmutableId("dcr-de21b053bd5a44beb99a256c9db85023") + .withStreamName("OFFICEPOWERAUTOMATE_RESTAPI")) + .withDataTypes(new PurviewAuditConnectorDataTypes() + .withLogs(new PurviewAuditConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + /* * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/CreateOfficeDataConnetor.json + * 2025-10-01-preview/dataConnectors/CreatePremiumMicrosoftDefenderForThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Creates or updates a PremiumMicrosoftDefenderForThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAPremiumMicrosoftDefenderForThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "8c569548-a86c-4fb4-8ae4-d1e35a6146f8", + new PremiumMicrosoftDefenderForThreatIntelligence() + .withLookbackPeriod(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")) + .withDataTypes(new PremiumMdtiDataConnectorDataTypes().withConnector( + new PremiumMdtiDataConnectorDataTypesConnector().withState(DataTypeState.ENABLED))) + .withTenantId("e4afb3c4-813b-4e68-b6de-e5360866e798"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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\n1. Log into the Qualys Vulnerability Management console with an administrator account, select the **Users** tab and the **Users** subtab. \n2. Click on the **New** drop-down menu and select **Users..**\n3. Create a username and password for the API account. \n4. In the **User Roles** tab, ensure the account role is set to **Manager** and access is allowed to **GUI** and **API**\n4. 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. \n5. Log back into the console using an administrator account and modify the API accounts User Roles, removing access to **GUI**. \n6. 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\n1. Click the **Deploy to Azure** button below. \n\n\t[![Deploy To Azure](https://aka.ms/deploytoazurebutton)](https://aka.ms/sentinelqualysvmazuredeploy)\n2. Select the preferred **Subscription**, **Resource Group** and **Location**. \n3. 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. \n4. Mark the checkbox labeled **I agree to the terms and conditions stated above**. \n5. 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\n1. From the Azure Portal, navigate to [Function App](https://portal.azure.com/#blade/HubsExtension/BrowseResource/resourceType/Microsoft.Web%2Fsites/kind/functionapp), and select **+ Add**.\n2. In the **Basics** tab, ensure Runtime stack is set to **Powershell Core**. \n3. In the **Hosting** tab, ensure the **Consumption (Serverless)** plan type is selected.\n4. Make other preferrable configuration changes, if needed, then click **Create**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("") + .withDescription( + "**2. Import Function App Code**\n\n1. In the newly created Function App, select **Functions** on the left pane and click **+ New Function**.\n2. Select **Timer Trigger**.\n3. Enter a unique Function **Name** and leave the default cron schedule of every 5 minutes, then click **Create**.\n5. Click on **Code + Test** on the left pane. \n6. Copy the [Function App Code](https://aka.ms/sentinelqualysvmazurefunctioncode) and paste into the Function App `run.ps1` editor.\n7. Click **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("") + .withDescription( + "**3. Configure the Function App**\n\n1. In the Function App, select the Function App Name and select **Configuration**.\n2. In the **Application settings** tab, select **+ New application setting**.\n3. 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.\n4. Once all application settings have been entered, click **Save**."), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("") + .withDescription( + "**4. Configure the host.json**.\n\nDue 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\n1. In the Function App, select the Function App Name and select the **App Service Editor** blade.\n2. Click **Go** to open the editor, then select the **host.json** file under the **wwwroot** directory.\n3. Add the line `\"functionTimeout\": \"00:10:00\",` above the `managedDependancy` line \n4. 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)")))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateOffice365ProjectDataConnetor.json + */ + /** + * Sample code: Creates or updates an Office365 Project data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnOffice365ProjectDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new Office365ProjectDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new Office365ProjectConnectorDataTypes() + .withLogs(new Office365ProjectConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateGoogleCloudPlatform.json + */ + /** + * Sample code: Creates or updates a GCP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAGCPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1", + new GCPDataConnector().withConnectorDefinitionName("GcpConnector") + .withAuth(new GCPAuthProperties() + .withServiceAccountEmail("sentinel-service-account@project-id.iam.gserviceaccount.com") + .withProjectNumber("123456789012") + .withWorkloadIdentityProviderId("sentinel-identity-provider")) + .withRequest(new GCPRequestProperties().withProjectId("project-id") + .withSubscriptionNames(Arrays.asList("sentinel-subscription"))) + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint( + "https://microsoft-sentinel-datacollectionendpoint-123m.westeurope-1.ingest.monitor.azure.com") + .withDataCollectionRuleImmutableId("dcr-de21b053bd5a44beb99a256c9db85023") + .withStreamName("SENTINEL_GCP_AUDIT_LOGS")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateMicrosoftThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Creates or updates a Microsoft Threat Intelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAMicrosoftThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", + new MSTIDataConnector() + .withDataTypes(new MSTIDataConnectorDataTypes().withMicrosoftEmergingThreatFeed( + new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed().withState(DataTypeState.ENABLED) + .withLookbackPeriod(OffsetDateTime.parse("1970-01-01T00:00:00.000Z")))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-10-01-preview/dataConnectors/CreateMicrosoftPurviewInformationProtectionDataConnetor.json + */ + /** + * Sample code: Creates or updates an MicrosoftPurviewInformationProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnMicrosoftPurviewInformationProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new MicrosoftPurviewInformationProtectionDataConnector() + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new MicrosoftPurviewInformationProtectionConnectorDataTypes() + .withLogs(new MicrosoftPurviewInformationProtectionConnectorDataTypesLogs() + .withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateOfficeDataConnetor.json */ /** * Sample code: Creates or updates an Office365 data connector. @@ -34,18 +377,62 @@ public static void createsOrUpdatesAnOffice365DataConnector( manager.dataConnectors() .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", new OfficeDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") - .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8") .withDataTypes(new OfficeDataConnectorDataTypes() .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.ENABLED)) .withSharePoint(new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) - .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))), + .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/CreateThreatIntelligenceDataConnector.json + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateOfficePowerBIDataConnector.json + */ + /** + * Sample code: Creates or updates an Office PowerBI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAnOfficePowerBIDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + new OfficePowerBIDataConnector().withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDataTypes(new OfficePowerBIConnectorDataTypes() + .withLogs(new OfficePowerBIConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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("fakeTokenPlaceholder") + .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"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/CreateThreatIntelligenceDataConnector.json */ /** * Sample code: Creates or updates an Threat Intelligence Platform data connector. @@ -56,10 +443,94 @@ public static void createsOrUpdatesAnThreatIntelligencePlatformDataConnector( com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.dataConnectors() .createOrUpdateWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - new TIDataConnector().withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b") - .withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) + new TIDataConnector().withTipLookbackPeriod(OffsetDateTime.parse("2020-01-01T13:00:30.123Z")) .withDataTypes(new TIDataConnectorDataTypes() - .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))), + .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))) + .withTenantId("06b3ccb8-1384-4bcc-aec7-852f6d57161b"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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("fakeTokenPlaceholder") + .withApiKeyIdentifier("fakeTokenPlaceholder")) + .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("$")))), com.azure.core.util.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 index 5cdfb61c46e7..d5aab921a9f8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -8,10 +8,69 @@ * Samples for DataConnectors Delete. */ public final class DataConnectorsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteOffice365ProjectDataConnetor.json + */ + /** + * Sample code: Delete an Office365 Project data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnOffice365ProjectDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + /* * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/DeleteOfficeDataConnetor.json + * 2025-10-01-preview/dataConnectors/DeleteMicrosoftPurviewInformationProtectionDataConnetor.json + */ + /** + * Sample code: Delete an MicrosoftPurviewInformationProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnMicrosoftPurviewInformationProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteGoogleCloudPlatform.json + */ + /** + * Sample code: Delete a GCP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAGCPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteOfficeDataConnetor.json */ /** * Sample code: Delete an Office365 data connector. @@ -24,4 +83,80 @@ public final class DataConnectorsDeleteSamples { .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteOfficePowerBIDataConnetor.json + */ + /** + * Sample code: Delete an Office PowerBI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAnOfficePowerBIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeletePurviewAuditDataConnector.json + */ + /** + * Sample code: Delete a PurviewAudit data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAPurviewAuditDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/DeleteMicrosoftThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Delete an MicrosoftThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAnMicrosoftThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-10-01-preview/dataConnectors/DeletePremiumMicrosoftDefenderForThreatIntelligenceDataConnector.json + */ + /** + * Sample code: Deletes a PremiumMicrosoftDefenderForThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deletesAPremiumMicrosoftDefenderForThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .deleteWithResponse("myRg", "myWorkspace", "8c569548-a86c-4fb4-8ae4-d1e35a6146f8", + com.azure.core.util.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..714ea4a7cdf4 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for DataConnectors Disconnect. + */ +public final class DataConnectorsDisconnectSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.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 index cc51ec8a70da..217585474762 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,43 +9,52 @@ */ public final class DataConnectorsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAzureSecurityCenterById.json + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetOffice365ProjectDataConnetorById.json */ /** - * Sample code: Get a ASC data connector. + * Sample code: Get an Office365 Project data connector. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getAASCDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + getAnOffice365ProjectDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.dataConnectors() - .getWithResponse("myRg", "myWorkspace", "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetOfficeDataConnetorById.json + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetGenericUI.json */ /** - * Sample code: Get an Office365 data connector. + * Sample code: Get a GenericUI data connector. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getAnOffice365DataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + getAGenericUIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.dataConnectors() - .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + .getWithResponse("myRg", "myWorkspace", "316ec55e-7138-4d63-ab18-90c8a60fd1c8", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetMicrosoftCloudAppSecurityById.json + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetIoTById.json + */ + /** + * Sample code: Get a IoT data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAIoTDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "d2e5dc7a-f3a2-429d-954b-939fa8c2932e", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetMicrosoftCloudAppSecurityById.json */ /** * Sample code: Get a MCAS data connector. @@ -60,9 +69,37 @@ public final class DataConnectorsGetSamples { } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAmazonWebServicesCloudTrailById.json + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetAmazonWebServicesCloudTrailById.json */ /** * Sample code: Get an AwsCloudTrail data connector. @@ -77,9 +114,21 @@ public final class DataConnectorsGetSamples { } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAzureAdvancedThreatProtectionById.json + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetAzureAdvancedThreatProtectionById.json */ /** * Sample code: Get an AATP data connector. @@ -95,8 +144,157 @@ public final class DataConnectorsGetSamples { /* * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json + * 2025-10-01-preview/dataConnectors/GetMicrosoftPurviewInformationProtectionDataConnetorById.json + */ + /** + * Sample code: Get a MicrosoftPurviewInformationProtection data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAMicrosoftPurviewInformationProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetMicrosoftInsiderRiskManagementById.json + */ + /** + * Sample code: Get an Office IRM data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnOfficeIRMDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetGoogleCloudPlatformById.json + */ + /** + * Sample code: Get a GCP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAGCPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "GCP_fce27b90-d6f5-4d30-991a-af509a2b50a1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetAzureActiveDirectoryById.json + */ + /** + * Sample code: Get an AADIP (Azure Active Directory Identity Protection) data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAnAADIPAzureActiveDirectoryIdentityProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetOffice365AdvancedThreatProtectionById.json + */ + /** + * Sample code: Get an Office ATP data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnOfficeATPDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "3d3e955e-33eb-401d-89a7-251c81ddd660", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetPurviewAuditDataConnectorById.json + */ + /** + * Sample code: Get a PurviewAudit data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAPurviewAuditDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetPremiumMicrosoftDefenderForThreatIntelligenceById.json + */ + /** + * Sample code: Get a PremiumMicrosoftDefenderForThreatIntelligence data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAPremiumMicrosoftDefenderForThreatIntelligenceDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "8c569548-a86c-4fb4-8ae4-d1e35a6146f8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetMicrosoftDefenderAdvancedThreatProtectionById.json */ /** * Sample code: Get a MDATP data connector. @@ -111,35 +309,77 @@ public final class DataConnectorsGetSamples { } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetThreatIntelligenceById.json + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetMicrosoftThreatProtectionById.json */ /** - * Sample code: Get a TI data connector. + * Sample code: Get a MicrosoftThreatProtection data connector. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getATIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + public static void getAMicrosoftThreatProtectionDataConnector( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.dataConnectors() .getWithResponse("myRg", "myWorkspace", "c345bf40-8509-4ed2-b947-50cb773aaf04", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetAzureActiveDirectoryById.json + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetDynamics365DataConnectorById.json */ /** - * Sample code: Get an AAD data connector. + * Sample code: Get a Dynamics365 data connector. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getAnAADDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + getADynamics365DataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.dataConnectors() - .getWithResponse("myRg", "myWorkspace", "f0cd27d2-5f03-4c06-ba31-d2dc82dcb51d", + .getWithResponse("myRg", "myWorkspace", "c2541efb-c9a6-47fe-9501-87d1017d1512", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetRestApiPollerById.json + */ + /** + * Sample code: Get a RestApiPoller data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getARestApiPollerDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "RestApiPoller_fce27b90-d6f5-4d30-991a-af509a2b50a1", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetOfficePowerBIDataConnetorById.json + */ + /** + * Sample code: Get an Office365 PowerBI data connector. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAnOffice365PowerBIDataConnector(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.dataConnectors() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.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 index 9c026cce1dd5..1e051645500f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class DataConnectorsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * dataConnectors/GetDataConnectors.json + * x-ms-original-file: 2025-10-01-preview/dataConnectors/GetDataConnectors.json */ /** * Sample code: Get all data connectors. 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..2b1c6d777f0b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import java.time.OffsetDateTime; + +/** + * Samples for Entities Expand. + */ +public final class EntitiesExpandSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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("a77992f3-25e9-4d01-99a4-5ff606cc410a") + .withStartTime(OffsetDateTime.parse("2019-04-25T00:00:00.000Z")), + com.azure.core.util.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..ac112d068262 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for Entities GetInsights. + */ +public final class EntitiesGetInsightsSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4")), + com.azure.core.util.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..70f42b5abf41 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetSamples.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Entities Get. + */ +public final class EntitiesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.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..8748bfb0a853 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelineListSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import java.time.OffsetDateTime; + +/** + * Samples for EntitiesGetTimeline List. + */ +public final class EntitiesGetTimelineListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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), + com.azure.core.util.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..0c22c3fa0764 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Entities List. + */ +public final class EntitiesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.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..6e5dc13988be --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; + +/** + * Samples for Entities Queries. + */ +public final class EntitiesQueriesSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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() + .queries("myRg", "myWorkspace", "e1d3d618-e11f-478b-98e3-bb381539a8e1", EntityItemQueryKind.INSIGHT, + com.azure.core.util.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..d7263581cd1b --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for EntitiesRelations List. + */ +public final class EntitiesRelationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRunPlaybookSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRunPlaybookSamples.java new file mode 100644 index 000000000000..c5152ec9fe11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRunPlaybookSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Entities RunPlaybook. + */ +public final class EntitiesRunPlaybookSamples { + /* + * x-ms-original-file: 2025-10-01-preview/manualTrigger/Entities_RunPlaybook.json + */ + /** + * Sample code: Entities_RunPlaybook. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void entitiesRunPlaybook(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.entities() + .runPlaybookWithResponse("myRg", "myWorkspace", "72e01a22-5cd2-4139-a149-9f2736ff2ar2", null, + com.azure.core.util.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..c0e3798c0fc4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +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: 2025-10-01-preview/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){\nSecurityEvent\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(\nComputer has '@', tostring(split(Computer, '@')[0]),\nComputer has '\\\\', tostring(split(Computer, '\\\\')[1]),\nComputer has '.', tostring(split(Computer, '.')[0]),\nComputer\n)\n| extend Host_NTDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', tostring(split(Computer, '.')[-2]), \nComputer\n)\n| extend Host_DnsDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \nComputer\n)\n| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \nor (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \nor v_Host_AzureID =~ _ResourceId \nor 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};\nGetAccountActions('{{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), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @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..709f9ca0f65c --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for EntityQueries Delete. + */ +public final class EntityQueriesDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.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..bb5a66ea5e5e --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for EntityQueries Get. + */ +public final class EntityQueriesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.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..d0ad2ca59663 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; + +/** + * Samples for EntityQueries List. + */ +public final class EntityQueriesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", EntityQueryTemplateKind.EXPANSION, com.azure.core.util.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..70a90e8eb7ee --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for EntityQueryTemplates Get. + */ +public final class EntityQueryTemplatesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.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..7341e1328c11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; + +/** + * Samples for EntityQueryTemplates List. + */ +public final class EntityQueryTemplatesListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", EntityQueryTemplateKind.ACTIVITY, com.azure.core.util.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..196b646cc3ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for EntityRelations GetRelation. + */ +public final class EntityRelationsGetRelationSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsCreateSamples.java new file mode 100644 index 000000000000..1b9889b3dbe8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsCreateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; + +/** + * Samples for FileImports Create. + */ +public final class FileImportsCreateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/CreateFileImport.json + */ + /** + * Sample code: Create a file import. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createAFileImport(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withExistingWorkspace("myRg", "myWorkspace") + .withIngestionMode(IngestionMode.INGEST_ANY_VALID_RECORDS) + .withContentType(FileImportContentType.STIX_INDICATOR) + .withImportFile( + new FileMetadata().withFileFormat(FileFormat.JSON).withFileName("myFile.json").withFileSize(4653)) + .withSource("mySource") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsDeleteSamples.java new file mode 100644 index 000000000000..fd664a132ed2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for FileImports Delete. + */ +public final class FileImportsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/DeleteFileImport.json + */ + /** + * Sample code: Delete a file import. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAFileImport(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .delete("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetSamples.java new file mode 100644 index 000000000000..6b323b681eea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for FileImports Get. + */ +public final class FileImportsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/GetFileImportById.json + */ + /** + * Sample code: Get a file import. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAFileImport(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListSamples.java new file mode 100644 index 000000000000..fbccf86424f6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for FileImports List. + */ +public final class FileImportsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/fileImports/GetFileImports.json + */ + /** + * Sample code: Get all file imports. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllFileImports(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.fileImports() + .list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListSamples.java new file mode 100644 index 000000000000..cc71af52b477 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for GetRecommendations List. + */ +public final class GetRecommendationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/recommendations/GetRecommendations.json + */ + /** + * Sample code: Get Recommendations list. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getRecommendationsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.getRecommendations().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetSingleRecommendationSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetSingleRecommendationSamples.java new file mode 100644 index 000000000000..f688588b0ee7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetSingleRecommendationSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Get SingleRecommendation. + */ +public final class GetSingleRecommendationSamples { + /* + * x-ms-original-file: 2025-10-01-preview/recommendations/GetRecommendation.json + */ + /** + * Sample code: Get a recommendation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.gets() + .singleRecommendationWithResponse("myRg", "myWorkspace", "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListSamples.java new file mode 100644 index 000000000000..8cc7de4d2424 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for GetTriggeredAnalyticsRuleRuns List. + */ +public final class GetTriggeredAnalyticsRuleRunsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/triggeredAnalyticsRuleRuns/triggeredAnalyticsRuleRuns_Get.json + */ + /** + * Sample code: triggeredAnalyticsRuleRuns_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + triggeredAnalyticsRuleRunsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.getTriggeredAnalyticsRuleRuns().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..632416907d39 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments CreateOrUpdate. + */ +public final class HuntCommentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/CreateHuntComment.json + */ + /** + * Sample code: Creates or updates a hunt comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAHuntComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .define("2216d0e1-91e3-4902-89fd-d2df8c535096") + .withExistingHunt("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f") + .withMessage("This is a test comment.") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteSamples.java new file mode 100644 index 000000000000..61c8bd653c8c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments Delete. + */ +public final class HuntCommentsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/DeleteHuntComment.json + */ + /** + * Sample code: Delete a hunt comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAHuntComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .deleteWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c123456", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetSamples.java new file mode 100644 index 000000000000..fb8856e214ca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments Get. + */ +public final class HuntCommentsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntCommentById.json + */ + /** + * Sample code: Get a hunt comment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHuntComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .getWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c535096", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListSamples.java new file mode 100644 index 000000000000..0d2f34a4dcde --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntComments List. + */ +public final class HuntCommentsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntComments.json + */ + /** + * Sample code: Get all hunt comments. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllHuntComments(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntComments() + .list("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", null, null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..15c74afb15ca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import java.util.Arrays; + +/** + * Samples for HuntRelations CreateOrUpdate. + */ +public final class HuntRelationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/CreateHuntRelation.json + */ + /** + * Sample code: Creates or updates a hunt relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAHuntRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .define("2216d0e1-91e3-4902-89fd-d2df8c535096") + .withExistingHunt("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f") + .withRelatedResourceId( + "/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/Bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096") + .withLabels(Arrays.asList("Test Label")) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteSamples.java new file mode 100644 index 000000000000..fc100ed119f2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntRelations Delete. + */ +public final class HuntRelationsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/DeleteHuntRelation.json + */ + /** + * Sample code: Delete a hunt relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAHuntRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .deleteWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c535096", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetSamples.java new file mode 100644 index 000000000000..9b9a1d98f0f1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntRelations Get. + */ +public final class HuntRelationsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntRelationById.json + */ + /** + * Sample code: Get a hunt relation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHuntRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .getWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + "2216d0e1-91e3-4902-89fd-d2df8c535096", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListSamples.java new file mode 100644 index 000000000000..f87afbcc11c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for HuntRelations List. + */ +public final class HuntRelationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntRelations.json + */ + /** + * Sample code: Get all hunt relations. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllHuntRelations(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.huntRelations() + .list("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", null, null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..a14f7bacd0cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.util.Arrays; + +/** + * Samples for Hunts CreateOrUpdate. + */ +public final class HuntsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/CreateHunt.json + */ + /** + * Sample code: Creates or updates a hunt. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesAHunt(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts() + .define("163e7b2a-a2ec-4041-aaba-d878a38f265f") + .withExistingWorkspace("myRg", "myWorkspace") + .withDisplayName("Log4J new hunt") + .withDescription("Log4J Hunt Description") + .withStatus(Status.NEW) + .withHypothesisStatus(HypothesisStatus.UNKNOWN) + .withAttackTactics(Arrays.asList(AttackTactic.RECONNAISSANCE)) + .withAttackTechniques(Arrays.asList("T1595")) + .withLabels(Arrays.asList("Label1", "Label2")) + .withOwner(new HuntOwner().withObjectId("873b5263-5d34-4149-b356-ad341b01e123")) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteSamples.java new file mode 100644 index 000000000000..ec613515a21d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Hunts Delete. + */ +public final class HuntsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/DeleteHunt.json + */ + /** + * Sample code: Delete a hunt. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAHunt(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts() + .deleteWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetSamples.java new file mode 100644 index 000000000000..ca80a4733234 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Hunts Get. + */ +public final class HuntsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHuntById.json + */ + /** + * Sample code: Get a hunt. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAHunt(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts() + .getWithResponse("myRg", "myWorkspace", "163e7b2a-a2ec-4041-aaba-d878a38f265f", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsListSamples.java new file mode 100644 index 000000000000..b8b417cdbddf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/HuntsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Hunts List. + */ +public final class HuntsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/hunts/GetHunts.json + */ + /** + * Sample code: Get all hunts. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllHunts(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.hunts().list("myRg", "myWorkspace", null, null, null, null, com.azure.core.util.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 index 09b68bbc3a3c..71efa423bc76 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,17 +9,15 @@ */ public final class IncidentCommentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/CreateIncidentComment.json + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_CreateOrUpdate.json */ /** - * Sample code: Creates or updates an incident comment. + * Sample code: IncidentComments_CreateOrUpdate. * * @param manager Entry point to SecurityInsightsManager. */ public static void - createsOrUpdatesAnIncidentComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + incidentCommentsCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidentComments() .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") .withExistingIncident("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") 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 index c998cd9791a6..bf6eaca58820 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,17 +9,15 @@ */ public final class IncidentCommentsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/DeleteIncidentComment.json + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_Delete.json */ /** - * Sample code: Delete the incident comment. + * Sample code: IncidentComments_Delete. * * @param manager Entry point to SecurityInsightsManager. */ public static void - deleteTheIncidentComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + incidentCommentsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidentComments() .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.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 index e41671b590db..faa06bf96afd 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,17 +9,14 @@ */ public final class IncidentCommentsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/GetIncidentCommentById.json + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_Get.json */ /** - * Sample code: Get an incident comment. + * Sample code: IncidentComments_Get. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - getAnIncidentComment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + public static void incidentCommentsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidentComments() .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.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 index d52d807a5dad..885d1db12597 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,17 +9,15 @@ */ public final class IncidentCommentsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * comments/GetAllIncidentComments.json + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentComments/IncidentComments_List.json */ /** - * Sample code: Get all incident comments. + * Sample code: IncidentComments_List. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getAllIncidentComments(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + incidentCommentsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidentComments() .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", null, null, null, null, com.azure.core.util.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 index ae3cb8dd999b..64d316523686 100644 --- 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 @@ -1,30 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; +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/stable/2022-11-01/examples/incidents/ - * relations/CreateIncidentRelation.json + * x-ms-original-file: 2025-10-01-preview/incidents/relations/CreateIncidentRelation.json */ /** - * Sample code: Creates or updates an incident relation. + * Sample code: Creates or updates a relation for a given incident. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - createsOrUpdatesAnIncidentRelation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + public static void createsOrUpdatesARelationForAGivenIncident( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidentRelations() - .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") - .withExistingIncident("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812") - .withRelatedResourceId( - "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096") - .create(); + .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"), + com.azure.core.util.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 index 4d3ace1360e3..7ef04806327d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class IncidentRelationsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * relations/DeleteIncidentRelation.json + * x-ms-original-file: 2025-10-01-preview/incidents/relations/DeleteIncidentRelation.json */ /** * Sample code: Delete the incident relation. 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 index 55e51741161d..d9b7c49227b9 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class IncidentRelationsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * relations/GetIncidentRelationByName.json + * x-ms-original-file: 2025-10-01-preview/incidents/relations/GetIncidentRelationByName.json */ /** * Sample code: Get an incident relation. 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 index 045926ddf191..c3ca1f1650ac 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class IncidentRelationsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * relations/GetAllIncidentRelations.json + * x-ms-original-file: 2025-10-01-preview/incidents/relations/GetAllIncidentRelations.json */ /** * Sample code: Get all incident relations. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateSamples.java new file mode 100644 index 000000000000..4095038f427b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; + +/** + * Samples for IncidentTasks CreateOrUpdate. + */ +public final class IncidentTasksCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_CreateOrUpdate.json + */ + /** + * Sample code: IncidentTasks_CreateOrUpdate. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentTasksCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingIncident("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5") + .withTitle("Task title") + .withStatus(IncidentTaskStatus.NEW) + .withDescription("Task description") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteSamples.java new file mode 100644 index 000000000000..2602149d9fef --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for IncidentTasks Delete. + */ +public final class IncidentTasksDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_Delete.json + */ + /** + * Sample code: IncidentTasks_Delete. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentTasksDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetSamples.java new file mode 100644 index 000000000000..214439802357 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for IncidentTasks Get. + */ +public final class IncidentTasksGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_Get.json + */ + /** + * Sample code: IncidentTasks_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentTasksGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListSamples.java new file mode 100644 index 000000000000..d584ba3f3624 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for IncidentTasks List. + */ +public final class IncidentTasksListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentTasks/IncidentTasks_List.json + */ + /** + * Sample code: IncidentTasks_List. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void incidentTasksList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidentTasks() + .list("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.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 index cdba3042eaab..d11911f31c6f 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -10,38 +10,35 @@ 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/stable/2022-11-01/examples/incidents/ - * CreateIncident.json + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_CreateOrUpdate.json */ /** - * Sample code: Creates or updates an incident. + * Sample code: Incidents_CreateOrUpdate. * * @param manager Entry point to SecurityInsightsManager. */ public static void - createsOrUpdatesAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + incidentsCreateOrUpdate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidents() .define("73e01a99-5cd7-4139-a149-9f2736ff2ab5") .withExistingWorkspace("myRg", "myWorkspace") .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withTitle("My incident") + .withDescription("This is a demo incident") + .withSeverity(IncidentSeverity.HIGH) + .withStatus(IncidentStatus.CLOSED) .withClassification(IncidentClassification.FALSE_POSITIVE) + .withClassificationReason(IncidentClassificationReason.INACCURATE_DATA) .withClassificationComment("Not a malicious activity") - .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) - .withDescription("This is a demo incident") + .withOwner(new IncidentOwnerInfo().withObjectId("2046feea-040d-4a46-9e2b-91c2941bfa70")) .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/IncidentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteSamples.java index bc3b337a867c..9842253daaa5 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,16 +9,14 @@ */ public final class IncidentsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * DeleteIncident.json + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_Delete.json */ /** - * Sample code: Delete an incident. + * Sample code: Incidents_Delete. * * @param manager Entry point to SecurityInsightsManager. */ - public static void deleteAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + public static void incidentsDelete(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidents() .deleteWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.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 index f272b107e3a6..8f20f90fa53b 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,16 +9,14 @@ */ public final class IncidentsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetIncidentById.json + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_Get.json */ /** - * Sample code: Get an incident. + * Sample code: Incidents_Get. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAnIncident(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + public static void incidentsGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidents() .getWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ab5", com.azure.core.util.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 index b2b197b380a1..77a113bda63c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,19 +9,16 @@ */ public final class IncidentsListAlertsSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetAllIncidentAlerts.json + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentAlerts/Incidents_ListAlerts.json */ /** - * Sample code: Get all incident alerts. + * Sample code: Incidents_ListAlerts. * * @param manager Entry point to SecurityInsightsManager. */ - public static void - getAllIncidentAlerts(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + public static void incidentsListAlerts(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidents() - .listAlertsWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + .listAlertsWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", com.azure.core.util.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 index 42621babe671..f152e2e50b2d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,19 +9,17 @@ */ public final class IncidentsListBookmarksSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetAllIncidentBookmarks.json + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentBookmarks/Incidents_ListBookmarks.json */ /** - * Sample code: Get all incident bookmarks. + * Sample code: Incidents_ListBookmarks. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getAllIncidentBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + incidentsListBookmarks(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidents() - .listBookmarksWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + .listBookmarksWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", com.azure.core.util.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 index 05b7d971d993..95697ffa3b2c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,19 +9,17 @@ */ public final class IncidentsListEntitiesSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetAllIncidentEntities.json + * x-ms-original-file: 2025-10-01-preview/incidents/IncidentEntities/Incidents_ListEntities.json */ /** - * Sample code: Gets all incident related entities. + * Sample code: Incidents_ListEntities. * * @param manager Entry point to SecurityInsightsManager. */ public static void - getsAllIncidentRelatedEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + incidentsListEntities(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidents() - .listEntitiesWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + .listEntitiesWithResponse("myRg", "myWorkspace", "69a30280-6a4c-4aa7-9af0-5d63f335d600", com.azure.core.util.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 index ba70ea21292b..8d1961310b38 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,16 +9,14 @@ */ public final class IncidentsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/incidents/ - * GetIncidents.json + * x-ms-original-file: 2025-10-01-preview/incidents/Incidents_List.json */ /** - * Sample code: Get all incidents. + * Sample code: Incidents_List. * * @param manager Entry point to SecurityInsightsManager. */ - public static void getAllIncidents(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + public static void incidentsList(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { manager.incidents() .list("myRg", "myWorkspace", null, "properties/createdTimeUtc desc", 1, null, com.azure.core.util.Context.NONE); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookSamples.java new file mode 100644 index 000000000000..7833d10898a7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Incidents RunPlaybook. + */ +public final class IncidentsRunPlaybookSamples { + /* + * x-ms-original-file: 2025-10-01-preview/manualTrigger/Incidents_RunPlaybook.json + */ + /** + * Sample code: Incidents_RunPlaybook. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + incidentsRunPlaybook(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.incidents() + .runPlaybookWithResponse("myRg", "myWorkspace", "73e01a99-5cd7-4139-a149-9f2736ff2ar4", null, + com.azure.core.util.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..82b74f3f4f11 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataCreateSamples.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +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: 2025-10-01-preview/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("AnalyticsRule") + .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(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withOperator(MetadataDependencyOperator.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")) + .withCustomVersion("1.0") + .withContentSchemaVersion("2.0") + .withThreatAnalysisTactics(Arrays.asList("reconnaissance", "commandandcontrol")) + .withThreatAnalysisTechniques(Arrays.asList("T1548", "T1548.001")) + .withPreviewImages(Arrays.asList("firstImage.png", "secondImage.jpeg")) + .withPreviewImagesDark(Arrays.asList("firstImageDark.png", "secondImageDark.jpeg")) + .create(); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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("AnalyticsRule") + .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..dcb3f41055f9 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Metadata Delete. + */ +public final class MetadataDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.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..a8ff4d8721b7 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Metadata Get. + */ +public final class MetadataGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.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..91c5dc5c3edb --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Metadata List. + */ +public final class MetadataListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-10-01-preview/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, com.azure.core.util.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..7bc3704a3b97 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/MetadataUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +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: 2025-10-01-preview/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", com.azure.core.util.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..7ca143897216 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for OfficeConsents Delete. + */ +public final class OfficeConsentsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.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..9ef24d5d182f --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for OfficeConsents Get. + */ +public final class OfficeConsentsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", + com.azure.core.util.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..7b7177244236 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for OfficeConsents List. + */ +public final class OfficeConsentsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OperationsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OperationsListSamples.java index 41a5512b658f..798f5e1f00b3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OperationsListSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/operations/ - * ListOperations.json + * x-ms-original-file: 2025-10-01-preview/operations/ListOperations.json */ /** * Sample code: Get all operations. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageGetSamples.java new file mode 100644 index 000000000000..521a159741c3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductPackage Get. + */ +public final class ProductPackageGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetProductPackageById.json + */ + /** + * Sample code: Get a package. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAPackage(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productPackages() + .getWithResponse("myRg", "myWorkspace", "str.azure-sentinel-solution-str", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationListSamples.java new file mode 100644 index 000000000000..68fec51bc813 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductPackagesOperation List. + */ +public final class ProductPackagesOperationListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentPackages/GetProductPackages.json + */ + /** + * Sample code: Get all available packages. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllAvailablePackages(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productPackagesOperations() + .list("myRg", "myWorkspace", null, null, null, null, null, com.azure.core.util.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..ee861e385b26 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductSettings Delete. + */ +public final class ProductSettingsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.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..06ce16e7a615 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductSettings Get. + */ +public final class ProductSettingsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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", com.azure.core.util.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..b2d02533f6f1 --- /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) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductSettings List. + */ +public final class ProductSettingsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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().list("myRg", "myWorkspace", com.azure.core.util.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..e84efe743ac4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EyesOn; + +/** + * Samples for ProductSettings Update. + */ +public final class ProductSettingsUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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\""), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateGetSamples.java new file mode 100644 index 000000000000..e65988a816cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductTemplate Get. + */ +public final class ProductTemplateGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetProductTemplateById.json + */ + /** + * Sample code: Get a template. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getATemplate(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productTemplates() + .getWithResponse("myRg", "myWorkspace", "8365ebfe-a381-45b7-ad08-7d818070e11f", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationListSamples.java new file mode 100644 index 000000000000..566e042eeadc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for ProductTemplatesOperation List. + */ +public final class ProductTemplatesOperationListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/contentTemplates/GetProductTemplates.json + */ + /** + * Sample code: Get all installed templates. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllInstalledTemplates(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.productTemplatesOperations() + .list("myRg", "myWorkspace", null, null, null, null, null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateRecommendationSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateRecommendationSamples.java new file mode 100644 index 000000000000..14e6c1f674b0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateRecommendationSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for Reevaluate Recommendation. + */ +public final class ReevaluateRecommendationSamples { + /* + * x-ms-original-file: 2025-10-01-preview/recommendations/ReevaluateRecommendation.json + */ + /** + * Sample code: Reevaluate a recommendation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + reevaluateARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.reevaluates() + .recommendationWithResponse("myRg", "myWorkspace", "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListGeodataByIpSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListGeodataByIpSamples.java new file mode 100644 index 000000000000..267c1d9f1434 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListGeodataByIpSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; + +/** + * Samples for ResourceProvider ListGeodataByIp. + */ +public final class ResourceProviderListGeodataByIpSamples { + /* + * x-ms-original-file: 2025-10-01-preview/enrichment/GetGeodataWithWorkspaceByIp.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.resourceProviders() + .listGeodataByIpWithResponse("myRg", "myWorkspace", EnrichmentType.MAIN, + new EnrichmentIpAddressBody().withIpAddress("1.2.3.4"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListWhoisByDomainSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListWhoisByDomainSamples.java new file mode 100644 index 000000000000..3ab096a17b34 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderListWhoisByDomainSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; + +/** + * Samples for ResourceProvider ListWhoisByDomain. + */ +public final class ResourceProviderListWhoisByDomainSamples { + /* + * x-ms-original-file: 2025-10-01-preview/enrichment/GetWhoisWithWorkspaceByDomainName.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.resourceProviders() + .listWhoisByDomainWithResponse("myRg", "myWorkspace", EnrichmentType.MAIN, + new EnrichmentDomainBody().withDomain("microsoft.com"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateSamples.java index 3d203cba89ba..9ae1672fe843 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,16 +13,13 @@ import java.io.IOException; import java.time.Duration; import java.util.Arrays; -import java.util.UUID; /** * Samples for SecurityMLAnalyticsSettings CreateOrUpdate. */ public final class SecurityMLAnalyticsSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json */ /** * Sample code: Creates or updates a Anomaly Security ML Analytics Settings. @@ -52,7 +49,7 @@ public static void createsOrUpdatesAAnomalySecurityMLAnalyticsSettings( .withSettingsStatus(SettingsStatus.PRODUCTION) .withIsDefaultSettings(true) .withAnomalySettingsVersion(0) - .withSettingsDefinitionId(UUID.fromString("f209187f-1d17-4431-94af-c141bf5f23db")), + .withSettingsDefinitionId("f209187f-1d17-4431-94af-c141bf5f23db"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteSamples.java index 0be50f1be808..4bb665ef9b85 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class SecurityMLAnalyticsSettingsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json */ /** * Sample code: Delete a Security ML Analytics Settings. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetSamples.java index dc8c9f7e933e..7ffa86540e2a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class SecurityMLAnalyticsSettingsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json */ /** * Sample code: Get a Anomaly Security ML Analytics Settings. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListSamples.java index e34c71af2b90..ad2109ef0041 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListSamples.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class SecurityMLAnalyticsSettingsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json + * x-ms-original-file: 2025-10-01-preview/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json */ /** * Sample code: Get all Security ML Analytics Settings. 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 index 925c3aac509f..daeb45b0782c 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class SentinelOnboardingStatesCreateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/CreateSentinelOnboardingState.json + * x-ms-original-file: 2025-10-01-preview/onboardingStates/CreateSentinelOnboardingState.json */ /** * Sample code: Create Sentinel onboarding state. 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 index 53af5b10c3ff..13d20b4848fa 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class SentinelOnboardingStatesDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/DeleteSentinelOnboardingState.json + * x-ms-original-file: 2025-10-01-preview/onboardingStates/DeleteSentinelOnboardingState.json */ /** * Sample code: Delete Sentinel onboarding state. 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 index cff543c45898..4af7e2d0e28a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class SentinelOnboardingStatesGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/GetSentinelOnboardingState.json + * x-ms-original-file: 2025-10-01-preview/onboardingStates/GetSentinelOnboardingState.json */ /** * Sample code: Get Sentinel onboarding state. 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 index c4ed7595c4a2..16c97c3f5b53 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class SentinelOnboardingStatesListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * onboardingStates/GetAllSentinelOnboardingStates.json + * x-ms-original-file: 2025-10-01-preview/onboardingStates/GetAllSentinelOnboardingStates.json */ /** * Sample code: Get all Sentinel onboarding states. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlOperationListRepositoriesSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlOperationListRepositoriesSamples.java new file mode 100644 index 000000000000..bcab4d52117a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlOperationListRepositoriesSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; + +/** + * Samples for SourceControlOperation ListRepositories. + */ +public final class SourceControlOperationListRepositoriesSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControlOperations() + .listRepositories("myRg", "myWorkspace", + new RepositoryAccessProperties().withKind(RepositoryAccessKind.OAUTH) + .withCode("fakeTokenPlaceholder") + .withState("state") + .withClientId("54b3c2c0-1f48-4a1c-af9f-6399c3240b73"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsCreateSamples.java new file mode 100644 index 000000000000..637df617624d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsCreateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.fluent.models.RepositoryAccess; +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.RepositoryAccessKind; +import java.util.Arrays; + +/** + * Samples for SourceControls Create. + */ +public final class SourceControlsCreateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/sourcecontrols/CreateSourceControl.json + */ + /** + * Sample code: Creates or updates a source control. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsOrUpdatesASourceControl(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.sourceControls() + .define("789e0c1f-4a3d-43ad-809c-e713b677b04a") + .withExistingWorkspace("myRg", "myWorkspace") + .withDisplayName("My Source Control") + .withRepoType(RepoType.GITHUB) + .withContentTypes(Arrays.asList(ContentType.ANALYTICS_RULE, ContentType.WORKBOOK)) + .withRepository(new Repository().withUrl("https://github.com/user/repo") + .withBranch("master") + .withDisplayUrl("https://github.com/user/repo")) + .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") + .withDescription("This is a source control") + .withRepositoryAccess(new RepositoryAccess().withKind(RepositoryAccessKind.OAUTH) + .withCode("fakeTokenPlaceholder") + .withState("state") + .withClientId("54b3c2c0-1f48-4a1c-af9f-6399c3240b73")) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsDeleteSamples.java new file mode 100644 index 000000000000..a1af2ced4b6f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsDeleteSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessKind; +import com.azure.resourcemanager.securityinsights.models.RepositoryAccessProperties; + +/** + * Samples for SourceControls Delete. + */ +public final class SourceControlsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControls() + .deleteWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", + new RepositoryAccessProperties().withKind(RepositoryAccessKind.OAUTH) + .withCode("fakeTokenPlaceholder") + .withState("state") + .withClientId("54b3c2c0-1f48-4a1c-af9f-6399c3240b73"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsGetSamples.java new file mode 100644 index 000000000000..b746e39d8ffb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for SourceControls Get. + */ +public final class SourceControlsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControls() + .getWithResponse("myRg", "myWorkspace", "789e0c1f-4a3d-43ad-809c-e713b677b04a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsListSamples.java new file mode 100644 index 000000000000..1b35b0d07d7f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/SourceControlsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for SourceControls List. + */ +public final class SourceControlsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/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.sourceControls().list("myRg", "myWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountSamples.java new file mode 100644 index 000000000000..cb626786ba21 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.CountQuery; +import com.azure.resourcemanager.securityinsights.models.TiType; + +/** + * Samples for ThreatIntelligence Count. + */ +public final class ThreatIntelligenceCountSamples { + /* + * x-ms-original-file: 2025-10-01-preview/threatintelligence/PostThreatIntelligenceCount.json + */ + /** + * Sample code: Get TI object count. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getTIObjectCount(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligences() + .countWithResponse("myRg", "myWorkspace", TiType.MAIN, new CountQuery(), com.azure.core.util.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 index e7c205388253..654dffe1a0a4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,9 +12,7 @@ */ public final class ThreatIntelligenceIndicatorAppendTagsSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/AppendTagsThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/AppendTagsThreatIntelligence.json */ /** * Sample code: Append tags to a threat intelligence indicator. 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 index 611b5aafd759..7db67c5dc0f6 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,9 +12,7 @@ */ public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/CreateThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/CreateThreatIntelligence.json */ /** * Sample code: Create a new Threat Intelligence. @@ -39,7 +37,7 @@ public final class ThreatIntelligenceIndicatorCreateIndicatorSamples { .withRevoked(false) .withConfidence(78) .withThreatTypes(Arrays.asList("compromised")) - .withValidFrom("2020-04-15T17:44:00.114052Z") + .withValidFrom("2021-09-15T17:44:00.114052Z") .withValidUntil("") .withModified(""), com.azure.core.util.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 index cc323cb02f19..781f94909a07 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,9 +12,7 @@ */ public final class ThreatIntelligenceIndicatorCreateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/UpdateThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/UpdateThreatIntelligence.json */ /** * Sample code: Update a threat Intelligence indicator. 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 index 9f8789c93794..6efd2f8630c1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ThreatIntelligenceIndicatorDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/DeleteThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/DeleteThreatIntelligence.json */ /** * Sample code: Delete a threat intelligence indicator. 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 index 1e1441f135ce..a83feaa2aa85 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ThreatIntelligenceIndicatorGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/GetThreatIntelligenceById.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/GetThreatIntelligenceById.json */ /** * Sample code: View a threat intelligence indicator by name. 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 index 28de4c5ff975..8a03d07b7bb1 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ThreatIntelligenceIndicatorMetricsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/CollectThreatIntelligenceMetrics.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/CollectThreatIntelligenceMetrics.json */ /** * Sample code: Get threat intelligence indicators metrics. 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 index 5e06fda5c85f..48304e19cf11 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -14,9 +14,7 @@ */ public final class ThreatIntelligenceIndicatorQueryIndicatorsSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/QueryThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/QueryThreatIntelligence.json */ /** * Sample code: Query threat intelligence indicators as per filtering criteria. @@ -29,8 +27,8 @@ public static void queryThreatIntelligenceIndicatorsAsPerFilteringCriteria( .queryIndicators("myRg", "myWorkspace", new ThreatIntelligenceFilteringCriteria().withPageSize(100) .withMinConfidence(25) .withMaxConfidence(80) - .withMinValidUntil("2020-04-05T17:44:00.114052Z") - .withMaxValidUntil("2020-04-25T17:44:00.114052Z") + .withMinValidUntil("2021-04-05T17:44:00.114052Z") + .withMaxValidUntil("2021-04-25T17:44:00.114052Z") .withSortBy(Arrays.asList(new ThreatIntelligenceSortingCriteria().withItemKey("fakeTokenPlaceholder") .withSortOrder(ThreatIntelligenceSortingOrder.DESCENDING))) .withSources(Arrays.asList("Azure Sentinel")), com.azure.core.util.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 index aa9fb4fd0be7..3e775e896f4d 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,9 +12,7 @@ */ public final class ThreatIntelligenceIndicatorReplaceTagsSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/ReplaceTagsThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/ReplaceTagsThreatIntelligence.json */ /** * Sample code: Replace tags to a Threat Intelligence. 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 index ff6deb2c9f5b..7be0dc1d9f67 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class ThreatIntelligenceIndicatorsOperationListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/ - * threatintelligence/GetThreatIntelligence.json + * x-ms-original-file: 2025-10-01-preview/threatintelligence/GetThreatIntelligence.json */ /** * Sample code: Get all threat intelligence indicators. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceQuerySamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceQuerySamples.java new file mode 100644 index 000000000000..4d6933541049 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceQuerySamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.QueryCondition; +import com.azure.resourcemanager.securityinsights.models.QuerySortBy; +import com.azure.resourcemanager.securityinsights.models.SortingDirection; +import com.azure.resourcemanager.securityinsights.models.TiType; +import java.util.Arrays; + +/** + * Samples for ThreatIntelligence Query. + */ +public final class ThreatIntelligenceQuerySamples { + /* + * x-ms-original-file: 2025-10-01-preview/threatintelligence/PostThreatIntelligenceQuery.json + */ + /** + * Sample code: Get TI objects. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getTIObjects(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.threatIntelligences() + .query("myRg", "myWorkspace", TiType.MAIN, + new Query() + .withCondition(new QueryCondition().withStixObjectType("attack-pattern") + .withClauses(Arrays.asList(new ConditionClause().withField("lastUpdatedTimeUtc") + .withOperator(Operator.ON_OR_BEFORE_ABSOLUTE) + .withValues(Arrays.asList("2024-02-09T23:59:59.999Z"))))) + .withSortBy(new QuerySortBy().withDirection(SortingDirection.DESC).withField("lastUpdatedTimeUtc")) + .withMaxPageSize(100) + .withMinPageSize(100), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationGetSamples.java new file mode 100644 index 000000000000..647ff894fc5a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for TriggeredAnalyticsRuleRunOperation Get. + */ +public final class TriggeredAnalyticsRuleRunOperationGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/triggeredAnalyticsRuleRuns/triggeredAnalyticsRuleRun_Get.json + */ + /** + * Sample code: triggeredAnalyticsRuleRun_Get. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + triggeredAnalyticsRuleRunGet(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.triggeredAnalyticsRuleRunOperations() + .getWithResponse("myRg", "myWorkspace", "65360bb0-8986-4ade-a89d-af3cf44d28aa", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/UpdateRecommendationSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/UpdateRecommendationSamples.java new file mode 100644 index 000000000000..984f98573e65 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/UpdateRecommendationSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties; +import com.azure.resourcemanager.securityinsights.models.State; + +/** + * Samples for Update Recommendation. + */ +public final class UpdateRecommendationSamples { + /* + * x-ms-original-file: 2025-10-01-preview/recommendations/PatchRecommendation.json + */ + /** + * Sample code: Creates a recommendation. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + createsARecommendation(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.updates() + .recommendationWithResponse("myRg", "myWorkspace", "6d4b54eb-8684-4aa3-a156-3aa37b8014bc", + new RecommendationPatch().withProperties(new RecommendationPatchProperties().withState(State.ACTIVE)), + com.azure.core.util.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 index ccbe41ad0d15..dbf0aeceebf4 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,9 +13,7 @@ */ public final class WatchlistItemsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * CreateWatchlistItem.json + * x-ms-original-file: 2025-10-01-preview/watchlists/CreateWatchlistItem.json */ /** * Sample code: Create or update a watchlist item. 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 index 1f58832ee557..cfe8b6402dff 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class WatchlistItemsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * DeleteWatchlistItem.json + * x-ms-original-file: 2025-10-01-preview/watchlists/DeleteWatchlistItem.json */ /** * Sample code: Delete a watchlist item. 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 index 0272f5be3087..39034c947896 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class WatchlistItemsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlistItemById.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlistItemById.json */ /** * Sample code: Get a watchlist item. 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 index 6ee3e2b0afb6..bbc01b6b888a 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class WatchlistItemsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlistItems.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlistItems.json */ /** * Sample code: Get all watchlist Items. 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 index 24e04549b8fa..aed4cb7210b2 100644 --- 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 @@ -1,19 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; -import com.azure.resourcemanager.securityinsights.models.Source; +import com.azure.resourcemanager.securityinsights.models.SourceType; /** * Samples for Watchlists CreateOrUpdate. */ public final class WatchlistsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * CreateWatchlist.json + * x-ms-original-file: 2025-10-01-preview/watchlists/CreateWatchlist.json */ /** * Sample code: Create or update a watchlist. @@ -28,16 +26,15 @@ public final class WatchlistsCreateOrUpdateSamples { .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") .withDisplayName("High Value Assets Watchlist") .withProvider("Microsoft") - .withSource(Source.LOCAL_FILE) + .withSource("watchlist.csv") + .withSourceType(SourceType.LOCAL) .withDescription("Watchlist from CSV content") .withItemsSearchKey("header1") .create(); } /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * CreateWatchlistAndWatchlistItems.json + * x-ms-original-file: 2025-10-01-preview/watchlists/CreateWatchlistAndWatchlistItems.json */ /** * Sample code: Create or update a watchlist and bulk creates watchlist items. @@ -52,7 +49,8 @@ public static void createOrUpdateAWatchlistAndBulkCreatesWatchlistItems( .withEtag("\"0300bf09-0000-0000-0000-5c37296e0000\"") .withDisplayName("High Value Assets Watchlist") .withProvider("Microsoft") - .withSource(Source.LOCAL_FILE) + .withSource("watchlist.csv") + .withSourceType(SourceType.LOCAL) .withDescription("Watchlist from CSV content") .withNumberOfLinesToSkip(1) .withRawContent("This line will be skipped\nheader1,header2\nvalue1,value2") 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 index 2ea289724ea9..b618ede2a9f2 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class WatchlistsDeleteSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * DeleteWatchlist.json + * x-ms-original-file: 2025-10-01-preview/watchlists/DeleteWatchlist.json */ /** * Sample code: Delete a watchlist. @@ -19,7 +17,6 @@ public final class WatchlistsDeleteSamples { * @param manager Entry point to SecurityInsightsManager. */ public static void deleteAWatchlist(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { - manager.watchlists() - .deleteWithResponse("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.Context.NONE); + manager.watchlists().delete("myRg", "myWorkspace", "highValueAsset", com.azure.core.util.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 index 3907f1f47d47..69081836bb28 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class WatchlistsGetSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlistByAlias.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlistByAlias.json */ /** * Sample code: Get a watchlist. 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 index 5b27d8ddc0a1..2073c94e0bb3 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -9,9 +9,7 @@ */ public final class WatchlistsListSamples { /* - * x-ms-original-file: - * specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2022-11-01/examples/watchlists/ - * GetWatchlists.json + * x-ms-original-file: 2025-10-01-preview/watchlists/GetWatchlists.json */ /** * Sample code: Get all watchlists. diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateSamples.java new file mode 100644 index 000000000000..8e0c63d649b1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs Create. + */ +public final class WorkspaceManagerAssignmentJobsCreateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/CreateJob.json + */ + /** + * Sample code: Creates a job for the specified workspace manager assignment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsAJobForTheSpecifiedWorkspaceManagerAssignment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignmentJobs() + .createWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteSamples.java new file mode 100644 index 000000000000..9456a515565d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs Delete. + */ +public final class WorkspaceManagerAssignmentJobsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/DeleteJob.json + */ + /** + * Sample code: Delete a workspace manager job. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAWorkspaceManagerJob(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignmentJobs() + .deleteWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + "cfbe1338-8276-4d5d-8b96-931117f9fa0e", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetSamples.java new file mode 100644 index 000000000000..3b7ceecd2659 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs Get. + */ +public final class WorkspaceManagerAssignmentJobsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetJob.json + */ + /** + * Sample code: Get a workspace manager job. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAWorkspaceManagerJob(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignmentJobs() + .getWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + "cfbe1338-8276-4d5d-8b96-931117f9fa0e", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListSamples.java new file mode 100644 index 000000000000..a3aa843ee11b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignmentJobs List. + */ +public final class WorkspaceManagerAssignmentJobsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetAllJobs.json + */ + /** + * Sample code: Get all jobs for the specified Sentinel workspace manager assignment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllJobsForTheSpecifiedSentinelWorkspaceManagerAssignment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignmentJobs() + .list("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..751fe72caa2d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import java.util.Arrays; + +/** + * Samples for WorkspaceManagerAssignments CreateOrUpdate. + */ +public final class WorkspaceManagerAssignmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/CreateOrUpdateWorkspaceManagerAssignment.json + */ + /** + * Sample code: Creates or updates a workspace manager assignment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWorkspaceManagerAssignment( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignments() + .define("47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58") + .withExistingWorkspace("myRg", "myWorkspace") + .withTargetResourceName("37207a7a-3b8a-438f-a559-c7df400e1b96") + .withItems(Arrays.asList(new AssignmentItem().withResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspac-es/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/microsoftSecurityIncidentCreationRuleExampleOne"), + new AssignmentItem().withResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspac-es/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/microsoftSecurityIncidentCreationRuleExampleTwo"))) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..7d5c6442e113 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignments Delete. + */ +public final class WorkspaceManagerAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/DeleteWorkspaceManagerAssignment.json + */ + /** + * Sample code: Delete a workspace manager assignment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAWorkspaceManagerAssignment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignments() + .deleteWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetSamples.java new file mode 100644 index 000000000000..c3af657e5d49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignments Get. + */ +public final class WorkspaceManagerAssignmentsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetWorkspaceManagerAssignment.json + */ + /** + * Sample code: Get a workspace manager assignment. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAWorkspaceManagerAssignment(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignments() + .getWithResponse("myRg", "myWorkspace", "47cdc5f5-37c4-47b5-bd5f-83c84b8bdd58", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListSamples.java new file mode 100644 index 000000000000..fd0f2914cccf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerAssignments List. + */ +public final class WorkspaceManagerAssignmentsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerAssignments/GetAllWorkspaceManagerAssignments.json + */ + /** + * Sample code: Get all workspace manager assignments for the Sentinel workspace manager. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllWorkspaceManagerAssignmentsForTheSentinelWorkspaceManager( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerAssignments() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..91744cb6bec0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.resourcemanager.securityinsights.models.Mode; + +/** + * Samples for WorkspaceManagerConfigurations CreateOrUpdate. + */ +public final class WorkspaceManagerConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * 2025-10-01-preview/workspaceManagerConfigurations/CreateOrUpdateWorkspaceManagerConfiguration.json + */ + /** + * Sample code: Create or Update a workspace manager Configuration. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createOrUpdateAWorkspaceManagerConfiguration( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerConfigurations() + .define("default") + .withExistingWorkspace("myRg", "myWorkspace") + .withMode(Mode.ENABLED) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..7e90de81b152 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerConfigurations Delete. + */ +public final class WorkspaceManagerConfigurationsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerConfigurations/DeleteWorkspaceManagerConfiguration.json + */ + /** + * Sample code: Delete a workspace manager configuration. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void deleteAWorkspaceManagerConfiguration( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerConfigurations() + .deleteWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetSamples.java new file mode 100644 index 000000000000..75ed8d278b0b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerConfigurations Get. + */ +public final class WorkspaceManagerConfigurationsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerConfigurations/GetWorkspaceManagerConfiguration.json + */ + /** + * Sample code: Get a workspace manager configuration. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAWorkspaceManagerConfiguration(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerConfigurations() + .getWithResponse("myRg", "myWorkspace", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListSamples.java new file mode 100644 index 000000000000..1658857c3c81 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerConfigurations List. + */ +public final class WorkspaceManagerConfigurationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerConfigurations/GetAllWorkspaceManagerConfigurations.json + */ + /** + * Sample code: Get all workspace manager configurations for a Sentinel workspace. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllWorkspaceManagerConfigurationsForASentinelWorkspace( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerConfigurations() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..af131e427f8d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import java.util.Arrays; + +/** + * Samples for WorkspaceManagerGroups CreateOrUpdate. + */ +public final class WorkspaceManagerGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/CreateOrUpdateWorkspaceManagerGroup.json + */ + /** + * Sample code: Creates or updates a workspace manager group. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createsOrUpdatesAWorkspaceManagerGroup( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .define("37207a7a-3b8a-438f-a559-c7df400e1b96") + .withExistingWorkspace("myRg", "myWorkspace") + .withDescription("Group of all financial and banking institutions") + .withDisplayName("Banks") + .withMemberResourceNames( + Arrays.asList("afbd324f-6c48-459c-8710-8d1e1cd03812", "f5fa104e-c0e3-4747-9182-d342dc048a9e")) + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteSamples.java new file mode 100644 index 000000000000..231d7b0ae54e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerGroups Delete. + */ +public final class WorkspaceManagerGroupsDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/DeleteWorkspaceManagerGroup.json + */ + /** + * Sample code: Delete a workspace manager group. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAWorkspaceManagerGroup(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .deleteWithResponse("myRg", "myWorkspace", "37207a7a-3b8a-438f-a559-c7df400e1b96", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetSamples.java new file mode 100644 index 000000000000..2f1f5b80af6b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerGroups Get. + */ +public final class WorkspaceManagerGroupsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/GetWorkspaceManagerGroup.json + */ + /** + * Sample code: Get a workspace manager group. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAWorkspaceManagerGroup(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .getWithResponse("myRg", "myWorkspace", "37207a7a-3b8a-438f-a559-c7df400e1b96", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListSamples.java new file mode 100644 index 000000000000..0561300e5b44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerGroups List. + */ +public final class WorkspaceManagerGroupsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerGroups/GetAllWorkspaceManagerGroups.json + */ + /** + * Sample code: Get all workspace manager groups in the Sentinel workspace manager. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void getAllWorkspaceManagerGroupsInTheSentinelWorkspaceManager( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerGroups() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2d566f8eacb5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers CreateOrUpdate. + */ +public final class WorkspaceManagerMembersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/CreateOrUpdateWorkspaceManagerMember.json + */ + /** + * Sample code: Create or Update a workspace manager member. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void createOrUpdateAWorkspaceManagerMember( + com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerMembers() + .define("afbd324f-6c48-459c-8710-8d1e1cd03812") + .withExistingWorkspace("myRg", "myWorkspace") + .withTargetWorkspaceResourceId( + "/subscriptions/7aef9d48-814f-45ad-b644-b0343316e174/resourceGroups/otherRg/providers/Microsoft.OperationalInsights/workspaces/Example_Workspace") + .withTargetWorkspaceTenantId("f676d436-8d16-42db-81b7-ab578e110ccd") + .create(); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteSamples.java new file mode 100644 index 000000000000..6cc7bc3f36e8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers Delete. + */ +public final class WorkspaceManagerMembersDeleteSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/DeleteWorkspaceManagerMember.json + */ + /** + * Sample code: Delete a workspace manager member. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + deleteAWorkspaceManagerMember(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerMembers() + .deleteWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetSamples.java new file mode 100644 index 000000000000..4e162e4274cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers Get. + */ +public final class WorkspaceManagerMembersGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/GetWorkspaceManagerMember.json + */ + /** + * Sample code: Get a workspace manager member. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAWorkspaceManagerMember(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerMembers() + .getWithResponse("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListSamples.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListSamples.java new file mode 100644 index 000000000000..312145322bee --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/samples/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +/** + * Samples for WorkspaceManagerMembers List. + */ +public final class WorkspaceManagerMembersListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/workspaceManagerMembers/GetAllWorkspaceManagerMembers.json + */ + /** + * Sample code: Get all workspace manager members. + * + * @param manager Entry point to SecurityInsightsManager. + */ + public static void + getAllWorkspaceManagerMembers(com.azure.resourcemanager.securityinsights.SecurityInsightsManager manager) { + manager.workspaceManagerMembers() + .list("myRg", "myWorkspace", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..414c7a004554 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.AADCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class AADCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AADCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"zkhi\"}").toObject(AADCheckRequirementsProperties.class); + Assertions.assertEquals("zkhi", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AADCheckRequirementsProperties model = new AADCheckRequirementsProperties().withTenantId("zkhi"); + model = BinaryData.fromObject(model).toObject(AADCheckRequirementsProperties.class); + Assertions.assertEquals("zkhi", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsTests.java new file mode 100644 index 000000000000..adca642b2d44 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AADCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class AADCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AADCheckRequirements model + = BinaryData.fromString("{\"kind\":\"AzureActiveDirectory\",\"properties\":{\"tenantId\":\"nuhgy\"}}") + .toObject(AADCheckRequirements.class); + Assertions.assertEquals("nuhgy", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AADCheckRequirements model = new AADCheckRequirements().withTenantId("nuhgy"); + model = BinaryData.fromObject(model).toObject(AADCheckRequirements.class); + Assertions.assertEquals("nuhgy", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AadDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADDataConnectorPropertiesTests.java similarity index 63% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AadDataConnectorPropertiesTests.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADDataConnectorPropertiesTests.java index 8fef1ce78e2d..73ffee58e4ca 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AadDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AADDataConnectorPropertiesTests.java @@ -1,33 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.AadDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.AADDataConnectorProperties; import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; import com.azure.resourcemanager.securityinsights.models.DataTypeState; import org.junit.jupiter.api.Assertions; -public final class AadDataConnectorPropertiesTests { +public final class AADDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AadDataConnectorProperties model - = BinaryData.fromString("{\"tenantId\":\"wpgdak\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}}") - .toObject(AadDataConnectorProperties.class); - Assertions.assertEquals("wpgdak", model.tenantId()); + AADDataConnectorProperties model + = BinaryData.fromString("{\"tenantId\":\"xo\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}}") + .toObject(AADDataConnectorProperties.class); + Assertions.assertEquals("xo", model.tenantId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AadDataConnectorProperties model = new AadDataConnectorProperties().withTenantId("wpgdak") + AADDataConnectorProperties model = new AADDataConnectorProperties().withTenantId("xo") .withDataTypes(new AlertsDataTypeOfDataConnector() .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); - model = BinaryData.fromObject(model).toObject(AadDataConnectorProperties.class); - Assertions.assertEquals("wpgdak", model.tenantId()); + model = BinaryData.fromObject(model).toObject(AADDataConnectorProperties.class); + Assertions.assertEquals("xo", model.tenantId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..b0887b899d7d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.AATPCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class AATPCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AATPCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"ertj\"}").toObject(AATPCheckRequirementsProperties.class); + Assertions.assertEquals("ertj", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AATPCheckRequirementsProperties model = new AATPCheckRequirementsProperties().withTenantId("ertj"); + model = BinaryData.fromObject(model).toObject(AATPCheckRequirementsProperties.class); + Assertions.assertEquals("ertj", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsTests.java new file mode 100644 index 000000000000..fb2e394296ea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AATPCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class AATPCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AATPCheckRequirements model = BinaryData + .fromString("{\"kind\":\"AzureAdvancedThreatProtection\",\"properties\":{\"tenantId\":\"rwpekiprjb\"}}") + .toObject(AATPCheckRequirements.class); + Assertions.assertEquals("rwpekiprjb", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AATPCheckRequirements model = new AATPCheckRequirements().withTenantId("rwpekiprjb"); + model = BinaryData.fromObject(model).toObject(AATPCheckRequirements.class); + Assertions.assertEquals("rwpekiprjb", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AscDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPDataConnectorPropertiesTests.java similarity index 59% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AscDataConnectorPropertiesTests.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPDataConnectorPropertiesTests.java index 7dbc19c6c4f3..92af537936db 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AscDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AATPDataConnectorPropertiesTests.java @@ -1,34 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.AscDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.AATPDataConnectorProperties; import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; import com.azure.resourcemanager.securityinsights.models.DataTypeState; import org.junit.jupiter.api.Assertions; -public final class AscDataConnectorPropertiesTests { +public final class AATPDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AscDataConnectorProperties model - = BinaryData.fromString("{\"subscriptionId\":\"z\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}}") - .toObject(AscDataConnectorProperties.class); + AATPDataConnectorProperties model + = BinaryData.fromString("{\"tenantId\":\"agpokddxe\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}}") + .toObject(AATPDataConnectorProperties.class); + Assertions.assertEquals("agpokddxe", model.tenantId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); - Assertions.assertEquals("z", model.subscriptionId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AscDataConnectorProperties model = new AscDataConnectorProperties() + AATPDataConnectorProperties model = new AATPDataConnectorProperties().withTenantId("agpokddxe") .withDataTypes(new AlertsDataTypeOfDataConnector() - .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))) - .withSubscriptionId("z"); - model = BinaryData.fromObject(model).toObject(AscDataConnectorProperties.class); + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(AATPDataConnectorProperties.class); + Assertions.assertEquals("agpokddxe", model.tenantId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); - Assertions.assertEquals("z", model.subscriptionId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..f292d87666aa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ASCCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class ASCCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ASCCheckRequirementsProperties model + = BinaryData.fromString("{\"subscriptionId\":\"wpejtvqo\"}").toObject(ASCCheckRequirementsProperties.class); + Assertions.assertEquals("wpejtvqo", model.subscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ASCCheckRequirementsProperties model = new ASCCheckRequirementsProperties().withSubscriptionId("wpejtvqo"); + model = BinaryData.fromObject(model).toObject(ASCCheckRequirementsProperties.class); + Assertions.assertEquals("wpejtvqo", model.subscriptionId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsTests.java new file mode 100644 index 000000000000..ee38638991d2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ASCCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class ASCCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ASCCheckRequirements model = BinaryData + .fromString("{\"kind\":\"AzureSecurityCenter\",\"properties\":{\"subscriptionId\":\"rpwjmcgiw\"}}") + .toObject(ASCCheckRequirements.class); + Assertions.assertEquals("rpwjmcgiw", model.subscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ASCCheckRequirements model = new ASCCheckRequirements().withSubscriptionId("rpwjmcgiw"); + model = BinaryData.fromObject(model).toObject(ASCCheckRequirements.class); + Assertions.assertEquals("rpwjmcgiw", model.subscriptionId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..1961ed12ee3e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ASCDataConnectorPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ASCDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import org.junit.jupiter.api.Assertions; + +public final class ASCDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ASCDataConnectorProperties model = BinaryData + .fromString("{\"subscriptionId\":\"pbcjtrpzuyudivbx\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") + .toObject(ASCDataConnectorProperties.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("pbcjtrpzuyudivbx", model.subscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ASCDataConnectorProperties model = new ASCDataConnectorProperties() + .withDataTypes(new AlertsDataTypeOfDataConnector() + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))) + .withSubscriptionId("pbcjtrpzuyudivbx"); + model = BinaryData.fromObject(model).toObject(ASCDataConnectorProperties.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("pbcjtrpzuyudivbx", model.subscriptionId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AWSAuthModelTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AWSAuthModelTests.java new file mode 100644 index 000000000000..f351d5069db9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AWSAuthModelTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AWSAuthModel; +import org.junit.jupiter.api.Assertions; + +public final class AWSAuthModelTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AWSAuthModel model + = BinaryData.fromString("{\"type\":\"AWS\",\"roleArn\":\"tftedz\",\"externalId\":\"bjtvgjsxmtyjj\"}") + .toObject(AWSAuthModel.class); + Assertions.assertEquals("tftedz", model.roleArn()); + Assertions.assertEquals("bjtvgjsxmtyjj", model.externalId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AWSAuthModel model = new AWSAuthModel().withRoleArn("tftedz").withExternalId("bjtvgjsxmtyjj"); + model = BinaryData.fromObject(model).toObject(AWSAuthModel.class); + Assertions.assertEquals("tftedz", model.roleArn()); + Assertions.assertEquals("bjtvgjsxmtyjj", model.externalId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AadDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AadDataConnectorTests.java index 5f51bb0bb229..ab18d215b1c9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AadDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AadDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,22 +15,22 @@ public final class AadDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AadDataConnector model = BinaryData.fromString( - "{\"kind\":\"AzureActiveDirectory\",\"properties\":{\"tenantId\":\"rkywuhpsvfuu\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"xxwla\",\"id\":\"iexzsrzpge\",\"name\":\"q\",\"type\":\"yb\"}") + "{\"kind\":\"AzureActiveDirectory\",\"properties\":{\"tenantId\":\"ng\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}},\"etag\":\"axyxzlbciphm\",\"id\":\"x\",\"name\":\"oqrndktxfvonfeeq\",\"type\":\"pkrietbgni\"}") .toObject(AadDataConnector.class); - Assertions.assertEquals("xxwla", model.etag()); - Assertions.assertEquals("rkywuhpsvfuu", model.tenantId()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("axyxzlbciphm", model.etag()); + Assertions.assertEquals("ng", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AadDataConnector model = new AadDataConnector().withEtag("xxwla") - .withTenantId("rkywuhpsvfuu") + AadDataConnector model = new AadDataConnector().withEtag("axyxzlbciphm") + .withTenantId("ng") .withDataTypes(new AlertsDataTypeOfDataConnector() - .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); model = BinaryData.fromObject(model).toObject(AadDataConnector.class); - Assertions.assertEquals("xxwla", model.etag()); - Assertions.assertEquals("rkywuhpsvfuu", model.tenantId()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("axyxzlbciphm", model.etag()); + Assertions.assertEquals("ng", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AatpDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AatpDataConnectorTests.java index 6e2d6e277937..4a74e35ce65e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AatpDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AatpDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,22 +15,22 @@ public final class AatpDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AatpDataConnector model = BinaryData.fromString( - "{\"kind\":\"AzureAdvancedThreatProtection\",\"properties\":{\"tenantId\":\"cxkjibnxmysuxswq\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"ijpstte\",\"id\":\"qqpwcyyuf\",\"name\":\"hruncuwmq\",\"type\":\"pkcdqzhlct\"}") + "{\"kind\":\"AzureAdvancedThreatProtection\",\"properties\":{\"tenantId\":\"ejuwyqwdqigmghgi\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}},\"etag\":\"lujkhn\",\"id\":\"mrnkfmkhcqtwml\",\"name\":\"hjnqt\",\"type\":\"eahjedv\"}") .toObject(AatpDataConnector.class); - Assertions.assertEquals("ijpstte", model.etag()); - Assertions.assertEquals("cxkjibnxmysuxswq", model.tenantId()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("lujkhn", model.etag()); + Assertions.assertEquals("ejuwyqwdqigmghgi", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AatpDataConnector model = new AatpDataConnector().withEtag("ijpstte") - .withTenantId("cxkjibnxmysuxswq") + AatpDataConnector model = new AatpDataConnector().withEtag("lujkhn") + .withTenantId("ejuwyqwdqigmghgi") .withDataTypes(new AlertsDataTypeOfDataConnector() - .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); model = BinaryData.fromObject(model).toObject(AatpDataConnector.class); - Assertions.assertEquals("ijpstte", model.etag()); - Assertions.assertEquals("cxkjibnxmysuxswq", model.tenantId()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("lujkhn", model.etag()); + Assertions.assertEquals("ejuwyqwdqigmghgi", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityPropertiesTests.java index cccfa1039e88..15e7fa936a00 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class AccountEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AccountEntityProperties model = BinaryData.fromString( - "{\"aadTenantId\":\"akoi\",\"aadUserId\":\"nsmjbl\",\"accountName\":\"jhlnymzotqyryu\",\"displayName\":\"bmqqvxmvw\",\"hostEntityId\":\"tayx\",\"isDomainJoined\":false,\"ntDomain\":\"peujlzqn\",\"objectGuid\":\"e11db145-e5d8-4876-a6f6-cfb9fd0e7038\",\"puid\":\"sqltnzo\",\"sid\":\"gsxgnxfyqon\",\"upnSuffix\":\"qoxwd\",\"dnsDomain\":\"dbxiqx\",\"additionalData\":{\"htmwwinh\":\"dataqbi\"},\"friendlyName\":\"f\"}") + "{\"aadTenantId\":\"inqcymczngnbdxxe\",\"aadUserId\":\"ninvudbchaqdt\",\"accountName\":\"ec\",\"displayName\":\"ct\",\"hostEntityId\":\"xdtddmflhuytxzv\",\"isDomainJoined\":true,\"ntDomain\":\"pxbannovvoxc\",\"objectGuid\":\"tprwnw\",\"puid\":\"oevytlyokr\",\"sid\":\"o\",\"upnSuffix\":\"xv\",\"dnsDomain\":\"asbcrymodizrx\",\"additionalData\":{\"mkmlmvevfx\":\"\\\"databdxnaz\\\"\",\"hbzxli\":\"\\\"dataop\\\"\",\"tfgxqbawpcb\":\"\\\"datahrdd\\\"\",\"napqo\":\"\\\"datanzqcy\\\"\"},\"friendlyName\":\"uicdhzbdybwwg\"}") .toObject(AccountEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountEntityProperties model = new AccountEntityProperties(); - model = BinaryData.fromObject(model).toObject(AccountEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityTests.java index bcc9e23c0743..cef588b2abac 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AccountEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class AccountEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AccountEntity model = BinaryData.fromString( - "{\"kind\":\"Account\",\"properties\":{\"aadTenantId\":\"pfhvfslk\",\"aadUserId\":\"tjlrigjksky\",\"accountName\":\"oov\",\"displayName\":\"dsxwaab\",\"hostEntityId\":\"ifrygzn\",\"isDomainJoined\":false,\"ntDomain\":\"ri\",\"objectGuid\":\"16435a79-b22c-4e8b-9883-fdab1dde04b7\",\"puid\":\"obgop\",\"sid\":\"hsln\",\"upnSuffix\":\"xieixynllxec\",\"dnsDomain\":\"rojphslhcawjutif\",\"additionalData\":{\"orq\":\"datamvi\",\"ujeickp\":\"databttzhraglkafhonq\",\"nwcl\":\"datavcpopmxe\",\"xm\":\"datayjede\"},\"friendlyName\":\"mkqscaz\"},\"id\":\"wxtzxpuamwab\",\"name\":\"xrvxcushsphai\",\"type\":\"mxyasflvgsgzw\"}") + "{\"kind\":\"Account\",\"properties\":{\"aadTenantId\":\"jnhgwydyyn\",\"aadUserId\":\"vkh\",\"accountName\":\"vqtanarfdlpuk\",\"displayName\":\"yrneizjcpeo\",\"hostEntityId\":\"hnmgbroux\",\"isDomainJoined\":true,\"ntDomain\":\"fhp\",\"objectGuid\":\"azjzo\",\"puid\":\"jxhpdulontacn\",\"sid\":\"w\",\"upnSuffix\":\"htuevrhrljy\",\"dnsDomain\":\"gwxhnsduugwbsreu\",\"additionalData\":{\"htkln\":\"\\\"datakfuarenlv\\\"\"},\"friendlyName\":\"afvvk\"},\"id\":\"edev\",\"name\":\"bo\",\"type\":\"lcqxypokk\"}") .toObject(AccountEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountEntity model = new AccountEntity(); - model = BinaryData.fromObject(model).toObject(AccountEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionPropertiesBaseTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionPropertiesBaseTests.java index c4b2a7073561..3aa17bbebe29 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionPropertiesBaseTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionPropertiesBaseTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,15 +11,15 @@ public final class ActionPropertiesBaseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ActionPropertiesBase model - = BinaryData.fromString("{\"logicAppResourceId\":\"atscmd\"}").toObject(ActionPropertiesBase.class); - Assertions.assertEquals("atscmd", model.logicAppResourceId()); + ActionPropertiesBase model = BinaryData.fromString("{\"logicAppResourceId\":\"qomaqsyilpzzbrw\"}") + .toObject(ActionPropertiesBase.class); + Assertions.assertEquals("qomaqsyilpzzbrw", model.logicAppResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ActionPropertiesBase model = new ActionPropertiesBase().withLogicAppResourceId("atscmd"); + ActionPropertiesBase model = new ActionPropertiesBase().withLogicAppResourceId("qomaqsyilpzzbrw"); model = BinaryData.fromObject(model).toObject(ActionPropertiesBase.class); - Assertions.assertEquals("atscmd", model.logicAppResourceId()); + Assertions.assertEquals("qomaqsyilpzzbrw", model.logicAppResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestPropertiesTests.java index f5f14d8de3b3..bbadc5b66fab 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,18 +12,18 @@ public final class ActionRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ActionRequestProperties model - = BinaryData.fromString("{\"triggerUri\":\"psoacctazakljl\",\"logicAppResourceId\":\"hbcryffdfdosyge\"}") + = BinaryData.fromString("{\"triggerUri\":\"xvpstizsyqagqll\",\"logicAppResourceId\":\"brvaid\"}") .toObject(ActionRequestProperties.class); - Assertions.assertEquals("hbcryffdfdosyge", model.logicAppResourceId()); - Assertions.assertEquals("psoacctazakljl", model.triggerUri()); + Assertions.assertEquals("brvaid", model.logicAppResourceId()); + Assertions.assertEquals("xvpstizsyqagqll", model.triggerUri()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ActionRequestProperties model - = new ActionRequestProperties().withLogicAppResourceId("hbcryffdfdosyge").withTriggerUri("psoacctazakljl"); + = new ActionRequestProperties().withLogicAppResourceId("brvaid").withTriggerUri("xvpstizsyqagqll"); model = BinaryData.fromObject(model).toObject(ActionRequestProperties.class); - Assertions.assertEquals("hbcryffdfdosyge", model.logicAppResourceId()); - Assertions.assertEquals("psoacctazakljl", model.triggerUri()); + Assertions.assertEquals("brvaid", model.logicAppResourceId()); + Assertions.assertEquals("xvpstizsyqagqll", model.triggerUri()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestTests.java index c07458c028fb..b7849faa3b47 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,20 +12,20 @@ public final class ActionRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ActionRequest model = BinaryData.fromString( - "{\"properties\":{\"triggerUri\":\"jhulsuuvmkjo\",\"logicAppResourceId\":\"k\"},\"etag\":\"f\",\"id\":\"iodjp\",\"name\":\"lwejdpv\",\"type\":\"ryo\"}") + "{\"properties\":{\"triggerUri\":\"zozsxag\",\"logicAppResourceId\":\"sokliik\"},\"etag\":\"bvrrbnh\",\"id\":\"sbhuj\",\"name\":\"ydy\",\"type\":\"l\"}") .toObject(ActionRequest.class); - Assertions.assertEquals("f", model.etag()); - Assertions.assertEquals("jhulsuuvmkjo", model.triggerUri()); - Assertions.assertEquals("k", model.logicAppResourceId()); + Assertions.assertEquals("bvrrbnh", model.etag()); + Assertions.assertEquals("zozsxag", model.triggerUri()); + Assertions.assertEquals("sokliik", model.logicAppResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ActionRequest model - = new ActionRequest().withEtag("f").withTriggerUri("jhulsuuvmkjo").withLogicAppResourceId("k"); + = new ActionRequest().withEtag("bvrrbnh").withTriggerUri("zozsxag").withLogicAppResourceId("sokliik"); model = BinaryData.fromObject(model).toObject(ActionRequest.class); - Assertions.assertEquals("f", model.etag()); - Assertions.assertEquals("jhulsuuvmkjo", model.triggerUri()); - Assertions.assertEquals("k", model.logicAppResourceId()); + Assertions.assertEquals("bvrrbnh", model.etag()); + Assertions.assertEquals("zozsxag", model.triggerUri()); + Assertions.assertEquals("sokliik", model.logicAppResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponseInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponseInnerTests.java index d70ac69ea2dc..de96534740c0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponseInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponseInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,21 +12,10 @@ public final class ActionResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ActionResponseInner model = BinaryData.fromString( - "{\"etag\":\"nhsjcnyej\",\"properties\":{\"workflowId\":\"yhtnapczwlokjye\",\"logicAppResourceId\":\"kkvnipjox\"},\"id\":\"nchgej\",\"name\":\"podmailzydehojwy\",\"type\":\"huxinpmqnj\"}") + "{\"properties\":{\"workflowId\":\"jixy\",\"logicAppResourceId\":\"secigzzdwj\"},\"etag\":\"cfvvtdpcbpzfo\",\"id\":\"saugbrhfiwl\",\"name\":\"kfysuntethk\",\"type\":\"xwhcvasy\"}") .toObject(ActionResponseInner.class); - Assertions.assertEquals("nhsjcnyej", model.etag()); - Assertions.assertEquals("yhtnapczwlokjye", model.workflowId()); - Assertions.assertEquals("kkvnipjox", model.logicAppResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActionResponseInner model = new ActionResponseInner().withEtag("nhsjcnyej") - .withWorkflowId("yhtnapczwlokjye") - .withLogicAppResourceId("kkvnipjox"); - model = BinaryData.fromObject(model).toObject(ActionResponseInner.class); - Assertions.assertEquals("nhsjcnyej", model.etag()); - Assertions.assertEquals("yhtnapczwlokjye", model.workflowId()); - Assertions.assertEquals("kkvnipjox", model.logicAppResourceId()); + Assertions.assertEquals("cfvvtdpcbpzfo", model.etag()); + Assertions.assertEquals("jixy", model.workflowId()); + Assertions.assertEquals("secigzzdwj", model.logicAppResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponsePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponsePropertiesTests.java index f8be39da3cc4..342308199456 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponsePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionResponsePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,18 +12,9 @@ public final class ActionResponsePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ActionResponseProperties model - = BinaryData.fromString("{\"workflowId\":\"wixjsprozvcp\",\"logicAppResourceId\":\"tegjvwmf\"}") + = BinaryData.fromString("{\"workflowId\":\"gqokjbmsrk\",\"logicAppResourceId\":\"xyxxhwr\"}") .toObject(ActionResponseProperties.class); - Assertions.assertEquals("tegjvwmf", model.logicAppResourceId()); - Assertions.assertEquals("wixjsprozvcp", model.workflowId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActionResponseProperties model - = new ActionResponseProperties().withLogicAppResourceId("tegjvwmf").withWorkflowId("wixjsprozvcp"); - model = BinaryData.fromObject(model).toObject(ActionResponseProperties.class); - Assertions.assertEquals("tegjvwmf", model.logicAppResourceId()); - Assertions.assertEquals("wixjsprozvcp", model.workflowId()); + Assertions.assertEquals("xyxxhwr", model.logicAppResourceId()); + Assertions.assertEquals("gqokjbmsrk", model.workflowId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateWithResponseMockTests.java index bc95b547fab7..7bcab67ea7d0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.ActionResponse; @@ -21,25 +21,25 @@ public final class ActionsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"zgwldoychillcec\",\"properties\":{\"workflowId\":\"uwaoaguhicqlli\",\"logicAppResourceId\":\"stacsjvhrweftkwq\"},\"id\":\"pmvssehaep\",\"name\":\"a\",\"type\":\"cxtczhupeukn\"}"; + = "{\"properties\":{\"workflowId\":\"w\",\"logicAppResourceId\":\"xhqel\"},\"etag\":\"folqdikuvjclsp\",\"id\":\"ghkflwnl\",\"name\":\"bawtpwnk\",\"type\":\"wxlplqni\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ActionResponse response = manager.actions() - .define("mghihp") - .withExistingAlertRule("aupia", "cxnafbwqrooh", "uovmaonurjt") - .withEtag("xigc") - .withTriggerUri("cmslclblyjxltbs") - .withLogicAppResourceId("uscv") + .define("ljtw") + .withExistingAlertRule("hcfndijz", "vckhbu", "mxtijssytdp") + .withEtag("rdtdlg") + .withTriggerUri("wcdxymnswxqtmhf") + .withLogicAppResourceId("ca") .create(); - Assertions.assertEquals("zgwldoychillcec", response.etag()); - Assertions.assertEquals("uwaoaguhicqlli", response.workflowId()); - Assertions.assertEquals("stacsjvhrweftkwq", response.logicAppResourceId()); + Assertions.assertEquals("folqdikuvjclsp", response.etag()); + Assertions.assertEquals("w", response.workflowId()); + Assertions.assertEquals("xhqel", response.logicAppResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteWithResponseMockTests.java index 5984cae143f4..3018e0034d44 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,11 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.actions().deleteWithResponse("jhqt", "b", "vnynkb", "etnjuhpsprkz", com.azure.core.util.Context.NONE); + manager.actions() + .deleteWithResponse("jxoueqljzkhnca", "ykueatztnprnshln", "ahvlzgsqwiubgb", "tjyisjscuwylukt", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetWithResponseMockTests.java index 3fc59ce02776..c5d0e603c9ba 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.ActionResponse; @@ -21,21 +21,21 @@ public final class ActionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"zyvneezaifghtmo\",\"properties\":{\"workflowId\":\"lffhz\",\"logicAppResourceId\":\"krkjjjavf\"},\"id\":\"vhnqo\",\"name\":\"wdogiyetesyp\",\"type\":\"idbz\"}"; + = "{\"properties\":{\"workflowId\":\"omufazacwzbe\",\"logicAppResourceId\":\"pbsspexejhwpnjco\"},\"etag\":\"jzbovuvmdz\",\"id\":\"tirguajs\",\"name\":\"decbowkh\",\"type\":\"affllpdnns\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ActionResponse response = manager.actions() - .getWithResponse("k", "ctwwgzw", "jlmec", "og", com.azure.core.util.Context.NONE) + .getWithResponse("f", "fqxejjntiqbxze", "udog", "fcrb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zyvneezaifghtmo", response.etag()); - Assertions.assertEquals("lffhz", response.workflowId()); - Assertions.assertEquals("krkjjjavf", response.logicAppResourceId()); + Assertions.assertEquals("jzbovuvmdz", response.etag()); + Assertions.assertEquals("omufazacwzbe", response.workflowId()); + Assertions.assertEquals("pbsspexejhwpnjco", response.logicAppResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleMockTests.java index 8e0c3e9779eb..c055290c6da7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListByAlertRuleMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.ActionResponse; @@ -22,20 +22,20 @@ public final class ActionsListByAlertRuleMockTests { @Test public void testListByAlertRule() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"sksrfhfvolmknbn\",\"properties\":{\"workflowId\":\"dommpvfqawzfg\",\"logicAppResourceId\":\"rttuiaclkiexha\"},\"id\":\"fnth\",\"name\":\"qfyuttd\",\"type\":\"ygbpvnwswmt\"}]}"; + = "{\"value\":[{\"properties\":{\"workflowId\":\"qvvepoftsapfw\",\"logicAppResourceId\":\"sfb\"},\"etag\":\"jvzlynvjempvubs\",\"id\":\"zntbieuqfgkfiftg\",\"name\":\"upuukpsw\",\"type\":\"utdu\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.actions() - .listByAlertRule("wvqsgny", "uuzivensrpmeyyvp", "patlbijp", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.actions().listByAlertRule("cuxuxaihheg", "xrziry", "rpjru", com.azure.core.util.Context.NONE); - Assertions.assertEquals("sksrfhfvolmknbn", response.iterator().next().etag()); - Assertions.assertEquals("dommpvfqawzfg", response.iterator().next().workflowId()); - Assertions.assertEquals("rttuiaclkiexha", response.iterator().next().logicAppResourceId()); + Assertions.assertEquals("jvzlynvjempvubs", response.iterator().next().etag()); + Assertions.assertEquals("qvvepoftsapfw", response.iterator().next().workflowId()); + Assertions.assertEquals("sfb", response.iterator().next().logicAppResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListTests.java index efbf927cd63f..6e979dbf7c39 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActionsListTests.java @@ -1,40 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.ActionResponseInner; -import com.azure.resourcemanager.securityinsights.models.ActionsList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.ActionsList; import org.junit.jupiter.api.Assertions; public final class ActionsListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ActionsList model = BinaryData.fromString( - "{\"nextLink\":\"jpsq\",\"value\":[{\"etag\":\"poyfdkfogkn\",\"properties\":{\"workflowId\":\"ofjdde\",\"logicAppResourceId\":\"s\"},\"id\":\"eupewnwreitjz\",\"name\":\"flusarhmof\",\"type\":\"qhsmyurkdtml\"},{\"etag\":\"ekuksjtx\",\"properties\":{\"workflowId\":\"dmpa\",\"logicAppResourceId\":\"cryuan\"},\"id\":\"uxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"},{\"etag\":\"nryrtihf\",\"properties\":{\"workflowId\":\"jbpzvgnwzsymg\",\"logicAppResourceId\":\"zufcyzkohdbi\"},\"id\":\"nufhf\",\"name\":\"bj\",\"type\":\"s\"},{\"etag\":\"ithxqhabifpi\",\"properties\":{\"workflowId\":\"czbysc\",\"logicAppResourceId\":\"pqxu\"},\"id\":\"vyq\",\"name\":\"iwbybrkxvdumjg\",\"type\":\"tfwvukxgaudc\"}]}") + "{\"value\":[{\"properties\":{\"workflowId\":\"htrrqwfy\",\"logicAppResourceId\":\"bptmj\"},\"etag\":\"nogykugdla\",\"id\":\"avgthkslge\",\"name\":\"ufkbzbf\",\"type\":\"xjblajy\"},{\"properties\":{\"workflowId\":\"bycsbtoi\",\"logicAppResourceId\":\"azdjmofsvpzxg\"},\"etag\":\"wxuymlfjymg\",\"id\":\"mszcfy\",\"name\":\"q\",\"type\":\"e\"},{\"properties\":{\"workflowId\":\"gfurdpagknx\",\"logicAppResourceId\":\"aovrgihlnzffewv\"},\"etag\":\"ycjcgeipqxxsdy\",\"id\":\"wt\",\"name\":\"dsmmabh\",\"type\":\"clejqzhpv\"},{\"properties\":{\"workflowId\":\"badjze\",\"logicAppResourceId\":\"llgfy\"},\"etag\":\"tqscjpvqerqxk\",\"id\":\"wdzpzl\",\"name\":\"cuex\",\"type\":\"qpwwvmbjecfwlbgh\"}],\"nextLink\":\"frwxohlydsn\"}") .toObject(ActionsList.class); - Assertions.assertEquals("poyfdkfogkn", model.value().get(0).etag()); - Assertions.assertEquals("ofjdde", model.value().get(0).workflowId()); - Assertions.assertEquals("s", model.value().get(0).logicAppResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActionsList model = new ActionsList().withValue(Arrays.asList( - new ActionResponseInner().withEtag("poyfdkfogkn").withWorkflowId("ofjdde").withLogicAppResourceId("s"), - new ActionResponseInner().withEtag("ekuksjtx").withWorkflowId("dmpa").withLogicAppResourceId("cryuan"), - new ActionResponseInner().withEtag("nryrtihf") - .withWorkflowId("jbpzvgnwzsymg") - .withLogicAppResourceId("zufcyzkohdbi"), - new ActionResponseInner().withEtag("ithxqhabifpi") - .withWorkflowId("czbysc") - .withLogicAppResourceId("pqxu"))); - model = BinaryData.fromObject(model).toObject(ActionsList.class); - Assertions.assertEquals("poyfdkfogkn", model.value().get(0).etag()); - Assertions.assertEquals("ofjdde", model.value().get(0).workflowId()); - Assertions.assertEquals("s", model.value().get(0).logicAppResourceId()); + Assertions.assertEquals("nogykugdla", model.value().get(0).etag()); + Assertions.assertEquals("htrrqwfy", model.value().get(0).workflowId()); + Assertions.assertEquals("bptmj", model.value().get(0).logicAppResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityCustomEntityQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityCustomEntityQueryTests.java new file mode 100644 index 000000000000..3b7ede92f5e8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityCustomEntityQueryTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +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; +import org.junit.jupiter.api.Assertions; + +public final class ActivityCustomEntityQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityCustomEntityQuery model = BinaryData.fromString( + "{\"kind\":\"Activity\",\"properties\":{\"title\":\"ulojhhylx\",\"content\":\"vfiyymot\",\"description\":\"bybwjmtftcvelnir\",\"queryDefinitions\":{\"query\":\"qnstpaqpibjg\"},\"inputEntityType\":\"AzureResource\",\"requiredInputFieldsSets\":[[\"hfxrt\",\"xbmsennqfabqc\",\"malec\",\"cxs\"],[\"bzdxmsynb\",\"d\",\"nyufxuzmsvzyq\"],[\"rnxhjtlxfikjk\",\"ara\",\"wwuasnjeglht\",\"xbozpcjcnwjz\"]],\"entitiesFilter\":{\"sorgf\":[\"xrnwvdsvo\",\"i\",\"awws\"]},\"templateName\":\"xsawooauff\",\"enabled\":false,\"createdTimeUtc\":\"2020-12-29T05:33:24Z\",\"lastModifiedTimeUtc\":\"2021-05-01T00:06:28Z\"},\"etag\":\"rdqyoybm\",\"id\":\"otoc\",\"name\":\"nzdaiovr\",\"type\":\"hrpqphkvyyzadcrx\"}") + .toObject(ActivityCustomEntityQuery.class); + Assertions.assertEquals("rdqyoybm", model.etag()); + Assertions.assertEquals("ulojhhylx", model.title()); + Assertions.assertEquals("vfiyymot", model.content()); + Assertions.assertEquals("bybwjmtftcvelnir", model.description()); + Assertions.assertEquals("qnstpaqpibjg", model.queryDefinitions().query()); + Assertions.assertEquals(EntityType.AZURE_RESOURCE, model.inputEntityType()); + Assertions.assertEquals("hfxrt", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("xrnwvdsvo", model.entitiesFilter().get("sorgf").get(0)); + Assertions.assertEquals("xsawooauff", model.templateName()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ActivityCustomEntityQuery model = new ActivityCustomEntityQuery().withEtag("rdqyoybm") + .withTitle("ulojhhylx") + .withContent("vfiyymot") + .withDescription("bybwjmtftcvelnir") + .withQueryDefinitions(new ActivityEntityQueriesPropertiesQueryDefinitions().withQuery("qnstpaqpibjg")) + .withInputEntityType(EntityType.AZURE_RESOURCE) + .withRequiredInputFieldsSets(Arrays.asList(Arrays.asList("hfxrt", "xbmsennqfabqc", "malec", "cxs"), + Arrays.asList("bzdxmsynb", "d", "nyufxuzmsvzyq"), + Arrays.asList("rnxhjtlxfikjk", "ara", "wwuasnjeglht", "xbozpcjcnwjz"))) + .withEntitiesFilter(mapOf("sorgf", Arrays.asList("xrnwvdsvo", "i", "awws"))) + .withTemplateName("xsawooauff") + .withEnabled(false); + model = BinaryData.fromObject(model).toObject(ActivityCustomEntityQuery.class); + Assertions.assertEquals("rdqyoybm", model.etag()); + Assertions.assertEquals("ulojhhylx", model.title()); + Assertions.assertEquals("vfiyymot", model.content()); + Assertions.assertEquals("bybwjmtftcvelnir", model.description()); + Assertions.assertEquals("qnstpaqpibjg", model.queryDefinitions().query()); + Assertions.assertEquals(EntityType.AZURE_RESOURCE, model.inputEntityType()); + Assertions.assertEquals("hfxrt", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("xrnwvdsvo", model.entitiesFilter().get("sorgf").get(0)); + Assertions.assertEquals("xsawooauff", model.templateName()); + Assertions.assertFalse(model.enabled()); + } + + // Use "Map.of" if available + @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/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesQueryDefinitionsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesQueryDefinitionsTests.java new file mode 100644 index 000000000000..6a8d3bdf19ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesQueryDefinitionsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueriesPropertiesQueryDefinitions; +import org.junit.jupiter.api.Assertions; + +public final class ActivityEntityQueriesPropertiesQueryDefinitionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityEntityQueriesPropertiesQueryDefinitions model = BinaryData.fromString("{\"query\":\"zsi\"}") + .toObject(ActivityEntityQueriesPropertiesQueryDefinitions.class); + Assertions.assertEquals("zsi", model.query()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ActivityEntityQueriesPropertiesQueryDefinitions model + = new ActivityEntityQueriesPropertiesQueryDefinitions().withQuery("zsi"); + model = BinaryData.fromObject(model).toObject(ActivityEntityQueriesPropertiesQueryDefinitions.class); + Assertions.assertEquals("zsi", model.query()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesTests.java new file mode 100644 index 000000000000..4d8db8cefe69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueriesPropertiesTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueriesProperties; +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; +import org.junit.jupiter.api.Assertions; + +public final class ActivityEntityQueriesPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityEntityQueriesProperties model = BinaryData.fromString( + "{\"title\":\"ybruhola\",\"content\":\"wcgi\",\"description\":\"rima\",\"queryDefinitions\":{\"query\":\"qqlonbzaowcah\"},\"inputEntityType\":\"CloudApplication\",\"requiredInputFieldsSets\":[[\"mihrijezbfsj\",\"fczglkvbg\",\"kbsvbwy\",\"tygnbknh\"],[\"clxaxw\",\"ffaspsdzkucsz\",\"hdoaqipmnx\"],[\"frsbzrnmuvwvpu\",\"fddtbfmekjcng\",\"n\"],[\"vmaoyqxfvgy\"]],\"entitiesFilter\":{\"tkykpaxnlsfgnys\":[\"ynofxlttxoq\",\"tdnzujsjirkrpskc\",\"h\",\"mofbnivd\"],\"wahdrdvhaztkxbi\":[\"ccptbzetxygxxice\",\"cvj\",\"yuveoxmpz\"],\"qwdr\":[\"fgxmbr\",\"gmwibiosiqsykqf\"]},\"templateName\":\"tfdaglmrcokz\",\"enabled\":false,\"createdTimeUtc\":\"2021-07-04T20:17:59Z\",\"lastModifiedTimeUtc\":\"2021-02-26T13:48:08Z\"}") + .toObject(ActivityEntityQueriesProperties.class); + Assertions.assertEquals("ybruhola", model.title()); + Assertions.assertEquals("wcgi", model.content()); + Assertions.assertEquals("rima", model.description()); + Assertions.assertEquals("qqlonbzaowcah", model.queryDefinitions().query()); + Assertions.assertEquals(EntityType.CLOUD_APPLICATION, model.inputEntityType()); + Assertions.assertEquals("mihrijezbfsj", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("ynofxlttxoq", model.entitiesFilter().get("tkykpaxnlsfgnys").get(0)); + Assertions.assertEquals("tfdaglmrcokz", model.templateName()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ActivityEntityQueriesProperties model = new ActivityEntityQueriesProperties().withTitle("ybruhola") + .withContent("wcgi") + .withDescription("rima") + .withQueryDefinitions(new ActivityEntityQueriesPropertiesQueryDefinitions().withQuery("qqlonbzaowcah")) + .withInputEntityType(EntityType.CLOUD_APPLICATION) + .withRequiredInputFieldsSets( + Arrays.asList(Arrays.asList("mihrijezbfsj", "fczglkvbg", "kbsvbwy", "tygnbknh"), + Arrays.asList("clxaxw", "ffaspsdzkucsz", "hdoaqipmnx"), + Arrays.asList("frsbzrnmuvwvpu", "fddtbfmekjcng", "n"), Arrays.asList("vmaoyqxfvgy"))) + .withEntitiesFilter( + mapOf("tkykpaxnlsfgnys", Arrays.asList("ynofxlttxoq", "tdnzujsjirkrpskc", "h", "mofbnivd"), + "wahdrdvhaztkxbi", Arrays.asList("ccptbzetxygxxice", "cvj", "yuveoxmpz"), "qwdr", + Arrays.asList("fgxmbr", "gmwibiosiqsykqf"))) + .withTemplateName("tfdaglmrcokz") + .withEnabled(false); + model = BinaryData.fromObject(model).toObject(ActivityEntityQueriesProperties.class); + Assertions.assertEquals("ybruhola", model.title()); + Assertions.assertEquals("wcgi", model.content()); + Assertions.assertEquals("rima", model.description()); + Assertions.assertEquals("qqlonbzaowcah", model.queryDefinitions().query()); + Assertions.assertEquals(EntityType.CLOUD_APPLICATION, model.inputEntityType()); + Assertions.assertEquals("mihrijezbfsj", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("ynofxlttxoq", model.entitiesFilter().get("tkykpaxnlsfgnys").get(0)); + Assertions.assertEquals("tfdaglmrcokz", model.templateName()); + Assertions.assertFalse(model.enabled()); + } + + // Use "Map.of" if available + @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/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesQueryDefinitionsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesQueryDefinitionsTests.java new file mode 100644 index 000000000000..b7aaae7684db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesQueryDefinitionsTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplatePropertiesQueryDefinitions; +import org.junit.jupiter.api.Assertions; + +public final class ActivityEntityQueryTemplatePropertiesQueryDefinitionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityEntityQueryTemplatePropertiesQueryDefinitions model + = BinaryData.fromString("{\"query\":\"vsmfas\",\"summarizeBy\":\"lvhqpoilo\"}") + .toObject(ActivityEntityQueryTemplatePropertiesQueryDefinitions.class); + Assertions.assertEquals("vsmfas", model.query()); + Assertions.assertEquals("lvhqpoilo", model.summarizeBy()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesTests.java new file mode 100644 index 000000000000..2c2218406c24 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplatePropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ActivityEntityQueryTemplateProperties; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import org.junit.jupiter.api.Assertions; + +public final class ActivityEntityQueryTemplatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityEntityQueryTemplateProperties model = BinaryData.fromString( + "{\"title\":\"snznwg\",\"content\":\"ufmjxc\",\"description\":\"seqcazisvbrqgc\",\"queryDefinitions\":{\"query\":\"gawepkwonrzp\",\"summarizeBy\":\"lrdt\"},\"dataTypes\":[{\"dataType\":\"xb\"},{\"dataType\":\"brvjztaflv\"},{\"dataType\":\"fjihvfjcqrttjfuq\"}],\"inputEntityType\":\"SecurityGroup\",\"requiredInputFieldsSets\":[[\"feqb\",\"vdostwyg\"],[\"mw\"]],\"entitiesFilter\":{\"zvzrbvgwxhlx\":[\"gwzz\",\"wdtlcjgpvc\"],\"ryearmhpwbu\":[\"xvmdr\",\"ynbgovazoymdvhhp\",\"khwwdkatve\",\"mgkcswzey\"]}}") + .toObject(ActivityEntityQueryTemplateProperties.class); + Assertions.assertEquals("snznwg", model.title()); + Assertions.assertEquals("ufmjxc", model.content()); + Assertions.assertEquals("seqcazisvbrqgc", model.description()); + Assertions.assertEquals("gawepkwonrzp", model.queryDefinitions().query()); + Assertions.assertEquals("lrdt", model.queryDefinitions().summarizeBy()); + Assertions.assertEquals("xb", model.dataTypes().get(0).dataType()); + Assertions.assertEquals(EntityType.SECURITY_GROUP, model.inputEntityType()); + Assertions.assertEquals("feqb", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("gwzz", model.entitiesFilter().get("zvzrbvgwxhlx").get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplateTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplateTests.java new file mode 100644 index 000000000000..c56aded5db33 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTemplateTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQueryTemplate; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import org.junit.jupiter.api.Assertions; + +public final class ActivityEntityQueryTemplateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityEntityQueryTemplate model = BinaryData.fromString( + "{\"kind\":\"Activity\",\"properties\":{\"title\":\"mfj\",\"content\":\"piywqnp\",\"description\":\"drfbgcnyxby\",\"queryDefinitions\":{\"query\":\"hmqyncgaullfstyy\",\"summarizeBy\":\"qpul\"},\"dataTypes\":[{\"dataType\":\"mhmqmiw\"}],\"inputEntityType\":\"Mailbox\",\"requiredInputFieldsSets\":[[\"ucqfgufjnbxwbm\"],[\"ukin\",\"lxhgdekekzou\",\"vewwpzrdwcgldo\"],[\"candxfhhh\",\"e\",\"tdqtdnnckkplj\",\"shvvfkdx\"]],\"entitiesFilter\":{\"uy\":[\"jjimhijz\",\"qnjxmv\",\"s\"],\"mvyujrxgunnq\":[\"nwgruhhqldr\",\"ymn\",\"wxiexqw\",\"nghxn\"]}},\"id\":\"puqtnylquevqmvy\",\"name\":\"mg\",\"type\":\"mu\"}") + .toObject(ActivityEntityQueryTemplate.class); + Assertions.assertEquals("mfj", model.title()); + Assertions.assertEquals("piywqnp", model.content()); + Assertions.assertEquals("drfbgcnyxby", model.description()); + Assertions.assertEquals("hmqyncgaullfstyy", model.queryDefinitions().query()); + Assertions.assertEquals("qpul", model.queryDefinitions().summarizeBy()); + Assertions.assertEquals("mhmqmiw", model.dataTypes().get(0).dataType()); + Assertions.assertEquals(EntityType.MAILBOX, model.inputEntityType()); + Assertions.assertEquals("ucqfgufjnbxwbm", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("jjimhijz", model.entitiesFilter().get("uy").get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTests.java new file mode 100644 index 000000000000..b539be3abcbb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityEntityQueryTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ActivityEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import org.junit.jupiter.api.Assertions; + +public final class ActivityEntityQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityEntityQuery model = BinaryData.fromString( + "{\"kind\":\"Activity\",\"properties\":{\"title\":\"wntotcxmmqmt\",\"content\":\"ky\",\"description\":\"exwdonbexf\",\"queryDefinitions\":{\"query\":\"aubheeggzgrnqt\"},\"inputEntityType\":\"SecurityAlert\",\"requiredInputFieldsSets\":[[\"mrtgjq\",\"acan\"],[\"syxzxjmkanbc\",\"azofm\",\"xvtemaspm\"]],\"entitiesFilter\":{\"iv\":[\"scd\",\"xwdpwjcbhaahntof\",\"lf\",\"pfixoskkzd\"],\"t\":[\"jybsrwz\",\"mr\"],\"vmmnii\":[\"hmfppinmgi\",\"esmkwtzgf\",\"agjhxerxlobkdbtq\"]},\"templateName\":\"ho\",\"enabled\":false,\"createdTimeUtc\":\"2021-07-15T12:04:51Z\",\"lastModifiedTimeUtc\":\"2021-05-03T05:21:14Z\"},\"etag\":\"gicnqwlctmwpblx\",\"id\":\"kqgvxrktj\",\"name\":\"jigcwtspanb\",\"type\":\"xasevchefpgee\"}") + .toObject(ActivityEntityQuery.class); + Assertions.assertEquals("gicnqwlctmwpblx", model.etag()); + Assertions.assertEquals("wntotcxmmqmt", model.title()); + Assertions.assertEquals("ky", model.content()); + Assertions.assertEquals("exwdonbexf", model.description()); + Assertions.assertEquals("aubheeggzgrnqt", model.queryDefinitions().query()); + Assertions.assertEquals(EntityType.SECURITY_ALERT, model.inputEntityType()); + Assertions.assertEquals("mrtgjq", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("scd", model.entitiesFilter().get("iv").get(0)); + Assertions.assertEquals("ho", model.templateName()); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityTimelineItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityTimelineItemTests.java new file mode 100644 index 000000000000..8b9b16102cc2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ActivityTimelineItemTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ActivityTimelineItem; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ActivityTimelineItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivityTimelineItem model = BinaryData.fromString( + "{\"kind\":\"Activity\",\"queryId\":\"pmsdfibwvhwouhys\",\"bucketStartTimeUTC\":\"2021-07-03T07:18:43Z\",\"bucketEndTimeUTC\":\"2021-08-09T11:14:34Z\",\"firstActivityTimeUTC\":\"2021-05-06T03:05:54Z\",\"lastActivityTimeUTC\":\"2021-05-08T18:19:10Z\",\"content\":\"jsnxzljxa\",\"title\":\"yxpdzvgyujkxjge\"}") + .toObject(ActivityTimelineItem.class); + Assertions.assertEquals("pmsdfibwvhwouhys", model.queryId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T07:18:43Z"), model.bucketStartTimeUTC()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T11:14:34Z"), model.bucketEndTimeUTC()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T03:05:54Z"), model.firstActivityTimeUTC()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T18:19:10Z"), model.lastActivityTimeUTC()); + Assertions.assertEquals("jsnxzljxa", model.content()); + Assertions.assertEquals("yxpdzvgyujkxjge", model.title()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AddIncidentTaskActionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AddIncidentTaskActionPropertiesTests.java new file mode 100644 index 000000000000..9ac24cbd440e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AddIncidentTaskActionPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AddIncidentTaskActionProperties; +import org.junit.jupiter.api.Assertions; + +public final class AddIncidentTaskActionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AddIncidentTaskActionProperties model + = BinaryData.fromString("{\"title\":\"kgimsidxasic\",\"description\":\"yvvjskgfmo\"}") + .toObject(AddIncidentTaskActionProperties.class); + Assertions.assertEquals("kgimsidxasic", model.title()); + Assertions.assertEquals("yvvjskgfmo", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AddIncidentTaskActionProperties model + = new AddIncidentTaskActionProperties().withTitle("kgimsidxasic").withDescription("yvvjskgfmo"); + model = BinaryData.fromObject(model).toObject(AddIncidentTaskActionProperties.class); + Assertions.assertEquals("kgimsidxasic", model.title()); + Assertions.assertEquals("yvvjskgfmo", model.description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertDetailsOverrideTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertDetailsOverrideTests.java index 12e62f1a895c..9da3a52b4293 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertDetailsOverrideTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertDetailsOverrideTests.java @@ -1,35 +1,46 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AlertDetailsOverrideTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertDetailsOverride model = BinaryData.fromString( - "{\"alertDisplayNameFormat\":\"xwh\",\"alertDescriptionFormat\":\"nsymoyqhlwigd\",\"alertTacticsColumnName\":\"bkbxgomfa\",\"alertSeverityColumnName\":\"wasqvdaeyyg\"}") + "{\"alertDisplayNameFormat\":\"ynkedyatrwyhqmib\",\"alertDescriptionFormat\":\"hwit\",\"alertTacticsColumnName\":\"ypyynpcdpumnzg\",\"alertSeverityColumnName\":\"z\",\"alertDynamicProperties\":[{\"alertProperty\":\"SubTechniques\",\"value\":\"nsorgjhxbldt\"},{\"alertProperty\":\"ProductName\",\"value\":\"lkdmtncvokotllxd\"}]}") .toObject(AlertDetailsOverride.class); - Assertions.assertEquals("xwh", model.alertDisplayNameFormat()); - Assertions.assertEquals("nsymoyqhlwigd", model.alertDescriptionFormat()); - Assertions.assertEquals("bkbxgomfa", model.alertTacticsColumnName()); - Assertions.assertEquals("wasqvdaeyyg", model.alertSeverityColumnName()); + Assertions.assertEquals("ynkedyatrwyhqmib", model.alertDisplayNameFormat()); + Assertions.assertEquals("hwit", model.alertDescriptionFormat()); + Assertions.assertEquals("ypyynpcdpumnzg", model.alertTacticsColumnName()); + Assertions.assertEquals("z", model.alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.SUB_TECHNIQUES, model.alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("nsorgjhxbldt", model.alertDynamicProperties().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AlertDetailsOverride model = new AlertDetailsOverride().withAlertDisplayNameFormat("xwh") - .withAlertDescriptionFormat("nsymoyqhlwigd") - .withAlertTacticsColumnName("bkbxgomfa") - .withAlertSeverityColumnName("wasqvdaeyyg"); + AlertDetailsOverride model = new AlertDetailsOverride().withAlertDisplayNameFormat("ynkedyatrwyhqmib") + .withAlertDescriptionFormat("hwit") + .withAlertTacticsColumnName("ypyynpcdpumnzg") + .withAlertSeverityColumnName("z") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.SUB_TECHNIQUES).withValue("nsorgjhxbldt"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_NAME) + .withValue("lkdmtncvokotllxd"))); model = BinaryData.fromObject(model).toObject(AlertDetailsOverride.class); - Assertions.assertEquals("xwh", model.alertDisplayNameFormat()); - Assertions.assertEquals("nsymoyqhlwigd", model.alertDescriptionFormat()); - Assertions.assertEquals("bkbxgomfa", model.alertTacticsColumnName()); - Assertions.assertEquals("wasqvdaeyyg", model.alertSeverityColumnName()); + Assertions.assertEquals("ynkedyatrwyhqmib", model.alertDisplayNameFormat()); + Assertions.assertEquals("hwit", model.alertDescriptionFormat()); + Assertions.assertEquals("ypyynpcdpumnzg", model.alertTacticsColumnName()); + Assertions.assertEquals("z", model.alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.SUB_TECHNIQUES, model.alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("nsorgjhxbldt", model.alertDynamicProperties().get(0).value()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertPropertyMappingTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertPropertyMappingTests.java new file mode 100644 index 000000000000..9d199ca148c5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertPropertyMappingTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; +import org.junit.jupiter.api.Assertions; + +public final class AlertPropertyMappingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AlertPropertyMapping model = BinaryData.fromString("{\"alertProperty\":\"ExtendedLinks\",\"value\":\"y\"}") + .toObject(AlertPropertyMapping.class); + Assertions.assertEquals(AlertProperty.EXTENDED_LINKS, model.alertProperty()); + Assertions.assertEquals("y", model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AlertPropertyMapping model + = new AlertPropertyMapping().withAlertProperty(AlertProperty.EXTENDED_LINKS).withValue("y"); + model = BinaryData.fromObject(model).toObject(AlertPropertyMapping.class); + Assertions.assertEquals(AlertProperty.EXTENDED_LINKS, model.alertProperty()); + Assertions.assertEquals("y", model.value()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleInnerTests.java index 59a9153b1391..c738641add8e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,15 +12,15 @@ public final class AlertRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertRuleInner model = BinaryData.fromString( - "{\"kind\":\"AlertRule\",\"etag\":\"fpownoizhwlr\",\"id\":\"bqsoqijg\",\"name\":\"dmbpazlobcufpdz\",\"type\":\"rbt\"}") + "{\"kind\":\"AlertRule\",\"etag\":\"v\",\"id\":\"sounqecanoaeu\",\"name\":\"fhyhltrpmopjmcma\",\"type\":\"u\"}") .toObject(AlertRuleInner.class); - Assertions.assertEquals("fpownoizhwlr", model.etag()); + Assertions.assertEquals("v", model.etag()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AlertRuleInner model = new AlertRuleInner().withEtag("fpownoizhwlr"); + AlertRuleInner model = new AlertRuleInner().withEtag("v"); model = BinaryData.fromObject(model).toObject(AlertRuleInner.class); - Assertions.assertEquals("fpownoizhwlr", model.etag()); + Assertions.assertEquals("v", model.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateDataSourceTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateDataSourceTests.java index cfef0f48a77a..bb0075481dc7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateDataSourceTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateDataSourceTests.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AlertRuleTemplateDataSourceTests { @@ -14,18 +13,9 @@ public final class AlertRuleTemplateDataSourceTests { public void testDeserialize() throws Exception { AlertRuleTemplateDataSource model = BinaryData .fromString( - "{\"connectorId\":\"stgktst\",\"dataTypes\":[\"eclze\",\"qbcvhzlhplod\",\"kdl\",\"wqfbumlkxtrqjfsm\"]}") + "{\"connectorId\":\"ahhxvrh\",\"dataTypes\":[\"wpjgwws\",\"ughftqsx\",\"qxujxukndxd\",\"grjguufzd\"]}") .toObject(AlertRuleTemplateDataSource.class); - Assertions.assertEquals("stgktst", model.connectorId()); - Assertions.assertEquals("eclze", model.dataTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertRuleTemplateDataSource model = new AlertRuleTemplateDataSource().withConnectorId("stgktst") - .withDataTypes(Arrays.asList("eclze", "qbcvhzlhplod", "kdl", "wqfbumlkxtrqjfsm")); - model = BinaryData.fromObject(model).toObject(AlertRuleTemplateDataSource.class); - Assertions.assertEquals("stgktst", model.connectorId()); - Assertions.assertEquals("eclze", model.dataTypes().get(0)); + Assertions.assertEquals("ahhxvrh", model.connectorId()); + Assertions.assertEquals("wpjgwws", model.dataTypes().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateInnerTests.java index fa0aca315f8d..a78ae7c2b2ce 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,13 +12,7 @@ public final class AlertRuleTemplateInnerTests { public void testDeserialize() throws Exception { AlertRuleTemplateInner model = BinaryData .fromString( - "{\"kind\":\"AlertRuleTemplate\",\"id\":\"hungbwjzrnf\",\"name\":\"gxg\",\"type\":\"spemvtzfk\"}") + "{\"kind\":\"AlertRuleTemplate\",\"id\":\"minrfdw\",\"name\":\"yuhhziu\",\"type\":\"efozbhdms\"}") .toObject(AlertRuleTemplateInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertRuleTemplateInner model = new AlertRuleTemplateInner(); - model = BinaryData.fromObject(model).toObject(AlertRuleTemplateInner.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatePropertiesBaseTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatePropertiesBaseTests.java new file mode 100644 index 000000000000..27a139ca5d69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatePropertiesBaseTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatePropertiesBase; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import org.junit.jupiter.api.Assertions; + +public final class AlertRuleTemplatePropertiesBaseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AlertRuleTemplatePropertiesBase model = BinaryData.fromString( + "{\"alertRulesCreatedByTemplateCount\":1432241544,\"lastUpdatedDateUTC\":\"2021-02-25T02:47:56Z\",\"createdDateUTC\":\"2021-06-15T04:40:06Z\",\"description\":\"frl\",\"displayName\":\"szrnwo\",\"requiredDataConnectors\":[{\"connectorId\":\"fpwpjylwbt\",\"dataTypes\":[\"lsj\",\"dhszfjv\"]},{\"connectorId\":\"gofel\",\"dataTypes\":[\"rqmq\",\"ldvriiiojnalghfk\",\"tvsexsowuel\"]}],\"status\":\"Installed\"}") + .toObject(AlertRuleTemplatePropertiesBase.class); + Assertions.assertEquals(1432241544, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("frl", model.description()); + Assertions.assertEquals("szrnwo", model.displayName()); + Assertions.assertEquals("fpwpjylwbt", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("lsj", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateWithMitrePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateWithMitrePropertiesTests.java new file mode 100644 index 000000000000..256c7ea5daf8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplateWithMitrePropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateWithMitreProperties; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import org.junit.jupiter.api.Assertions; + +public final class AlertRuleTemplateWithMitrePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AlertRuleTemplateWithMitreProperties model = BinaryData.fromString( + "{\"tactics\":[\"CredentialAccess\",\"PreAttack\",\"ImpairProcessControl\"],\"techniques\":[\"bizikayuhq\",\"bjbsybb\",\"wrv\"],\"alertRulesCreatedByTemplateCount\":1583288095,\"lastUpdatedDateUTC\":\"2021-05-18T22:00:24Z\",\"createdDateUTC\":\"2021-06-20T07:23:19Z\",\"description\":\"vm\",\"displayName\":\"paslthaqfxssmwu\",\"requiredDataConnectors\":[{\"connectorId\":\"srezp\",\"dataTypes\":[\"neuyow\",\"kdw\",\"t\"]},{\"connectorId\":\"ib\",\"dataTypes\":[\"gpikpzimejza\",\"lfzxiavrmbzonoki\"]}],\"status\":\"Available\"}") + .toObject(AlertRuleTemplateWithMitreProperties.class); + Assertions.assertEquals(1583288095, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("vm", model.description()); + Assertions.assertEquals("paslthaqfxssmwu", model.displayName()); + Assertions.assertEquals("srezp", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("neuyow", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.AVAILABLE, model.status()); + Assertions.assertEquals(AttackTactic.CREDENTIAL_ACCESS, model.tactics().get(0)); + Assertions.assertEquals("bizikayuhq", model.techniques().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetWithResponseMockTests.java index acf17295dcc4..739adfe19871 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplate; @@ -20,17 +20,17 @@ public final class AlertRuleTemplatesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"AlertRuleTemplate\",\"id\":\"ay\",\"name\":\"xbulpzealbmqkyo\",\"type\":\"wyvf\"}"; + = "{\"kind\":\"AlertRuleTemplate\",\"id\":\"xxdxnhinn\",\"name\":\"akqwtozxltjsf\",\"type\":\"x\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AlertRuleTemplate response = manager.alertRuleTemplates() - .getWithResponse("nozoeoq", "vjhvefgwbm", "jchnta", com.azure.core.util.Context.NONE) + .getWithResponse("prhxskt", "srpjmevszbjnqkt", "kcjckmz", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListMockTests.java index 4e232f6cd02c..29163d5dd4d3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplate; @@ -21,17 +21,17 @@ public final class AlertRuleTemplatesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"AlertRuleTemplate\",\"id\":\"hhulrtywikdm\",\"name\":\"lakuflgbhgauacd\",\"type\":\"xmxufrsryjqgdk\"}]}"; + = "{\"value\":[{\"kind\":\"AlertRuleTemplate\",\"id\":\"aknppucfv\",\"name\":\"qrmx\",\"type\":\"rhzecnv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.alertRuleTemplates().list("jduyyespydjfb", "c", com.azure.core.util.Context.NONE); + = manager.alertRuleTemplates().list("gxwzznocrbtazopf", "htfm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListTests.java index 736cac767945..395e50b82633 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRuleTemplatesListTests.java @@ -1,27 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleTemplateInner; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplatesList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.AlertRuleTemplatesList; public final class AlertRuleTemplatesListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertRuleTemplatesList model = BinaryData.fromString( - "{\"nextLink\":\"aojakhmsbzjhcrz\",\"value\":[{\"kind\":\"AlertRuleTemplate\",\"id\":\"phlxa\",\"name\":\"lthqtrgqjbp\",\"type\":\"zfsinzgvf\"},{\"kind\":\"AlertRuleTemplate\",\"id\":\"rwzoxxjtfelluwf\",\"name\":\"it\",\"type\":\"np\"},{\"kind\":\"AlertRuleTemplate\",\"id\":\"fpjkjlxofp\",\"name\":\"vhpfxxypininmay\",\"type\":\"uybbkpodep\"},{\"kind\":\"AlertRuleTemplate\",\"id\":\"ginuvamih\",\"name\":\"ognarxzxtheotus\",\"type\":\"vyevcciqi\"}]}") + "{\"value\":[{\"kind\":\"AlertRuleTemplate\",\"id\":\"eazulcs\",\"name\":\"thwwn\",\"type\":\"jhlfzswpchwahf\"}],\"nextLink\":\"usnfepgfewet\"}") .toObject(AlertRuleTemplatesList.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertRuleTemplatesList model - = new AlertRuleTemplatesList().withValue(Arrays.asList(new AlertRuleTemplateInner(), - new AlertRuleTemplateInner(), new AlertRuleTemplateInner(), new AlertRuleTemplateInner())); - model = BinaryData.fromObject(model).toObject(AlertRuleTemplatesList.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateWithResponseMockTests.java index d69dd2fc823d..698aaca8dc8a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; @@ -22,20 +22,20 @@ public final class AlertRulesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"kind\":\"AlertRule\",\"etag\":\"rctat\",\"id\":\"intqpbrlcyr\",\"name\":\"uczkgofxyfsruc\",\"type\":\"crrpcjttbstvje\"}"; + = "{\"kind\":\"AlertRule\",\"etag\":\"sqjjcwggjimlcb\",\"id\":\"sfgaxuvaejy\",\"name\":\"fszxnzjxvdn\",\"type\":\"vdlp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AlertRule response = manager.alertRules() - .createOrUpdateWithResponse("xlghieegj", "gvvpasek", "gbuxantuygdh", new AlertRuleInner().withEtag("qipir"), + .createOrUpdateWithResponse("ygdoitdf", "nxrbyvbdvgzt", "tzsge", new AlertRuleInner().withEtag("dqxff"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rctat", response.etag()); + Assertions.assertEquals("sqjjcwggjimlcb", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteWithResponseMockTests.java index 23b9bd8a8df7..391906547bbd 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.alertRules() - .deleteWithResponse("qnrmvvfko", "mlghktuidvrmazlp", "wwexymzvlazipbh", com.azure.core.util.Context.NONE); + .deleteWithResponse("ulwgpdz", "fxbiqwgm", "ynwaofnoiphwaedp", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetWithResponseMockTests.java index 922535df6c69..df824f96803f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AlertRule; @@ -21,19 +21,19 @@ public final class AlertRulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"AlertRule\",\"etag\":\"sm\",\"id\":\"dlfp\",\"name\":\"apucygvo\",\"type\":\"vyuns\"}"; + = "{\"kind\":\"AlertRule\",\"etag\":\"zngmwemzvqmkjsvx\",\"id\":\"gccvhnoqlo\",\"name\":\"e\",\"type\":\"cntqoszrwkkxdnxu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AlertRule response = manager.alertRules() - .getWithResponse("hmbpyryxamebly", "yvk", "kmrocxne", com.azure.core.util.Context.NONE) + .getWithResponse("hkwhiorhwuujym", "jvko", "jgtourrqmch", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("sm", response.etag()); + Assertions.assertEquals("zngmwemzvqmkjsvx", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListMockTests.java index e63fff1e73ec..a9770f23fe23 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AlertRule; @@ -22,18 +22,18 @@ public final class AlertRulesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"AlertRule\",\"etag\":\"jqfutlxj\",\"id\":\"zasunwqrjzfrgq\",\"name\":\"aohcmbuocn\",\"type\":\"r\"}]}"; + = "{\"value\":[{\"kind\":\"AlertRule\",\"etag\":\"fqrvtymn\",\"id\":\"jdmjdphtfpjrbn\",\"name\":\"bem\",\"type\":\"qbfimageiqjn\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.alertRules().list("mizvgbgatzuuvbx", "grebwggahttzlsw", com.azure.core.util.Context.NONE); + = manager.alertRules().list("gxjtuhid", "wszxmcqenyjwa", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jqfutlxj", response.iterator().next().etag()); + Assertions.assertEquals("fqrvtymn", response.iterator().next().etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListTests.java index ec8bff7569a1..09cefda09510 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertRulesListTests.java @@ -1,29 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.AlertRuleInner; -import com.azure.resourcemanager.securityinsights.models.AlertRulesList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.AlertRulesList; import org.junit.jupiter.api.Assertions; public final class AlertRulesListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AlertRulesList model = BinaryData.fromString( - "{\"nextLink\":\"mhquvgjxp\",\"value\":[{\"kind\":\"AlertRule\",\"etag\":\"zm\",\"id\":\"mtz\",\"name\":\"pbsphrupidgs\",\"type\":\"bb\"},{\"kind\":\"AlertRule\",\"etag\":\"hphoycm\",\"id\":\"ao\",\"name\":\"hdxbmtqio\",\"type\":\"jzehtb\"}]}") + "{\"value\":[{\"kind\":\"AlertRule\",\"etag\":\"ewpusdsttwvogvb\",\"id\":\"jdcngqqm\",\"name\":\"akufgmjz\",\"type\":\"wr\"}],\"nextLink\":\"rtwaenuuzko\"}") .toObject(AlertRulesList.class); - Assertions.assertEquals("zm", model.value().get(0).etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertRulesList model = new AlertRulesList() - .withValue(Arrays.asList(new AlertRuleInner().withEtag("zm"), new AlertRuleInner().withEtag("hphoycm"))); - model = BinaryData.fromObject(model).toObject(AlertRulesList.class); - Assertions.assertEquals("zm", model.value().get(0).etag()); + Assertions.assertEquals("ewpusdsttwvogvb", model.value().get(0).etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertsDataTypeOfDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertsDataTypeOfDataConnectorTests.java index 8b4bac4e8a1e..046dfddccff6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertsDataTypeOfDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AlertsDataTypeOfDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,16 +13,16 @@ public final class AlertsDataTypeOfDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AlertsDataTypeOfDataConnector model = BinaryData.fromString("{\"alerts\":{\"state\":\"Enabled\"}}") + AlertsDataTypeOfDataConnector model = BinaryData.fromString("{\"alerts\":{\"state\":\"Disabled\"}}") .toObject(AlertsDataTypeOfDataConnector.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.alerts().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AlertsDataTypeOfDataConnector model = new AlertsDataTypeOfDataConnector() - .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED)); + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED)); model = BinaryData.fromObject(model).toObject(AlertsDataTypeOfDataConnector.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.alerts().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerPropertiesTests.java new file mode 100644 index 000000000000..31665322fc9d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.AnalyticsRuleRunTriggerProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AnalyticsRuleRunTriggerPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AnalyticsRuleRunTriggerProperties model + = BinaryData.fromString("{\"executionTimeUtc\":\"2021-05-22T15:58:23Z\"}") + .toObject(AnalyticsRuleRunTriggerProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T15:58:23Z"), model.executionTimeUtc()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AnalyticsRuleRunTriggerProperties model = new AnalyticsRuleRunTriggerProperties() + .withExecutionTimeUtc(OffsetDateTime.parse("2021-05-22T15:58:23Z")); + model = BinaryData.fromObject(model).toObject(AnalyticsRuleRunTriggerProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T15:58:23Z"), model.executionTimeUtc()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerTests.java new file mode 100644 index 000000000000..6743074c52c9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnalyticsRuleRunTriggerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AnalyticsRuleRunTrigger; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AnalyticsRuleRunTriggerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AnalyticsRuleRunTrigger model + = BinaryData.fromString("{\"properties\":{\"executionTimeUtc\":\"2021-06-11T10:02:43Z\"}}") + .toObject(AnalyticsRuleRunTrigger.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T10:02:43Z"), model.executionTimeUtc()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AnalyticsRuleRunTrigger model + = new AnalyticsRuleRunTrigger().withExecutionTimeUtc(OffsetDateTime.parse("2021-06-11T10:02:43Z")); + model = BinaryData.fromObject(model).toObject(AnalyticsRuleRunTrigger.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-11T10:02:43Z"), model.executionTimeUtc()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesSettingsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesSettingsPropertiesTests.java new file mode 100644 index 000000000000..8351fcf446dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesSettingsPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.AnomaliesSettingsProperties; + +public final class AnomaliesSettingsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AnomaliesSettingsProperties model + = BinaryData.fromString("{\"isEnabled\":false}").toObject(AnomaliesSettingsProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AnomaliesSettingsProperties model = new AnomaliesSettingsProperties(); + model = BinaryData.fromObject(model).toObject(AnomaliesSettingsProperties.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesTests.java new file mode 100644 index 000000000000..36ecd1128753 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomaliesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Anomalies; +import org.junit.jupiter.api.Assertions; + +public final class AnomaliesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Anomalies model = BinaryData.fromString( + "{\"kind\":\"Anomalies\",\"properties\":{\"isEnabled\":false},\"etag\":\"aaxxsritr\",\"id\":\"baaesyy\",\"name\":\"fmxwoqot\",\"type\":\"iqbgpasrvrm\"}") + .toObject(Anomalies.class); + Assertions.assertEquals("aaxxsritr", model.etag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Anomalies model = new Anomalies().withEtag("aaxxsritr"); + model = BinaryData.fromObject(model).toObject(Anomalies.class); + Assertions.assertEquals("aaxxsritr", model.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsPropertiesTests.java index fd590320de39..2e5076b253d4 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,61 +11,60 @@ import com.azure.resourcemanager.securityinsights.models.SettingsStatus; import java.time.Duration; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class AnomalySecurityMLAnalyticsSettingsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AnomalySecurityMLAnalyticsSettingsProperties model = BinaryData.fromString( - "{\"description\":\"vechndbnwiehole\",\"displayName\":\"jwiuubwefqsfapaq\",\"enabled\":false,\"lastModifiedUtc\":\"2021-10-04T15:26:40Z\",\"requiredDataConnectors\":[{\"connectorId\":\"ex\",\"dataTypes\":[\"fxapjwogqqnobpu\",\"cdabtqwpwya\",\"bzasqbucljgkyexa\",\"guyaip\"]}],\"tactics\":[\"CredentialAccess\",\"PrivilegeEscalation\",\"LateralMovement\"],\"techniques\":[\"xijj\"],\"anomalyVersion\":\"mfqwa\",\"customizableObservations\":\"datanqnm\",\"frequency\":\"PT225H52M14S\",\"settingsStatus\":\"Production\",\"isDefaultSettings\":true,\"anomalySettingsVersion\":878214115,\"settingsDefinitionId\":\"69819be3-f87c-494e-8407-4dae319becce\"}") + "{\"description\":\"ooajeyyjmjjx\",\"displayName\":\"zxpxhn\",\"enabled\":true,\"lastModifiedUtc\":\"2021-10-01T07:21:28Z\",\"requiredDataConnectors\":[{\"connectorId\":\"ttgzkjtyq\",\"dataTypes\":[\"adeghztldsvc\",\"djiah\"]}],\"tactics\":[\"ImpairProcessControl\",\"Reconnaissance\"],\"techniques\":[\"cwwmejjqh\",\"dwvmqxiyookyfo\",\"kbnzxbypfq\"],\"anomalyVersion\":\"gaixwrgrkkd\",\"customizableObservations\":\"\\\"datafrswqikwepw\\\"\",\"frequency\":\"PT135H9M30S\",\"settingsStatus\":\"Flighting\",\"isDefaultSettings\":true,\"anomalySettingsVersion\":747872961,\"settingsDefinitionId\":\"nxhtf\"}") .toObject(AnomalySecurityMLAnalyticsSettingsProperties.class); - Assertions.assertEquals("vechndbnwiehole", model.description()); - Assertions.assertEquals("jwiuubwefqsfapaq", model.displayName()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ex", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("fxapjwogqqnobpu", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(AttackTactic.CREDENTIAL_ACCESS, model.tactics().get(0)); - Assertions.assertEquals("xijj", model.techniques().get(0)); - Assertions.assertEquals("mfqwa", model.anomalyVersion()); - Assertions.assertEquals(Duration.parse("PT225H52M14S"), model.frequency()); - Assertions.assertEquals(SettingsStatus.PRODUCTION, model.settingsStatus()); - Assertions.assertEquals(true, model.isDefaultSettings()); - Assertions.assertEquals(878214115, model.anomalySettingsVersion()); - Assertions.assertEquals(UUID.fromString("69819be3-f87c-494e-8407-4dae319becce"), model.settingsDefinitionId()); + Assertions.assertEquals("ooajeyyjmjjx", model.description()); + Assertions.assertEquals("zxpxhn", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("ttgzkjtyq", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("adeghztldsvc", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(AttackTactic.IMPAIR_PROCESS_CONTROL, model.tactics().get(0)); + Assertions.assertEquals("cwwmejjqh", model.techniques().get(0)); + Assertions.assertEquals("gaixwrgrkkd", model.anomalyVersion()); + Assertions.assertEquals(Duration.parse("PT135H9M30S"), model.frequency()); + Assertions.assertEquals(SettingsStatus.FLIGHTING, model.settingsStatus()); + Assertions.assertTrue(model.isDefaultSettings()); + Assertions.assertEquals(747872961, model.anomalySettingsVersion()); + Assertions.assertEquals("nxhtf", model.settingsDefinitionId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AnomalySecurityMLAnalyticsSettingsProperties model = new AnomalySecurityMLAnalyticsSettingsProperties() - .withDescription("vechndbnwiehole") - .withDisplayName("jwiuubwefqsfapaq") - .withEnabled(false) - .withRequiredDataConnectors(Arrays.asList(new SecurityMLAnalyticsSettingsDataSource().withConnectorId("ex") - .withDataTypes(Arrays.asList("fxapjwogqqnobpu", "cdabtqwpwya", "bzasqbucljgkyexa", "guyaip")))) - .withTactics(Arrays.asList(AttackTactic.CREDENTIAL_ACCESS, AttackTactic.PRIVILEGE_ESCALATION, - AttackTactic.LATERAL_MOVEMENT)) - .withTechniques(Arrays.asList("xijj")) - .withAnomalyVersion("mfqwa") - .withCustomizableObservations("datanqnm") - .withFrequency(Duration.parse("PT225H52M14S")) - .withSettingsStatus(SettingsStatus.PRODUCTION) - .withIsDefaultSettings(true) - .withAnomalySettingsVersion(878214115) - .withSettingsDefinitionId(UUID.fromString("69819be3-f87c-494e-8407-4dae319becce")); + AnomalySecurityMLAnalyticsSettingsProperties model + = new AnomalySecurityMLAnalyticsSettingsProperties().withDescription("ooajeyyjmjjx") + .withDisplayName("zxpxhn") + .withEnabled(true) + .withRequiredDataConnectors( + Arrays.asList(new SecurityMLAnalyticsSettingsDataSource().withConnectorId("ttgzkjtyq") + .withDataTypes(Arrays.asList("adeghztldsvc", "djiah")))) + .withTactics(Arrays.asList(AttackTactic.IMPAIR_PROCESS_CONTROL, AttackTactic.RECONNAISSANCE)) + .withTechniques(Arrays.asList("cwwmejjqh", "dwvmqxiyookyfo", "kbnzxbypfq")) + .withAnomalyVersion("gaixwrgrkkd") + .withCustomizableObservations("\"datafrswqikwepw\"") + .withFrequency(Duration.parse("PT135H9M30S")) + .withSettingsStatus(SettingsStatus.FLIGHTING) + .withIsDefaultSettings(true) + .withAnomalySettingsVersion(747872961) + .withSettingsDefinitionId("nxhtf"); model = BinaryData.fromObject(model).toObject(AnomalySecurityMLAnalyticsSettingsProperties.class); - Assertions.assertEquals("vechndbnwiehole", model.description()); - Assertions.assertEquals("jwiuubwefqsfapaq", model.displayName()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ex", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("fxapjwogqqnobpu", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(AttackTactic.CREDENTIAL_ACCESS, model.tactics().get(0)); - Assertions.assertEquals("xijj", model.techniques().get(0)); - Assertions.assertEquals("mfqwa", model.anomalyVersion()); - Assertions.assertEquals(Duration.parse("PT225H52M14S"), model.frequency()); - Assertions.assertEquals(SettingsStatus.PRODUCTION, model.settingsStatus()); - Assertions.assertEquals(true, model.isDefaultSettings()); - Assertions.assertEquals(878214115, model.anomalySettingsVersion()); - Assertions.assertEquals(UUID.fromString("69819be3-f87c-494e-8407-4dae319becce"), model.settingsDefinitionId()); + Assertions.assertEquals("ooajeyyjmjjx", model.description()); + Assertions.assertEquals("zxpxhn", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("ttgzkjtyq", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("adeghztldsvc", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(AttackTactic.IMPAIR_PROCESS_CONTROL, model.tactics().get(0)); + Assertions.assertEquals("cwwmejjqh", model.techniques().get(0)); + Assertions.assertEquals("gaixwrgrkkd", model.anomalyVersion()); + Assertions.assertEquals(Duration.parse("PT135H9M30S"), model.frequency()); + Assertions.assertEquals(SettingsStatus.FLIGHTING, model.settingsStatus()); + Assertions.assertTrue(model.isDefaultSettings()); + Assertions.assertEquals(747872961, model.anomalySettingsVersion()); + Assertions.assertEquals("nxhtf", model.settingsDefinitionId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsTests.java index b442c0aced3a..17e91330a0ae 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalySecurityMLAnalyticsSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,63 +11,69 @@ import com.azure.resourcemanager.securityinsights.models.SettingsStatus; import java.time.Duration; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class AnomalySecurityMLAnalyticsSettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AnomalySecurityMLAnalyticsSettings model = BinaryData.fromString( - "{\"kind\":\"Anomaly\",\"properties\":{\"description\":\"nqzi\",\"displayName\":\"kfkbgbzbowxeqocl\",\"enabled\":true,\"lastModifiedUtc\":\"2021-01-04T04:03:18Z\",\"requiredDataConnectors\":[{\"connectorId\":\"qkjjeokbz\",\"dataTypes\":[\"zrxcczurt\",\"e\",\"pqxbkwvzgnzvdf\",\"zdix\"]}],\"tactics\":[\"InhibitResponseFunction\"],\"techniques\":[\"d\",\"wopqhewjptmcgs\",\"ostzelndlatu\",\"mzlbiojlvfhrb\"],\"anomalyVersion\":\"pn\",\"customizableObservations\":\"datavcwwyyurmochppr\",\"frequency\":\"PT151H32M19S\",\"settingsStatus\":\"Flighting\",\"isDefaultSettings\":true,\"anomalySettingsVersion\":1135076177,\"settingsDefinitionId\":\"8af64da2-e0a9-4296-9e40-0abb55fb4dc1\"},\"etag\":\"yzejnhlbk\",\"id\":\"z\",\"name\":\"cpilj\",\"type\":\"a\"}") + "{\"kind\":\"Anomaly\",\"properties\":{\"description\":\"nimtwuuhaueg\",\"displayName\":\"kwmnfeub\",\"enabled\":false,\"lastModifiedUtc\":\"2021-07-09T17:25:31Z\",\"requiredDataConnectors\":[{\"connectorId\":\"fugiphrrkuu\",\"dataTypes\":[\"durhzzfopueoqus\",\"wlujopwnibit\",\"oztjdqumqvfmw\"]},{\"connectorId\":\"ddtgctxegtvgwy\",\"dataTypes\":[\"elfnzzryiz\"]},{\"connectorId\":\"xgdebxl\",\"dataTypes\":[\"no\",\"irhpfabenq\"]},{\"connectorId\":\"mwmgewayxfl\",\"dataTypes\":[\"pjs\"]}],\"tactics\":[\"ImpairProcessControl\",\"InhibitResponseFunction\",\"PreAttack\",\"Persistence\"],\"techniques\":[\"sqsnxf\",\"xufeapd\",\"bzyvbsua\"],\"anomalyVersion\":\"ulpodkaxpf\",\"customizableObservations\":\"\\\"datakzhmhj\\\"\",\"frequency\":\"PT128H4M57S\",\"settingsStatus\":\"Production\",\"isDefaultSettings\":true,\"anomalySettingsVersion\":1291647350,\"settingsDefinitionId\":\"uq\"},\"etag\":\"jadhfztl\",\"id\":\"ysrkgzkyhudbk\",\"name\":\"wpzqxlcweakfecj\",\"type\":\"xfaqufqizjvp\"}") .toObject(AnomalySecurityMLAnalyticsSettings.class); - Assertions.assertEquals("yzejnhlbk", model.etag()); - Assertions.assertEquals("nqzi", model.description()); - Assertions.assertEquals("kfkbgbzbowxeqocl", model.displayName()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("qkjjeokbz", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("zrxcczurt", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(AttackTactic.INHIBIT_RESPONSE_FUNCTION, model.tactics().get(0)); - Assertions.assertEquals("d", model.techniques().get(0)); - Assertions.assertEquals("pn", model.anomalyVersion()); - Assertions.assertEquals(Duration.parse("PT151H32M19S"), model.frequency()); - Assertions.assertEquals(SettingsStatus.FLIGHTING, model.settingsStatus()); - Assertions.assertEquals(true, model.isDefaultSettings()); - Assertions.assertEquals(1135076177, model.anomalySettingsVersion()); - Assertions.assertEquals(UUID.fromString("8af64da2-e0a9-4296-9e40-0abb55fb4dc1"), model.settingsDefinitionId()); + Assertions.assertEquals("jadhfztl", model.etag()); + Assertions.assertEquals("nimtwuuhaueg", model.description()); + Assertions.assertEquals("kwmnfeub", model.displayName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("fugiphrrkuu", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("durhzzfopueoqus", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(AttackTactic.IMPAIR_PROCESS_CONTROL, model.tactics().get(0)); + Assertions.assertEquals("sqsnxf", model.techniques().get(0)); + Assertions.assertEquals("ulpodkaxpf", model.anomalyVersion()); + Assertions.assertEquals(Duration.parse("PT128H4M57S"), model.frequency()); + Assertions.assertEquals(SettingsStatus.PRODUCTION, model.settingsStatus()); + Assertions.assertTrue(model.isDefaultSettings()); + Assertions.assertEquals(1291647350, model.anomalySettingsVersion()); + Assertions.assertEquals("uq", model.settingsDefinitionId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AnomalySecurityMLAnalyticsSettings model = new AnomalySecurityMLAnalyticsSettings().withEtag("yzejnhlbk") - .withDescription("nqzi") - .withDisplayName("kfkbgbzbowxeqocl") - .withEnabled(true) - .withRequiredDataConnectors( - Arrays.asList(new SecurityMLAnalyticsSettingsDataSource().withConnectorId("qkjjeokbz") - .withDataTypes(Arrays.asList("zrxcczurt", "e", "pqxbkwvzgnzvdf", "zdix")))) - .withTactics(Arrays.asList(AttackTactic.INHIBIT_RESPONSE_FUNCTION)) - .withTechniques(Arrays.asList("d", "wopqhewjptmcgs", "ostzelndlatu", "mzlbiojlvfhrb")) - .withAnomalyVersion("pn") - .withCustomizableObservations("datavcwwyyurmochppr") - .withFrequency(Duration.parse("PT151H32M19S")) - .withSettingsStatus(SettingsStatus.FLIGHTING) + AnomalySecurityMLAnalyticsSettings model = new AnomalySecurityMLAnalyticsSettings().withEtag("jadhfztl") + .withDescription("nimtwuuhaueg") + .withDisplayName("kwmnfeub") + .withEnabled(false) + .withRequiredDataConnectors(Arrays.asList( + new SecurityMLAnalyticsSettingsDataSource().withConnectorId("fugiphrrkuu") + .withDataTypes(Arrays.asList("durhzzfopueoqus", "wlujopwnibit", "oztjdqumqvfmw")), + new SecurityMLAnalyticsSettingsDataSource().withConnectorId("ddtgctxegtvgwy") + .withDataTypes(Arrays.asList("elfnzzryiz")), + new SecurityMLAnalyticsSettingsDataSource().withConnectorId("xgdebxl") + .withDataTypes(Arrays.asList("no", "irhpfabenq")), + new SecurityMLAnalyticsSettingsDataSource().withConnectorId("mwmgewayxfl") + .withDataTypes(Arrays.asList("pjs")))) + .withTactics(Arrays.asList(AttackTactic.IMPAIR_PROCESS_CONTROL, AttackTactic.INHIBIT_RESPONSE_FUNCTION, + AttackTactic.PRE_ATTACK, AttackTactic.PERSISTENCE)) + .withTechniques(Arrays.asList("sqsnxf", "xufeapd", "bzyvbsua")) + .withAnomalyVersion("ulpodkaxpf") + .withCustomizableObservations("\"datakzhmhj\"") + .withFrequency(Duration.parse("PT128H4M57S")) + .withSettingsStatus(SettingsStatus.PRODUCTION) .withIsDefaultSettings(true) - .withAnomalySettingsVersion(1135076177) - .withSettingsDefinitionId(UUID.fromString("8af64da2-e0a9-4296-9e40-0abb55fb4dc1")); + .withAnomalySettingsVersion(1291647350) + .withSettingsDefinitionId("uq"); model = BinaryData.fromObject(model).toObject(AnomalySecurityMLAnalyticsSettings.class); - Assertions.assertEquals("yzejnhlbk", model.etag()); - Assertions.assertEquals("nqzi", model.description()); - Assertions.assertEquals("kfkbgbzbowxeqocl", model.displayName()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("qkjjeokbz", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("zrxcczurt", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(AttackTactic.INHIBIT_RESPONSE_FUNCTION, model.tactics().get(0)); - Assertions.assertEquals("d", model.techniques().get(0)); - Assertions.assertEquals("pn", model.anomalyVersion()); - Assertions.assertEquals(Duration.parse("PT151H32M19S"), model.frequency()); - Assertions.assertEquals(SettingsStatus.FLIGHTING, model.settingsStatus()); - Assertions.assertEquals(true, model.isDefaultSettings()); - Assertions.assertEquals(1135076177, model.anomalySettingsVersion()); - Assertions.assertEquals(UUID.fromString("8af64da2-e0a9-4296-9e40-0abb55fb4dc1"), model.settingsDefinitionId()); + Assertions.assertEquals("jadhfztl", model.etag()); + Assertions.assertEquals("nimtwuuhaueg", model.description()); + Assertions.assertEquals("kwmnfeub", model.displayName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("fugiphrrkuu", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("durhzzfopueoqus", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(AttackTactic.IMPAIR_PROCESS_CONTROL, model.tactics().get(0)); + Assertions.assertEquals("sqsnxf", model.techniques().get(0)); + Assertions.assertEquals("ulpodkaxpf", model.anomalyVersion()); + Assertions.assertEquals(Duration.parse("PT128H4M57S"), model.frequency()); + Assertions.assertEquals(SettingsStatus.PRODUCTION, model.settingsStatus()); + Assertions.assertTrue(model.isDefaultSettings()); + Assertions.assertEquals(1291647350, model.anomalySettingsVersion()); + Assertions.assertEquals("uq", model.settingsDefinitionId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalyTimelineItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalyTimelineItemTests.java new file mode 100644 index 000000000000..49eea482f30d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AnomalyTimelineItemTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AnomalyTimelineItem; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class AnomalyTimelineItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AnomalyTimelineItem model = BinaryData.fromString( + "{\"kind\":\"Anomaly\",\"azureResourceId\":\"lxptxhednkzjtrja\",\"productName\":\"zrtsei\",\"description\":\"krw\",\"displayName\":\"zn\",\"endTimeUtc\":\"2021-07-11T10:45:48Z\",\"startTimeUtc\":\"2021-06-12T15:53:50Z\",\"timeGenerated\":\"2021-09-19T17:32:50Z\",\"vendor\":\"cyeljni\",\"intent\":\"gzxb\",\"techniques\":[\"yihct\",\"u\"],\"reasons\":[\"ozbkhtvu\",\"hutiqlmvn\"]}") + .toObject(AnomalyTimelineItem.class); + Assertions.assertEquals("lxptxhednkzjtrja", model.azureResourceId()); + Assertions.assertEquals("zrtsei", model.productName()); + Assertions.assertEquals("krw", model.description()); + Assertions.assertEquals("zn", model.displayName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-11T10:45:48Z"), model.endTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T15:53:50Z"), model.startTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T17:32:50Z"), model.timeGenerated()); + Assertions.assertEquals("cyeljni", model.vendor()); + Assertions.assertEquals("gzxb", model.intent()); + Assertions.assertEquals("yihct", model.techniques().get(0)); + Assertions.assertEquals("ozbkhtvu", model.reasons().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AscDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AscDataConnectorTests.java index 5059c39f922a..4702954d66d9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AscDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AscDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,22 +15,22 @@ public final class AscDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AscDataConnector model = BinaryData.fromString( - "{\"kind\":\"AzureSecurityCenter\",\"properties\":{\"subscriptionId\":\"gydcw\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"vqqolih\",\"id\":\"aiouaubrjt\",\"name\":\"oq\",\"type\":\"fuojrngif\"}") + "{\"kind\":\"AzureSecurityCenter\",\"properties\":{\"subscriptionId\":\"guavtptb\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"qynspgbvoffb\",\"id\":\"w\",\"name\":\"dxaexqokmyrljia\",\"type\":\"zbnobr\"}") .toObject(AscDataConnector.class); - Assertions.assertEquals("vqqolih", model.etag()); - Assertions.assertEquals("gydcw", model.subscriptionId()); + Assertions.assertEquals("qynspgbvoffb", model.etag()); + Assertions.assertEquals("guavtptb", model.subscriptionId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AscDataConnector model = new AscDataConnector().withEtag("vqqolih") - .withSubscriptionId("gydcw") + AscDataConnector model = new AscDataConnector().withEtag("qynspgbvoffb") + .withSubscriptionId("guavtptb") .withDataTypes(new AlertsDataTypeOfDataConnector() .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); model = BinaryData.fromObject(model).toObject(AscDataConnector.class); - Assertions.assertEquals("vqqolih", model.etag()); - Assertions.assertEquals("gydcw", model.subscriptionId()); + Assertions.assertEquals("qynspgbvoffb", model.etag()); + Assertions.assertEquals("guavtptb", model.subscriptionId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AssignmentItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AssignmentItemTests.java new file mode 100644 index 000000000000..29bb5c8c94fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AssignmentItemTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import org.junit.jupiter.api.Assertions; + +public final class AssignmentItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssignmentItem model + = BinaryData.fromString("{\"resourceId\":\"ncuyjeykcnhppl\"}").toObject(AssignmentItem.class); + Assertions.assertEquals("ncuyjeykcnhppl", model.resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AssignmentItem model = new AssignmentItem().withResourceId("ncuyjeykcnhppl"); + model = BinaryData.fromObject(model).toObject(AssignmentItem.class); + Assertions.assertEquals("ncuyjeykcnhppl", model.resourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AttackPatternTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AttackPatternTests.java new file mode 100644 index 000000000000..33149b62e9d9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AttackPatternTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AttackPattern; + +public final class AttackPatternTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AttackPattern model = BinaryData.fromString( + "{\"kind\":\"AttackPattern\",\"properties\":{\"data\":{\"hqyhxhuhhnr\":\"\\\"datapxdiibjjwuek\\\"\",\"fajhtv\":\"\\\"datamfzfkhfnzj\\\"\",\"vpdtrlsmsr\":\"\\\"dataskgciedl\\\"\"},\"createdBy\":{\"email\":\"gbuugc\",\"name\":\"tps\",\"objectId\":\"awfupny\"},\"source\":\"uivrjse\",\"firstIngestedTimeUtc\":\"2021-11-27T23:05:36Z\",\"lastIngestedTimeUtc\":\"2021-06-05T23:15:35Z\",\"ingestionRulesVersion\":\"e\",\"lastUpdateMethod\":\"eb\",\"lastModifiedBy\":{\"email\":\"zxrusafvflyqau\",\"name\":\"hskimntxd\",\"objectId\":\"qmnwh\"},\"lastUpdatedDateTimeUtc\":\"2021-01-22T20:51:13Z\",\"relationshipHints\":[{\"fieldName\":\"dumaplp\",\"source\":\"riettnmi\"}]},\"id\":\"p\",\"name\":\"fqmlmbyqyekuw\",\"type\":\"dxz\"}") + .toObject(AttackPattern.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleActionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleActionTests.java index 61358f629285..082b78390dfc 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleActionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleActionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,15 +12,15 @@ public final class AutomationRuleActionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRuleAction model - = BinaryData.fromString("{\"actionType\":\"AutomationRuleAction\",\"order\":967174365}") + = BinaryData.fromString("{\"actionType\":\"AutomationRuleAction\",\"order\":37361117}") .toObject(AutomationRuleAction.class); - Assertions.assertEquals(967174365, model.order()); + Assertions.assertEquals(37361117, model.order()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutomationRuleAction model = new AutomationRuleAction().withOrder(967174365); + AutomationRuleAction model = new AutomationRuleAction().withOrder(37361117); model = BinaryData.fromObject(model).toObject(AutomationRuleAction.class); - Assertions.assertEquals(967174365, model.order()); + Assertions.assertEquals(37361117, model.order()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleAddIncidentTaskActionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleAddIncidentTaskActionTests.java new file mode 100644 index 000000000000..d0900620d3e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleAddIncidentTaskActionTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AddIncidentTaskActionProperties; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleAddIncidentTaskAction; +import org.junit.jupiter.api.Assertions; + +public final class AutomationRuleAddIncidentTaskActionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutomationRuleAddIncidentTaskAction model = BinaryData.fromString( + "{\"actionType\":\"AddIncidentTask\",\"actionConfiguration\":{\"title\":\"y\",\"description\":\"xakjsqzhzb\"},\"order\":1931618736}") + .toObject(AutomationRuleAddIncidentTaskAction.class); + Assertions.assertEquals(1931618736, model.order()); + Assertions.assertEquals("y", model.actionConfiguration().title()); + Assertions.assertEquals("xakjsqzhzb", model.actionConfiguration().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutomationRuleAddIncidentTaskAction model = new AutomationRuleAddIncidentTaskAction().withOrder(1931618736) + .withActionConfiguration( + new AddIncidentTaskActionProperties().withTitle("y").withDescription("xakjsqzhzb")); + model = BinaryData.fromObject(model).toObject(AutomationRuleAddIncidentTaskAction.class); + Assertions.assertEquals(1931618736, model.order()); + Assertions.assertEquals("y", model.actionConfiguration().title()); + Assertions.assertEquals("xakjsqzhzb", model.actionConfiguration().description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleBooleanConditionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleBooleanConditionTests.java new file mode 100644 index 000000000000..7c08e1885ae1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleBooleanConditionTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanCondition; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanConditionSupportedOperator; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleCondition; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AutomationRuleBooleanConditionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutomationRuleBooleanCondition model = BinaryData.fromString( + "{\"operator\":\"Or\",\"innerConditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]}") + .toObject(AutomationRuleBooleanCondition.class); + Assertions.assertEquals(AutomationRuleBooleanConditionSupportedOperator.OR, model.operator()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutomationRuleBooleanCondition model + = new AutomationRuleBooleanCondition().withOperator(AutomationRuleBooleanConditionSupportedOperator.OR) + .withInnerConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition())); + model = BinaryData.fromObject(model).toObject(AutomationRuleBooleanCondition.class); + Assertions.assertEquals(AutomationRuleBooleanConditionSupportedOperator.OR, model.operator()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleConditionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleConditionTests.java index e67be0914405..e4dafc54ea6e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleConditionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleConditionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleInnerTests.java index ae4173cba25c..5b4252f64aab 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -19,40 +19,40 @@ public final class AutomationRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRuleInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"fublj\",\"order\":1488023344,\"triggeringLogic\":{\"isEnabled\":true,\"expirationTimeUtc\":\"2021-09-01T11:04:48Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1887671612}],\"lastModifiedTimeUtc\":\"2021-01-23T13:20:17Z\",\"createdTimeUtc\":\"2021-11-28T09:58Z\",\"lastModifiedBy\":{\"email\":\"s\",\"name\":\"smjqulngsntnbyb\",\"objectId\":\"38e16d6d-321d-402d-9e1a-e8ca9de546c2\",\"userPrincipalName\":\"cwrwclxxwrljdous\"},\"createdBy\":{\"email\":\"vkocrcjdkwtn\",\"name\":\"bnjbiksqrglssain\",\"objectId\":\"4c8a18d6-c9d2-4ae9-b3e2-bc30b3b2ec9e\",\"userPrincipalName\":\"wnzlljfmppeeb\"}},\"etag\":\"gxsabkyq\",\"id\":\"ujitcjcz\",\"name\":\"zevndhkrwpdappds\",\"type\":\"dkvwrwjfe\"}") + "{\"properties\":{\"displayName\":\"l\",\"order\":1791330628,\"triggeringLogic\":{\"isEnabled\":true,\"expirationTimeUtc\":\"2021-06-27T13:13:13Z\",\"triggersOn\":\"Incidents\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1693425826},{\"actionType\":\"AutomationRuleAction\",\"order\":1841615082},{\"actionType\":\"AutomationRuleAction\",\"order\":31870038}],\"lastModifiedTimeUtc\":\"2021-01-08T06:22:15Z\",\"createdTimeUtc\":\"2021-08-04T19:07:06Z\",\"lastModifiedBy\":{\"email\":\"x\",\"name\":\"bcporxvxcjzhqizx\",\"objectId\":\"xtgqscjavftjuh\",\"userPrincipalName\":\"azkmtgguwp\"},\"createdBy\":{\"email\":\"ajc\",\"name\":\"m\",\"objectId\":\"hfcf\",\"userPrincipalName\":\"rxgkne\"}},\"etag\":\"yinzqodfvpgs\",\"id\":\"xgsg\",\"name\":\"p\",\"type\":\"gzdjtxvzf\"}") .toObject(AutomationRuleInner.class); - Assertions.assertEquals("gxsabkyq", model.etag()); - Assertions.assertEquals("fublj", model.displayName()); - Assertions.assertEquals(1488023344, model.order()); - Assertions.assertEquals(true, model.triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-01T11:04:48Z"), + Assertions.assertEquals("yinzqodfvpgs", model.etag()); + Assertions.assertEquals("l", model.displayName()); + Assertions.assertEquals(1791330628, model.order()); + Assertions.assertTrue(model.triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T13:13:13Z"), model.triggeringLogic().expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.ALERTS, model.triggeringLogic().triggersOn()); + Assertions.assertEquals(TriggersOn.INCIDENTS, model.triggeringLogic().triggersOn()); Assertions.assertEquals(TriggersWhen.CREATED, model.triggeringLogic().triggersWhen()); - Assertions.assertEquals(1887671612, model.actions().get(0).order()); + Assertions.assertEquals(1693425826, model.actions().get(0).order()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutomationRuleInner model = new AutomationRuleInner().withEtag("gxsabkyq") - .withDisplayName("fublj") - .withOrder(1488023344) + AutomationRuleInner model = new AutomationRuleInner().withEtag("yinzqodfvpgs") + .withDisplayName("l") + .withOrder(1791330628) .withTriggeringLogic(new AutomationRuleTriggeringLogic().withIsEnabled(true) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-09-01T11:04:48Z")) - .withTriggersOn(TriggersOn.ALERTS) + .withExpirationTimeUtc(OffsetDateTime.parse("2021-06-27T13:13:13Z")) + .withTriggersOn(TriggersOn.INCIDENTS) .withTriggersWhen(TriggersWhen.CREATED) - .withConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition(), - new AutomationRuleCondition(), new AutomationRuleCondition()))) - .withActions(Arrays.asList(new AutomationRuleAction().withOrder(1887671612))); + .withConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition()))) + .withActions(Arrays.asList(new AutomationRuleAction().withOrder(1693425826), + new AutomationRuleAction().withOrder(1841615082), new AutomationRuleAction().withOrder(31870038))); model = BinaryData.fromObject(model).toObject(AutomationRuleInner.class); - Assertions.assertEquals("gxsabkyq", model.etag()); - Assertions.assertEquals("fublj", model.displayName()); - Assertions.assertEquals(1488023344, model.order()); - Assertions.assertEquals(true, model.triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-01T11:04:48Z"), + Assertions.assertEquals("yinzqodfvpgs", model.etag()); + Assertions.assertEquals("l", model.displayName()); + Assertions.assertEquals(1791330628, model.order()); + Assertions.assertTrue(model.triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T13:13:13Z"), model.triggeringLogic().expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.ALERTS, model.triggeringLogic().triggersOn()); + Assertions.assertEquals(TriggersOn.INCIDENTS, model.triggeringLogic().triggersOn()); Assertions.assertEquals(TriggersWhen.CREATED, model.triggeringLogic().triggersWhen()); - Assertions.assertEquals(1887671612, model.actions().get(0).order()); + Assertions.assertEquals(1693425826, model.actions().get(0).order()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleModifyPropertiesActionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleModifyPropertiesActionTests.java index a07709510c50..37e76a33768d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleModifyPropertiesActionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleModifyPropertiesActionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,60 +15,58 @@ import com.azure.resourcemanager.securityinsights.models.IncidentStatus; import com.azure.resourcemanager.securityinsights.models.OwnerType; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class AutomationRuleModifyPropertiesActionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRuleModifyPropertiesAction model = BinaryData.fromString( - "{\"actionType\":\"ModifyProperties\",\"actionConfiguration\":{\"severity\":\"Informational\",\"status\":\"New\",\"classification\":\"TruePositive\",\"classificationReason\":\"SuspiciousActivity\",\"classificationComment\":\"mrsieekp\",\"owner\":{\"email\":\"aapm\",\"assignedTo\":\"qmeqwigpibudqwyx\",\"objectId\":\"c20b53ae-8fa6-4963-bb1b-69b6dad0a3c5\",\"userPrincipalName\":\"ybpmzznrtffyaq\",\"ownerType\":\"Unknown\"},\"labels\":[{\"labelName\":\"eioqaqhvse\",\"labelType\":\"User\"},{\"labelName\":\"qyrxp\",\"labelType\":\"User\"}]},\"order\":801625089}") + "{\"actionType\":\"ModifyProperties\",\"actionConfiguration\":{\"severity\":\"Informational\",\"status\":\"Closed\",\"classification\":\"TruePositive\",\"classificationReason\":\"IncorrectAlertLogic\",\"classificationComment\":\"a\",\"owner\":{\"email\":\"vjhhn\",\"assignedTo\":\"zybbj\",\"objectId\":\"dj\",\"userPrincipalName\":\"yxkyxvx\",\"ownerType\":\"User\"},\"labels\":[{\"labelName\":\"jednlj\",\"labelType\":\"User\"},{\"labelName\":\"euaulxu\",\"labelType\":\"User\"},{\"labelName\":\"jbnkpp\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"enlsvxeizzgwkln\",\"labelType\":\"AutoAssigned\"}]},\"order\":1411434101}") .toObject(AutomationRuleModifyPropertiesAction.class); - Assertions.assertEquals(801625089, model.order()); + Assertions.assertEquals(1411434101, model.order()); Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.actionConfiguration().severity()); - Assertions.assertEquals(IncidentStatus.NEW, model.actionConfiguration().status()); + Assertions.assertEquals(IncidentStatus.CLOSED, model.actionConfiguration().status()); Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.actionConfiguration().classification()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_ACTIVITY, + Assertions.assertEquals(IncidentClassificationReason.INCORRECT_ALERT_LOGIC, model.actionConfiguration().classificationReason()); - Assertions.assertEquals("mrsieekp", model.actionConfiguration().classificationComment()); - Assertions.assertEquals("aapm", model.actionConfiguration().owner().email()); - Assertions.assertEquals("qmeqwigpibudqwyx", model.actionConfiguration().owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("c20b53ae-8fa6-4963-bb1b-69b6dad0a3c5"), - model.actionConfiguration().owner().objectId()); - Assertions.assertEquals("ybpmzznrtffyaq", model.actionConfiguration().owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.UNKNOWN, model.actionConfiguration().owner().ownerType()); - Assertions.assertEquals("eioqaqhvse", model.actionConfiguration().labels().get(0).labelName()); + Assertions.assertEquals("a", model.actionConfiguration().classificationComment()); + Assertions.assertEquals("vjhhn", model.actionConfiguration().owner().email()); + Assertions.assertEquals("zybbj", model.actionConfiguration().owner().assignedTo()); + Assertions.assertEquals("dj", model.actionConfiguration().owner().objectId()); + Assertions.assertEquals("yxkyxvx", model.actionConfiguration().owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.actionConfiguration().owner().ownerType()); + Assertions.assertEquals("jednlj", model.actionConfiguration().labels().get(0).labelName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutomationRuleModifyPropertiesAction model = new AutomationRuleModifyPropertiesAction().withOrder(801625089) + AutomationRuleModifyPropertiesAction model = new AutomationRuleModifyPropertiesAction().withOrder(1411434101) .withActionConfiguration(new IncidentPropertiesAction().withSeverity(IncidentSeverity.INFORMATIONAL) - .withStatus(IncidentStatus.NEW) + .withStatus(IncidentStatus.CLOSED) .withClassification(IncidentClassification.TRUE_POSITIVE) - .withClassificationReason(IncidentClassificationReason.SUSPICIOUS_ACTIVITY) - .withClassificationComment("mrsieekp") - .withOwner(new IncidentOwnerInfo().withEmail("aapm") - .withAssignedTo("qmeqwigpibudqwyx") - .withObjectId(UUID.fromString("c20b53ae-8fa6-4963-bb1b-69b6dad0a3c5")) - .withUserPrincipalName("ybpmzznrtffyaq") - .withOwnerType(OwnerType.UNKNOWN)) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("eioqaqhvse"), - new IncidentLabel().withLabelName("qyrxp")))); + .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) + .withClassificationComment("a") + .withOwner(new IncidentOwnerInfo().withEmail("vjhhn") + .withAssignedTo("zybbj") + .withObjectId("dj") + .withUserPrincipalName("yxkyxvx") + .withOwnerType(OwnerType.USER)) + .withLabels(Arrays.asList(new IncidentLabel().withLabelName("jednlj"), + new IncidentLabel().withLabelName("euaulxu"), new IncidentLabel().withLabelName("jbnkpp"), + new IncidentLabel().withLabelName("enlsvxeizzgwkln")))); model = BinaryData.fromObject(model).toObject(AutomationRuleModifyPropertiesAction.class); - Assertions.assertEquals(801625089, model.order()); + Assertions.assertEquals(1411434101, model.order()); Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.actionConfiguration().severity()); - Assertions.assertEquals(IncidentStatus.NEW, model.actionConfiguration().status()); + Assertions.assertEquals(IncidentStatus.CLOSED, model.actionConfiguration().status()); Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.actionConfiguration().classification()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_ACTIVITY, + Assertions.assertEquals(IncidentClassificationReason.INCORRECT_ALERT_LOGIC, model.actionConfiguration().classificationReason()); - Assertions.assertEquals("mrsieekp", model.actionConfiguration().classificationComment()); - Assertions.assertEquals("aapm", model.actionConfiguration().owner().email()); - Assertions.assertEquals("qmeqwigpibudqwyx", model.actionConfiguration().owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("c20b53ae-8fa6-4963-bb1b-69b6dad0a3c5"), - model.actionConfiguration().owner().objectId()); - Assertions.assertEquals("ybpmzznrtffyaq", model.actionConfiguration().owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.UNKNOWN, model.actionConfiguration().owner().ownerType()); - Assertions.assertEquals("eioqaqhvse", model.actionConfiguration().labels().get(0).labelName()); + Assertions.assertEquals("a", model.actionConfiguration().classificationComment()); + Assertions.assertEquals("vjhhn", model.actionConfiguration().owner().email()); + Assertions.assertEquals("zybbj", model.actionConfiguration().owner().assignedTo()); + Assertions.assertEquals("dj", model.actionConfiguration().owner().objectId()); + Assertions.assertEquals("yxkyxvx", model.actionConfiguration().owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.actionConfiguration().owner().ownerType()); + Assertions.assertEquals("jednlj", model.actionConfiguration().labels().get(0).labelName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertiesTests.java index b4e4331bfc54..42b286918fb1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -19,39 +19,37 @@ public final class AutomationRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRuleProperties model = BinaryData.fromString( - "{\"displayName\":\"snhu\",\"order\":470678351,\"triggeringLogic\":{\"isEnabled\":true,\"expirationTimeUtc\":\"2021-03-06T17:49:31Z\",\"triggersOn\":\"Incidents\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":2022069390},{\"actionType\":\"AutomationRuleAction\",\"order\":1504510608},{\"actionType\":\"AutomationRuleAction\",\"order\":885785432},{\"actionType\":\"AutomationRuleAction\",\"order\":768645194}],\"lastModifiedTimeUtc\":\"2021-10-02T10:39:21Z\",\"createdTimeUtc\":\"2021-10-25T23:35:46Z\",\"lastModifiedBy\":{\"email\":\"hocdgeab\",\"name\":\"phut\",\"objectId\":\"bd58f5da-c08f-41d7-8175-70310ef93f31\",\"userPrincipalName\":\"dvkaozw\"},\"createdBy\":{\"email\":\"tyhxhurokft\",\"name\":\"olniwpwcukjf\",\"objectId\":\"15c99d5c-c1ca-4697-9ad5-89f44fb15f34\",\"userPrincipalName\":\"awxklr\"}}") + "{\"displayName\":\"bqvgaqv\",\"order\":1448680502,\"triggeringLogic\":{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-05-28T12:54:39Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":596829514},{\"actionType\":\"AutomationRuleAction\",\"order\":673220982}],\"lastModifiedTimeUtc\":\"2021-10-16T19:18:21Z\",\"createdTimeUtc\":\"2021-02-14T01:46:34Z\",\"lastModifiedBy\":{\"email\":\"utnw\",\"name\":\"uycvuzhyrmewip\",\"objectId\":\"ekdxuku\",\"userPrincipalName\":\"sjjxundxgketw\"},\"createdBy\":{\"email\":\"zjhfjmhvv\",\"name\":\"vgpmun\",\"objectId\":\"sx\",\"userPrincipalName\":\"hfbuzjyihsasbhud\"}}") .toObject(AutomationRuleProperties.class); - Assertions.assertEquals("snhu", model.displayName()); - Assertions.assertEquals(470678351, model.order()); - Assertions.assertEquals(true, model.triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T17:49:31Z"), + Assertions.assertEquals("bqvgaqv", model.displayName()); + Assertions.assertEquals(1448680502, model.order()); + Assertions.assertFalse(model.triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T12:54:39Z"), model.triggeringLogic().expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.INCIDENTS, model.triggeringLogic().triggersOn()); + Assertions.assertEquals(TriggersOn.ALERTS, model.triggeringLogic().triggersOn()); Assertions.assertEquals(TriggersWhen.CREATED, model.triggeringLogic().triggersWhen()); - Assertions.assertEquals(2022069390, model.actions().get(0).order()); + Assertions.assertEquals(596829514, model.actions().get(0).order()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutomationRuleProperties model = new AutomationRuleProperties().withDisplayName("snhu") - .withOrder(470678351) - .withTriggeringLogic(new AutomationRuleTriggeringLogic().withIsEnabled(true) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-03-06T17:49:31Z")) - .withTriggersOn(TriggersOn.INCIDENTS) + AutomationRuleProperties model = new AutomationRuleProperties().withDisplayName("bqvgaqv") + .withOrder(1448680502) + .withTriggeringLogic(new AutomationRuleTriggeringLogic().withIsEnabled(false) + .withExpirationTimeUtc(OffsetDateTime.parse("2021-05-28T12:54:39Z")) + .withTriggersOn(TriggersOn.ALERTS) .withTriggersWhen(TriggersWhen.CREATED) - .withConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition(), - new AutomationRuleCondition(), new AutomationRuleCondition()))) - .withActions(Arrays.asList(new AutomationRuleAction().withOrder(2022069390), - new AutomationRuleAction().withOrder(1504510608), new AutomationRuleAction().withOrder(885785432), - new AutomationRuleAction().withOrder(768645194))); + .withConditions(Arrays.asList(new AutomationRuleCondition()))) + .withActions(Arrays.asList(new AutomationRuleAction().withOrder(596829514), + new AutomationRuleAction().withOrder(673220982))); model = BinaryData.fromObject(model).toObject(AutomationRuleProperties.class); - Assertions.assertEquals("snhu", model.displayName()); - Assertions.assertEquals(470678351, model.order()); - Assertions.assertEquals(true, model.triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T17:49:31Z"), + Assertions.assertEquals("bqvgaqv", model.displayName()); + Assertions.assertEquals(1448680502, model.order()); + Assertions.assertFalse(model.triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T12:54:39Z"), model.triggeringLogic().expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.INCIDENTS, model.triggeringLogic().triggersOn()); + Assertions.assertEquals(TriggersOn.ALERTS, model.triggeringLogic().triggersOn()); Assertions.assertEquals(TriggersWhen.CREATED, model.triggeringLogic().triggersWhen()); - Assertions.assertEquals(2022069390, model.actions().get(0).order()); + Assertions.assertEquals(596829514, model.actions().get(0).order()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayChangedValuesConditionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayChangedValuesConditionTests.java index 394e63683beb..cf6a06da9816 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayChangedValuesConditionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayChangedValuesConditionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -14,9 +14,9 @@ public final class AutomationRulePropertyArrayChangedValuesConditionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRulePropertyArrayChangedValuesCondition model - = BinaryData.fromString("{\"arrayType\":\"Comments\",\"changeType\":\"Added\"}") + = BinaryData.fromString("{\"arrayType\":\"Labels\",\"changeType\":\"Added\"}") .toObject(AutomationRulePropertyArrayChangedValuesCondition.class); - Assertions.assertEquals(AutomationRulePropertyArrayChangedConditionSupportedArrayType.COMMENTS, + Assertions.assertEquals(AutomationRulePropertyArrayChangedConditionSupportedArrayType.LABELS, model.arrayType()); Assertions.assertEquals(AutomationRulePropertyArrayChangedConditionSupportedChangeType.ADDED, model.changeType()); @@ -26,10 +26,10 @@ public void testDeserialize() throws Exception { public void testSerialize() throws Exception { AutomationRulePropertyArrayChangedValuesCondition model = new AutomationRulePropertyArrayChangedValuesCondition() - .withArrayType(AutomationRulePropertyArrayChangedConditionSupportedArrayType.COMMENTS) + .withArrayType(AutomationRulePropertyArrayChangedConditionSupportedArrayType.LABELS) .withChangeType(AutomationRulePropertyArrayChangedConditionSupportedChangeType.ADDED); model = BinaryData.fromObject(model).toObject(AutomationRulePropertyArrayChangedValuesCondition.class); - Assertions.assertEquals(AutomationRulePropertyArrayChangedConditionSupportedArrayType.COMMENTS, + Assertions.assertEquals(AutomationRulePropertyArrayChangedConditionSupportedArrayType.LABELS, model.arrayType()); Assertions.assertEquals(AutomationRulePropertyArrayChangedConditionSupportedChangeType.ADDED, model.changeType()); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayValuesConditionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayValuesConditionTests.java new file mode 100644 index 000000000000..943d7d24757b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyArrayValuesConditionTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleCondition; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayType; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayValuesCondition; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AutomationRulePropertyArrayValuesConditionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutomationRulePropertyArrayValuesCondition model = BinaryData.fromString( + "{\"arrayType\":\"CustomDetailValues\",\"arrayConditionType\":\"AllItems\",\"itemConditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]}") + .toObject(AutomationRulePropertyArrayValuesCondition.class); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayType.CUSTOM_DETAIL_VALUES, + model.arrayType()); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayConditionType.ALL_ITEMS, + model.arrayConditionType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutomationRulePropertyArrayValuesCondition model = new AutomationRulePropertyArrayValuesCondition() + .withArrayType(AutomationRulePropertyArrayConditionSupportedArrayType.CUSTOM_DETAIL_VALUES) + .withArrayConditionType(AutomationRulePropertyArrayConditionSupportedArrayConditionType.ALL_ITEMS) + .withItemConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition(), + new AutomationRuleCondition(), new AutomationRuleCondition())); + model = BinaryData.fromObject(model).toObject(AutomationRulePropertyArrayValuesCondition.class); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayType.CUSTOM_DETAIL_VALUES, + model.arrayType()); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayConditionType.ALL_ITEMS, + model.arrayConditionType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesChangedConditionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesChangedConditionTests.java index ba2b8a8fba2c..d035331e11ba 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesChangedConditionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesChangedConditionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -16,29 +16,29 @@ public final class AutomationRulePropertyValuesChangedConditionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRulePropertyValuesChangedCondition model = BinaryData.fromString( - "{\"propertyName\":\"IncidentOwner\",\"changeType\":\"ChangedTo\",\"operator\":\"EndsWith\",\"propertyValues\":[\"vjtszcofize\",\"tdhgbjkvrelj\",\"amurvzmlovuan\"]}") + "{\"propertyName\":\"IncidentSeverity\",\"changeType\":\"ChangedTo\",\"operator\":\"EndsWith\",\"propertyValues\":[\"yefrpmpdnqqska\",\"ao\",\"vmm\",\"npqfrtqlkzmeg\"]}") .toObject(AutomationRulePropertyValuesChangedCondition.class); - Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_OWNER, + Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_SEVERITY, model.propertyName()); Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_TO, model.changeType()); Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.ENDS_WITH, model.operator()); - Assertions.assertEquals("vjtszcofize", model.propertyValues().get(0)); + Assertions.assertEquals("yefrpmpdnqqska", model.propertyValues().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AutomationRulePropertyValuesChangedCondition model = new AutomationRulePropertyValuesChangedCondition() - .withPropertyName(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_OWNER) + .withPropertyName(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_SEVERITY) .withChangeType(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_TO) .withOperator(AutomationRulePropertyConditionSupportedOperator.ENDS_WITH) - .withPropertyValues(Arrays.asList("vjtszcofize", "tdhgbjkvrelj", "amurvzmlovuan")); + .withPropertyValues(Arrays.asList("yefrpmpdnqqska", "ao", "vmm", "npqfrtqlkzmeg")); model = BinaryData.fromObject(model).toObject(AutomationRulePropertyValuesChangedCondition.class); - Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_OWNER, + Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_SEVERITY, model.propertyName()); Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_TO, model.changeType()); Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.ENDS_WITH, model.operator()); - Assertions.assertEquals("vjtszcofize", model.propertyValues().get(0)); + Assertions.assertEquals("yefrpmpdnqqska", model.propertyValues().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesConditionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesConditionTests.java index d78f1133c1e6..05a70a071013 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesConditionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulePropertyValuesConditionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,22 +15,22 @@ public final class AutomationRulePropertyValuesConditionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRulePropertyValuesCondition model = BinaryData.fromString( - "{\"propertyName\":\"AccountSid\",\"operator\":\"NotEquals\",\"propertyValues\":[\"mjerbdk\",\"lvidizozs\",\"bccxjmonfdgn\",\"n\"]}") + "{\"propertyName\":\"HostName\",\"operator\":\"NotEndsWith\",\"propertyValues\":[\"wigdi\",\"bkbxgomfa\",\"uwasqvd\"]}") .toObject(AutomationRulePropertyValuesCondition.class); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.ACCOUNT_SID, model.propertyName()); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_EQUALS, model.operator()); - Assertions.assertEquals("mjerbdk", model.propertyValues().get(0)); + Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.HOST_NAME, model.propertyName()); + Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_ENDS_WITH, model.operator()); + Assertions.assertEquals("wigdi", model.propertyValues().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AutomationRulePropertyValuesCondition model = new AutomationRulePropertyValuesCondition() - .withPropertyName(AutomationRulePropertyConditionSupportedProperty.ACCOUNT_SID) - .withOperator(AutomationRulePropertyConditionSupportedOperator.NOT_EQUALS) - .withPropertyValues(Arrays.asList("mjerbdk", "lvidizozs", "bccxjmonfdgn", "n")); + .withPropertyName(AutomationRulePropertyConditionSupportedProperty.HOST_NAME) + .withOperator(AutomationRulePropertyConditionSupportedOperator.NOT_ENDS_WITH) + .withPropertyValues(Arrays.asList("wigdi", "bkbxgomfa", "uwasqvd")); model = BinaryData.fromObject(model).toObject(AutomationRulePropertyValuesCondition.class); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.ACCOUNT_SID, model.propertyName()); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_EQUALS, model.operator()); - Assertions.assertEquals("mjerbdk", model.propertyValues().get(0)); + Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.HOST_NAME, model.propertyName()); + Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_ENDS_WITH, model.operator()); + Assertions.assertEquals("wigdi", model.propertyValues().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleRunPlaybookActionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleRunPlaybookActionTests.java index 9606f2ad3b8c..4f253bf42d5a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleRunPlaybookActionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleRunPlaybookActionTests.java @@ -1,36 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.AutomationRuleRunPlaybookAction; import com.azure.resourcemanager.securityinsights.models.PlaybookActionProperties; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class AutomationRuleRunPlaybookActionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRuleRunPlaybookAction model = BinaryData.fromString( - "{\"actionType\":\"RunPlaybook\",\"actionConfiguration\":{\"logicAppResourceId\":\"puuw\",\"tenantId\":\"341782c1-abbf-407a-a4de-285633e7341b\"},\"order\":1941131866}") + "{\"actionType\":\"RunPlaybook\",\"actionConfiguration\":{\"logicAppResourceId\":\"kdlpa\",\"tenantId\":\"rcxfailcfxwmdb\"},\"order\":1074409808}") .toObject(AutomationRuleRunPlaybookAction.class); - Assertions.assertEquals(1941131866, model.order()); - Assertions.assertEquals("puuw", model.actionConfiguration().logicAppResourceId()); - Assertions.assertEquals(UUID.fromString("341782c1-abbf-407a-a4de-285633e7341b"), - model.actionConfiguration().tenantId()); + Assertions.assertEquals(1074409808, model.order()); + Assertions.assertEquals("kdlpa", model.actionConfiguration().logicAppResourceId()); + Assertions.assertEquals("rcxfailcfxwmdb", model.actionConfiguration().tenantId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutomationRuleRunPlaybookAction model = new AutomationRuleRunPlaybookAction().withOrder(1941131866) - .withActionConfiguration(new PlaybookActionProperties().withLogicAppResourceId("puuw") - .withTenantId(UUID.fromString("341782c1-abbf-407a-a4de-285633e7341b"))); + AutomationRuleRunPlaybookAction model = new AutomationRuleRunPlaybookAction().withOrder(1074409808) + .withActionConfiguration( + new PlaybookActionProperties().withLogicAppResourceId("kdlpa").withTenantId("rcxfailcfxwmdb")); model = BinaryData.fromObject(model).toObject(AutomationRuleRunPlaybookAction.class); - Assertions.assertEquals(1941131866, model.order()); - Assertions.assertEquals("puuw", model.actionConfiguration().logicAppResourceId()); - Assertions.assertEquals(UUID.fromString("341782c1-abbf-407a-a4de-285633e7341b"), - model.actionConfiguration().tenantId()); + Assertions.assertEquals(1074409808, model.order()); + Assertions.assertEquals("kdlpa", model.actionConfiguration().logicAppResourceId()); + Assertions.assertEquals("rcxfailcfxwmdb", model.actionConfiguration().tenantId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleTriggeringLogicTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleTriggeringLogicTests.java index cf9a430a9de9..80dac08ea605 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleTriggeringLogicTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRuleTriggeringLogicTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -17,25 +17,25 @@ public final class AutomationRuleTriggeringLogicTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRuleTriggeringLogic model = BinaryData.fromString( - "{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-07-12T14:06:09Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"}]}") + "{\"isEnabled\":true,\"expirationTimeUtc\":\"2021-02-04T09:51:08Z\",\"triggersOn\":\"Incidents\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"}]}") .toObject(AutomationRuleTriggeringLogic.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T14:06:09Z"), model.expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.ALERTS, model.triggersOn()); + Assertions.assertTrue(model.isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T09:51:08Z"), model.expirationTimeUtc()); + Assertions.assertEquals(TriggersOn.INCIDENTS, model.triggersOn()); Assertions.assertEquals(TriggersWhen.CREATED, model.triggersWhen()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AutomationRuleTriggeringLogic model = new AutomationRuleTriggeringLogic().withIsEnabled(false) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-07-12T14:06:09Z")) - .withTriggersOn(TriggersOn.ALERTS) + AutomationRuleTriggeringLogic model = new AutomationRuleTriggeringLogic().withIsEnabled(true) + .withExpirationTimeUtc(OffsetDateTime.parse("2021-02-04T09:51:08Z")) + .withTriggersOn(TriggersOn.INCIDENTS) .withTriggersWhen(TriggersWhen.CREATED) .withConditions(Arrays.asList(new AutomationRuleCondition())); model = BinaryData.fromObject(model).toObject(AutomationRuleTriggeringLogic.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T14:06:09Z"), model.expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.ALERTS, model.triggersOn()); + Assertions.assertTrue(model.isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T09:51:08Z"), model.expirationTimeUtc()); + Assertions.assertEquals(TriggersOn.INCIDENTS, model.triggersOn()); Assertions.assertEquals(TriggersWhen.CREATED, model.triggersWhen()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateWithResponseMockTests.java index a6a434cf15cf..7f1b3b7f8efa 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AutomationRule; @@ -27,39 +27,39 @@ public final class AutomationRulesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"v\",\"order\":1938856045,\"triggeringLogic\":{\"isEnabled\":true,\"expirationTimeUtc\":\"2021-11-25T05:19:39Z\",\"triggersOn\":\"Incidents\",\"triggersWhen\":\"Updated\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1192045217}],\"lastModifiedTimeUtc\":\"2021-05-27T17:09:08Z\",\"createdTimeUtc\":\"2021-03-12T14:36:14Z\",\"lastModifiedBy\":{\"email\":\"zutgqztwhghmupg\",\"name\":\"jtcdxabbujftaben\",\"objectId\":\"42efc29e-75ce-45b7-b0d9-52c8c0b6a44c\",\"userPrincipalName\":\"lqpx\"},\"createdBy\":{\"email\":\"afeddwwnlza\",\"name\":\"xud\",\"objectId\":\"75f3e2c4-d29d-41ef-aeb2-f5ffaece5807\",\"userPrincipalName\":\"gookrtalvnb\"}},\"etag\":\"pbeme\",\"id\":\"clvdjjukyrdnqod\",\"name\":\"ahhxhqfaqnvzoqg\",\"type\":\"ipemchgavscz\"}"; + = "{\"properties\":{\"displayName\":\"vzjqf\",\"order\":1486545523,\"triggeringLogic\":{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-10-27T07:25:10Z\",\"triggersOn\":\"Incidents\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":305660182}],\"lastModifiedTimeUtc\":\"2021-02-22T08:59:54Z\",\"createdTimeUtc\":\"2021-06-09T05:32:53Z\",\"lastModifiedBy\":{\"email\":\"ymdypsxkwwfy\",\"name\":\"hurklowm\",\"objectId\":\"vzc\",\"userPrincipalName\":\"lyoix\"},\"createdBy\":{\"email\":\"znqizvsihs\",\"name\":\"xjcajhsjuq\",\"objectId\":\"zrnubod\",\"userPrincipalName\":\"u\"}},\"etag\":\"ianpgug\",\"id\":\"xxdlgorvu\",\"name\":\"wnbzslmffcttkp\",\"type\":\"xypxtipk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AutomationRule response = manager.automationRules() - .define("pt") - .withExistingWorkspace("abzoghktdpyczhco", "ocnhzqrottjzcfyj") - .withDisplayName("rl") - .withOrder(132522705) + .define("ehuweuitqe") + .withExistingWorkspace("sythuioixpfgqlw", "ojwvvqcjrmnverbf") + .withDisplayName("onmo") + .withOrder(1629220780) .withTriggeringLogic(new AutomationRuleTriggeringLogic().withIsEnabled(false) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-03-15T17:03:59Z")) + .withExpirationTimeUtc(OffsetDateTime.parse("2021-04-30T00:29:06Z")) .withTriggersOn(TriggersOn.INCIDENTS) - .withTriggersWhen(TriggersWhen.UPDATED) + .withTriggersWhen(TriggersWhen.CREATED) .withConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition(), - new AutomationRuleCondition()))) - .withActions(Arrays.asList(new AutomationRuleAction().withOrder(1373677319), - new AutomationRuleAction().withOrder(1335089450), new AutomationRuleAction().withOrder(1375742572))) - .withEtag("vcacoyv") + new AutomationRuleCondition(), new AutomationRuleCondition()))) + .withActions(Arrays.asList(new AutomationRuleAction().withOrder(1819797418), + new AutomationRuleAction().withOrder(1118291905), new AutomationRuleAction().withOrder(207552455))) + .withEtag("gverbywuuveisj") .create(); - Assertions.assertEquals("pbeme", response.etag()); - Assertions.assertEquals("v", response.displayName()); - Assertions.assertEquals(1938856045, response.order()); - Assertions.assertEquals(true, response.triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T05:19:39Z"), + Assertions.assertEquals("ianpgug", response.etag()); + Assertions.assertEquals("vzjqf", response.displayName()); + Assertions.assertEquals(1486545523, response.order()); + Assertions.assertFalse(response.triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-27T07:25:10Z"), response.triggeringLogic().expirationTimeUtc()); Assertions.assertEquals(TriggersOn.INCIDENTS, response.triggeringLogic().triggersOn()); - Assertions.assertEquals(TriggersWhen.UPDATED, response.triggeringLogic().triggersWhen()); - Assertions.assertEquals(1192045217, response.actions().get(0).order()); + Assertions.assertEquals(TriggersWhen.CREATED, response.triggeringLogic().triggersWhen()); + Assertions.assertEquals(305660182, response.actions().get(0).order()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteWithResponseMockTests.java index 47a7cd3b033b..9be3868056af 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -18,17 +18,17 @@ public final class AutomationRulesDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { - String responseStr = "\"datajpnnbmjksibjgsj\""; + String responseStr = "\"\\\"datazsw\\\"\""; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Object response = manager.automationRules() - .deleteWithResponse("t", "ormkfqlwxldyk", "lsygaol", com.azure.core.util.Context.NONE) + .deleteWithResponse("xeyumwlbpyidecff", "hizwqz", "sqwjypiosz", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetWithResponseMockTests.java index df9b593ea400..497492eda939 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AutomationRule; @@ -23,27 +23,27 @@ public final class AutomationRulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"displayName\":\"jxcjrmmuabwib\",\"order\":1982955250,\"triggeringLogic\":{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-03-07T23:51:24Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":164118392},{\"actionType\":\"AutomationRuleAction\",\"order\":1088019488},{\"actionType\":\"AutomationRuleAction\",\"order\":1568139443},{\"actionType\":\"AutomationRuleAction\",\"order\":45684576}],\"lastModifiedTimeUtc\":\"2021-02-25T08:15:11Z\",\"createdTimeUtc\":\"2021-05-22T21:47:24Z\",\"lastModifiedBy\":{\"email\":\"neo\",\"name\":\"fkak\",\"objectId\":\"8774f628-4738-484b-88a7-fc5f3f291ba1\",\"userPrincipalName\":\"dt\"},\"createdBy\":{\"email\":\"boclzhzjknyuxgv\",\"name\":\"xpn\",\"objectId\":\"3e3e771d-9638-4784-813a-c986e2b726c0\",\"userPrincipalName\":\"zaamrdixtrekid\"}},\"etag\":\"yskbruff\",\"id\":\"lukkutvlxhrpqhvm\",\"name\":\"lcouqehbhbcdszir\",\"type\":\"randoypmb\"}"; + = "{\"properties\":{\"displayName\":\"p\",\"order\":370367551,\"triggeringLogic\":{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-04-10T12:48:19Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Updated\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1699864168},{\"actionType\":\"AutomationRuleAction\",\"order\":238571551},{\"actionType\":\"AutomationRuleAction\",\"order\":1692719260},{\"actionType\":\"AutomationRuleAction\",\"order\":438451880}],\"lastModifiedTimeUtc\":\"2021-11-15T06:02:31Z\",\"createdTimeUtc\":\"2021-08-28T03:01:10Z\",\"lastModifiedBy\":{\"email\":\"c\",\"name\":\"z\",\"objectId\":\"wvbxvi\",\"userPrincipalName\":\"vhjryppmmtqx\"},\"createdBy\":{\"email\":\"aef\",\"name\":\"qfcorajdb\",\"objectId\":\"kffgyfehjseceuvy\",\"userPrincipalName\":\"mbz\"}},\"etag\":\"fxfyzqrsu\",\"id\":\"lsud\",\"name\":\"biycepjklly\",\"type\":\"dsormbvir\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AutomationRule response = manager.automationRules() - .getWithResponse("mbtsuahxsg", "jcmmzrrscub", "wsdrnpxqwodif", com.azure.core.util.Context.NONE) + .getWithResponse("umiuxxmrntphyj", "eddtkpys", "a", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("yskbruff", response.etag()); - Assertions.assertEquals("jxcjrmmuabwib", response.displayName()); - Assertions.assertEquals(1982955250, response.order()); - Assertions.assertEquals(false, response.triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T23:51:24Z"), + Assertions.assertEquals("fxfyzqrsu", response.etag()); + Assertions.assertEquals("p", response.displayName()); + Assertions.assertEquals(370367551, response.order()); + Assertions.assertFalse(response.triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-10T12:48:19Z"), response.triggeringLogic().expirationTimeUtc()); Assertions.assertEquals(TriggersOn.ALERTS, response.triggeringLogic().triggersOn()); - Assertions.assertEquals(TriggersWhen.CREATED, response.triggeringLogic().triggersWhen()); - Assertions.assertEquals(164118392, response.actions().get(0).order()); + Assertions.assertEquals(TriggersWhen.UPDATED, response.triggeringLogic().triggersWhen()); + Assertions.assertEquals(1699864168, response.actions().get(0).order()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListMockTests.java index c17876d1a639..aa3d2776d5ef 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AutomationRule; @@ -24,26 +24,26 @@ public final class AutomationRulesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"jkgqxnhmbkez\",\"order\":1006468867,\"triggeringLogic\":{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-09-27T18:55:36Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1703232234},{\"actionType\":\"AutomationRuleAction\",\"order\":2077139001},{\"actionType\":\"AutomationRuleAction\",\"order\":1985576592}],\"lastModifiedTimeUtc\":\"2021-06-09T08:46Z\",\"createdTimeUtc\":\"2021-10-28T20:38:38Z\",\"lastModifiedBy\":{\"email\":\"aawxwfeka\",\"name\":\"rrqmbzmqk\",\"objectId\":\"fbaef790-263f-44ce-ad78-26456bc6dacc\",\"userPrincipalName\":\"bnxwbjsidbirkf\"},\"createdBy\":{\"email\":\"okdgoge\",\"name\":\"jymrhbg\",\"objectId\":\"2c270371-966a-4d29-a522-f6250fd085c2\",\"userPrincipalName\":\"zkye\"}},\"etag\":\"f\",\"id\":\"hhhqosm\",\"name\":\"fjkutycyarnroo\",\"type\":\"g\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"vvb\",\"order\":873220110,\"triggeringLogic\":{\"isEnabled\":true,\"expirationTimeUtc\":\"2021-11-02T08:47:45Z\",\"triggersOn\":\"Incidents\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1340998248},{\"actionType\":\"AutomationRuleAction\",\"order\":1298013973},{\"actionType\":\"AutomationRuleAction\",\"order\":978577114}],\"lastModifiedTimeUtc\":\"2021-11-08T14:02:23Z\",\"createdTimeUtc\":\"2021-07-23T19:15:19Z\",\"lastModifiedBy\":{\"email\":\"mqpcw\",\"name\":\"tjrfrucpefwdxbpv\",\"objectId\":\"ib\",\"userPrincipalName\":\"vdeyoexpotht\"},\"createdBy\":{\"email\":\"mfwieshqielbky\",\"name\":\"mgud\",\"objectId\":\"tecuvejlcwdgek\",\"userPrincipalName\":\"vrrvjqhoeh\"}},\"etag\":\"rsvredoxpvqpblq\",\"id\":\"fpe\",\"name\":\"megynheamzlqvaj\",\"type\":\"tsvc\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.automationRules().list("xxahmrnadzyqegxy", "vpinbmhwbj", com.azure.core.util.Context.NONE); + = manager.automationRules().list("dglxppewtlfsw", "lwnffczwzr", com.azure.core.util.Context.NONE); - Assertions.assertEquals("f", response.iterator().next().etag()); - Assertions.assertEquals("jkgqxnhmbkez", response.iterator().next().displayName()); - Assertions.assertEquals(1006468867, response.iterator().next().order()); - Assertions.assertEquals(false, response.iterator().next().triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T18:55:36Z"), + Assertions.assertEquals("rsvredoxpvqpblq", response.iterator().next().etag()); + Assertions.assertEquals("vvb", response.iterator().next().displayName()); + Assertions.assertEquals(873220110, response.iterator().next().order()); + Assertions.assertTrue(response.iterator().next().triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T08:47:45Z"), response.iterator().next().triggeringLogic().expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.ALERTS, response.iterator().next().triggeringLogic().triggersOn()); + Assertions.assertEquals(TriggersOn.INCIDENTS, response.iterator().next().triggeringLogic().triggersOn()); Assertions.assertEquals(TriggersWhen.CREATED, response.iterator().next().triggeringLogic().triggersWhen()); - Assertions.assertEquals(1703232234, response.iterator().next().actions().get(0).order()); + Assertions.assertEquals(1340998248, response.iterator().next().actions().get(0).order()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListTests.java index 2243582b3df1..f5aa9dd06a49 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AutomationRulesListTests.java @@ -1,73 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner; -import com.azure.resourcemanager.securityinsights.models.AutomationRuleAction; -import com.azure.resourcemanager.securityinsights.models.AutomationRuleCondition; -import com.azure.resourcemanager.securityinsights.models.AutomationRuleTriggeringLogic; -import com.azure.resourcemanager.securityinsights.models.AutomationRulesList; +import com.azure.resourcemanager.securityinsights.implementation.models.AutomationRulesList; import com.azure.resourcemanager.securityinsights.models.TriggersOn; import com.azure.resourcemanager.securityinsights.models.TriggersWhen; import java.time.OffsetDateTime; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AutomationRulesListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AutomationRulesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"qkgfgibma\",\"order\":1793250583,\"triggeringLogic\":{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-10-30T15:28:22Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Created\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1109303076}],\"lastModifiedTimeUtc\":\"2021-07-21T07:36:15Z\",\"createdTimeUtc\":\"2021-07-27T23:28:20Z\",\"lastModifiedBy\":{\"email\":\"ytb\",\"name\":\"qfou\",\"objectId\":\"d0287df1-f755-4ddd-89a2-445dd4afc6bd\",\"userPrincipalName\":\"mnkzsmod\"},\"createdBy\":{\"email\":\"ougpbkwt\",\"name\":\"tduqktapspwgcuer\",\"objectId\":\"8ae8b4bb-a8b9-40e8-964c-15568742b6ca\",\"userPrincipalName\":\"kdosvqw\"}},\"etag\":\"mdgbbjfdd\",\"id\":\"bmbexppbhtqqro\",\"name\":\"fpfpsalgbquxigj\",\"type\":\"jgzjaoyfhrtx\"},{\"properties\":{\"displayName\":\"lnerkujysvleju\",\"order\":140485038,\"triggeringLogic\":{\"isEnabled\":true,\"expirationTimeUtc\":\"2021-11-11T16:20:30Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Updated\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1106115756},{\"actionType\":\"AutomationRuleAction\",\"order\":1769432566}],\"lastModifiedTimeUtc\":\"2021-05-18T18:45:02Z\",\"createdTimeUtc\":\"2021-08-01T09:30:41Z\",\"lastModifiedBy\":{\"email\":\"xgjvtbv\",\"name\":\"sszdnru\",\"objectId\":\"5b0bfc4f-dd45-4b62-a007-8bd0a965e9a3\",\"userPrincipalName\":\"uhmuouqfprwzwbn\"},\"createdBy\":{\"email\":\"tnwu\",\"name\":\"gazxuf\",\"objectId\":\"bf38305f-e118-4128-8534-7536e0a5076b\",\"userPrincipalName\":\"ckyfih\"}},\"etag\":\"idf\",\"id\":\"wdzuhtymwisd\",\"name\":\"fthwxmnteiwa\",\"type\":\"pvkmijcmmxdcuf\"}],\"nextLink\":\"srp\"}") + "{\"value\":[{\"properties\":{\"displayName\":\"svgjrwhryvy\",\"order\":1042320973,\"triggeringLogic\":{\"isEnabled\":false,\"expirationTimeUtc\":\"2021-08-06T16:32:23Z\",\"triggersOn\":\"Alerts\",\"triggersWhen\":\"Updated\",\"conditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]},\"actions\":[{\"actionType\":\"AutomationRuleAction\",\"order\":1259287621},{\"actionType\":\"AutomationRuleAction\",\"order\":822408153},{\"actionType\":\"AutomationRuleAction\",\"order\":825571919},{\"actionType\":\"AutomationRuleAction\",\"order\":653879731}],\"lastModifiedTimeUtc\":\"2021-02-14T03:07:22Z\",\"createdTimeUtc\":\"2021-09-18T13:57:49Z\",\"lastModifiedBy\":{\"email\":\"pdvjdhttzaefedx\",\"name\":\"ch\",\"objectId\":\"hk\",\"userPrincipalName\":\"rjdqnsdfzp\"},\"createdBy\":{\"email\":\"gkylkdghr\",\"name\":\"uutlwxezwzhok\",\"objectId\":\"wnhhtqlgehgppip\",\"userPrincipalName\":\"hpfeoajvgcxtxjc\"}},\"etag\":\"eafidltugsresm\",\"id\":\"sjhoiftxfkfwegpr\",\"name\":\"ptil\",\"type\":\"ucb\"}],\"nextLink\":\"tgdqohmcwsldriz\"}") .toObject(AutomationRulesList.class); - Assertions.assertEquals("mdgbbjfdd", model.value().get(0).etag()); - Assertions.assertEquals("qkgfgibma", model.value().get(0).displayName()); - Assertions.assertEquals(1793250583, model.value().get(0).order()); - Assertions.assertEquals(false, model.value().get(0).triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T15:28:22Z"), + Assertions.assertEquals("eafidltugsresm", model.value().get(0).etag()); + Assertions.assertEquals("svgjrwhryvy", model.value().get(0).displayName()); + Assertions.assertEquals(1042320973, model.value().get(0).order()); + Assertions.assertFalse(model.value().get(0).triggeringLogic().isEnabled()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-06T16:32:23Z"), model.value().get(0).triggeringLogic().expirationTimeUtc()); Assertions.assertEquals(TriggersOn.ALERTS, model.value().get(0).triggeringLogic().triggersOn()); - Assertions.assertEquals(TriggersWhen.CREATED, model.value().get(0).triggeringLogic().triggersWhen()); - Assertions.assertEquals(1109303076, model.value().get(0).actions().get(0).order()); - Assertions.assertEquals("srp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationRulesList model = new AutomationRulesList().withValue(Arrays.asList( - new AutomationRuleInner().withEtag("mdgbbjfdd") - .withDisplayName("qkgfgibma") - .withOrder(1793250583) - .withTriggeringLogic(new AutomationRuleTriggeringLogic().withIsEnabled(false) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-10-30T15:28:22Z")) - .withTriggersOn(TriggersOn.ALERTS) - .withTriggersWhen(TriggersWhen.CREATED) - .withConditions(Arrays.asList(new AutomationRuleCondition()))) - .withActions(Arrays.asList(new AutomationRuleAction().withOrder(1109303076))), - new AutomationRuleInner().withEtag("idf") - .withDisplayName("lnerkujysvleju") - .withOrder(140485038) - .withTriggeringLogic(new AutomationRuleTriggeringLogic().withIsEnabled(true) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-11-11T16:20:30Z")) - .withTriggersOn(TriggersOn.ALERTS) - .withTriggersWhen(TriggersWhen.UPDATED) - .withConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition(), - new AutomationRuleCondition(), new AutomationRuleCondition()))) - .withActions(Arrays.asList(new AutomationRuleAction().withOrder(1106115756), - new AutomationRuleAction().withOrder(1769432566))))) - .withNextLink("srp"); - model = BinaryData.fromObject(model).toObject(AutomationRulesList.class); - Assertions.assertEquals("mdgbbjfdd", model.value().get(0).etag()); - Assertions.assertEquals("qkgfgibma", model.value().get(0).displayName()); - Assertions.assertEquals(1793250583, model.value().get(0).order()); - Assertions.assertEquals(false, model.value().get(0).triggeringLogic().isEnabled()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T15:28:22Z"), - model.value().get(0).triggeringLogic().expirationTimeUtc()); - Assertions.assertEquals(TriggersOn.ALERTS, model.value().get(0).triggeringLogic().triggersOn()); - Assertions.assertEquals(TriggersWhen.CREATED, model.value().get(0).triggeringLogic().triggersWhen()); - Assertions.assertEquals(1109303076, model.value().get(0).actions().get(0).order()); - Assertions.assertEquals("srp", model.nextLink()); + Assertions.assertEquals(TriggersWhen.UPDATED, model.value().get(0).triggeringLogic().triggersWhen()); + Assertions.assertEquals(1259287621, model.value().get(0).actions().get(0).order()); + Assertions.assertEquals("tgdqohmcwsldriz", model.nextLink()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AvailabilityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AvailabilityTests.java new file mode 100644 index 000000000000..d38889946518 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AvailabilityTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Availability; +import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; +import org.junit.jupiter.api.Assertions; + +public final class AvailabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Availability model = BinaryData.fromString("{\"status\":1,\"isPreview\":false}").toObject(Availability.class); + Assertions.assertEquals(AvailabilityStatus.ONE, model.status()); + Assertions.assertFalse(model.isPreview()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Availability model = new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(false); + model = BinaryData.fromObject(model).toObject(Availability.class); + Assertions.assertEquals(AvailabilityStatus.ONE, model.status()); + Assertions.assertFalse(model.isPreview()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailCheckRequirementsTests.java new file mode 100644 index 000000000000..c088f34ec43b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailCheckRequirementsTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AwsCloudTrailCheckRequirements; + +public final class AwsCloudTrailCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AwsCloudTrailCheckRequirements model = BinaryData.fromString("{\"kind\":\"AmazonWebServicesCloudTrail\"}") + .toObject(AwsCloudTrailCheckRequirements.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AwsCloudTrailCheckRequirements model = new AwsCloudTrailCheckRequirements(); + model = BinaryData.fromObject(model).toObject(AwsCloudTrailCheckRequirements.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesLogsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesLogsTests.java index bdf0806ae077..1860d1c27b0e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesLogsTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesLogsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesTests.java index 687819625967..e0a584a3d15b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorDataTypesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorPropertiesTests.java index fdc61f797a9c..84234774697f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -14,21 +14,21 @@ public final class AwsCloudTrailDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AwsCloudTrailDataConnectorProperties model - = BinaryData.fromString("{\"awsRoleArn\":\"bsnmfpph\",\"dataTypes\":{\"logs\":{\"state\":\"Disabled\"}}}") - .toObject(AwsCloudTrailDataConnectorProperties.class); - Assertions.assertEquals("bsnmfpph", model.awsRoleArn()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + AwsCloudTrailDataConnectorProperties model = BinaryData + .fromString("{\"awsRoleArn\":\"ugdybnhrxlel\",\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}}}") + .toObject(AwsCloudTrailDataConnectorProperties.class); + Assertions.assertEquals("ugdybnhrxlel", model.awsRoleArn()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AwsCloudTrailDataConnectorProperties model - = new AwsCloudTrailDataConnectorProperties().withAwsRoleArn("bsnmfpph") + = new AwsCloudTrailDataConnectorProperties().withAwsRoleArn("ugdybnhrxlel") .withDataTypes(new AwsCloudTrailDataConnectorDataTypes() - .withLogs(new AwsCloudTrailDataConnectorDataTypesLogs().withState(DataTypeState.DISABLED))); + .withLogs(new AwsCloudTrailDataConnectorDataTypesLogs().withState(DataTypeState.ENABLED))); model = BinaryData.fromObject(model).toObject(AwsCloudTrailDataConnectorProperties.class); - Assertions.assertEquals("bsnmfpph", model.awsRoleArn()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("ugdybnhrxlel", model.awsRoleArn()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorTests.java index 641aba731d93..758cf63286d2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsCloudTrailDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,22 +15,22 @@ public final class AwsCloudTrailDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AwsCloudTrailDataConnector model = BinaryData.fromString( - "{\"kind\":\"AmazonWebServicesCloudTrail\",\"properties\":{\"awsRoleArn\":\"dlyjdf\",\"dataTypes\":{\"logs\":{\"state\":\"Disabled\"}}},\"etag\":\"qufdvruzslzojh\",\"id\":\"tfnmdx\",\"name\":\"tngfdgugeyzihgr\",\"type\":\"yui\"}") + "{\"kind\":\"AmazonWebServicesCloudTrail\",\"properties\":{\"awsRoleArn\":\"on\",\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}}},\"etag\":\"wgdhu\",\"id\":\"zytzarogatmolj\",\"name\":\"ywmpinmzvfkneer\",\"type\":\"ztrknsj\"}") .toObject(AwsCloudTrailDataConnector.class); - Assertions.assertEquals("qufdvruzslzojh", model.etag()); - Assertions.assertEquals("dlyjdf", model.awsRoleArn()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("wgdhu", model.etag()); + Assertions.assertEquals("on", model.awsRoleArn()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AwsCloudTrailDataConnector model = new AwsCloudTrailDataConnector().withEtag("qufdvruzslzojh") - .withAwsRoleArn("dlyjdf") + AwsCloudTrailDataConnector model = new AwsCloudTrailDataConnector().withEtag("wgdhu") + .withAwsRoleArn("on") .withDataTypes(new AwsCloudTrailDataConnectorDataTypes() - .withLogs(new AwsCloudTrailDataConnectorDataTypesLogs().withState(DataTypeState.DISABLED))); + .withLogs(new AwsCloudTrailDataConnectorDataTypesLogs().withState(DataTypeState.ENABLED))); model = BinaryData.fromObject(model).toObject(AwsCloudTrailDataConnector.class); - Assertions.assertEquals("qufdvruzslzojh", model.etag()); - Assertions.assertEquals("dlyjdf", model.awsRoleArn()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("wgdhu", model.etag()); + Assertions.assertEquals("on", model.awsRoleArn()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3CheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3CheckRequirementsTests.java new file mode 100644 index 000000000000..f05f2068ad7e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3CheckRequirementsTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AwsS3CheckRequirements; + +public final class AwsS3CheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AwsS3CheckRequirements model + = BinaryData.fromString("{\"kind\":\"AmazonWebServicesS3\"}").toObject(AwsS3CheckRequirements.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AwsS3CheckRequirements model = new AwsS3CheckRequirements(); + model = BinaryData.fromObject(model).toObject(AwsS3CheckRequirements.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesLogsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesLogsTests.java new file mode 100644 index 000000000000..e2cddacdd077 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesLogsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import org.junit.jupiter.api.Assertions; + +public final class AwsS3DataConnectorDataTypesLogsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AwsS3DataConnectorDataTypesLogs model + = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(AwsS3DataConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AwsS3DataConnectorDataTypesLogs model = new AwsS3DataConnectorDataTypesLogs().withState(DataTypeState.ENABLED); + model = BinaryData.fromObject(model).toObject(AwsS3DataConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesTests.java new file mode 100644 index 000000000000..7b4f6366dd88 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorDataTypesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import org.junit.jupiter.api.Assertions; + +public final class AwsS3DataConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AwsS3DataConnectorDataTypes model + = BinaryData.fromString("{\"logs\":{\"state\":\"Disabled\"}}").toObject(AwsS3DataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AwsS3DataConnectorDataTypes model = new AwsS3DataConnectorDataTypes() + .withLogs(new AwsS3DataConnectorDataTypesLogs().withState(DataTypeState.DISABLED)); + model = BinaryData.fromObject(model).toObject(AwsS3DataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorPropertiesTests.java new file mode 100644 index 000000000000..72a8f9fc9eab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorPropertiesTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.AwsS3DataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AwsS3DataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AwsS3DataConnectorProperties model = BinaryData.fromString( + "{\"destinationTable\":\"bmom\",\"sqsUrls\":[\"vvjhvvlrlohewjj\",\"ajnkdflqionswae\",\"kzfzqxjosho\"],\"roleArn\":\"totryegpkhxrme\",\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}}}") + .toObject(AwsS3DataConnectorProperties.class); + Assertions.assertEquals("bmom", model.destinationTable()); + Assertions.assertEquals("vvjhvvlrlohewjj", model.sqsUrls().get(0)); + Assertions.assertEquals("totryegpkhxrme", model.roleArn()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AwsS3DataConnectorProperties model = new AwsS3DataConnectorProperties().withDestinationTable("bmom") + .withSqsUrls(Arrays.asList("vvjhvvlrlohewjj", "ajnkdflqionswae", "kzfzqxjosho")) + .withRoleArn("totryegpkhxrme") + .withDataTypes(new AwsS3DataConnectorDataTypes() + .withLogs(new AwsS3DataConnectorDataTypesLogs().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(AwsS3DataConnectorProperties.class); + Assertions.assertEquals("bmom", model.destinationTable()); + Assertions.assertEquals("vvjhvvlrlohewjj", model.sqsUrls().get(0)); + Assertions.assertEquals("totryegpkhxrme", model.roleArn()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorTests.java new file mode 100644 index 000000000000..48d593a002a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AwsS3DataConnectorTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnector; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.AwsS3DataConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AwsS3DataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AwsS3DataConnector model = BinaryData.fromString( + "{\"kind\":\"AmazonWebServicesS3\",\"properties\":{\"destinationTable\":\"izcpihtdmiw\",\"sqsUrls\":[\"kpty\"],\"roleArn\":\"aydb\",\"dataTypes\":{\"logs\":{\"state\":\"Disabled\"}}},\"etag\":\"qy\",\"id\":\"cfnzhmhsurlgw\",\"name\":\"kpmmz\",\"type\":\"stauolawi\"}") + .toObject(AwsS3DataConnector.class); + Assertions.assertEquals("qy", model.etag()); + Assertions.assertEquals("izcpihtdmiw", model.destinationTable()); + Assertions.assertEquals("kpty", model.sqsUrls().get(0)); + Assertions.assertEquals("aydb", model.roleArn()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AwsS3DataConnector model = new AwsS3DataConnector().withEtag("qy") + .withDestinationTable("izcpihtdmiw") + .withSqsUrls(Arrays.asList("kpty")) + .withRoleArn("aydb") + .withDataTypes(new AwsS3DataConnectorDataTypes() + .withLogs(new AwsS3DataConnectorDataTypesLogs().withState(DataTypeState.DISABLED))); + model = BinaryData.fromObject(model).toObject(AwsS3DataConnector.class); + Assertions.assertEquals("qy", model.etag()); + Assertions.assertEquals("izcpihtdmiw", model.destinationTable()); + Assertions.assertEquals("kpty", model.sqsUrls().get(0)); + Assertions.assertEquals("aydb", model.roleArn()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureDevOpsResourceInfoTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureDevOpsResourceInfoTests.java new file mode 100644 index 000000000000..b1d318dac948 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureDevOpsResourceInfoTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AzureDevOpsResourceInfo; +import org.junit.jupiter.api.Assertions; + +public final class AzureDevOpsResourceInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AzureDevOpsResourceInfo model + = BinaryData.fromString("{\"pipelineId\":\"zulrqt\",\"serviceConnectionId\":\"trezpzlpryfmxmdu\"}") + .toObject(AzureDevOpsResourceInfo.class); + Assertions.assertEquals("zulrqt", model.pipelineId()); + Assertions.assertEquals("trezpzlpryfmxmdu", model.serviceConnectionId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityPropertiesTests.java index 89ba9adbbfa2..634f38ab69ed 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class AzureResourceEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AzureResourceEntityProperties model = BinaryData.fromString( - "{\"resourceId\":\"ofrzgb\",\"subscriptionId\":\"edm\",\"additionalData\":{\"nsnvpd\":\"datavnlvxbcuiiznktwf\",\"z\":\"databmikost\",\"fy\":\"datakiwbuqnyoph\",\"elfwy\":\"datasgcrpfbcunezzce\"},\"friendlyName\":\"lwxjwetn\"}") + "{\"resourceId\":\"dmmcpugmehqep\",\"subscriptionId\":\"fhbzehewhoqhn\",\"additionalData\":{\"krsrrmoucs\":\"\\\"datanbldxeaclgschori\\\"\",\"abeolhbhlvbm\":\"\\\"datafldpuviyfc\\\"\"},\"friendlyName\":\"qi\"}") .toObject(AzureResourceEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceEntityProperties model = new AzureResourceEntityProperties(); - model = BinaryData.fromObject(model).toObject(AzureResourceEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityTests.java index ea9559a44856..d0ce839533d8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AzureResourceEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class AzureResourceEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AzureResourceEntity model = BinaryData.fromString( - "{\"kind\":\"AzureResource\",\"properties\":{\"resourceId\":\"fvwbcb\",\"subscriptionId\":\"mbnkb\",\"additionalData\":{\"uwfmduragegizvc\":\"datavxkdivqihebwtswb\",\"gbqi\":\"datafelisdjub\"},\"friendlyName\":\"xkbsazgakgac\"},\"id\":\"cmjdmspof\",\"name\":\"pv\",\"type\":\"hryl\"}") + "{\"kind\":\"AzureResource\",\"properties\":{\"resourceId\":\"ibidmhmwffp\",\"subscriptionId\":\"muvapc\",\"additionalData\":{\"xoy\":\"\\\"datarrvwey\\\"\",\"oshbragapyy\":\"\\\"dataukphaimmoiroq\\\"\"},\"friendlyName\":\"fsv\"},\"id\":\"avbopfp\",\"name\":\"dbwnu\",\"type\":\"gahxkumasjcaa\"}") .toObject(AzureResourceEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceEntity model = new AzureResourceEntity(); - model = BinaryData.fromObject(model).toObject(AzureResourceEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticInnerTests.java new file mode 100644 index 000000000000..bf3d4ef8ee7a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.BillingStatisticInner; + +public final class BillingStatisticInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BillingStatisticInner model = BinaryData.fromString( + "{\"kind\":\"BillingStatistic\",\"etag\":\"doyqx\",\"id\":\"nkfthmcxqqxmyz\",\"name\":\"laoanpohrvmz\",\"type\":\"qr\"}") + .toObject(BillingStatisticInner.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticListTests.java new file mode 100644 index 000000000000..ad6328e832a5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticListTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.BillingStatisticList; +import org.junit.jupiter.api.Assertions; + +public final class BillingStatisticListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BillingStatisticList model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"BillingStatistic\",\"etag\":\"lxspmrjct\",\"id\":\"ldsxebuhsxrz\",\"name\":\"mgsdaluyckhefrbh\",\"type\":\"eu\"},{\"kind\":\"BillingStatistic\",\"etag\":\"bgpxebjlu\",\"id\":\"aytujraxdtpryjm\",\"name\":\"tnsewou\",\"type\":\"ly\"},{\"kind\":\"BillingStatistic\",\"etag\":\"vvyljurkepose\",\"id\":\"qylmpctwjwdsd\",\"name\":\"zmk\",\"type\":\"erxxxoteehkhowgo\"}],\"nextLink\":\"vhxowpcbapnpxra\"}") + .toObject(BillingStatisticList.class); + Assertions.assertEquals("vhxowpcbapnpxra", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetWithResponseMockTests.java new file mode 100644 index 000000000000..c8549d55701a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.BillingStatistic; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BillingStatisticsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"BillingStatistic\",\"etag\":\"cmougddy\",\"id\":\"yf\",\"name\":\"unamzqvawk\",\"type\":\"sxvzc\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BillingStatistic response = manager.billingStatistics() + .getWithResponse("n", "fabgtcgg", "pp", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListMockTests.java new file mode 100644 index 000000000000..960cb9b24869 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BillingStatisticsListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.BillingStatistic; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BillingStatisticsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"BillingStatistic\",\"etag\":\"cxmh\",\"id\":\"recoiqwnqlizlcyh\",\"name\":\"hrkfpt\",\"type\":\"iommis\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.billingStatistics().list("xfwpjpg", "wbrzkmgyl", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkEntityMappingsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkEntityMappingsTests.java new file mode 100644 index 000000000000..2b18d1707c1f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkEntityMappingsTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; +import com.azure.resourcemanager.securityinsights.models.EntityFieldMapping; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class BookmarkEntityMappingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BookmarkEntityMappings model = BinaryData.fromString( + "{\"entityType\":\"xetyvku\",\"fieldMappings\":[{\"identifier\":\"nohikkgq\",\"value\":\"jwpindedvabbxbh\"},{\"identifier\":\"dei\",\"value\":\"jywfcfxzirzzih\"}]}") + .toObject(BookmarkEntityMappings.class); + Assertions.assertEquals("xetyvku", model.entityType()); + Assertions.assertEquals("nohikkgq", model.fieldMappings().get(0).identifier()); + Assertions.assertEquals("jwpindedvabbxbh", model.fieldMappings().get(0).value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BookmarkEntityMappings model = new BookmarkEntityMappings().withEntityType("xetyvku") + .withFieldMappings( + Arrays.asList(new EntityFieldMapping().withIdentifier("nohikkgq").withValue("jwpindedvabbxbh"), + new EntityFieldMapping().withIdentifier("dei").withValue("jywfcfxzirzzih"))); + model = BinaryData.fromObject(model).toObject(BookmarkEntityMappings.class); + Assertions.assertEquals("xetyvku", model.entityType()); + Assertions.assertEquals("nohikkgq", model.fieldMappings().get(0).identifier()); + Assertions.assertEquals("jwpindedvabbxbh", model.fieldMappings().get(0).value()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandParametersTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandParametersTests.java new file mode 100644 index 000000000000..e2a899f3fac7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandParametersTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class BookmarkExpandParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BookmarkExpandParameters model = BinaryData.fromString( + "{\"endTime\":\"2021-02-01T20:47:19Z\",\"expansionId\":\"hiypbfhmihi\",\"startTime\":\"2021-10-09T07:05:11Z\"}") + .toObject(BookmarkExpandParameters.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:47:19Z"), model.endTime()); + Assertions.assertEquals("hiypbfhmihi", model.expansionId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T07:05:11Z"), model.startTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BookmarkExpandParameters model + = new BookmarkExpandParameters().withEndTime(OffsetDateTime.parse("2021-02-01T20:47:19Z")) + .withExpansionId("hiypbfhmihi") + .withStartTime(OffsetDateTime.parse("2021-10-09T07:05:11Z")); + model = BinaryData.fromObject(model).toObject(BookmarkExpandParameters.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:47:19Z"), model.endTime()); + Assertions.assertEquals("hiypbfhmihi", model.expansionId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T07:05:11Z"), model.startTime()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseInnerTests.java new file mode 100644 index 000000000000..48658e820c10 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkExpandResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; +import org.junit.jupiter.api.Assertions; + +public final class BookmarkExpandResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BookmarkExpandResponseInner model = BinaryData.fromString( + "{\"metaData\":{\"aggregations\":[{\"aggregationType\":\"brsrjzgkbrau\",\"count\":400185287,\"displayName\":\"ufqnnqbjxgjwsr\",\"entityKind\":\"Malware\"}]},\"value\":{\"entities\":[{\"kind\":\"Entity\",\"id\":\"udrizwkw\",\"name\":\"jxlaaced\",\"type\":\"kq\"},{\"kind\":\"Entity\",\"id\":\"ssybzbe\",\"name\":\"gbnrommkiqhypwt\",\"type\":\"zyjj\"},{\"kind\":\"Entity\",\"id\":\"t\",\"name\":\"mzqlnaag\",\"type\":\"i\"},{\"kind\":\"Entity\",\"id\":\"cfqiywhx\",\"name\":\"sbapiale\",\"type\":\"aydpuzudegefxl\"}],\"edges\":[{\"targetEntityId\":\"ot\",\"additionalData\":\"\\\"datamhssfnwh\\\"\"}]}}") + .toObject(BookmarkExpandResponseInner.class); + Assertions.assertEquals("brsrjzgkbrau", model.metaData().aggregations().get(0).aggregationType()); + Assertions.assertEquals(400185287, model.metaData().aggregations().get(0).count()); + Assertions.assertEquals("ufqnnqbjxgjwsr", model.metaData().aggregations().get(0).displayName()); + Assertions.assertEquals(EntityKindEnum.MALWARE, model.metaData().aggregations().get(0).entityKind()); + Assertions.assertEquals("ot", model.value().edges().get(0).targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseValueTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseValueTests.java new file mode 100644 index 000000000000..5aefc21da953 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkExpandResponseValueTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponseValue; +import org.junit.jupiter.api.Assertions; + +public final class BookmarkExpandResponseValueTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BookmarkExpandResponseValue model = BinaryData.fromString( + "{\"entities\":[{\"kind\":\"Entity\",\"id\":\"hecknfmkcuft\",\"name\":\"dgwuzron\",\"type\":\"dvhzfkdn\"}],\"edges\":[{\"targetEntityId\":\"dcikgxk\",\"additionalData\":\"\\\"datazfzdjekeb\\\"\"},{\"targetEntityId\":\"nxzsjwy\",\"additionalData\":\"\\\"dataxirgcjfaiwulpj\\\"\"}]}") + .toObject(BookmarkExpandResponseValue.class); + Assertions.assertEquals("dcikgxk", model.edges().get(0).targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkInnerTests.java index 9fa0a3a58dc5..9bc9229580cf 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkInnerTests.java @@ -1,80 +1,103 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; +import com.azure.resourcemanager.securityinsights.models.EntityFieldMapping; import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class BookmarkInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BookmarkInner model = BinaryData.fromString( - "{\"properties\":{\"created\":\"2021-07-20T05:11Z\",\"createdBy\":{\"email\":\"jtjaodxobnbdxkq\",\"name\":\"okaj\",\"objectId\":\"c1a4425e-086a-4b66-9aee-d404f04561ab\"},\"displayName\":\"npime\",\"labels\":[\"txgcpodgmaajr\",\"vdjwzrlovm\"],\"notes\":\"whijcoejctbza\",\"query\":\"s\",\"queryResult\":\"y\",\"updated\":\"2021-02-18T20:34:43Z\",\"updatedBy\":{\"email\":\"k\",\"name\":\"kdkexxp\",\"objectId\":\"33887cc7-0b9c-4218-a246-cecf4ea52dd4\"},\"eventTime\":\"2021-08-26T06:38:07Z\",\"queryStartTime\":\"2021-05-26T04:34:13Z\",\"queryEndTime\":\"2021-11-01T06:54:57Z\",\"incidentInfo\":{\"incidentId\":\"pg\",\"severity\":\"High\",\"title\":\"c\",\"relationName\":\"xhvpmoue\"}},\"etag\":\"dzxibqeojnxqbzvd\",\"id\":\"t\",\"name\":\"ndei\",\"type\":\"btwnpzaoqvuhrhcf\"}") + "{\"properties\":{\"created\":\"2021-04-05T20:46:20Z\",\"createdBy\":{\"email\":\"oiisbamnppcce\",\"name\":\"ztdsbeza\",\"objectId\":\"f\"},\"displayName\":\"kzxuiz\",\"labels\":[\"nepk\",\"etiarxqiubxdukec\",\"xdazv\"],\"notes\":\"ctmmkoszudbl\",\"query\":\"s\",\"queryResult\":\"rpcaqkiofkbtf\",\"updated\":\"2021-03-25T16:21:47Z\",\"updatedBy\":{\"email\":\"nldpvcbhhezyquwu\",\"name\":\"xut\",\"objectId\":\"brruyuuatv\"},\"eventTime\":\"2021-02-09T14:08:52Z\",\"queryStartTime\":\"2021-08-31T05:43:57Z\",\"queryEndTime\":\"2021-01-22T06:54:58Z\",\"incidentInfo\":{\"incidentId\":\"mxlbn\",\"severity\":\"Informational\",\"title\":\"pa\",\"relationName\":\"rzrv\"},\"entityMappings\":[{\"entityType\":\"fhocnxzcmj\",\"fieldMappings\":[{\"identifier\":\"noq\",\"value\":\"tdisnjevhdlmyd\"},{\"identifier\":\"whepfww\",\"value\":\"f\"},{\"identifier\":\"esxxhmwcdbckyoi\",\"value\":\"kxhnegknj\"}]}],\"tactics\":[\"InitialAccess\",\"Discovery\",\"PreAttack\"],\"techniques\":[\"lvukaobrlb\",\"gsnbagnchjh\",\"emuowakyw\",\"lhjym\"]},\"etag\":\"gqtagd\",\"id\":\"lss\",\"name\":\"ljomevt\",\"type\":\"ycnlbvgjcodk\"}") .toObject(BookmarkInner.class); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T05:11Z"), model.created()); - Assertions.assertEquals(UUID.fromString("c1a4425e-086a-4b66-9aee-d404f04561ab"), model.createdBy().objectId()); - Assertions.assertEquals("npime", model.displayName()); - Assertions.assertEquals("txgcpodgmaajr", model.labels().get(0)); - Assertions.assertEquals("whijcoejctbza", model.notes()); + Assertions.assertEquals("gqtagd", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T20:46:20Z"), model.created()); + Assertions.assertEquals("f", model.createdBy().objectId()); + Assertions.assertEquals("kzxuiz", model.displayName()); + Assertions.assertEquals("nepk", model.labels().get(0)); + Assertions.assertEquals("ctmmkoszudbl", model.notes()); Assertions.assertEquals("s", model.query()); - Assertions.assertEquals("y", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-18T20:34:43Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("33887cc7-0b9c-4218-a246-cecf4ea52dd4"), model.updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-26T06:38:07Z"), model.eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T04:34:13Z"), model.queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T06:54:57Z"), model.queryEndTime()); - Assertions.assertEquals("pg", model.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.HIGH, model.incidentInfo().severity()); - Assertions.assertEquals("c", model.incidentInfo().title()); - Assertions.assertEquals("xhvpmoue", model.incidentInfo().relationName()); + Assertions.assertEquals("rpcaqkiofkbtf", model.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T16:21:47Z"), model.updated()); + Assertions.assertEquals("brruyuuatv", model.updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T14:08:52Z"), model.eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T05:43:57Z"), model.queryStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T06:54:58Z"), model.queryEndTime()); + Assertions.assertEquals("mxlbn", model.incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.incidentInfo().severity()); + Assertions.assertEquals("pa", model.incidentInfo().title()); + Assertions.assertEquals("rzrv", model.incidentInfo().relationName()); + Assertions.assertEquals("fhocnxzcmj", model.entityMappings().get(0).entityType()); + Assertions.assertEquals("noq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("tdisnjevhdlmyd", model.entityMappings().get(0).fieldMappings().get(0).value()); + Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.tactics().get(0)); + Assertions.assertEquals("lvukaobrlb", model.techniques().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BookmarkInner model = new BookmarkInner().withEtag("dzxibqeojnxqbzvd") - .withCreated(OffsetDateTime.parse("2021-07-20T05:11Z")) - .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("c1a4425e-086a-4b66-9aee-d404f04561ab"))) - .withDisplayName("npime") - .withLabels(Arrays.asList("txgcpodgmaajr", "vdjwzrlovm")) - .withNotes("whijcoejctbza") - .withQuery("s") - .withQueryResult("y") - .withUpdated(OffsetDateTime.parse("2021-02-18T20:34:43Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("33887cc7-0b9c-4218-a246-cecf4ea52dd4"))) - .withEventTime(OffsetDateTime.parse("2021-08-26T06:38:07Z")) - .withQueryStartTime(OffsetDateTime.parse("2021-05-26T04:34:13Z")) - .withQueryEndTime(OffsetDateTime.parse("2021-11-01T06:54:57Z")) - .withIncidentInfo(new IncidentInfo().withIncidentId("pg") - .withSeverity(IncidentSeverity.HIGH) - .withTitle("c") - .withRelationName("xhvpmoue")); + BookmarkInner model + = new BookmarkInner().withEtag("gqtagd") + .withCreated(OffsetDateTime.parse("2021-04-05T20:46:20Z")) + .withCreatedBy(new UserInfo().withObjectId("f")) + .withDisplayName("kzxuiz") + .withLabels(Arrays.asList("nepk", "etiarxqiubxdukec", "xdazv")) + .withNotes("ctmmkoszudbl") + .withQuery("s") + .withQueryResult("rpcaqkiofkbtf") + .withUpdated(OffsetDateTime.parse("2021-03-25T16:21:47Z")) + .withUpdatedBy(new UserInfo().withObjectId("brruyuuatv")) + .withEventTime(OffsetDateTime.parse("2021-02-09T14:08:52Z")) + .withQueryStartTime(OffsetDateTime.parse("2021-08-31T05:43:57Z")) + .withQueryEndTime(OffsetDateTime.parse("2021-01-22T06:54:58Z")) + .withIncidentInfo(new IncidentInfo().withIncidentId("mxlbn") + .withSeverity(IncidentSeverity.INFORMATIONAL) + .withTitle("pa") + .withRelationName("rzrv")) + .withEntityMappings( + Arrays + .asList(new BookmarkEntityMappings().withEntityType("fhocnxzcmj") + .withFieldMappings(Arrays.asList( + new EntityFieldMapping().withIdentifier("noq").withValue("tdisnjevhdlmyd"), + new EntityFieldMapping().withIdentifier("whepfww").withValue("f"), + new EntityFieldMapping().withIdentifier("esxxhmwcdbckyoi").withValue("kxhnegknj"))))) + .withTactics( + Arrays.asList(AttackTactic.INITIAL_ACCESS, AttackTactic.DISCOVERY, AttackTactic.PRE_ATTACK)) + .withTechniques(Arrays.asList("lvukaobrlb", "gsnbagnchjh", "emuowakyw", "lhjym")); model = BinaryData.fromObject(model).toObject(BookmarkInner.class); - Assertions.assertEquals("dzxibqeojnxqbzvd", model.etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T05:11Z"), model.created()); - Assertions.assertEquals(UUID.fromString("c1a4425e-086a-4b66-9aee-d404f04561ab"), model.createdBy().objectId()); - Assertions.assertEquals("npime", model.displayName()); - Assertions.assertEquals("txgcpodgmaajr", model.labels().get(0)); - Assertions.assertEquals("whijcoejctbza", model.notes()); + Assertions.assertEquals("gqtagd", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T20:46:20Z"), model.created()); + Assertions.assertEquals("f", model.createdBy().objectId()); + Assertions.assertEquals("kzxuiz", model.displayName()); + Assertions.assertEquals("nepk", model.labels().get(0)); + Assertions.assertEquals("ctmmkoszudbl", model.notes()); Assertions.assertEquals("s", model.query()); - Assertions.assertEquals("y", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-18T20:34:43Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("33887cc7-0b9c-4218-a246-cecf4ea52dd4"), model.updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-26T06:38:07Z"), model.eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T04:34:13Z"), model.queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T06:54:57Z"), model.queryEndTime()); - Assertions.assertEquals("pg", model.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.HIGH, model.incidentInfo().severity()); - Assertions.assertEquals("c", model.incidentInfo().title()); - Assertions.assertEquals("xhvpmoue", model.incidentInfo().relationName()); + Assertions.assertEquals("rpcaqkiofkbtf", model.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T16:21:47Z"), model.updated()); + Assertions.assertEquals("brruyuuatv", model.updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T14:08:52Z"), model.eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T05:43:57Z"), model.queryStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T06:54:58Z"), model.queryEndTime()); + Assertions.assertEquals("mxlbn", model.incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.incidentInfo().severity()); + Assertions.assertEquals("pa", model.incidentInfo().title()); + Assertions.assertEquals("rzrv", model.incidentInfo().relationName()); + Assertions.assertEquals("fhocnxzcmj", model.entityMappings().get(0).entityType()); + Assertions.assertEquals("noq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("tdisnjevhdlmyd", model.entityMappings().get(0).fieldMappings().get(0).value()); + Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.tactics().get(0)); + Assertions.assertEquals("lvukaobrlb", model.techniques().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkListTests.java index 3caba526dc5d..e1e98ab32bb3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkListTests.java @@ -1,85 +1,41 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkInner; -import com.azure.resourcemanager.securityinsights.models.BookmarkList; -import com.azure.resourcemanager.securityinsights.models.IncidentInfo; +import com.azure.resourcemanager.securityinsights.implementation.models.BookmarkList; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; -import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class BookmarkListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BookmarkList model = BinaryData.fromString( - "{\"nextLink\":\"zidnsezcxtbzsgfy\",\"value\":[{\"properties\":{\"created\":\"2021-04-28T14:26:37Z\",\"createdBy\":{\"email\":\"dwzjeiach\",\"name\":\"osfln\",\"objectId\":\"0296629a-3485-4e09-9e99-92d0788328ba\"},\"displayName\":\"sfqpteehz\",\"labels\":[\"pyqr\",\"mzinpvswjdk\",\"rsoodqxhcrmnoh\"],\"notes\":\"ckwhds\",\"query\":\"ifiyipjxsqwpgrj\",\"queryResult\":\"norcjxvsnbyxqab\",\"updated\":\"2021-01-31T04:10:32Z\",\"updatedBy\":{\"email\":\"cyshurzafbljjgp\",\"name\":\"oq\",\"objectId\":\"40d76acc-6403-4303-9e1c-377f943dd4e0\"},\"eventTime\":\"2021-08-23T17:30:32Z\",\"queryStartTime\":\"2021-06-12T13:13:31Z\",\"queryEndTime\":\"2021-09-28T22:54:32Z\",\"incidentInfo\":{\"incidentId\":\"idtqajzyu\",\"severity\":\"Low\",\"title\":\"dj\",\"relationName\":\"lkhbz\"}},\"etag\":\"epgzgqexz\",\"id\":\"c\",\"name\":\"scpai\",\"type\":\"rhhbcs\"}]}") + "{\"value\":[{\"properties\":{\"created\":\"2021-05-23T01:22:54Z\",\"createdBy\":{\"email\":\"cfrgnawbabgfbkt\",\"name\":\"mfczl\",\"objectId\":\"yq\"},\"displayName\":\"frbzgowo\",\"labels\":[\"je\"],\"notes\":\"cxn\",\"query\":\"qg\",\"queryResult\":\"lusrv\",\"updated\":\"2021-01-17T12:48:42Z\",\"updatedBy\":{\"email\":\"jceagb\",\"name\":\"vl\",\"objectId\":\"mywzashxgonoy\"},\"eventTime\":\"2021-03-26T06:58:47Z\",\"queryStartTime\":\"2021-08-26T18:06:48Z\",\"queryEndTime\":\"2021-05-26T17:24:34Z\",\"incidentInfo\":{\"incidentId\":\"nclkfkeeb\",\"severity\":\"Medium\",\"title\":\"e\",\"relationName\":\"uoqujlyeg\"},\"entityMappings\":[{\"entityType\":\"igflqqbtnyjp\",\"fieldMappings\":[{}]}],\"tactics\":[\"ImpairProcessControl\"],\"techniques\":[\"bmvmsxba\",\"vwjcnkottlwuh\",\"ajmailfemjjza\",\"zwjiqullq\"]},\"etag\":\"dmvr\",\"id\":\"mqerndb\",\"name\":\"nyeofltfnnxrk\",\"type\":\"dj\"},{\"properties\":{\"created\":\"2021-08-09T02:13:11Z\",\"createdBy\":{\"email\":\"ui\",\"name\":\"ri\",\"objectId\":\"ohykfkxbbcbrw\"},\"displayName\":\"iutgnjizbeewoiy\",\"labels\":[\"zbju\",\"rsrziuctix\",\"bdsuifr\"],\"notes\":\"kaapezkiswqjmdg\",\"query\":\"syparybjufp\",\"queryResult\":\"jczjnciuiyqv\",\"updated\":\"2021-11-30T16:40:05Z\",\"updatedBy\":{\"email\":\"v\",\"name\":\"i\",\"objectId\":\"qzlgcndhzxrrfcfs\"},\"eventTime\":\"2021-01-14T17:36:28Z\",\"queryStartTime\":\"2021-08-01T19:52:12Z\",\"queryEndTime\":\"2021-11-26T18:17:13Z\",\"incidentInfo\":{\"incidentId\":\"wkpphefsb\",\"severity\":\"Low\",\"title\":\"zxomeikjclwz\",\"relationName\":\"nmwpf\"},\"entityMappings\":[{\"entityType\":\"aazyqbxyxoyfpuqq\",\"fieldMappings\":[{},{},{}]},{\"entityType\":\"xlhdj\",\"fieldMappings\":[{},{},{},{}]},{\"entityType\":\"a\",\"fieldMappings\":[{},{},{}]}],\"tactics\":[\"LateralMovement\",\"Impact\"],\"techniques\":[\"ih\",\"riybmrz\",\"epnxwd\"]},\"etag\":\"njkgvfnmx\",\"id\":\"rsqftib\",\"name\":\"yibuyvpirfqjpnqn\",\"type\":\"owsbedenrexkxbh\"},{\"properties\":{\"created\":\"2021-04-27T17:56:02Z\",\"createdBy\":{\"email\":\"lgmnhjevdyzn\",\"name\":\"jsvkskmqozzkivy\",\"objectId\":\"rl\"},\"displayName\":\"izjixlq\",\"labels\":[\"fkwa\"],\"notes\":\"olro\",\"query\":\"qqlmgnlqxsjxte\",\"queryResult\":\"xhvuqbozool\",\"updated\":\"2021-02-23T22:19:44Z\",\"updatedBy\":{\"email\":\"rkuz\",\"name\":\"cnn\",\"objectId\":\"snxawqyt\"},\"eventTime\":\"2021-06-27T19:26:31Z\",\"queryStartTime\":\"2021-10-14T11:13:01Z\",\"queryEndTime\":\"2021-09-28T01:05:07Z\",\"incidentInfo\":{\"incidentId\":\"kzexnx\",\"severity\":\"Low\",\"title\":\"ywymxgaabj\",\"relationName\":\"tfohf\"},\"entityMappings\":[{\"entityType\":\"vkiwrsiwdyjqu\",\"fieldMappings\":[{}]},{\"entityType\":\"rra\",\"fieldMappings\":[{},{}]},{\"entityType\":\"csuehogddac\",\"fieldMappings\":[{},{},{}]},{\"entityType\":\"ydl\",\"fieldMappings\":[{}]}],\"tactics\":[\"DefenseEvasion\",\"PreAttack\",\"Collection\",\"Impact\"],\"techniques\":[\"ril\",\"fbnrq\"]},\"etag\":\"vzt\",\"id\":\"nfnqtxjtomals\",\"name\":\"bnfddep\",\"type\":\"dwq\"},{\"properties\":{\"created\":\"2021-04-30T18:08:12Z\",\"createdBy\":{\"email\":\"gl\",\"name\":\"x\",\"objectId\":\"vmywhsbrcarycsjj\"},\"displayName\":\"yvoaqajuvehzp\",\"labels\":[\"krrbhmpful\"],\"notes\":\"efgybpmfbfununmp\",\"query\":\"krvfyifkdschl\",\"queryResult\":\"fict\",\"updated\":\"2021-11-20T12:55:12Z\",\"updatedBy\":{\"email\":\"gcwn\",\"name\":\"bkgfyrtogmhmjpjs\",\"objectId\":\"fp\"},\"eventTime\":\"2021-09-25T01:25:06Z\",\"queryStartTime\":\"2021-10-23T16:23:17Z\",\"queryEndTime\":\"2021-01-06T10:09:12Z\",\"incidentInfo\":{\"incidentId\":\"wmseharxifvqn\",\"severity\":\"Medium\",\"title\":\"bpjptnvwjhrsi\",\"relationName\":\"pxlbtpakftngat\"},\"entityMappings\":[{\"entityType\":\"yutrymd\",\"fieldMappings\":[{}]},{\"entityType\":\"hpycvjqdvdwkq\",\"fieldMappings\":[{},{},{},{}]},{\"entityType\":\"lefgnaavuagnte\",\"fieldMappings\":[{},{},{},{}]},{\"entityType\":\"tnpdctuhspfefy\",\"fieldMappings\":[{},{}]}],\"tactics\":[\"Discovery\",\"Discovery\"],\"techniques\":[\"dphmtybkcgsuth\",\"llnmwyn\",\"fxexlfciatxtjrr\"]},\"etag\":\"mdskjhhxdlajfoxc\",\"id\":\"cvslxlhuavkrmukm\",\"name\":\"jmkxettcslojf\",\"type\":\"qid\"}],\"nextLink\":\"toqxjh\"}") .toObject(BookmarkList.class); - Assertions.assertEquals("epgzgqexz", model.value().get(0).etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T14:26:37Z"), model.value().get(0).created()); - Assertions.assertEquals(UUID.fromString("0296629a-3485-4e09-9e99-92d0788328ba"), - model.value().get(0).createdBy().objectId()); - Assertions.assertEquals("sfqpteehz", model.value().get(0).displayName()); - Assertions.assertEquals("pyqr", model.value().get(0).labels().get(0)); - Assertions.assertEquals("ckwhds", model.value().get(0).notes()); - Assertions.assertEquals("ifiyipjxsqwpgrj", model.value().get(0).query()); - Assertions.assertEquals("norcjxvsnbyxqab", model.value().get(0).queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T04:10:32Z"), model.value().get(0).updated()); - Assertions.assertEquals(UUID.fromString("40d76acc-6403-4303-9e1c-377f943dd4e0"), - model.value().get(0).updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T17:30:32Z"), model.value().get(0).eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T13:13:31Z"), model.value().get(0).queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T22:54:32Z"), model.value().get(0).queryEndTime()); - Assertions.assertEquals("idtqajzyu", model.value().get(0).incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.LOW, model.value().get(0).incidentInfo().severity()); - Assertions.assertEquals("dj", model.value().get(0).incidentInfo().title()); - Assertions.assertEquals("lkhbz", model.value().get(0).incidentInfo().relationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BookmarkList model = new BookmarkList().withValue(Arrays.asList(new BookmarkInner().withEtag("epgzgqexz") - .withCreated(OffsetDateTime.parse("2021-04-28T14:26:37Z")) - .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("0296629a-3485-4e09-9e99-92d0788328ba"))) - .withDisplayName("sfqpteehz") - .withLabels(Arrays.asList("pyqr", "mzinpvswjdk", "rsoodqxhcrmnoh")) - .withNotes("ckwhds") - .withQuery("ifiyipjxsqwpgrj") - .withQueryResult("norcjxvsnbyxqab") - .withUpdated(OffsetDateTime.parse("2021-01-31T04:10:32Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("40d76acc-6403-4303-9e1c-377f943dd4e0"))) - .withEventTime(OffsetDateTime.parse("2021-08-23T17:30:32Z")) - .withQueryStartTime(OffsetDateTime.parse("2021-06-12T13:13:31Z")) - .withQueryEndTime(OffsetDateTime.parse("2021-09-28T22:54:32Z")) - .withIncidentInfo(new IncidentInfo().withIncidentId("idtqajzyu") - .withSeverity(IncidentSeverity.LOW) - .withTitle("dj") - .withRelationName("lkhbz")))); - model = BinaryData.fromObject(model).toObject(BookmarkList.class); - Assertions.assertEquals("epgzgqexz", model.value().get(0).etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T14:26:37Z"), model.value().get(0).created()); - Assertions.assertEquals(UUID.fromString("0296629a-3485-4e09-9e99-92d0788328ba"), - model.value().get(0).createdBy().objectId()); - Assertions.assertEquals("sfqpteehz", model.value().get(0).displayName()); - Assertions.assertEquals("pyqr", model.value().get(0).labels().get(0)); - Assertions.assertEquals("ckwhds", model.value().get(0).notes()); - Assertions.assertEquals("ifiyipjxsqwpgrj", model.value().get(0).query()); - Assertions.assertEquals("norcjxvsnbyxqab", model.value().get(0).queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T04:10:32Z"), model.value().get(0).updated()); - Assertions.assertEquals(UUID.fromString("40d76acc-6403-4303-9e1c-377f943dd4e0"), - model.value().get(0).updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T17:30:32Z"), model.value().get(0).eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T13:13:31Z"), model.value().get(0).queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T22:54:32Z"), model.value().get(0).queryEndTime()); - Assertions.assertEquals("idtqajzyu", model.value().get(0).incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.LOW, model.value().get(0).incidentInfo().severity()); - Assertions.assertEquals("dj", model.value().get(0).incidentInfo().title()); - Assertions.assertEquals("lkhbz", model.value().get(0).incidentInfo().relationName()); + Assertions.assertEquals("dmvr", model.value().get(0).etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T01:22:54Z"), model.value().get(0).created()); + Assertions.assertEquals("yq", model.value().get(0).createdBy().objectId()); + Assertions.assertEquals("frbzgowo", model.value().get(0).displayName()); + Assertions.assertEquals("je", model.value().get(0).labels().get(0)); + Assertions.assertEquals("cxn", model.value().get(0).notes()); + Assertions.assertEquals("qg", model.value().get(0).query()); + Assertions.assertEquals("lusrv", model.value().get(0).queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-17T12:48:42Z"), model.value().get(0).updated()); + Assertions.assertEquals("mywzashxgonoy", model.value().get(0).updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T06:58:47Z"), model.value().get(0).eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-26T18:06:48Z"), model.value().get(0).queryStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T17:24:34Z"), model.value().get(0).queryEndTime()); + Assertions.assertEquals("nclkfkeeb", model.value().get(0).incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.MEDIUM, model.value().get(0).incidentInfo().severity()); + Assertions.assertEquals("e", model.value().get(0).incidentInfo().title()); + Assertions.assertEquals("uoqujlyeg", model.value().get(0).incidentInfo().relationName()); + Assertions.assertEquals("igflqqbtnyjp", model.value().get(0).entityMappings().get(0).entityType()); + Assertions.assertEquals(AttackTactic.IMPAIR_PROCESS_CONTROL, model.value().get(0).tactics().get(0)); + Assertions.assertEquals("bmvmsxba", model.value().get(0).techniques().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationsExpandWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationsExpandWithResponseMockTests.java new file mode 100644 index 000000000000..0364e1543165 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkOperationsExpandWithResponseMockTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandParameters; +import com.azure.resourcemanager.securityinsights.models.BookmarkExpandResponse; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BookmarkOperationsExpandWithResponseMockTests { + @Test + public void testExpandWithResponse() throws Exception { + String responseStr + = "{\"metaData\":{\"aggregations\":[{\"aggregationType\":\"droqktegi\",\"count\":1791823666,\"displayName\":\"zctqbvn\",\"entityKind\":\"Url\"}]},\"value\":{\"entities\":[{\"kind\":\"Entity\",\"id\":\"mexqoydyislepdbs\",\"name\":\"klntspfnumpyy\",\"type\":\"b\"}],\"edges\":[{\"targetEntityId\":\"bmtxbiwflkgeq\",\"additionalData\":\"\\\"datavocjk\\\"\"},{\"targetEntityId\":\"h\",\"additionalData\":\"\\\"datayvtrsgfdmtfn\\\"\"},{\"targetEntityId\":\"txqqlbmiq\",\"additionalData\":\"\\\"dataiahjxcd\\\"\"}]}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BookmarkExpandResponse response = manager.bookmarkOperations() + .expandWithResponse("ozfygvsfafcar", "dmlie", "dwocufcsh", + new BookmarkExpandParameters().withEndTime(OffsetDateTime.parse("2021-02-16T21:36:53Z")) + .withExpansionId("c") + .withStartTime(OffsetDateTime.parse("2021-05-18T19:30:53Z")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("droqktegi", response.metaData().aggregations().get(0).aggregationType()); + Assertions.assertEquals(1791823666, response.metaData().aggregations().get(0).count()); + Assertions.assertEquals("zctqbvn", response.metaData().aggregations().get(0).displayName()); + Assertions.assertEquals(EntityKindEnum.URL, response.metaData().aggregations().get(0).entityKind()); + Assertions.assertEquals("bmtxbiwflkgeq", response.value().edges().get(0).targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkPropertiesTests.java index ed28d9d892f1..5fbc155882fe 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkPropertiesTests.java @@ -1,77 +1,113 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.BookmarkProperties; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; +import com.azure.resourcemanager.securityinsights.models.EntityFieldMapping; import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class BookmarkPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BookmarkProperties model = BinaryData.fromString( - "{\"created\":\"2021-05-08T13:34:52Z\",\"createdBy\":{\"email\":\"glmjth\",\"name\":\"kw\",\"objectId\":\"2465c5c0-6f86-4f84-ba3f-59023614fb30\"},\"displayName\":\"eicxmqciwqvhkhi\",\"labels\":[\"gdtopbobjogh\",\"e\",\"u\"],\"notes\":\"a\",\"query\":\"hrzayvvtpgvdf\",\"queryResult\":\"otkftutqxlngx\",\"updated\":\"2021-12-03T02:20:16Z\",\"updatedBy\":{\"email\":\"gnxkrxdqmidtth\",\"name\":\"vqdra\",\"objectId\":\"edee10b2-5f55-4ab1-994a-208bf16c1919\"},\"eventTime\":\"2021-09-24T23:35:33Z\",\"queryStartTime\":\"2021-09-14T02:51:19Z\",\"queryEndTime\":\"2021-06-25T18:07:24Z\",\"incidentInfo\":{\"incidentId\":\"qfbow\",\"severity\":\"Informational\",\"title\":\"yktz\",\"relationName\":\"u\"}}") + "{\"created\":\"2021-09-14T01:02:16Z\",\"createdBy\":{\"email\":\"ytssikiz\",\"name\":\"ufqbvntnr\",\"objectId\":\"qsorh\"},\"displayName\":\"ekxgn\",\"labels\":[\"mxcpwzvmdoks\"],\"notes\":\"tiwlwxlboncqb\",\"query\":\"zqicqchygtvxbyja\",\"queryResult\":\"pubdpkx\",\"updated\":\"2021-07-08T09:02:36Z\",\"updatedBy\":{\"email\":\"i\",\"name\":\"detv\",\"objectId\":\"kxdxuwsaifmcwn\"},\"eventTime\":\"2021-09-25T23:57:18Z\",\"queryStartTime\":\"2021-02-25T08:45:47Z\",\"queryEndTime\":\"2021-11-15T05:17:44Z\",\"incidentInfo\":{\"incidentId\":\"vkbcknjolgjyyxp\",\"severity\":\"Low\",\"title\":\"zerqzevxoqei\",\"relationName\":\"xwaljgl\"},\"entityMappings\":[{\"entityType\":\"qwaafrqulhm\",\"fieldMappings\":[{\"identifier\":\"hdvafjrqpjiyrqjc\",\"value\":\"a\"}]},{\"entityType\":\"mzwdfk\",\"fieldMappings\":[{\"identifier\":\"orpdltbqct\",\"value\":\"fg\"},{\"identifier\":\"saetgzdgvpyig\",\"value\":\"qqil\"}]},{\"entityType\":\"cduwjoedx\",\"fieldMappings\":[{\"identifier\":\"aifpaurwwgil\",\"value\":\"qqa\"},{\"identifier\":\"mkxwxdcvjwcyziak\",\"value\":\"iqch\"},{\"identifier\":\"tuicds\",\"value\":\"dfmmpzhzzwvy\"},{\"identifier\":\"gyngydgrpxncak\",\"value\":\"aondjrkclamgg\"}]},{\"entityType\":\"lmf\",\"fieldMappings\":[{\"identifier\":\"qey\",\"value\":\"ltygxhqfgqkayej\"},{\"identifier\":\"tlgflwfgz\",\"value\":\"u\"}]}],\"tactics\":[\"Collection\",\"Impact\",\"PrivilegeEscalation\"],\"techniques\":[\"lijjjrtvam\",\"a\",\"zknxkv\"]}") .toObject(BookmarkProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T13:34:52Z"), model.created()); - Assertions.assertEquals(UUID.fromString("2465c5c0-6f86-4f84-ba3f-59023614fb30"), model.createdBy().objectId()); - Assertions.assertEquals("eicxmqciwqvhkhi", model.displayName()); - Assertions.assertEquals("gdtopbobjogh", model.labels().get(0)); - Assertions.assertEquals("a", model.notes()); - Assertions.assertEquals("hrzayvvtpgvdf", model.query()); - Assertions.assertEquals("otkftutqxlngx", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T02:20:16Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("edee10b2-5f55-4ab1-994a-208bf16c1919"), model.updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T23:35:33Z"), model.eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T02:51:19Z"), model.queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T18:07:24Z"), model.queryEndTime()); - Assertions.assertEquals("qfbow", model.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.incidentInfo().severity()); - Assertions.assertEquals("yktz", model.incidentInfo().title()); - Assertions.assertEquals("u", model.incidentInfo().relationName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T01:02:16Z"), model.created()); + Assertions.assertEquals("qsorh", model.createdBy().objectId()); + Assertions.assertEquals("ekxgn", model.displayName()); + Assertions.assertEquals("mxcpwzvmdoks", model.labels().get(0)); + Assertions.assertEquals("tiwlwxlboncqb", model.notes()); + Assertions.assertEquals("zqicqchygtvxbyja", model.query()); + Assertions.assertEquals("pubdpkx", model.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-08T09:02:36Z"), model.updated()); + Assertions.assertEquals("kxdxuwsaifmcwn", model.updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T23:57:18Z"), model.eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T08:45:47Z"), model.queryStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-15T05:17:44Z"), model.queryEndTime()); + Assertions.assertEquals("vkbcknjolgjyyxp", model.incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.LOW, model.incidentInfo().severity()); + Assertions.assertEquals("zerqzevxoqei", model.incidentInfo().title()); + Assertions.assertEquals("xwaljgl", model.incidentInfo().relationName()); + Assertions.assertEquals("qwaafrqulhm", model.entityMappings().get(0).entityType()); + Assertions.assertEquals("hdvafjrqpjiyrqjc", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("a", model.entityMappings().get(0).fieldMappings().get(0).value()); + Assertions.assertEquals(AttackTactic.COLLECTION, model.tactics().get(0)); + Assertions.assertEquals("lijjjrtvam", model.techniques().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BookmarkProperties model = new BookmarkProperties().withCreated(OffsetDateTime.parse("2021-05-08T13:34:52Z")) - .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("2465c5c0-6f86-4f84-ba3f-59023614fb30"))) - .withDisplayName("eicxmqciwqvhkhi") - .withLabels(Arrays.asList("gdtopbobjogh", "e", "u")) - .withNotes("a") - .withQuery("hrzayvvtpgvdf") - .withQueryResult("otkftutqxlngx") - .withUpdated(OffsetDateTime.parse("2021-12-03T02:20:16Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("edee10b2-5f55-4ab1-994a-208bf16c1919"))) - .withEventTime(OffsetDateTime.parse("2021-09-24T23:35:33Z")) - .withQueryStartTime(OffsetDateTime.parse("2021-09-14T02:51:19Z")) - .withQueryEndTime(OffsetDateTime.parse("2021-06-25T18:07:24Z")) - .withIncidentInfo(new IncidentInfo().withIncidentId("qfbow") - .withSeverity(IncidentSeverity.INFORMATIONAL) - .withTitle("yktz") - .withRelationName("u")); + BookmarkProperties model + = new BookmarkProperties().withCreated(OffsetDateTime.parse("2021-09-14T01:02:16Z")) + .withCreatedBy(new UserInfo().withObjectId("qsorh")) + .withDisplayName("ekxgn") + .withLabels(Arrays.asList("mxcpwzvmdoks")) + .withNotes("tiwlwxlboncqb") + .withQuery("zqicqchygtvxbyja") + .withQueryResult("pubdpkx") + .withUpdated(OffsetDateTime.parse("2021-07-08T09:02:36Z")) + .withUpdatedBy(new UserInfo().withObjectId("kxdxuwsaifmcwn")) + .withEventTime(OffsetDateTime.parse("2021-09-25T23:57:18Z")) + .withQueryStartTime(OffsetDateTime.parse("2021-02-25T08:45:47Z")) + .withQueryEndTime(OffsetDateTime.parse("2021-11-15T05:17:44Z")) + .withIncidentInfo(new IncidentInfo().withIncidentId("vkbcknjolgjyyxp") + .withSeverity(IncidentSeverity.LOW) + .withTitle("zerqzevxoqei") + .withRelationName("xwaljgl")) + .withEntityMappings( + Arrays.asList( + new BookmarkEntityMappings().withEntityType("qwaafrqulhm") + .withFieldMappings(Arrays + .asList(new EntityFieldMapping().withIdentifier("hdvafjrqpjiyrqjc").withValue("a"))), + new BookmarkEntityMappings().withEntityType("mzwdfk") + .withFieldMappings( + Arrays.asList(new EntityFieldMapping().withIdentifier("orpdltbqct").withValue("fg"), + new EntityFieldMapping().withIdentifier("saetgzdgvpyig").withValue("qqil"))), + new BookmarkEntityMappings().withEntityType("cduwjoedx") + .withFieldMappings( + Arrays.asList(new EntityFieldMapping().withIdentifier("aifpaurwwgil").withValue("qqa"), + new EntityFieldMapping().withIdentifier("mkxwxdcvjwcyziak").withValue("iqch"), + new EntityFieldMapping().withIdentifier("tuicds").withValue("dfmmpzhzzwvy"), + new EntityFieldMapping().withIdentifier("gyngydgrpxncak") + .withValue("aondjrkclamgg"))), + new BookmarkEntityMappings().withEntityType("lmf") + .withFieldMappings(Arrays.asList( + new EntityFieldMapping().withIdentifier("qey").withValue("ltygxhqfgqkayej"), + new EntityFieldMapping().withIdentifier("tlgflwfgz").withValue("u"))))) + .withTactics( + Arrays.asList(AttackTactic.COLLECTION, AttackTactic.IMPACT, AttackTactic.PRIVILEGE_ESCALATION)) + .withTechniques(Arrays.asList("lijjjrtvam", "a", "zknxkv")); model = BinaryData.fromObject(model).toObject(BookmarkProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T13:34:52Z"), model.created()); - Assertions.assertEquals(UUID.fromString("2465c5c0-6f86-4f84-ba3f-59023614fb30"), model.createdBy().objectId()); - Assertions.assertEquals("eicxmqciwqvhkhi", model.displayName()); - Assertions.assertEquals("gdtopbobjogh", model.labels().get(0)); - Assertions.assertEquals("a", model.notes()); - Assertions.assertEquals("hrzayvvtpgvdf", model.query()); - Assertions.assertEquals("otkftutqxlngx", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T02:20:16Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("edee10b2-5f55-4ab1-994a-208bf16c1919"), model.updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T23:35:33Z"), model.eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T02:51:19Z"), model.queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T18:07:24Z"), model.queryEndTime()); - Assertions.assertEquals("qfbow", model.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.incidentInfo().severity()); - Assertions.assertEquals("yktz", model.incidentInfo().title()); - Assertions.assertEquals("u", model.incidentInfo().relationName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T01:02:16Z"), model.created()); + Assertions.assertEquals("qsorh", model.createdBy().objectId()); + Assertions.assertEquals("ekxgn", model.displayName()); + Assertions.assertEquals("mxcpwzvmdoks", model.labels().get(0)); + Assertions.assertEquals("tiwlwxlboncqb", model.notes()); + Assertions.assertEquals("zqicqchygtvxbyja", model.query()); + Assertions.assertEquals("pubdpkx", model.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-08T09:02:36Z"), model.updated()); + Assertions.assertEquals("kxdxuwsaifmcwn", model.updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T23:57:18Z"), model.eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T08:45:47Z"), model.queryStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-15T05:17:44Z"), model.queryEndTime()); + Assertions.assertEquals("vkbcknjolgjyyxp", model.incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.LOW, model.incidentInfo().severity()); + Assertions.assertEquals("zerqzevxoqei", model.incidentInfo().title()); + Assertions.assertEquals("xwaljgl", model.incidentInfo().relationName()); + Assertions.assertEquals("qwaafrqulhm", model.entityMappings().get(0).entityType()); + Assertions.assertEquals("hdvafjrqpjiyrqjc", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("a", model.entityMappings().get(0).fieldMappings().get(0).value()); + Assertions.assertEquals(AttackTactic.COLLECTION, model.tactics().get(0)); + Assertions.assertEquals("lijjjrtvam", model.techniques().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..029b94c82e6e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Relation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BookmarkRelationsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"relatedResourceId\":\"nqbkpobjufksddxk\",\"relatedResourceName\":\"wxlylxfpvoylf\",\"relatedResourceType\":\"srgu\",\"relatedResourceKind\":\"bthauivgbimededq\"},\"etag\":\"rvulzg\",\"id\":\"ckpdpdcnr\",\"name\":\"qskikq\",\"type\":\"qiybqtlvofjjse\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Relation response = manager.bookmarkRelations() + .define("yujnrvwjxmwalhlj") + .withExistingBookmark("gtmoy", "potmaosongt", "hvhsqvubwwqg") + .withEtag("vpjydwmaqeytjp") + .withRelatedResourceId("snbpiuvqhodfm") + .create(); + + Assertions.assertEquals("rvulzg", response.etag()); + Assertions.assertEquals("nqbkpobjufksddxk", response.relatedResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..567d00b6dd2d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BookmarkRelationsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.bookmarkRelations() + .deleteWithResponse("uveljfa", "in", "fziztgddahymvk", "jtdhmig", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..ae6b5ede13fd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsGetWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Relation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BookmarkRelationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"relatedResourceId\":\"llolnxhsupi\",\"relatedResourceName\":\"xtabl\",\"relatedResourceType\":\"y\",\"relatedResourceKind\":\"mgsejisydhardxnk\"},\"etag\":\"qfffglftlqakie\",\"id\":\"u\",\"name\":\"prbjxe\",\"type\":\"cs\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Relation response = manager.bookmarkRelations() + .getWithResponse("jpcuzexoymfkumb", "sgsqzpgrvfag", "phlfrxrpahptv", "kfenmiflky", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("qfffglftlqakie", response.etag()); + Assertions.assertEquals("llolnxhsupi", response.relatedResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java new file mode 100644 index 000000000000..8b61ce99c04d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Relation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BookmarkRelationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"llbpegcetezaa\",\"relatedResourceName\":\"szrbttz\",\"relatedResourceType\":\"eyrw\",\"relatedResourceKind\":\"fgoyxxszpaiecurf\"},\"etag\":\"fshfmgiixurve\",\"id\":\"hsmulvmy\",\"name\":\"oefkpuuuxiuwhc\",\"type\":\"ckekmufip\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.bookmarkRelations() + .list("waoex", "ienyls", "jqygo", "shd", "ehxv", 1570316766, "fdsafgkysymhuxs", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fshfmgiixurve", response.iterator().next().etag()); + Assertions.assertEquals("llbpegcetezaa", response.iterator().next().relatedResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkTimelineItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkTimelineItemTests.java new file mode 100644 index 000000000000..0646d8bea597 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkTimelineItemTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.BookmarkTimelineItem; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class BookmarkTimelineItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BookmarkTimelineItem model = BinaryData.fromString( + "{\"kind\":\"Bookmark\",\"azureResourceId\":\"zdbigitra\",\"displayName\":\"dy\",\"notes\":\"irnbpiddvbxqxoli\",\"endTimeUtc\":\"2021-04-12T05:40:17Z\",\"startTimeUtc\":\"2021-07-29T21:39:23Z\",\"eventTime\":\"2021-12-07T05:45:15Z\",\"createdBy\":{\"email\":\"vtzy\",\"name\":\"tbayh\",\"objectId\":\"njalkiyzlkqyezyz\"},\"labels\":[\"dfdssofuxystltkq\",\"ikoiiqajfwzubf\",\"oq\",\"zbueiydoqbru\"]}") + .toObject(BookmarkTimelineItem.class); + Assertions.assertEquals("zdbigitra", model.azureResourceId()); + Assertions.assertEquals("dy", model.displayName()); + Assertions.assertEquals("irnbpiddvbxqxoli", model.notes()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T05:40:17Z"), model.endTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T21:39:23Z"), model.startTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T05:45:15Z"), model.eventTime()); + Assertions.assertEquals("njalkiyzlkqyezyz", model.createdBy().objectId()); + Assertions.assertEquals("dfdssofuxystltkq", model.labels().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateWithResponseMockTests.java index c49772bfaa9c..a2147957e686 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksCreateOrUpdateWithResponseMockTests.java @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.Bookmark; +import com.azure.resourcemanager.securityinsights.models.BookmarkEntityMappings; +import com.azure.resourcemanager.securityinsights.models.EntityFieldMapping; import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -26,55 +28,69 @@ public final class BookmarksCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"created\":\"2021-06-02T10:49:39Z\",\"createdBy\":{\"email\":\"jj\",\"name\":\"ybwfdbkjb\",\"objectId\":\"7c87954f-318a-4af8-a0a9-ee6bfdd4d195\"},\"displayName\":\"ensvkzykjtj\",\"labels\":[\"xfwush\",\"dpkupnqrmgjf\",\"pkuwxeoioj\"],\"notes\":\"zfav\",\"query\":\"jzwfb\",\"queryResult\":\"aykmmf\",\"updated\":\"2021-10-29T00:02:40Z\",\"updatedBy\":{\"email\":\"xrzxmdewsrsxkrp\",\"name\":\"jazejwwviyoyp\",\"objectId\":\"aa116b26-98f9-41fc-8b37-b5ba791f653a\"},\"eventTime\":\"2021-03-21T06:31:37Z\",\"queryStartTime\":\"2021-02-25T20:04:53Z\",\"queryEndTime\":\"2021-09-20T22:56:33Z\",\"incidentInfo\":{\"incidentId\":\"sqwjhqkbiwetpozy\",\"severity\":\"Informational\",\"title\":\"qyhgf\",\"relationName\":\"tzlexbs\"}},\"etag\":\"e\",\"id\":\"no\",\"name\":\"pziuwfbzkkdtnh\",\"type\":\"sycljsel\"}"; + = "{\"properties\":{\"created\":\"2021-08-02T16:38:22Z\",\"createdBy\":{\"email\":\"sfulookwnzotjbvh\",\"name\":\"dlo\",\"objectId\":\"qsylkkqvmmm\"},\"displayName\":\"eljcauegymcmnsm\",\"labels\":[\"tx\"],\"notes\":\"hlbibwodayi\",\"query\":\"gshkioecmbyo\",\"queryResult\":\"vbvfchfuxuqp\",\"updated\":\"2021-03-04T16:27:31Z\",\"updatedBy\":{\"email\":\"kzdshhhd\",\"name\":\"n\",\"objectId\":\"pzibmstvzzk\"},\"eventTime\":\"2021-01-21T16:23:53Z\",\"queryStartTime\":\"2021-04-28T19:32:22Z\",\"queryEndTime\":\"2021-05-27T20:49:40Z\",\"incidentInfo\":{\"incidentId\":\"akjhvpk\",\"severity\":\"Medium\",\"title\":\"hx\",\"relationName\":\"zzpauts\"},\"entityMappings\":[{\"entityType\":\"knvouyts\",\"fieldMappings\":[{},{},{}]}],\"tactics\":[\"CommandAndControl\",\"CredentialAccess\"],\"techniques\":[\"ichjkwctlsohrt\",\"pvv\"]},\"etag\":\"tegiwcmeya\",\"id\":\"z\",\"name\":\"fgvxau\",\"type\":\"mnabgrsnfzmthie\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - Bookmark response = manager.bookmarks() - .define("a") - .withExistingWorkspace("qyv", "eh") - .withEtag("eslk") - .withCreated(OffsetDateTime.parse("2021-11-16T18:17:43Z")) - .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("622c50a3-4b55-4566-a757-18bded4e2909"))) - .withDisplayName("imipskdyzatvfuz") - .withLabels(Arrays.asList("tjvv", "uxwigsyeipqdsm", "tgrqgdgkkile", "lkcsmknhwtbbae")) - .withNotes("rvvmqfloygb") - .withQuery("gwumgxdgdhpa") - .withQueryResult("dexjddvjs") - .withUpdated(OffsetDateTime.parse("2021-10-15T10:21:04Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("2c0be9fc-ea00-4fe5-9b7f-028f20d18d5c"))) - .withEventTime(OffsetDateTime.parse("2021-10-07T17:44:14Z")) - .withQueryStartTime(OffsetDateTime.parse("2021-05-27T02:17:12Z")) - .withQueryEndTime(OffsetDateTime.parse("2021-06-27T11:48:43Z")) - .withIncidentInfo(new IncidentInfo().withIncidentId("hv") - .withSeverity(IncidentSeverity.INFORMATIONAL) - .withTitle("ek") - .withRelationName("eksnbksdqhjvyk")) - .create(); + Bookmark response + = manager.bookmarks() + .define("jzofyldxkzhvfo") + .withExistingWorkspace("rnrbnjkcolozqly", "utawdmdikufzqvvk") + .withEtag("ouxpdnlbp") + .withCreated(OffsetDateTime.parse("2021-08-05T09:00:41Z")) + .withCreatedBy(new UserInfo().withObjectId("beauvldb")) + .withDisplayName("n") + .withLabels(Arrays.asList("ifqj", "oxzxbljpzauug")) + .withNotes("rfumitjaii") + .withQuery("mokfdybv") + .withQueryResult("bgmjrvrsqrjco") + .withUpdated(OffsetDateTime.parse("2021-06-19T15:11:45Z")) + .withUpdatedBy(new UserInfo().withObjectId("oqaaqjblwqw")) + .withEventTime(OffsetDateTime.parse("2021-04-14T02:29:21Z")) + .withQueryStartTime(OffsetDateTime.parse("2021-08-25T02:25:23Z")) + .withQueryEndTime(OffsetDateTime.parse("2021-08-11T11:16:34Z")) + .withIncidentInfo(new IncidentInfo().withIncidentId("wtsztxoswvfrymq") + .withSeverity(IncidentSeverity.HIGH) + .withTitle("qfcxdleohys") + .withRelationName("kbaxygwvtkrq")) + .withEntityMappings(Arrays.asList( + new BookmarkEntityMappings().withEntityType("d") + .withFieldMappings(Arrays.asList(new EntityFieldMapping(), new EntityFieldMapping(), + new EntityFieldMapping())), + new BookmarkEntityMappings().withEntityType("z") + .withFieldMappings(Arrays.asList(new EntityFieldMapping())), + new BookmarkEntityMappings().withEntityType("meipfotaaqy") + .withFieldMappings(Arrays.asList(new EntityFieldMapping(), new EntityFieldMapping())), + new BookmarkEntityMappings().withEntityType("abco") + .withFieldMappings(Arrays.asList(new EntityFieldMapping(), new EntityFieldMapping())))) + .withTactics(Arrays.asList(AttackTactic.RECONNAISSANCE)) + .withTechniques(Arrays.asList("e", "q", "sviysbvo", "ivianklqclftp")) + .create(); - Assertions.assertEquals("e", response.etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-02T10:49:39Z"), response.created()); - Assertions.assertEquals(UUID.fromString("7c87954f-318a-4af8-a0a9-ee6bfdd4d195"), - response.createdBy().objectId()); - Assertions.assertEquals("ensvkzykjtj", response.displayName()); - Assertions.assertEquals("xfwush", response.labels().get(0)); - Assertions.assertEquals("zfav", response.notes()); - Assertions.assertEquals("jzwfb", response.query()); - Assertions.assertEquals("aykmmf", response.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T00:02:40Z"), response.updated()); - Assertions.assertEquals(UUID.fromString("aa116b26-98f9-41fc-8b37-b5ba791f653a"), - response.updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-21T06:31:37Z"), response.eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T20:04:53Z"), response.queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-20T22:56:33Z"), response.queryEndTime()); - Assertions.assertEquals("sqwjhqkbiwetpozy", response.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, response.incidentInfo().severity()); - Assertions.assertEquals("qyhgf", response.incidentInfo().title()); - Assertions.assertEquals("tzlexbs", response.incidentInfo().relationName()); + Assertions.assertEquals("tegiwcmeya", response.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-02T16:38:22Z"), response.created()); + Assertions.assertEquals("qsylkkqvmmm", response.createdBy().objectId()); + Assertions.assertEquals("eljcauegymcmnsm", response.displayName()); + Assertions.assertEquals("tx", response.labels().get(0)); + Assertions.assertEquals("hlbibwodayi", response.notes()); + Assertions.assertEquals("gshkioecmbyo", response.query()); + Assertions.assertEquals("vbvfchfuxuqp", response.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T16:27:31Z"), response.updated()); + Assertions.assertEquals("pzibmstvzzk", response.updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T16:23:53Z"), response.eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T19:32:22Z"), response.queryStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-27T20:49:40Z"), response.queryEndTime()); + Assertions.assertEquals("akjhvpk", response.incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.MEDIUM, response.incidentInfo().severity()); + Assertions.assertEquals("hx", response.incidentInfo().title()); + Assertions.assertEquals("zzpauts", response.incidentInfo().relationName()); + Assertions.assertEquals("knvouyts", response.entityMappings().get(0).entityType()); + Assertions.assertEquals(AttackTactic.COMMAND_AND_CONTROL, response.tactics().get(0)); + Assertions.assertEquals("ichjkwctlsohrt", response.techniques().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteWithResponseMockTests.java index be5cca42452d..8e06560732a7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.bookmarks().deleteWithResponse("smzhhkuuipldqqct", "kva", "blhtjq", com.azure.core.util.Context.NONE); + manager.bookmarks().deleteWithResponse("ioe", "dgnuoewfgt", "mmf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetWithResponseMockTests.java index a964c41b21a2..e0572555e22e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksGetWithResponseMockTests.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.Bookmark; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import java.util.UUID; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -23,37 +23,38 @@ public final class BookmarksGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"created\":\"2021-03-25T08:01:58Z\",\"createdBy\":{\"email\":\"xkdtxfkndlqvtwkn\",\"name\":\"mmbugtywatmqaq\",\"objectId\":\"d60ac3c4-a9b4-4c1e-9e2c-4e140d6e95fb\"},\"displayName\":\"eatgroeshoy\",\"labels\":[\"byfqxkfaoy\",\"ehqpuvjmvqmt\"],\"notes\":\"ckygroejnndljdju\",\"query\":\"kb\",\"queryResult\":\"eqy\",\"updated\":\"2021-11-21T07:30:22Z\",\"updatedBy\":{\"email\":\"sfaq\",\"name\":\"pl\",\"objectId\":\"3007627c-3a7e-491b-acc7-c6cc1366c31d\"},\"eventTime\":\"2021-11-04T02:30:34Z\",\"queryStartTime\":\"2020-12-21T02:35:09Z\",\"queryEndTime\":\"2021-09-25T21:50:21Z\",\"incidentInfo\":{\"incidentId\":\"bxgkqusy\",\"severity\":\"Low\",\"title\":\"dacarvvlfnty\",\"relationName\":\"poi\"}},\"etag\":\"naz\",\"id\":\"ohzrsqalsx\",\"name\":\"dnwqapfg\",\"type\":\"dpcve\"}"; + = "{\"properties\":{\"created\":\"2021-08-28T13:20:43Z\",\"createdBy\":{\"email\":\"tohdlpcixpxxnyhi\",\"name\":\"yujq\",\"objectId\":\"fbkazylayabrdnov\"},\"displayName\":\"duwwjohg\",\"labels\":[\"kmci\"],\"notes\":\"wwhyejh\",\"query\":\"bdf\",\"queryResult\":\"yzw\",\"updated\":\"2021-08-14T23:15:08Z\",\"updatedBy\":{\"email\":\"sqb\",\"name\":\"qaqoveqowqodisp\",\"objectId\":\"xwiicf\"},\"eventTime\":\"2021-06-07T09:36:45Z\",\"queryStartTime\":\"2021-08-16T20:20:45Z\",\"queryEndTime\":\"2021-08-10T00:21:12Z\",\"incidentInfo\":{\"incidentId\":\"owkxqkw\",\"severity\":\"High\",\"title\":\"bieehpvqfifrrjpr\",\"relationName\":\"jg\"},\"entityMappings\":[{\"entityType\":\"pgqiisma\",\"fieldMappings\":[{},{}]},{\"entityType\":\"c\",\"fieldMappings\":[{},{}]}],\"tactics\":[\"Exfiltration\",\"InhibitResponseFunction\",\"PreAttack\",\"Impact\"],\"techniques\":[\"jkronxmtrhwwdfnc\",\"utyszhzlvkmirn\",\"dbza\"]},\"etag\":\"epbmogtfpksk\",\"id\":\"yohfrlyynkgnych\",\"name\":\"zhngw\",\"type\":\"bhjgl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Bookmark response = manager.bookmarks() - .getWithResponse("hvyeldotj", "dkwisw", "kukjtasb", com.azure.core.util.Context.NONE) + .getWithResponse("egemtnbke", "uukydi", "sncrzbtlrbzqtuhg", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("naz", response.etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T08:01:58Z"), response.created()); - Assertions.assertEquals(UUID.fromString("d60ac3c4-a9b4-4c1e-9e2c-4e140d6e95fb"), - response.createdBy().objectId()); - Assertions.assertEquals("eatgroeshoy", response.displayName()); - Assertions.assertEquals("byfqxkfaoy", response.labels().get(0)); - Assertions.assertEquals("ckygroejnndljdju", response.notes()); - Assertions.assertEquals("kb", response.query()); - Assertions.assertEquals("eqy", response.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T07:30:22Z"), response.updated()); - Assertions.assertEquals(UUID.fromString("3007627c-3a7e-491b-acc7-c6cc1366c31d"), - response.updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T02:30:34Z"), response.eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T02:35:09Z"), response.queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T21:50:21Z"), response.queryEndTime()); - Assertions.assertEquals("bxgkqusy", response.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.LOW, response.incidentInfo().severity()); - Assertions.assertEquals("dacarvvlfnty", response.incidentInfo().title()); - Assertions.assertEquals("poi", response.incidentInfo().relationName()); + Assertions.assertEquals("epbmogtfpksk", response.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T13:20:43Z"), response.created()); + Assertions.assertEquals("fbkazylayabrdnov", response.createdBy().objectId()); + Assertions.assertEquals("duwwjohg", response.displayName()); + Assertions.assertEquals("kmci", response.labels().get(0)); + Assertions.assertEquals("wwhyejh", response.notes()); + Assertions.assertEquals("bdf", response.query()); + Assertions.assertEquals("yzw", response.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T23:15:08Z"), response.updated()); + Assertions.assertEquals("xwiicf", response.updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T09:36:45Z"), response.eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T20:20:45Z"), response.queryStartTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T00:21:12Z"), response.queryEndTime()); + Assertions.assertEquals("owkxqkw", response.incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.HIGH, response.incidentInfo().severity()); + Assertions.assertEquals("bieehpvqfifrrjpr", response.incidentInfo().title()); + Assertions.assertEquals("jg", response.incidentInfo().relationName()); + Assertions.assertEquals("pgqiisma", response.entityMappings().get(0).entityType()); + Assertions.assertEquals(AttackTactic.EXFILTRATION, response.tactics().get(0)); + Assertions.assertEquals("jkronxmtrhwwdfnc", response.techniques().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListMockTests.java index 665a8c0e13ae..412ddf1e11de 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarksListMockTests.java @@ -1,21 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.Bookmark; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import java.util.UUID; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -24,37 +24,39 @@ public final class BookmarksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"created\":\"2021-11-16T18:34:33Z\",\"createdBy\":{\"email\":\"wjjstliuhqa\",\"name\":\"oaiancznvodrrs\",\"objectId\":\"dc6948c0-897f-4ea2-b171-d197ed89bc8b\"},\"displayName\":\"lxydkxrxv\",\"labels\":[\"iwkgfbqljnq\",\"hychocokuleh\",\"rqlrqffawe\"],\"notes\":\"rkphyjdxr\",\"query\":\"vjuqdbrxmrgchb\",\"queryResult\":\"xk\",\"updated\":\"2021-01-07T08:52:04Z\",\"updatedBy\":{\"email\":\"kbajbu\",\"name\":\"gd\",\"objectId\":\"e0d696a9-4ac3-4e52-a75f-0a4c35f7e486\"},\"eventTime\":\"2021-07-19T21:01:06Z\",\"queryStartTime\":\"2021-03-11T15:48:32Z\",\"queryEndTime\":\"2021-08-21T01:03:20Z\",\"incidentInfo\":{\"incidentId\":\"vpmclujyxkyxlz\",\"severity\":\"High\",\"title\":\"kzzltafhbzf\",\"relationName\":\"vwmbjlzqsczpg\"}},\"etag\":\"wnapfdq\",\"id\":\"wf\",\"name\":\"ptnuwjtkschgc\",\"type\":\"qyhleseyq\"}]}"; + = "{\"value\":[{\"properties\":{\"created\":\"2021-01-31T13:04:12Z\",\"createdBy\":{\"email\":\"xjgkrppm\",\"name\":\"oqtwqciqawhkdkva\",\"objectId\":\"pbds\"},\"displayName\":\"otidikxmtmjkfmr\",\"labels\":[\"rjsqtirhabhhpcvs\",\"yjmbydr\",\"xvnmtjmuxrdmu\"],\"notes\":\"ruogmth\",\"query\":\"qcyycxlllk\",\"queryResult\":\"gjl\",\"updated\":\"2021-08-07T01:52:51Z\",\"updatedBy\":{\"email\":\"iebqvuscmcegyi\",\"name\":\"ouplamdgf\",\"objectId\":\"x\"},\"eventTime\":\"2021-09-07T17:52:12Z\",\"queryStartTime\":\"2021-08-08T10:37:20Z\",\"queryEndTime\":\"2021-11-25T18:01:35Z\",\"incidentInfo\":{\"incidentId\":\"tjpsjwlpcxljz\",\"severity\":\"Low\",\"title\":\"gtuaoouocafaxv\",\"relationName\":\"rpbnrolgelsgnenj\"},\"entityMappings\":[{\"entityType\":\"wdmrqahlbyjah\",\"fieldMappings\":[{},{},{}]}],\"tactics\":[\"Persistence\",\"Exfiltration\",\"PrivilegeEscalation\",\"Impact\"],\"techniques\":[\"vphmjyzicelrlaz\",\"gwnibnd\",\"qgjibrxxiaocr\",\"uhumgw\"]},\"etag\":\"ugnvhtgwa\",\"id\":\"dokoxqbozezxzw\",\"name\":\"nrgukqobovql\",\"type\":\"tqlquf\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.bookmarks().list("ejdtxptl", "h", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.bookmarks().list("xtyavvexjqdj", "o", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wnapfdq", response.iterator().next().etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-16T18:34:33Z"), response.iterator().next().created()); - Assertions.assertEquals(UUID.fromString("dc6948c0-897f-4ea2-b171-d197ed89bc8b"), - response.iterator().next().createdBy().objectId()); - Assertions.assertEquals("lxydkxrxv", response.iterator().next().displayName()); - Assertions.assertEquals("iwkgfbqljnq", response.iterator().next().labels().get(0)); - Assertions.assertEquals("rkphyjdxr", response.iterator().next().notes()); - Assertions.assertEquals("vjuqdbrxmrgchb", response.iterator().next().query()); - Assertions.assertEquals("xk", response.iterator().next().queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-07T08:52:04Z"), response.iterator().next().updated()); - Assertions.assertEquals(UUID.fromString("e0d696a9-4ac3-4e52-a75f-0a4c35f7e486"), - response.iterator().next().updatedBy().objectId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T21:01:06Z"), response.iterator().next().eventTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-11T15:48:32Z"), + Assertions.assertEquals("ugnvhtgwa", response.iterator().next().etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T13:04:12Z"), response.iterator().next().created()); + Assertions.assertEquals("pbds", response.iterator().next().createdBy().objectId()); + Assertions.assertEquals("otidikxmtmjkfmr", response.iterator().next().displayName()); + Assertions.assertEquals("rjsqtirhabhhpcvs", response.iterator().next().labels().get(0)); + Assertions.assertEquals("ruogmth", response.iterator().next().notes()); + Assertions.assertEquals("qcyycxlllk", response.iterator().next().query()); + Assertions.assertEquals("gjl", response.iterator().next().queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T01:52:51Z"), response.iterator().next().updated()); + Assertions.assertEquals("x", response.iterator().next().updatedBy().objectId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T17:52:12Z"), response.iterator().next().eventTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-08T10:37:20Z"), response.iterator().next().queryStartTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T01:03:20Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-11-25T18:01:35Z"), response.iterator().next().queryEndTime()); - Assertions.assertEquals("vpmclujyxkyxlz", response.iterator().next().incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.HIGH, response.iterator().next().incidentInfo().severity()); - Assertions.assertEquals("kzzltafhbzf", response.iterator().next().incidentInfo().title()); - Assertions.assertEquals("vwmbjlzqsczpg", response.iterator().next().incidentInfo().relationName()); + Assertions.assertEquals("tjpsjwlpcxljz", response.iterator().next().incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.LOW, response.iterator().next().incidentInfo().severity()); + Assertions.assertEquals("gtuaoouocafaxv", response.iterator().next().incidentInfo().title()); + Assertions.assertEquals("rpbnrolgelsgnenj", response.iterator().next().incidentInfo().relationName()); + Assertions.assertEquals("wdmrqahlbyjah", response.iterator().next().entityMappings().get(0).entityType()); + Assertions.assertEquals(AttackTactic.PERSISTENCE, response.iterator().next().tactics().get(0)); + Assertions.assertEquals("vphmjyzicelrlaz", response.iterator().next().techniques().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BooleanConditionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BooleanConditionPropertiesTests.java new file mode 100644 index 000000000000..14e635d70b15 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BooleanConditionPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanCondition; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleBooleanConditionSupportedOperator; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleCondition; +import com.azure.resourcemanager.securityinsights.models.BooleanConditionProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class BooleanConditionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BooleanConditionProperties model = BinaryData.fromString( + "{\"conditionType\":\"Boolean\",\"conditionProperties\":{\"operator\":\"Or\",\"innerConditions\":[{\"conditionType\":\"AutomationRuleCondition\"}]}}") + .toObject(BooleanConditionProperties.class); + Assertions.assertEquals(AutomationRuleBooleanConditionSupportedOperator.OR, + model.conditionProperties().operator()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BooleanConditionProperties model = new BooleanConditionProperties().withConditionProperties( + new AutomationRuleBooleanCondition().withOperator(AutomationRuleBooleanConditionSupportedOperator.OR) + .withInnerConditions(Arrays.asList(new AutomationRuleCondition()))); + model = BinaryData.fromObject(model).toObject(BooleanConditionProperties.class); + Assertions.assertEquals(AutomationRuleBooleanConditionSupportedOperator.OR, + model.conditionProperties().operator()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpAuthConfigTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpAuthConfigTests.java new file mode 100644 index 000000000000..7aa1b0be12d2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpAuthConfigTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CcpAuthConfig; + +public final class CcpAuthConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CcpAuthConfig model = BinaryData.fromString("{\"type\":\"CcpAuthConfig\"}").toObject(CcpAuthConfig.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CcpAuthConfig model = new CcpAuthConfig(); + model = BinaryData.fromObject(model).toObject(CcpAuthConfig.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpResponseConfigTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpResponseConfigTests.java new file mode 100644 index 000000000000..df41953ebf04 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CcpResponseConfigTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CcpResponseConfig; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CcpResponseConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CcpResponseConfig model = BinaryData.fromString( + "{\"eventsJsonPaths\":[\"ciqgjjrlhiqlwixv\"],\"successStatusJsonPath\":\"ougu\",\"successStatusValue\":\"n\",\"isGzipCompressed\":false,\"compressionAlgo\":\"jtt\",\"format\":\"sualapdlndbeaqbk\",\"csvDelimiter\":\"vvlwynpbbf\",\"hasCsvBoundary\":false,\"hasCsvHeader\":true,\"convertChildPropertiesToArray\":true,\"csvEscape\":\"ugzfeuzjl\"}") + .toObject(CcpResponseConfig.class); + Assertions.assertEquals("ciqgjjrlhiqlwixv", model.eventsJsonPaths().get(0)); + Assertions.assertEquals("ougu", model.successStatusJsonPath()); + Assertions.assertEquals("n", model.successStatusValue()); + Assertions.assertFalse(model.isGzipCompressed()); + Assertions.assertEquals("jtt", model.compressionAlgo()); + Assertions.assertEquals("sualapdlndbeaqbk", model.format()); + Assertions.assertEquals("vvlwynpbbf", model.csvDelimiter()); + Assertions.assertFalse(model.hasCsvBoundary()); + Assertions.assertTrue(model.hasCsvHeader()); + Assertions.assertTrue(model.convertChildPropertiesToArray()); + Assertions.assertEquals("ugzfeuzjl", model.csvEscape()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CcpResponseConfig model = new CcpResponseConfig().withEventsJsonPaths(Arrays.asList("ciqgjjrlhiqlwixv")) + .withSuccessStatusJsonPath("ougu") + .withSuccessStatusValue("n") + .withIsGzipCompressed(false) + .withCompressionAlgo("jtt") + .withFormat("sualapdlndbeaqbk") + .withCsvDelimiter("vvlwynpbbf") + .withHasCsvBoundary(false) + .withHasCsvHeader(true) + .withConvertChildPropertiesToArray(true) + .withCsvEscape("ugzfeuzjl"); + model = BinaryData.fromObject(model).toObject(CcpResponseConfig.class); + Assertions.assertEquals("ciqgjjrlhiqlwixv", model.eventsJsonPaths().get(0)); + Assertions.assertEquals("ougu", model.successStatusJsonPath()); + Assertions.assertEquals("n", model.successStatusValue()); + Assertions.assertFalse(model.isGzipCompressed()); + Assertions.assertEquals("jtt", model.compressionAlgo()); + Assertions.assertEquals("sualapdlndbeaqbk", model.format()); + Assertions.assertEquals("vvlwynpbbf", model.csvDelimiter()); + Assertions.assertFalse(model.hasCsvBoundary()); + Assertions.assertTrue(model.hasCsvHeader()); + Assertions.assertTrue(model.convertChildPropertiesToArray()); + Assertions.assertEquals("ugzfeuzjl", model.csvEscape()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ClientInfoTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ClientInfoTests.java index be6d3ec4a3fa..1838069cfea2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ClientInfoTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ClientInfoTests.java @@ -1,36 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.ClientInfo; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class ClientInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ClientInfo model = BinaryData.fromString( - "{\"email\":\"ypnddhsgcb\",\"name\":\"phejkotynqgoulz\",\"objectId\":\"e8d52ac3-8832-42e0-9085-4ca135c7369f\",\"userPrincipalName\":\"i\"}") + "{\"email\":\"zvytnrzvuljraaer\",\"name\":\"okqgukkjq\",\"objectId\":\"broyla\",\"userPrincipalName\":\"ulcdisdosf\"}") .toObject(ClientInfo.class); - Assertions.assertEquals("ypnddhsgcb", model.email()); - Assertions.assertEquals("phejkotynqgoulz", model.name()); - Assertions.assertEquals(UUID.fromString("e8d52ac3-8832-42e0-9085-4ca135c7369f"), model.objectId()); - Assertions.assertEquals("i", model.userPrincipalName()); + Assertions.assertEquals("zvytnrzvuljraaer", model.email()); + Assertions.assertEquals("okqgukkjq", model.name()); + Assertions.assertEquals("broyla", model.objectId()); + Assertions.assertEquals("ulcdisdosf", model.userPrincipalName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClientInfo model = new ClientInfo().withEmail("ypnddhsgcb") - .withName("phejkotynqgoulz") - .withObjectId(UUID.fromString("e8d52ac3-8832-42e0-9085-4ca135c7369f")) - .withUserPrincipalName("i"); + ClientInfo model = new ClientInfo().withEmail("zvytnrzvuljraaer") + .withName("okqgukkjq") + .withObjectId("broyla") + .withUserPrincipalName("ulcdisdosf"); model = BinaryData.fromObject(model).toObject(ClientInfo.class); - Assertions.assertEquals("ypnddhsgcb", model.email()); - Assertions.assertEquals("phejkotynqgoulz", model.name()); - Assertions.assertEquals(UUID.fromString("e8d52ac3-8832-42e0-9085-4ca135c7369f"), model.objectId()); - Assertions.assertEquals("i", model.userPrincipalName()); + Assertions.assertEquals("zvytnrzvuljraaer", model.email()); + Assertions.assertEquals("okqgukkjq", model.name()); + Assertions.assertEquals("broyla", model.objectId()); + Assertions.assertEquals("ulcdisdosf", model.userPrincipalName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityPropertiesTests.java index 535beccf7a23..310ffeebbfed 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class CloudApplicationEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CloudApplicationEntityProperties model = BinaryData.fromString( - "{\"appId\":1918015991,\"appName\":\"hkfkimrtixokf\",\"instanceName\":\"yinljqe\",\"additionalData\":{\"monstshiyxgve\":\"datahi\",\"wcobie\":\"datafclduccbirdsv\",\"gshejjtbxqmulux\":\"datastmninwjizcilng\"},\"friendlyName\":\"qzvnersbycucr\"}") + "{\"appId\":1207992775,\"appName\":\"ikcyyc\",\"instanceName\":\"nsjlpjrtws\",\"additionalData\":{\"vtrrmhwrbfdpyflu\":\"\\\"datavuicp\\\"\"},\"friendlyName\":\"vjglrocuyzlwhhme\"}") .toObject(CloudApplicationEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudApplicationEntityProperties model = new CloudApplicationEntityProperties(); - model = BinaryData.fromObject(model).toObject(CloudApplicationEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityTests.java index 7eefb192a045..00450a0d9b28 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CloudApplicationEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class CloudApplicationEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CloudApplicationEntity model = BinaryData.fromString( - "{\"kind\":\"CloudApplication\",\"properties\":{\"appId\":1420965357,\"appName\":\"lafzvaylptr\",\"instanceName\":\"qwztcmwqkc\",\"additionalData\":{\"xfdeqvhpsyl\":\"datawaxfewzjkj\",\"bffmbmxz\":\"dataksh\",\"jx\":\"datargywwp\"},\"friendlyName\":\"ptfujgicgaaoept\"},\"id\":\"qutdewemxs\",\"name\":\"vru\",\"type\":\"nz\"}") + "{\"kind\":\"CloudApplication\",\"properties\":{\"appId\":1929507655,\"appName\":\"cudfbsfarfsiowl\",\"instanceName\":\"xnq\",\"additionalData\":{\"tmhqykiz\":\"\\\"datagf\\\"\",\"saoafcluqvox\":\"\\\"datad\\\"\",\"gwe\":\"\\\"dataycjimryvwgcwwpbm\\\"\",\"efoh\":\"\\\"dataydsx\\\"\"},\"friendlyName\":\"bvopwndyqle\"},\"id\":\"lklmtkhlo\",\"name\":\"kxxpvbrd\",\"type\":\"jmzsyzfh\"}") .toObject(CloudApplicationEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudApplicationEntity model = new CloudApplicationEntity(); - model = BinaryData.fromObject(model).toObject(CloudApplicationEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingRequestPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingRequestPropertiesTests.java new file mode 100644 index 000000000000..cd1f48d45d1a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingRequestPropertiesTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingRequestProperties; +import org.junit.jupiter.api.Assertions; + +public final class CodelessConnectorPollingRequestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessConnectorPollingRequestProperties model = BinaryData.fromString( + "{\"apiEndpoint\":\"p\",\"rateLimitQps\":1983453114,\"queryWindowInMin\":1176807480,\"httpMethod\":\"ybszfncnpatpf\",\"queryTimeFormat\":\"saebwfwhxorpwal\",\"retryCount\":809458754,\"timeoutInSeconds\":1877042144,\"headers\":\"\\\"dataxojfcc\\\"\",\"queryParameters\":\"\\\"datah\\\"\",\"queryParametersTemplate\":\"hthvazjpwex\",\"startTimeAttributeName\":\"rzprobzzxe\",\"endTimeAttributeName\":\"nrkjgpjeuxsph\"}") + .toObject(CodelessConnectorPollingRequestProperties.class); + Assertions.assertEquals("p", model.apiEndpoint()); + Assertions.assertEquals(1983453114, model.rateLimitQps()); + Assertions.assertEquals(1176807480, model.queryWindowInMin()); + Assertions.assertEquals("ybszfncnpatpf", model.httpMethod()); + Assertions.assertEquals("saebwfwhxorpwal", model.queryTimeFormat()); + Assertions.assertEquals(809458754, model.retryCount()); + Assertions.assertEquals(1877042144, model.timeoutInSeconds()); + Assertions.assertEquals("hthvazjpwex", model.queryParametersTemplate()); + Assertions.assertEquals("rzprobzzxe", model.startTimeAttributeName()); + Assertions.assertEquals("nrkjgpjeuxsph", model.endTimeAttributeName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessConnectorPollingRequestProperties model + = new CodelessConnectorPollingRequestProperties().withApiEndpoint("p") + .withRateLimitQps(1983453114) + .withQueryWindowInMin(1176807480) + .withHttpMethod("ybszfncnpatpf") + .withQueryTimeFormat("saebwfwhxorpwal") + .withRetryCount(809458754) + .withTimeoutInSeconds(1877042144) + .withHeaders("\"dataxojfcc\"") + .withQueryParameters("\"datah\"") + .withQueryParametersTemplate("hthvazjpwex") + .withStartTimeAttributeName("rzprobzzxe") + .withEndTimeAttributeName("nrkjgpjeuxsph"); + model = BinaryData.fromObject(model).toObject(CodelessConnectorPollingRequestProperties.class); + Assertions.assertEquals("p", model.apiEndpoint()); + Assertions.assertEquals(1983453114, model.rateLimitQps()); + Assertions.assertEquals(1176807480, model.queryWindowInMin()); + Assertions.assertEquals("ybszfncnpatpf", model.httpMethod()); + Assertions.assertEquals("saebwfwhxorpwal", model.queryTimeFormat()); + Assertions.assertEquals(809458754, model.retryCount()); + Assertions.assertEquals(1877042144, model.timeoutInSeconds()); + Assertions.assertEquals("hthvazjpwex", model.queryParametersTemplate()); + Assertions.assertEquals("rzprobzzxe", model.startTimeAttributeName()); + Assertions.assertEquals("nrkjgpjeuxsph", model.endTimeAttributeName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingResponsePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingResponsePropertiesTests.java new file mode 100644 index 000000000000..3bdefe1c68be --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessConnectorPollingResponsePropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingResponseProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CodelessConnectorPollingResponsePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessConnectorPollingResponseProperties model = BinaryData.fromString( + "{\"eventsJsonPaths\":[\"bz\"],\"successStatusJsonPath\":\"k\",\"successStatusValue\":\"utibhlen\",\"isGzipCompressed\":false}") + .toObject(CodelessConnectorPollingResponseProperties.class); + Assertions.assertEquals("bz", model.eventsJsonPaths().get(0)); + Assertions.assertEquals("k", model.successStatusJsonPath()); + Assertions.assertEquals("utibhlen", model.successStatusValue()); + Assertions.assertFalse(model.isGzipCompressed()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessConnectorPollingResponseProperties model + = new CodelessConnectorPollingResponseProperties().withEventsJsonPaths(Arrays.asList("bz")) + .withSuccessStatusJsonPath("k") + .withSuccessStatusValue("utibhlen") + .withIsGzipCompressed(false); + model = BinaryData.fromObject(model).toObject(CodelessConnectorPollingResponseProperties.class); + Assertions.assertEquals("bz", model.eventsJsonPaths().get(0)); + Assertions.assertEquals("k", model.successStatusJsonPath()); + Assertions.assertEquals("utibhlen", model.successStatusValue()); + Assertions.assertFalse(model.isGzipCompressed()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessParametersTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessParametersTests.java new file mode 100644 index 000000000000..1c923739b30f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessParametersTests.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.CodelessParameters; +import com.azure.resourcemanager.securityinsights.models.Availability; +import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; +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.ConnectivityType; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +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.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CodelessParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessParameters model = BinaryData.fromString( + "{\"connectorUiConfig\":{\"title\":\"wzt\",\"publisher\":\"detjygowi\",\"descriptionMarkdown\":\"cq\",\"customImage\":\"lzkgysdgzyybzo\",\"graphQueriesTableName\":\"lvoc\",\"graphQueries\":[{\"metricName\":\"dxxheigmlilwz\",\"legend\":\"jhjvmabzzbw\",\"baseQuery\":\"b\"},{\"metricName\":\"d\",\"legend\":\"bgymqt\",\"baseQuery\":\"preojxrjnbsconxa\"}],\"sampleQueries\":[{\"description\":\"neychbjizq\",\"query\":\"gnwdxz\"},{\"description\":\"p\",\"query\":\"rfbo\"}],\"dataTypes\":[{\"name\":\"p\",\"lastDataReceivedQuery\":\"nfy\"}],\"connectivityCriteria\":[{\"type\":\"IsConnectedQuery\",\"value\":[\"ypi\",\"dbkp\",\"jtaqhsmqazpdg\"]},{\"type\":\"IsConnectedQuery\",\"value\":[\"shthmgpczqu\"]}],\"availability\":{\"status\":1,\"isPreview\":true},\"permissions\":{\"resourceProvider\":[{\"provider\":\"microsoft.aadiam/diagnosticSettings\",\"permissionsDisplayText\":\"zhigqqbtimpkj\",\"providerDisplayName\":\"o\",\"scope\":\"ResourceGroup\",\"requiredPermissions\":{\"action\":true,\"write\":false,\"read\":true,\"delete\":false}},{\"provider\":\"Microsoft.OperationalInsights/solutions\",\"permissionsDisplayText\":\"awja\",\"providerDisplayName\":\"wj\",\"scope\":\"Subscription\",\"requiredPermissions\":{\"action\":true,\"write\":true,\"read\":false,\"delete\":false}},{\"provider\":\"Microsoft.Authorization/policyAssignments\",\"permissionsDisplayText\":\"anosj\",\"providerDisplayName\":\"irnb\",\"scope\":\"Workspace\",\"requiredPermissions\":{\"action\":true,\"write\":false,\"read\":true,\"delete\":true}}],\"customs\":[{\"name\":\"mpftm\",\"description\":\"e\"}]},\"instructionSteps\":[{\"title\":\"gsy\",\"description\":\"etamfddrvlkpzwb\",\"instructions\":[{\"parameters\":\"\\\"datacc\\\"\",\"type\":\"InfoMessage\"},{\"parameters\":\"\\\"datadrmuhka\\\"\",\"type\":\"InfoMessage\"},{\"parameters\":\"\\\"dataedbiucvkhhwmjpjb\\\"\",\"type\":\"CopyableLabel\"}]},{\"title\":\"nx\",\"description\":\"rrihufoi\",\"instructions\":[{\"parameters\":\"\\\"dataybxvgn\\\"\",\"type\":\"InfoMessage\"},{\"parameters\":\"\\\"datap\\\"\",\"type\":\"InfoMessage\"},{\"parameters\":\"\\\"datazc\\\"\",\"type\":\"InfoMessage\"},{\"parameters\":\"\\\"dataiuzvkunhdimju\\\"\",\"type\":\"InfoMessage\"}]}]}}") + .toObject(CodelessParameters.class); + Assertions.assertEquals("wzt", model.connectorUiConfig().title()); + Assertions.assertEquals("detjygowi", model.connectorUiConfig().publisher()); + Assertions.assertEquals("cq", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("lzkgysdgzyybzo", model.connectorUiConfig().customImage()); + Assertions.assertEquals("lvoc", model.connectorUiConfig().graphQueriesTableName()); + Assertions.assertEquals("dxxheigmlilwz", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("jhjvmabzzbw", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("b", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("neychbjizq", model.connectorUiConfig().sampleQueries().get(0).description()); + Assertions.assertEquals("gnwdxz", model.connectorUiConfig().sampleQueries().get(0).query()); + Assertions.assertEquals("p", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("nfy", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, + model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("ypi", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(AvailabilityStatus.ONE, model.connectorUiConfig().availability().status()); + Assertions.assertTrue(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals(ProviderName.MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS, + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("zhigqqbtimpkj", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("o", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.RESOURCE_GROUP, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions.assertTrue( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertFalse( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions + .assertTrue(model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertFalse( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertEquals("mpftm", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("e", model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("gsy", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("etamfddrvlkpzwb", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals(SettingType.INFO_MESSAGE, + model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessParameters model + = new CodelessParameters().withConnectorUiConfig(new CodelessUiConnectorConfigProperties().withTitle("wzt") + .withPublisher("detjygowi") + .withDescriptionMarkdown("cq") + .withCustomImage("lzkgysdgzyybzo") + .withGraphQueriesTableName("lvoc") + .withGraphQueries(Arrays.asList( + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("dxxheigmlilwz") + .withLegend("jhjvmabzzbw") + .withBaseQuery("b"), + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("d") + .withLegend("bgymqt") + .withBaseQuery("preojxrjnbsconxa"))) + .withSampleQueries(Arrays.asList( + new CodelessUiConnectorConfigPropertiesSampleQueriesItem().withDescription("neychbjizq") + .withQuery("gnwdxz"), + new CodelessUiConnectorConfigPropertiesSampleQueriesItem().withDescription("p").withQuery("rfbo"))) + .withDataTypes(Arrays.asList(new CodelessUiConnectorConfigPropertiesDataTypesItem().withName("p") + .withLastDataReceivedQuery("nfy"))) + .withConnectivityCriteria(Arrays.asList( + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("ypi", "dbkp", "jtaqhsmqazpdg")), + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("shthmgpczqu")))) + .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) + .withPermissions(new Permissions() + .withResourceProvider(Arrays.asList( + new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS) + .withPermissionsDisplayText("zhigqqbtimpkj") + .withProviderDisplayName("o") + .withScope(PermissionProviderScope.RESOURCE_GROUP) + .withRequiredPermissions(new RequiredPermissions().withAction(true) + .withWrite(false) + .withRead(true) + .withDelete(false)), + new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS) + .withPermissionsDisplayText("awja") + .withProviderDisplayName("wj") + .withScope(PermissionProviderScope.SUBSCRIPTION) + .withRequiredPermissions(new RequiredPermissions().withAction(true) + .withWrite(true) + .withRead(false) + .withDelete(false)), + new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS) + .withPermissionsDisplayText("anosj") + .withProviderDisplayName("irnb") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions(new RequiredPermissions().withAction(true) + .withWrite(false) + .withRead(true) + .withDelete(true)))) + .withCustoms(Arrays.asList(new PermissionsCustomsItem().withName("mpftm").withDescription("e")))) + .withInstructionSteps(Arrays.asList( + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("gsy") + .withDescription("etamfddrvlkpzwb") + .withInstructions(Arrays.asList( + new InstructionStepsInstructionsItem().withParameters("\"datacc\"") + .withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withParameters("\"datadrmuhka\"") + .withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withParameters("\"dataedbiucvkhhwmjpjb\"") + .withType(SettingType.COPYABLE_LABEL))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("nx") + .withDescription("rrihufoi") + .withInstructions(Arrays.asList( + new InstructionStepsInstructionsItem().withParameters("\"dataybxvgn\"") + .withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withParameters("\"datap\"") + .withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withParameters("\"datazc\"") + .withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withParameters("\"dataiuzvkunhdimju\"") + .withType(SettingType.INFO_MESSAGE)))))); + model = BinaryData.fromObject(model).toObject(CodelessParameters.class); + Assertions.assertEquals("wzt", model.connectorUiConfig().title()); + Assertions.assertEquals("detjygowi", model.connectorUiConfig().publisher()); + Assertions.assertEquals("cq", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("lzkgysdgzyybzo", model.connectorUiConfig().customImage()); + Assertions.assertEquals("lvoc", model.connectorUiConfig().graphQueriesTableName()); + Assertions.assertEquals("dxxheigmlilwz", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("jhjvmabzzbw", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("b", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("neychbjizq", model.connectorUiConfig().sampleQueries().get(0).description()); + Assertions.assertEquals("gnwdxz", model.connectorUiConfig().sampleQueries().get(0).query()); + Assertions.assertEquals("p", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("nfy", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, + model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("ypi", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(AvailabilityStatus.ONE, model.connectorUiConfig().availability().status()); + Assertions.assertTrue(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals(ProviderName.MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS, + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("zhigqqbtimpkj", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("o", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.RESOURCE_GROUP, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions.assertTrue( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertFalse( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions + .assertTrue(model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertFalse( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertEquals("mpftm", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("e", model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("gsy", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("etamfddrvlkpzwb", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals(SettingType.INFO_MESSAGE, + model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItemTests.java new file mode 100644 index 000000000000..6dc89089a39c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItemTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem; +import com.azure.resourcemanager.securityinsights.models.ConnectivityType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem model = BinaryData + .fromString("{\"type\":\"IsConnectedQuery\",\"value\":[\"hfnzocx\",\"tfshksnyzm\",\"pamwbw\",\"bnl\"]}") + .toObject(CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.class); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, model.type()); + Assertions.assertEquals("hfnzocx", model.value().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem model + = new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("hfnzocx", "tfshksnyzm", "pamwbw", "bnl")); + model + = BinaryData.fromObject(model).toObject(CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.class); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, model.type()); + Assertions.assertEquals("hfnzocx", model.value().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesDataTypesItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesDataTypesItemTests.java new file mode 100644 index 000000000000..a548adc21a00 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesDataTypesItemTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesDataTypesItem; +import org.junit.jupiter.api.Assertions; + +public final class CodelessUiConnectorConfigPropertiesDataTypesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessUiConnectorConfigPropertiesDataTypesItem model + = BinaryData.fromString("{\"name\":\"gizmshxxbaizabu\",\"lastDataReceivedQuery\":\"vgs\"}") + .toObject(CodelessUiConnectorConfigPropertiesDataTypesItem.class); + Assertions.assertEquals("gizmshxxbaizabu", model.name()); + Assertions.assertEquals("vgs", model.lastDataReceivedQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessUiConnectorConfigPropertiesDataTypesItem model + = new CodelessUiConnectorConfigPropertiesDataTypesItem().withName("gizmshxxbaizabu") + .withLastDataReceivedQuery("vgs"); + model = BinaryData.fromObject(model).toObject(CodelessUiConnectorConfigPropertiesDataTypesItem.class); + Assertions.assertEquals("gizmshxxbaizabu", model.name()); + Assertions.assertEquals("vgs", model.lastDataReceivedQuery()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesGraphQueriesItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesGraphQueriesItemTests.java new file mode 100644 index 000000000000..1b9fb4ea6832 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesGraphQueriesItemTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesGraphQueriesItem; +import org.junit.jupiter.api.Assertions; + +public final class CodelessUiConnectorConfigPropertiesGraphQueriesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessUiConnectorConfigPropertiesGraphQueriesItem model = BinaryData + .fromString("{\"metricName\":\"isnionetbzdrdpue\",\"legend\":\"kgtlzl\",\"baseQuery\":\"rlxcznnhz\"}") + .toObject(CodelessUiConnectorConfigPropertiesGraphQueriesItem.class); + Assertions.assertEquals("isnionetbzdrdpue", model.metricName()); + Assertions.assertEquals("kgtlzl", model.legend()); + Assertions.assertEquals("rlxcznnhz", model.baseQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessUiConnectorConfigPropertiesGraphQueriesItem model + = new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("isnionetbzdrdpue") + .withLegend("kgtlzl") + .withBaseQuery("rlxcznnhz"); + model = BinaryData.fromObject(model).toObject(CodelessUiConnectorConfigPropertiesGraphQueriesItem.class); + Assertions.assertEquals("isnionetbzdrdpue", model.metricName()); + Assertions.assertEquals("kgtlzl", model.legend()); + Assertions.assertEquals("rlxcznnhz", model.baseQuery()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesInstructionStepsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesInstructionStepsItemTests.java new file mode 100644 index 000000000000..4c7413c4384c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesInstructionStepsItemTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesInstructionStepsItem; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CodelessUiConnectorConfigPropertiesInstructionStepsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessUiConnectorConfigPropertiesInstructionStepsItem model = BinaryData.fromString( + "{\"title\":\"odmkrrwepgqv\",\"description\":\"kqlujqgira\",\"instructions\":[{\"parameters\":\"\\\"datavxchpqvct\\\"\",\"type\":\"InfoMessage\"},{\"parameters\":\"\\\"dataeuhwwskn\\\"\",\"type\":\"InstructionStepsGroup\"}]}") + .toObject(CodelessUiConnectorConfigPropertiesInstructionStepsItem.class); + Assertions.assertEquals("odmkrrwepgqv", model.title()); + Assertions.assertEquals("kqlujqgira", model.description()); + Assertions.assertEquals(SettingType.INFO_MESSAGE, model.instructions().get(0).type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessUiConnectorConfigPropertiesInstructionStepsItem model + = new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("odmkrrwepgqv") + .withDescription("kqlujqgira") + .withInstructions(Arrays.asList( + new InstructionStepsInstructionsItem().withParameters("\"datavxchpqvct\"") + .withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withParameters("\"dataeuhwwskn\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP))); + model = BinaryData.fromObject(model).toObject(CodelessUiConnectorConfigPropertiesInstructionStepsItem.class); + Assertions.assertEquals("odmkrrwepgqv", model.title()); + Assertions.assertEquals("kqlujqgira", model.description()); + Assertions.assertEquals(SettingType.INFO_MESSAGE, model.instructions().get(0).type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesSampleQueriesItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesSampleQueriesItemTests.java new file mode 100644 index 000000000000..d0ae4e673a1e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesSampleQueriesItemTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigPropertiesSampleQueriesItem; +import org.junit.jupiter.api.Assertions; + +public final class CodelessUiConnectorConfigPropertiesSampleQueriesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessUiConnectorConfigPropertiesSampleQueriesItem model + = BinaryData.fromString("{\"description\":\"gbjmlr\",\"query\":\"srfwsszvlcwl\"}") + .toObject(CodelessUiConnectorConfigPropertiesSampleQueriesItem.class); + Assertions.assertEquals("gbjmlr", model.description()); + Assertions.assertEquals("srfwsszvlcwl", model.query()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessUiConnectorConfigPropertiesSampleQueriesItem model + = new CodelessUiConnectorConfigPropertiesSampleQueriesItem().withDescription("gbjmlr") + .withQuery("srfwsszvlcwl"); + model = BinaryData.fromObject(model).toObject(CodelessUiConnectorConfigPropertiesSampleQueriesItem.class); + Assertions.assertEquals("gbjmlr", model.description()); + Assertions.assertEquals("srfwsszvlcwl", model.query()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesTests.java new file mode 100644 index 000000000000..4a4d7d755629 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiConnectorConfigPropertiesTests.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Availability; +import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; +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.ConnectivityType; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +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.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CodelessUiConnectorConfigPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessUiConnectorConfigProperties model = BinaryData.fromString( + "{\"title\":\"irzkaugpucdo\",\"publisher\":\"fq\",\"descriptionMarkdown\":\"lwgofm\",\"customImage\":\"wrjlvzkl\",\"graphQueriesTableName\":\"vbgikyj\",\"graphQueries\":[{\"metricName\":\"kvlbishjvpzaptuo\",\"legend\":\"aoizjix\",\"baseQuery\":\"gcdiyk\"},{\"metricName\":\"xwnujvqyn\",\"legend\":\"vitmdmuqohhih\",\"baseQuery\":\"xquddrw\"},{\"metricName\":\"ljbrhlhpvzadbw\",\"legend\":\"ninafhxrz\",\"baseQuery\":\"m\"},{\"metricName\":\"tiucwv\",\"legend\":\"llukhkrcqxgcbvz\",\"baseQuery\":\"mqcbpokstsinv\"}],\"sampleQueries\":[{\"description\":\"vjyhdrxbrdvc\",\"query\":\"qwh\"}],\"dataTypes\":[{\"name\":\"nmxgnm\",\"lastDataReceivedQuery\":\"zbuwvorbalkjnbk\"},{\"name\":\"h\",\"lastDataReceivedQuery\":\"tqstqkqsygxiyne\"},{\"name\":\"vagzkheuba\",\"lastDataReceivedQuery\":\"xunpqcckqiawzlz\"}],\"connectivityCriteria\":[{\"type\":\"IsConnectedQuery\",\"value\":[\"acizuxlr\",\"rwpewsa\",\"doejtighsxjpyt\"]},{\"type\":\"IsConnectedQuery\",\"value\":[\"lahovuuwx\",\"mehjnhjioti\",\"fbbcngkegxcypxbb\"]},{\"type\":\"IsConnectedQuery\",\"value\":[\"lyr\",\"oxpdxq\"]}],\"availability\":{\"status\":1,\"isPreview\":true},\"permissions\":{\"resourceProvider\":[{\"provider\":\"Microsoft.OperationalInsights/workspaces/datasources\",\"permissionsDisplayText\":\"iu\",\"providerDisplayName\":\"ewnahwkxjjmzt\",\"scope\":\"Subscription\",\"requiredPermissions\":{\"action\":true,\"write\":true,\"read\":true,\"delete\":true}}],\"customs\":[{\"name\":\"yswcrptveajczx\",\"description\":\"gsrgkrfizr\"},{\"name\":\"wlp\",\"description\":\"uqhrlmcskykp\"},{\"name\":\"ofix\",\"description\":\"pcfykkpy\"},{\"name\":\"pawmpjprdp\",\"description\":\"pcfpcfj\"}]},\"instructionSteps\":[{\"title\":\"lgzawkgyepeyamnn\",\"description\":\"mdiawpzx\",\"instructions\":[{\"parameters\":\"\\\"datatmkctdhuosgwqpsq\\\"\",\"type\":\"InstructionStepsGroup\"},{\"parameters\":\"\\\"datahqodv\\\"\",\"type\":\"InstructionStepsGroup\"},{\"parameters\":\"\\\"datanb\\\"\",\"type\":\"InfoMessage\"}]},{\"title\":\"mjkztibniynts\",\"description\":\"mfmeftvhkmoo\",\"instructions\":[{\"parameters\":\"\\\"dataskbwgm\\\"\",\"type\":\"InfoMessage\"}]},{\"title\":\"u\",\"description\":\"fogxhcxnw\",\"instructions\":[{\"parameters\":\"\\\"datadzxcouzfwo\\\"\",\"type\":\"InfoMessage\"},{\"parameters\":\"\\\"datak\\\"\",\"type\":\"InstructionStepsGroup\"},{\"parameters\":\"\\\"datakdt\\\"\",\"type\":\"InstructionStepsGroup\"},{\"parameters\":\"\\\"dataoednlwglihezomuc\\\"\",\"type\":\"InfoMessage\"}]}]}") + .toObject(CodelessUiConnectorConfigProperties.class); + Assertions.assertEquals("irzkaugpucdo", model.title()); + Assertions.assertEquals("fq", model.publisher()); + Assertions.assertEquals("lwgofm", model.descriptionMarkdown()); + Assertions.assertEquals("wrjlvzkl", model.customImage()); + Assertions.assertEquals("vbgikyj", model.graphQueriesTableName()); + Assertions.assertEquals("kvlbishjvpzaptuo", model.graphQueries().get(0).metricName()); + Assertions.assertEquals("aoizjix", model.graphQueries().get(0).legend()); + Assertions.assertEquals("gcdiyk", model.graphQueries().get(0).baseQuery()); + Assertions.assertEquals("vjyhdrxbrdvc", model.sampleQueries().get(0).description()); + Assertions.assertEquals("qwh", model.sampleQueries().get(0).query()); + Assertions.assertEquals("nmxgnm", model.dataTypes().get(0).name()); + Assertions.assertEquals("zbuwvorbalkjnbk", model.dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, model.connectivityCriteria().get(0).type()); + Assertions.assertEquals("acizuxlr", model.connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(AvailabilityStatus.ONE, model.availability().status()); + Assertions.assertTrue(model.availability().isPreview()); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES, + model.permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("iu", model.permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("ewnahwkxjjmzt", model.permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.SUBSCRIPTION, + model.permissions().resourceProvider().get(0).scope()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertEquals("yswcrptveajczx", model.permissions().customs().get(0).name()); + Assertions.assertEquals("gsrgkrfizr", model.permissions().customs().get(0).description()); + Assertions.assertEquals("lgzawkgyepeyamnn", model.instructionSteps().get(0).title()); + Assertions.assertEquals("mdiawpzx", model.instructionSteps().get(0).description()); + Assertions.assertEquals(SettingType.INSTRUCTION_STEPS_GROUP, + model.instructionSteps().get(0).instructions().get(0).type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessUiConnectorConfigProperties model = new CodelessUiConnectorConfigProperties().withTitle("irzkaugpucdo") + .withPublisher("fq") + .withDescriptionMarkdown("lwgofm") + .withCustomImage("wrjlvzkl") + .withGraphQueriesTableName("vbgikyj") + .withGraphQueries(Arrays.asList( + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("kvlbishjvpzaptuo") + .withLegend("aoizjix") + .withBaseQuery("gcdiyk"), + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("xwnujvqyn") + .withLegend("vitmdmuqohhih") + .withBaseQuery("xquddrw"), + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("ljbrhlhpvzadbw") + .withLegend("ninafhxrz") + .withBaseQuery("m"), + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("tiucwv") + .withLegend("llukhkrcqxgcbvz") + .withBaseQuery("mqcbpokstsinv"))) + .withSampleQueries( + Arrays.asList(new CodelessUiConnectorConfigPropertiesSampleQueriesItem().withDescription("vjyhdrxbrdvc") + .withQuery("qwh"))) + .withDataTypes(Arrays.asList( + new CodelessUiConnectorConfigPropertiesDataTypesItem().withName("nmxgnm") + .withLastDataReceivedQuery("zbuwvorbalkjnbk"), + new CodelessUiConnectorConfigPropertiesDataTypesItem().withName("h") + .withLastDataReceivedQuery("tqstqkqsygxiyne"), + new CodelessUiConnectorConfigPropertiesDataTypesItem().withName("vagzkheuba") + .withLastDataReceivedQuery("xunpqcckqiawzlz"))) + .withConnectivityCriteria(Arrays.asList( + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("acizuxlr", "rwpewsa", "doejtighsxjpyt")), + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("lahovuuwx", "mehjnhjioti", "fbbcngkegxcypxbb")), + new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("lyr", "oxpdxq")))) + .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(true)) + .withPermissions(new Permissions() + .withResourceProvider(Arrays.asList(new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES) + .withPermissionsDisplayText("iu") + .withProviderDisplayName("ewnahwkxjjmzt") + .withScope(PermissionProviderScope.SUBSCRIPTION) + .withRequiredPermissions( + new RequiredPermissions().withAction(true).withWrite(true).withRead(true).withDelete(true)))) + .withCustoms( + Arrays.asList(new PermissionsCustomsItem().withName("yswcrptveajczx").withDescription("gsrgkrfizr"), + new PermissionsCustomsItem().withName("wlp").withDescription("uqhrlmcskykp"), + new PermissionsCustomsItem().withName("ofix").withDescription("pcfykkpy"), + new PermissionsCustomsItem().withName("pawmpjprdp").withDescription("pcfpcfj")))) + .withInstructionSteps(Arrays.asList( + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("lgzawkgyepeyamnn") + .withDescription("mdiawpzx") + .withInstructions(Arrays.asList( + new InstructionStepsInstructionsItem().withParameters("\"datatmkctdhuosgwqpsq\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP), + new InstructionStepsInstructionsItem().withParameters("\"datahqodv\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP), + new InstructionStepsInstructionsItem().withParameters("\"datanb\"") + .withType(SettingType.INFO_MESSAGE))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("mjkztibniynts") + .withDescription("mfmeftvhkmoo") + .withInstructions( + Arrays.asList(new InstructionStepsInstructionsItem().withParameters("\"dataskbwgm\"") + .withType(SettingType.INFO_MESSAGE))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("u") + .withDescription("fogxhcxnw") + .withInstructions(Arrays.asList( + new InstructionStepsInstructionsItem().withParameters("\"datadzxcouzfwo\"") + .withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withParameters("\"datak\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP), + new InstructionStepsInstructionsItem().withParameters("\"datakdt\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP), + new InstructionStepsInstructionsItem().withParameters("\"dataoednlwglihezomuc\"") + .withType(SettingType.INFO_MESSAGE))))); + model = BinaryData.fromObject(model).toObject(CodelessUiConnectorConfigProperties.class); + Assertions.assertEquals("irzkaugpucdo", model.title()); + Assertions.assertEquals("fq", model.publisher()); + Assertions.assertEquals("lwgofm", model.descriptionMarkdown()); + Assertions.assertEquals("wrjlvzkl", model.customImage()); + Assertions.assertEquals("vbgikyj", model.graphQueriesTableName()); + Assertions.assertEquals("kvlbishjvpzaptuo", model.graphQueries().get(0).metricName()); + Assertions.assertEquals("aoizjix", model.graphQueries().get(0).legend()); + Assertions.assertEquals("gcdiyk", model.graphQueries().get(0).baseQuery()); + Assertions.assertEquals("vjyhdrxbrdvc", model.sampleQueries().get(0).description()); + Assertions.assertEquals("qwh", model.sampleQueries().get(0).query()); + Assertions.assertEquals("nmxgnm", model.dataTypes().get(0).name()); + Assertions.assertEquals("zbuwvorbalkjnbk", model.dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, model.connectivityCriteria().get(0).type()); + Assertions.assertEquals("acizuxlr", model.connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(AvailabilityStatus.ONE, model.availability().status()); + Assertions.assertTrue(model.availability().isPreview()); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES_DATASOURCES, + model.permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("iu", model.permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("ewnahwkxjjmzt", model.permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.SUBSCRIPTION, + model.permissions().resourceProvider().get(0).scope()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertEquals("yswcrptveajczx", model.permissions().customs().get(0).name()); + Assertions.assertEquals("gsrgkrfizr", model.permissions().customs().get(0).description()); + Assertions.assertEquals("lgzawkgyepeyamnn", model.instructionSteps().get(0).title()); + Assertions.assertEquals("mdiawpzx", model.instructionSteps().get(0).description()); + Assertions.assertEquals(SettingType.INSTRUCTION_STEPS_GROUP, + model.instructionSteps().get(0).instructions().get(0).type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiDataConnectorTests.java new file mode 100644 index 000000000000..ce48eba72a92 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CodelessUiDataConnectorTests.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Availability; +import com.azure.resourcemanager.securityinsights.models.AvailabilityStatus; +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.InstructionStepsInstructionsItem; +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.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CodelessUiDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CodelessUiDataConnector model = BinaryData.fromString( + "{\"kind\":\"GenericUI\",\"properties\":{\"connectorUiConfig\":{\"title\":\"bxuharl\",\"publisher\":\"ir\",\"descriptionMarkdown\":\"ccla\",\"customImage\":\"oyn\",\"graphQueriesTableName\":\"suxxc\",\"graphQueries\":[{\"metricName\":\"yqjoghdsa\",\"legend\":\"janormovdxxu\",\"baseQuery\":\"tujmoil\"},{\"metricName\":\"wemhdee\",\"legend\":\"slkyozd\",\"baseQuery\":\"zjuegrh\"}],\"sampleQueries\":[{\"description\":\"slejtvxj\",\"query\":\"vgjbfio\"},{\"description\":\"njodfcbjqqwmtq\",\"query\":\"oxsazuxejgwe\"},{\"description\":\"wnf\",\"query\":\"zzaczsinqbdn\"}],\"dataTypes\":[{\"name\":\"bozsyvr\",\"lastDataReceivedQuery\":\"jmyitrchwudl\"}],\"connectivityCriteria\":[{\"type\":\"IsConnectedQuery\",\"value\":[\"pmnoejhqlf\",\"sibz\"]}],\"availability\":{\"status\":1,\"isPreview\":false},\"permissions\":{\"resourceProvider\":[{\"provider\":\"Microsoft.OperationalInsights/solutions\",\"permissionsDisplayText\":\"mypgfqvmty\",\"providerDisplayName\":\"lakxpejpewp\",\"scope\":\"Subscription\",\"requiredPermissions\":{}},{\"provider\":\"Microsoft.OperationalInsights/workspaces\",\"permissionsDisplayText\":\"pqcrzgeuqxbpiat\",\"providerDisplayName\":\"aujegqdtadra\",\"scope\":\"Workspace\",\"requiredPermissions\":{}},{\"provider\":\"Microsoft.Authorization/policyAssignments\",\"permissionsDisplayText\":\"rukizyhgsqt\",\"providerDisplayName\":\"s\",\"scope\":\"Subscription\",\"requiredPermissions\":{}},{\"provider\":\"Microsoft.Authorization/policyAssignments\",\"permissionsDisplayText\":\"bqggw\",\"providerDisplayName\":\"iwdhdmncgbfzu\",\"scope\":\"Workspace\",\"requiredPermissions\":{}}],\"customs\":[{\"name\":\"lhxd\",\"description\":\"klciichgjsysm\"},{\"name\":\"o\",\"description\":\"wxfkzsifcuvbdujg\"},{\"name\":\"xvecbbwjt\",\"description\":\"xrizagbbgi\"},{\"name\":\"ksykpgdqxwabzrw\",\"description\":\"rxhaclcdosqkp\"}]},\"instructionSteps\":[{\"title\":\"gkifmmainwh\",\"description\":\"xkpbqwun\",\"instructions\":[{\"type\":\"InfoMessage\"},{\"type\":\"CopyableLabel\"},{\"type\":\"InstructionStepsGroup\"}]},{\"title\":\"zz\",\"description\":\"wgvydjufb\",\"instructions\":[{\"type\":\"CopyableLabel\"},{\"type\":\"CopyableLabel\"},{\"type\":\"CopyableLabel\"}]},{\"title\":\"peg\",\"description\":\"dabalfdxaglzfytl\",\"instructions\":[{\"type\":\"InstructionStepsGroup\"},{\"type\":\"CopyableLabel\"},{\"type\":\"CopyableLabel\"}]},{\"title\":\"xouvmrs\",\"description\":\"likyypzkgxfxfmyr\",\"instructions\":[{\"type\":\"InstructionStepsGroup\"}]}]}},\"etag\":\"oksz\",\"id\":\"mhwgp\",\"name\":\"erd\",\"type\":\"uwkirk\"}") + .toObject(CodelessUiDataConnector.class); + Assertions.assertEquals("oksz", model.etag()); + Assertions.assertEquals("bxuharl", model.connectorUiConfig().title()); + Assertions.assertEquals("ir", model.connectorUiConfig().publisher()); + Assertions.assertEquals("ccla", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("oyn", model.connectorUiConfig().customImage()); + Assertions.assertEquals("suxxc", model.connectorUiConfig().graphQueriesTableName()); + Assertions.assertEquals("yqjoghdsa", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("janormovdxxu", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("tujmoil", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("slejtvxj", model.connectorUiConfig().sampleQueries().get(0).description()); + Assertions.assertEquals("vgjbfio", model.connectorUiConfig().sampleQueries().get(0).query()); + Assertions.assertEquals("bozsyvr", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("jmyitrchwudl", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, + model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("pmnoejhqlf", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(AvailabilityStatus.ONE, model.connectorUiConfig().availability().status()); + Assertions.assertFalse(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS, + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("mypgfqvmty", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("lakxpejpewp", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.SUBSCRIPTION, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions.assertEquals("lhxd", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("klciichgjsysm", + model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("gkifmmainwh", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("xkpbqwun", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals(SettingType.INFO_MESSAGE, + model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CodelessUiDataConnector model = new CodelessUiDataConnector().withEtag("oksz") + .withConnectorUiConfig(new CodelessUiConnectorConfigProperties().withTitle("bxuharl") + .withPublisher("ir") + .withDescriptionMarkdown("ccla") + .withCustomImage("oyn") + .withGraphQueriesTableName("suxxc") + .withGraphQueries(Arrays.asList( + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("yqjoghdsa") + .withLegend("janormovdxxu") + .withBaseQuery("tujmoil"), + new CodelessUiConnectorConfigPropertiesGraphQueriesItem().withMetricName("wemhdee") + .withLegend("slkyozd") + .withBaseQuery("zjuegrh"))) + .withSampleQueries(Arrays.asList( + new CodelessUiConnectorConfigPropertiesSampleQueriesItem().withDescription("slejtvxj") + .withQuery("vgjbfio"), + new CodelessUiConnectorConfigPropertiesSampleQueriesItem().withDescription("njodfcbjqqwmtq") + .withQuery("oxsazuxejgwe"), + new CodelessUiConnectorConfigPropertiesSampleQueriesItem().withDescription("wnf") + .withQuery("zzaczsinqbdn"))) + .withDataTypes(Arrays.asList(new CodelessUiConnectorConfigPropertiesDataTypesItem().withName("bozsyvr") + .withLastDataReceivedQuery("jmyitrchwudl"))) + .withConnectivityCriteria( + Arrays.asList(new CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() + .withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("pmnoejhqlf", "sibz")))) + .withAvailability(new Availability().withStatus(AvailabilityStatus.ONE).withIsPreview(false)) + .withPermissions(new Permissions() + .withResourceProvider(Arrays.asList( + new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS) + .withPermissionsDisplayText("mypgfqvmty") + .withProviderDisplayName("lakxpejpewp") + .withScope(PermissionProviderScope.SUBSCRIPTION) + .withRequiredPermissions(new RequiredPermissions()), + new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) + .withPermissionsDisplayText("pqcrzgeuqxbpiat") + .withProviderDisplayName("aujegqdtadra") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions(new RequiredPermissions()), + new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS) + .withPermissionsDisplayText("rukizyhgsqt") + .withProviderDisplayName("s") + .withScope(PermissionProviderScope.SUBSCRIPTION) + .withRequiredPermissions(new RequiredPermissions()), + new PermissionsResourceProviderItem() + .withProvider(ProviderName.MICROSOFT_AUTHORIZATION_POLICY_ASSIGNMENTS) + .withPermissionsDisplayText("bqggw") + .withProviderDisplayName("iwdhdmncgbfzu") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions(new RequiredPermissions()))) + .withCustoms( + Arrays.asList(new PermissionsCustomsItem().withName("lhxd").withDescription("klciichgjsysm"), + new PermissionsCustomsItem().withName("o").withDescription("wxfkzsifcuvbdujg"), + new PermissionsCustomsItem().withName("xvecbbwjt").withDescription("xrizagbbgi"), + new PermissionsCustomsItem().withName("ksykpgdqxwabzrw").withDescription("rxhaclcdosqkp")))) + .withInstructionSteps( + Arrays + .asList( + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("gkifmmainwh") + .withDescription("xkpbqwun") + .withInstructions(Arrays + .asList(new InstructionStepsInstructionsItem().withType(SettingType.INFO_MESSAGE), + new InstructionStepsInstructionsItem().withType(SettingType.COPYABLE_LABEL), + new InstructionStepsInstructionsItem() + .withType(SettingType.INSTRUCTION_STEPS_GROUP))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("zz") + .withDescription("wgvydjufb") + .withInstructions(Arrays.asList( + new InstructionStepsInstructionsItem().withType(SettingType.COPYABLE_LABEL), + new InstructionStepsInstructionsItem().withType(SettingType.COPYABLE_LABEL), + new InstructionStepsInstructionsItem().withType(SettingType.COPYABLE_LABEL))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("peg") + .withDescription("dabalfdxaglzfytl") + .withInstructions(Arrays.asList(new InstructionStepsInstructionsItem() + .withType(SettingType.INSTRUCTION_STEPS_GROUP), + new InstructionStepsInstructionsItem().withType(SettingType.COPYABLE_LABEL), + new InstructionStepsInstructionsItem().withType(SettingType.COPYABLE_LABEL))), + new CodelessUiConnectorConfigPropertiesInstructionStepsItem().withTitle("xouvmrs") + .withDescription("likyypzkgxfxfmyr") + .withInstructions(Arrays.asList(new InstructionStepsInstructionsItem() + .withType(SettingType.INSTRUCTION_STEPS_GROUP)))))); + model = BinaryData.fromObject(model).toObject(CodelessUiDataConnector.class); + Assertions.assertEquals("oksz", model.etag()); + Assertions.assertEquals("bxuharl", model.connectorUiConfig().title()); + Assertions.assertEquals("ir", model.connectorUiConfig().publisher()); + Assertions.assertEquals("ccla", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("oyn", model.connectorUiConfig().customImage()); + Assertions.assertEquals("suxxc", model.connectorUiConfig().graphQueriesTableName()); + Assertions.assertEquals("yqjoghdsa", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("janormovdxxu", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("tujmoil", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("slejtvxj", model.connectorUiConfig().sampleQueries().get(0).description()); + Assertions.assertEquals("vgjbfio", model.connectorUiConfig().sampleQueries().get(0).query()); + Assertions.assertEquals("bozsyvr", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("jmyitrchwudl", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, + model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("pmnoejhqlf", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(AvailabilityStatus.ONE, model.connectorUiConfig().availability().status()); + Assertions.assertFalse(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS, + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("mypgfqvmty", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("lakxpejpewp", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.SUBSCRIPTION, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions.assertEquals("lhxd", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("klciichgjsysm", + model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("gkifmmainwh", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("xkpbqwun", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals(SettingType.INFO_MESSAGE, + model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionClauseTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionClauseTests.java new file mode 100644 index 000000000000..ca6cab73fa8b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionClauseTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.Operator; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConditionClauseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConditionClause model = BinaryData.fromString( + "{\"clauseConnective\":\"Or\",\"field\":\"og\",\"operator\":\"ArrayContains\",\"values\":[\"juaiuvem\",\"cbnkivexiathm\"]}") + .toObject(ConditionClause.class); + Assertions.assertEquals("og", model.field()); + Assertions.assertEquals(Operator.ARRAY_CONTAINS, model.operator()); + Assertions.assertEquals("juaiuvem", model.values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConditionClause model = new ConditionClause().withField("og") + .withOperator(Operator.ARRAY_CONTAINS) + .withValues(Arrays.asList("juaiuvem", "cbnkivexiathm")); + model = BinaryData.fromObject(model).toObject(ConditionClause.class); + Assertions.assertEquals("og", model.field()); + Assertions.assertEquals(Operator.ARRAY_CONTAINS, model.operator()); + Assertions.assertEquals("juaiuvem", model.values().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionPropertiesTests.java new file mode 100644 index 000000000000..36b1c9c5a5f7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConditionPropertiesTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.ConditionProperties; +import com.azure.resourcemanager.securityinsights.models.Operator; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConditionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConditionProperties model = BinaryData.fromString( + "{\"stixObjectType\":\"kgjsryhxfghaenpf\",\"clauses\":[{\"clauseConnective\":\"Or\",\"field\":\"bmvxbi\",\"operator\":\"OnOrBeforeRelative\",\"values\":[\"ghps\",\"tbame\",\"rbusnaq\",\"vruuhyncppmmwh\"]},{\"clauseConnective\":\"And\",\"field\":\"lurgipv\",\"operator\":\"IsNull\",\"values\":[\"leps\",\"c\"]},{\"clauseConnective\":\"Or\",\"field\":\"xdxgc\",\"operator\":\"ArrayContains\",\"values\":[\"uv\",\"koiihrfcowla\"]},{\"clauseConnective\":\"Or\",\"field\":\"ifywxjjylaqhx\",\"operator\":\"GreaterThan\",\"values\":[\"dar\",\"jhwgkyn\",\"lwrjgotdtmcktkal\",\"piybfnkylzri\"]}],\"conditionConnective\":\"Or\"}") + .toObject(ConditionProperties.class); + Assertions.assertEquals("bmvxbi", model.clauses().get(0).field()); + Assertions.assertEquals(Operator.ON_OR_BEFORE_RELATIVE, model.clauses().get(0).operator()); + Assertions.assertEquals("ghps", model.clauses().get(0).values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConditionProperties model = new ConditionProperties().withClauses(Arrays.asList( + new ConditionClause().withField("bmvxbi") + .withOperator(Operator.ON_OR_BEFORE_RELATIVE) + .withValues(Arrays.asList("ghps", "tbame", "rbusnaq", "vruuhyncppmmwh")), + new ConditionClause().withField("lurgipv") + .withOperator(Operator.IS_NULL) + .withValues(Arrays.asList("leps", "c")), + new ConditionClause().withField("xdxgc") + .withOperator(Operator.ARRAY_CONTAINS) + .withValues(Arrays.asList("uv", "koiihrfcowla")), + new ConditionClause().withField("ifywxjjylaqhx") + .withOperator(Operator.GREATER_THAN) + .withValues(Arrays.asList("dar", "jhwgkyn", "lwrjgotdtmcktkal", "piybfnkylzri")))); + model = BinaryData.fromObject(model).toObject(ConditionProperties.class); + Assertions.assertEquals("bmvxbi", model.clauses().get(0).field()); + Assertions.assertEquals(Operator.ON_OR_BEFORE_RELATIVE, model.clauses().get(0).operator()); + Assertions.assertEquals("ghps", model.clauses().get(0).values().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectedEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectedEntityTests.java new file mode 100644 index 000000000000..87d3a7938b7f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectedEntityTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectedEntity; +import org.junit.jupiter.api.Assertions; + +public final class ConnectedEntityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectedEntity model = BinaryData + .fromString("{\"targetEntityId\":\"krxifqn\",\"additionalData\":\"\\\"dataorxsqtzngxbsale\\\"\"}") + .toObject(ConnectedEntity.class); + Assertions.assertEquals("krxifqn", model.targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriteriaTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriteriaTests.java new file mode 100644 index 000000000000..4babe7550ccb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriteriaTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectivityCriteria; +import com.azure.resourcemanager.securityinsights.models.ConnectivityType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConnectivityCriteriaTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectivityCriteria model + = BinaryData.fromString("{\"type\":\"IsConnectedQuery\",\"value\":[\"iqdktwtkvih\"]}") + .toObject(ConnectivityCriteria.class); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, model.type()); + Assertions.assertEquals("iqdktwtkvih", model.value().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectivityCriteria model = new ConnectivityCriteria().withType(ConnectivityType.IS_CONNECTED_QUERY) + .withValue(Arrays.asList("iqdktwtkvih")); + model = BinaryData.fromObject(model).toObject(ConnectivityCriteria.class); + Assertions.assertEquals(ConnectivityType.IS_CONNECTED_QUERY, model.type()); + Assertions.assertEquals("iqdktwtkvih", model.value().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriterionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriterionTests.java new file mode 100644 index 000000000000..5e67aebf2d9c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectivityCriterionTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConnectivityCriterionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectivityCriterion model + = BinaryData.fromString("{\"type\":\"trwntfmtbgw\",\"value\":[\"wnaz\",\"urrdreyzjwhsetww\"]}") + .toObject(ConnectivityCriterion.class); + Assertions.assertEquals("trwntfmtbgw", model.type()); + Assertions.assertEquals("wnaz", model.value().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectivityCriterion model + = new ConnectivityCriterion().withType("trwntfmtbgw").withValue(Arrays.asList("wnaz", "urrdreyzjwhsetww")); + model = BinaryData.fromObject(model).toObject(ConnectivityCriterion.class); + Assertions.assertEquals("trwntfmtbgw", model.type()); + Assertions.assertEquals("wnaz", model.value().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDataTypeTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDataTypeTests.java new file mode 100644 index 000000000000..8688c75f0d26 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDataTypeTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectorDataType; +import org.junit.jupiter.api.Assertions; + +public final class ConnectorDataTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectorDataType model + = BinaryData.fromString("{\"name\":\"jtfrnquktrfn\",\"lastDataReceivedQuery\":\"lnlrxsmy\"}") + .toObject(ConnectorDataType.class); + Assertions.assertEquals("jtfrnquktrfn", model.name()); + Assertions.assertEquals("lnlrxsmy", model.lastDataReceivedQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectorDataType model + = new ConnectorDataType().withName("jtfrnquktrfn").withLastDataReceivedQuery("lnlrxsmy"); + model = BinaryData.fromObject(model).toObject(ConnectorDataType.class); + Assertions.assertEquals("jtfrnquktrfn", model.name()); + Assertions.assertEquals("lnlrxsmy", model.lastDataReceivedQuery()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsAvailabilityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsAvailabilityTests.java new file mode 100644 index 000000000000..235738cb022a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsAvailabilityTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability; +import org.junit.jupiter.api.Assertions; + +public final class ConnectorDefinitionsAvailabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectorDefinitionsAvailability model = BinaryData.fromString("{\"status\":48439553,\"isPreview\":true}") + .toObject(ConnectorDefinitionsAvailability.class); + Assertions.assertEquals(48439553, model.status()); + Assertions.assertTrue(model.isPreview()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectorDefinitionsAvailability model + = new ConnectorDefinitionsAvailability().withStatus(48439553).withIsPreview(true); + model = BinaryData.fromObject(model).toObject(ConnectorDefinitionsAvailability.class); + Assertions.assertEquals(48439553, model.status()); + Assertions.assertTrue(model.isPreview()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsPermissionsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsPermissionsTests.java new file mode 100644 index 000000000000..877c81ae6a65 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsPermissionsTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +import com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ConnectorDefinitionsPermissionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectorDefinitionsPermissions model = BinaryData.fromString( + "{\"tenant\":[\"uzu\"],\"licenses\":[\"kcyqhyqqzzd\"],\"resourceProvider\":[{\"provider\":\"ey\",\"permissionsDisplayText\":\"tewfopazdazgbsq\",\"providerDisplayName\":\"pew\",\"scope\":\"ResourceGroup\",\"requiredPermissions\":{\"read\":true,\"write\":false,\"delete\":true,\"action\":false}}],\"customs\":[{\"name\":\"lq\",\"description\":\"bknlzcl\"}]}") + .toObject(ConnectorDefinitionsPermissions.class); + Assertions.assertEquals("uzu", model.tenant().get(0)); + Assertions.assertEquals("kcyqhyqqzzd", model.licenses().get(0)); + Assertions.assertEquals("ey", model.resourceProvider().get(0).provider()); + Assertions.assertEquals("tewfopazdazgbsq", model.resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("pew", model.resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.RESOURCE_GROUP, model.resourceProvider().get(0).scope()); + Assertions.assertTrue(model.resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertTrue(model.resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertEquals("lq", model.customs().get(0).name()); + Assertions.assertEquals("bknlzcl", model.customs().get(0).description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectorDefinitionsPermissions model = new ConnectorDefinitionsPermissions().withTenant(Arrays.asList("uzu")) + .withLicenses(Arrays.asList("kcyqhyqqzzd")) + .withResourceProvider(Arrays.asList(new ConnectorDefinitionsResourceProvider().withProvider("ey") + .withPermissionsDisplayText("tewfopazdazgbsq") + .withProviderDisplayName("pew") + .withScope(ProviderPermissionsScope.RESOURCE_GROUP) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(true) + .withWrite(false) + .withDelete(true) + .withAction(false)))) + .withCustoms(Arrays.asList(new CustomPermissionDetails().withName("lq").withDescription("bknlzcl"))); + model = BinaryData.fromObject(model).toObject(ConnectorDefinitionsPermissions.class); + Assertions.assertEquals("uzu", model.tenant().get(0)); + Assertions.assertEquals("kcyqhyqqzzd", model.licenses().get(0)); + Assertions.assertEquals("ey", model.resourceProvider().get(0).provider()); + Assertions.assertEquals("tewfopazdazgbsq", model.resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("pew", model.resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.RESOURCE_GROUP, model.resourceProvider().get(0).scope()); + Assertions.assertTrue(model.resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertTrue(model.resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertEquals("lq", model.customs().get(0).name()); + Assertions.assertEquals("bknlzcl", model.customs().get(0).description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsResourceProviderTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsResourceProviderTests.java new file mode 100644 index 000000000000..d2ed3a5b7127 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorDefinitionsResourceProviderTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider; +import com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import org.junit.jupiter.api.Assertions; + +public final class ConnectorDefinitionsResourceProviderTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectorDefinitionsResourceProvider model = BinaryData.fromString( + "{\"provider\":\"tzeyowmndcovd\",\"permissionsDisplayText\":\"zqauxzan\",\"providerDisplayName\":\"mk\",\"scope\":\"Subscription\",\"requiredPermissions\":{\"read\":true,\"write\":true,\"delete\":false,\"action\":true}}") + .toObject(ConnectorDefinitionsResourceProvider.class); + Assertions.assertEquals("tzeyowmndcovd", model.provider()); + Assertions.assertEquals("zqauxzan", model.permissionsDisplayText()); + Assertions.assertEquals("mk", model.providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.SUBSCRIPTION, model.scope()); + Assertions.assertTrue(model.requiredPermissions().read()); + Assertions.assertTrue(model.requiredPermissions().write()); + Assertions.assertFalse(model.requiredPermissions().delete()); + Assertions.assertTrue(model.requiredPermissions().action()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectorDefinitionsResourceProvider model + = new ConnectorDefinitionsResourceProvider().withProvider("tzeyowmndcovd") + .withPermissionsDisplayText("zqauxzan") + .withProviderDisplayName("mk") + .withScope(ProviderPermissionsScope.SUBSCRIPTION) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(true) + .withWrite(true) + .withDelete(false) + .withAction(true)); + model = BinaryData.fromObject(model).toObject(ConnectorDefinitionsResourceProvider.class); + Assertions.assertEquals("tzeyowmndcovd", model.provider()); + Assertions.assertEquals("zqauxzan", model.permissionsDisplayText()); + Assertions.assertEquals("mk", model.providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.SUBSCRIPTION, model.scope()); + Assertions.assertTrue(model.requiredPermissions().read()); + Assertions.assertTrue(model.requiredPermissions().write()); + Assertions.assertFalse(model.requiredPermissions().delete()); + Assertions.assertTrue(model.requiredPermissions().action()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorInstructionModelBaseTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorInstructionModelBaseTests.java new file mode 100644 index 000000000000..f30d3b5f5817 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ConnectorInstructionModelBaseTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectorInstructionModelBase; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import org.junit.jupiter.api.Assertions; + +public final class ConnectorInstructionModelBaseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ConnectorInstructionModelBase model + = BinaryData.fromString("{\"parameters\":\"\\\"datadeayscseydzje\\\"\",\"type\":\"CopyableLabel\"}") + .toObject(ConnectorInstructionModelBase.class); + Assertions.assertEquals(SettingType.COPYABLE_LABEL, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ConnectorInstructionModelBase model + = new ConnectorInstructionModelBase().withParameters("\"datadeayscseydzje\"") + .withType(SettingType.COPYABLE_LABEL); + model = BinaryData.fromObject(model).toObject(ConnectorInstructionModelBase.class); + Assertions.assertEquals(SettingType.COPYABLE_LABEL, model.type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsInstallWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsInstallWithResponseMockTests.java new file mode 100644 index 000000000000..5cb7b03c8094 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsInstallWithResponseMockTests.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.PackageModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentPackageOperationsInstallWithResponseMockTests { + @Test + public void testInstallWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"oecijrlmn\",\"contentProductId\":\"paf\",\"contentKind\":\"Solution\",\"contentSchemaVersion\":\"csk\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"yllcckgfoxvrbfy\",\"displayName\":\"enqc\",\"description\":\"f\",\"publisherDisplayName\":\"tvsfsvqyzgawe\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"blazwhdacz\",\"sourceId\":\"fduwlsov\"},\"author\":{\"name\":\"csmaxzdx\",\"email\":\"hmiu\",\"link\":\"pvuazaj\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"khjzbfb\",\"email\":\"eqkuozarr\",\"link\":\"pyzryjb\"},\"dependencies\":{\"contentId\":\"cvoyqnrjdrctar\",\"kind\":\"WorkbookTemplate\",\"version\":\"oghbpz\",\"name\":\"jqecjfdromeaw\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"gpist\",\"kind\":\"Solution\",\"version\":\"jnparsulm\",\"name\":\"lawakhe\",\"operator\":\"OR\",\"criteria\":[{},{},{}]}]},\"providers\":[\"vzycx\"],\"categories\":{\"domains\":[\"loo\",\"ftm\"],\"verticals\":[\"wzslrprftqhfvo\",\"yqzhoikemhohxa\",\"m\"]},\"threatAnalysisTactics\":[\"wp\",\"ogozercczvpbnkgk\"],\"threatAnalysisTechniques\":[\"e\",\"qjqafjk\"],\"icon\":\"logvfnwqzolva\"},\"etag\":\"qkyc\",\"id\":\"jgwehjybboqyx\",\"name\":\"ycdvdgemymydd\",\"type\":\"jtxlvgslmg\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PackageModel response = manager.contentPackageOperations() + .define("bto") + .withExistingWorkspace("bifktnxugiorb", "yeyrnbuby") + .withEtag("rawbftznxf") + .withContentId("uhlw") + .withContentProductId("vzuxfsmfpd") + .withContentKind(PackageKind.STANDALONE) + .withContentSchemaVersion("pzw") + .withIsNew(Flag.TRUE) + .withIsPreview(Flag.TRUE) + .withIsFeatured(Flag.TRUE) + .withIsDeprecated(Flag.TRUE) + .withVersion("lhvpljzrqwjtsw") + .withDisplayName("o") + .withDescription("kejyavk") + .withPublisherDisplayName("vctqaq") + .withSource( + new MetadataSource().withKind(SourceKind.LOCAL_WORKSPACE).withName("paeyklxsvcbr").withSourceId("lt")) + .withAuthor(new MetadataAuthor().withName("dsng").withEmail("ofmrph").withLink("s")) + .withSupport(new MetadataSupport().withTier(SupportTier.MICROSOFT) + .withName("kcgdnhacexibomr") + .withEmail("ooepfbas") + .withLink("fxansgn")) + .withDependencies(new MetadataDependencies().withContentId("nlpklrjdkypmkvil") + .withKind(Kind.ANALYTICS_RULE) + .withVersion("tjbldgikokjwgej") + .withName("uzezwnqhcpkjgsy") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("mq") + .withKind(Kind.HUNTING_QUERY) + .withVersion("kpr") + .withName("rtm") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies()))))) + .withProviders(Arrays.asList("ypluxvjutc")) + .withCategories( + new MetadataCategories().withDomains(Arrays.asList("vlbx", "ezvujpbmz", "xlgmu", "xwkkbnhmdtj")) + .withVerticals(Arrays.asList("foispchhvvmvs", "gyqdhazm", "ug", "tsovoz"))) + .withThreatAnalysisTactics(Arrays.asList("kr", "cjrqhugubobqqn")) + .withThreatAnalysisTechniques(Arrays.asList("mvdowlqcyhf")) + .withIcon("zixqx") + .create(); + + Assertions.assertEquals("qkyc", response.etag()); + Assertions.assertEquals("oecijrlmn", response.contentId()); + Assertions.assertEquals("paf", response.contentProductId()); + Assertions.assertEquals(PackageKind.SOLUTION, response.contentKind()); + Assertions.assertEquals("csk", response.contentSchemaVersion()); + Assertions.assertEquals(Flag.TRUE, response.isNew()); + Assertions.assertEquals(Flag.FALSE, response.isPreview()); + Assertions.assertEquals(Flag.TRUE, response.isFeatured()); + Assertions.assertEquals(Flag.TRUE, response.isDeprecated()); + Assertions.assertEquals("yllcckgfoxvrbfy", response.version()); + Assertions.assertEquals("enqc", response.displayName()); + Assertions.assertEquals("f", response.description()); + Assertions.assertEquals("tvsfsvqyzgawe", response.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, response.source().kind()); + Assertions.assertEquals("blazwhdacz", response.source().name()); + Assertions.assertEquals("fduwlsov", response.source().sourceId()); + Assertions.assertEquals("csmaxzdx", response.author().name()); + Assertions.assertEquals("hmiu", response.author().email()); + Assertions.assertEquals("pvuazaj", response.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, response.support().tier()); + Assertions.assertEquals("khjzbfb", response.support().name()); + Assertions.assertEquals("eqkuozarr", response.support().email()); + Assertions.assertEquals("pyzryjb", response.support().link()); + Assertions.assertEquals("cvoyqnrjdrctar", response.dependencies().contentId()); + Assertions.assertEquals(Kind.WORKBOOK_TEMPLATE, response.dependencies().kind()); + Assertions.assertEquals("oghbpz", response.dependencies().version()); + Assertions.assertEquals("jqecjfdromeaw", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().operator()); + Assertions.assertEquals("gpist", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.SOLUTION, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("jnparsulm", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("lawakhe", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("vzycx", response.providers().get(0)); + Assertions.assertEquals("loo", response.categories().domains().get(0)); + Assertions.assertEquals("wzslrprftqhfvo", response.categories().verticals().get(0)); + Assertions.assertEquals("wp", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("e", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("logvfnwqzolva", response.icon()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsUninstallWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsUninstallWithResponseMockTests.java new file mode 100644 index 000000000000..df5a9e39a6bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackageOperationsUninstallWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentPackageOperationsUninstallWithResponseMockTests { + @Test + public void testUninstallWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.contentPackageOperations() + .uninstallWithResponse("gcbjclfbpfdsatr", "q", "tuxwtdaz", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetWithResponseMockTests.java new file mode 100644 index 000000000000..c3e3287adf5c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesGetWithResponseMockTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.PackageModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentPackagesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"jzsjhhru\",\"contentProductId\":\"zqvgad\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"nglzjhaqxf\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"rabbyfhz\",\"displayName\":\"jrxenpkxanlbrcy\",\"description\":\"rc\",\"publisherDisplayName\":\"anbw\",\"source\":{\"kind\":\"Community\",\"name\":\"ioqhoxcgfyzlui\",\"sourceId\":\"gpghjakzmn\"},\"author\":{\"name\":\"qmajslwmj\",\"email\":\"bxvpfyupgojrwp\",\"link\":\"uykqyoyjpt\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"kzgtxwyqkkdumxdr\",\"email\":\"msioffyboon\",\"link\":\"vfundkhdmyxmsbt\"},\"dependencies\":{\"contentId\":\"gn\",\"kind\":\"Parser\",\"version\":\"jxgj\",\"name\":\"gb\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"zlf\",\"kind\":\"Standalone\",\"version\":\"hlzljqcm\",\"name\":\"smlujunqwkjfmt\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"xbckxen\",\"kind\":\"AnalyticsRule\",\"version\":\"guirhexjpw\",\"name\":\"mktpykoicpk\",\"operator\":\"OR\",\"criteria\":[{},{}]}]},\"providers\":[\"baobj\",\"ofkcvh\",\"rgvkuu\",\"k\"],\"categories\":{\"domains\":[\"ws\"],\"verticals\":[\"xenxjvapd\",\"gfvygrfyyknxua\",\"fm\"]},\"threatAnalysisTactics\":[\"lcimjm\"],\"threatAnalysisTechniques\":[\"cryf\",\"vkt\"],\"icon\":\"zuzvbqbroyrw\"},\"etag\":\"bbfweozkbok\",\"id\":\"su\",\"name\":\"wc\",\"type\":\"lzcavodcvfwkp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PackageModel response = manager.contentPackages() + .getWithResponse("pdlxwsfddyqp", "yn", "owmjsur", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("bbfweozkbok", response.etag()); + Assertions.assertEquals("jzsjhhru", response.contentId()); + Assertions.assertEquals("zqvgad", response.contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, response.contentKind()); + Assertions.assertEquals("nglzjhaqxf", response.contentSchemaVersion()); + Assertions.assertEquals(Flag.TRUE, response.isNew()); + Assertions.assertEquals(Flag.FALSE, response.isPreview()); + Assertions.assertEquals(Flag.TRUE, response.isFeatured()); + Assertions.assertEquals(Flag.TRUE, response.isDeprecated()); + Assertions.assertEquals("rabbyfhz", response.version()); + Assertions.assertEquals("jrxenpkxanlbrcy", response.displayName()); + Assertions.assertEquals("rc", response.description()); + Assertions.assertEquals("anbw", response.publisherDisplayName()); + Assertions.assertEquals(SourceKind.COMMUNITY, response.source().kind()); + Assertions.assertEquals("ioqhoxcgfyzlui", response.source().name()); + Assertions.assertEquals("gpghjakzmn", response.source().sourceId()); + Assertions.assertEquals("qmajslwmj", response.author().name()); + Assertions.assertEquals("bxvpfyupgojrwp", response.author().email()); + Assertions.assertEquals("uykqyoyjpt", response.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, response.support().tier()); + Assertions.assertEquals("kzgtxwyqkkdumxdr", response.support().name()); + Assertions.assertEquals("msioffyboon", response.support().email()); + Assertions.assertEquals("vfundkhdmyxmsbt", response.support().link()); + Assertions.assertEquals("gn", response.dependencies().contentId()); + Assertions.assertEquals(Kind.PARSER, response.dependencies().kind()); + Assertions.assertEquals("jxgj", response.dependencies().version()); + Assertions.assertEquals("gb", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().operator()); + Assertions.assertEquals("zlf", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.STANDALONE, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("hlzljqcm", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("smlujunqwkjfmt", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("baobj", response.providers().get(0)); + Assertions.assertEquals("ws", response.categories().domains().get(0)); + Assertions.assertEquals("xenxjvapd", response.categories().verticals().get(0)); + Assertions.assertEquals("lcimjm", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("cryf", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("zuzvbqbroyrw", response.icon()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListMockTests.java new file mode 100644 index 000000000000..66610fdc220d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentPackagesListMockTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.PackageModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentPackagesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"contentId\":\"wx\",\"contentProductId\":\"aask\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"buhzucdljqjstnc\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"false\",\"isDeprecated\":\"true\",\"version\":\"lundkjphvh\",\"displayName\":\"ivsh\",\"description\":\"x\",\"publisherDisplayName\":\"jythxearlpnajjt\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"do\",\"sourceId\":\"xbungmpnry\"},\"author\":{\"name\":\"cdfxglrcjugoazzy\",\"email\":\"cwu\",\"link\":\"npoyrqjonilny\"},\"support\":{\"tier\":\"Community\",\"name\":\"ttdcloqpgzd\",\"email\":\"nepp\",\"link\":\"mzeufjzqaq\"},\"dependencies\":{\"contentId\":\"bygqcwz\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"nqcth\",\"name\":\"yvaoa\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"cqafnv\",\"kind\":\"Workbook\",\"version\":\"sjhinpyeksll\",\"name\":\"sqolckwhgnfbnnhw\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"xzdohfvxavhfhl\",\"kind\":\"WatchlistTemplate\",\"version\":\"zpbamcfrf\",\"name\":\"tcygoombnrm\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"emgfv\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"wltozxdzoldwv\",\"name\":\"pnyaterj\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"gesoozpuda\",\"kind\":\"SummaryRule\",\"version\":\"dhdtt\",\"name\":\"keculxvkuxvccpda\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]}]},\"providers\":[\"tyvvgxe\",\"hq\",\"swjwbhtawb\"],\"categories\":{\"domains\":[\"uzueikadhu\"],\"verticals\":[\"kbgljcywyr\"]},\"threatAnalysisTactics\":[\"p\"],\"threatAnalysisTechniques\":[\"xxkviyjr\"],\"icon\":\"yejyavxgmogcnw\"},\"etag\":\"qqxpnjqtzda\",\"id\":\"ethnl\",\"name\":\"eggyqlvnhmuut\",\"type\":\"wwtymbccmwsyfsgi\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.contentPackages() + .list("p", "sgfn", "txlkioviklxsgstu", "sa", "cist", false, 1857519747, 912071821, "kbuajkodpzqtg", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("qqxpnjqtzda", response.iterator().next().etag()); + Assertions.assertEquals("wx", response.iterator().next().contentId()); + Assertions.assertEquals("aask", response.iterator().next().contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, response.iterator().next().contentKind()); + Assertions.assertEquals("buhzucdljqjstnc", response.iterator().next().contentSchemaVersion()); + Assertions.assertEquals(Flag.TRUE, response.iterator().next().isNew()); + Assertions.assertEquals(Flag.FALSE, response.iterator().next().isPreview()); + Assertions.assertEquals(Flag.FALSE, response.iterator().next().isFeatured()); + Assertions.assertEquals(Flag.TRUE, response.iterator().next().isDeprecated()); + Assertions.assertEquals("lundkjphvh", response.iterator().next().version()); + Assertions.assertEquals("ivsh", response.iterator().next().displayName()); + Assertions.assertEquals("x", response.iterator().next().description()); + Assertions.assertEquals("jythxearlpnajjt", response.iterator().next().publisherDisplayName()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, response.iterator().next().source().kind()); + Assertions.assertEquals("do", response.iterator().next().source().name()); + Assertions.assertEquals("xbungmpnry", response.iterator().next().source().sourceId()); + Assertions.assertEquals("cdfxglrcjugoazzy", response.iterator().next().author().name()); + Assertions.assertEquals("cwu", response.iterator().next().author().email()); + Assertions.assertEquals("npoyrqjonilny", response.iterator().next().author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, response.iterator().next().support().tier()); + Assertions.assertEquals("ttdcloqpgzd", response.iterator().next().support().name()); + Assertions.assertEquals("nepp", response.iterator().next().support().email()); + Assertions.assertEquals("mzeufjzqaq", response.iterator().next().support().link()); + Assertions.assertEquals("bygqcwz", response.iterator().next().dependencies().contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, response.iterator().next().dependencies().kind()); + Assertions.assertEquals("nqcth", response.iterator().next().dependencies().version()); + Assertions.assertEquals("yvaoa", response.iterator().next().dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.iterator().next().dependencies().operator()); + Assertions.assertEquals("cqafnv", response.iterator().next().dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WORKBOOK, response.iterator().next().dependencies().criteria().get(0).kind()); + Assertions.assertEquals("sjhinpyeksll", response.iterator().next().dependencies().criteria().get(0).version()); + Assertions.assertEquals("sqolckwhgnfbnnhw", response.iterator().next().dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + response.iterator().next().dependencies().criteria().get(0).operator()); + Assertions.assertEquals("tyvvgxe", response.iterator().next().providers().get(0)); + Assertions.assertEquals("uzueikadhu", response.iterator().next().categories().domains().get(0)); + Assertions.assertEquals("kbgljcywyr", response.iterator().next().categories().verticals().get(0)); + Assertions.assertEquals("p", response.iterator().next().threatAnalysisTactics().get(0)); + Assertions.assertEquals("xxkviyjr", response.iterator().next().threatAnalysisTechniques().get(0)); + Assertions.assertEquals("yejyavxgmogcnw", response.iterator().next().icon()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..f7b70f4ad129 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentTemplatesDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.contentTemplates() + .deleteWithResponse("pdpudqiw", "vxbovpoeuufwsmde", "frb", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesGetWithResponseMockTests.java new file mode 100644 index 000000000000..54a81c805b77 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesGetWithResponseMockTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import com.azure.resourcemanager.securityinsights.models.TemplateModel; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentTemplatesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"xjdgaimktnsowsz\",\"contentProductId\":\"flhxikrgokyngar\",\"packageVersion\":\"ut\",\"version\":\"xgas\",\"displayName\":\"natnp\",\"contentKind\":\"WorkbookTemplate\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"qysgmiixngekcwe\",\"sourceId\":\"qtkdginmhlgpefqq\"},\"author\":{\"name\":\"yowrwvbqv\",\"email\":\"qgqrsopqgiqf\",\"link\":\"tl\"},\"support\":{\"tier\":\"Partner\",\"name\":\"cgugslpvyk\",\"email\":\"uhfaabi\",\"link\":\"slocdkpvv\"},\"dependencies\":{\"contentId\":\"khdxnzj\",\"kind\":\"AutomationRule\",\"version\":\"hiztfmibw\",\"name\":\"hydajckgwtb\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"nbascjighm\",\"kind\":\"Watchlist\",\"version\":\"ayyhtiyxehmni\",\"name\":\"yb\",\"operator\":\"AND\",\"criteria\":[{},{},{}]}]},\"categories\":{\"domains\":[\"mmyznwrcfqwkqu\",\"kz\"],\"verticals\":[\"ohwi\",\"hrqxj\"]},\"providers\":[\"sosndnypxnsjj\",\"cdd\",\"vg\",\"bfn\"],\"customVersion\":\"csjhp\",\"contentSchemaVersion\":\"jgczpdio\",\"icon\":\"tjylimzvj\",\"threatAnalysisTactics\":[\"mtcacwmabehrfys\",\"zwtghzvhzrxcaes\"],\"threatAnalysisTechniques\":[\"avlwwpvjr\",\"jwvciarqlceflgs\",\"durhqozjw\",\"wkdehjlo\"],\"previewImages\":[\"wokuxedpqwzzzi\"],\"previewImagesDark\":[\"xjgxrhajrubcvu\",\"ve\",\"dfmdjnfeealp\"],\"packageId\":\"clkbwkmwdrvkb\",\"packageKind\":\"Solution\",\"packageName\":\"nvkh\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datazzjjrzhjqengop\\\"\",\"dependantTemplates\":[{\"contentId\":\"ndliodajxvszdyv\",\"contentProductId\":\"iufbw\",\"packageVersion\":\"awh\",\"version\":\"h\",\"displayName\":\"uee\",\"contentKind\":\"Standalone\",\"source\":{\"kind\":\"Solution\",\"name\":\"esvzdv\",\"sourceId\":\"qajia\"},\"author\":{\"name\":\"y\",\"email\":\"trdukdmsktuvjh\",\"link\":\"tvyt\"},\"support\":{\"tier\":\"Partner\",\"name\":\"sgrzwdwd\",\"email\":\"xqebtrp\",\"link\":\"l\"},\"dependencies\":{\"contentId\":\"ocsey\",\"kind\":\"Watchlist\",\"version\":\"coznnjqxck\",\"name\":\"kuuotlymybm\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},\"categories\":{\"domains\":[\"uynugptfj\",\"isvfh\",\"tqqshb\"],\"verticals\":[\"huhujkzj\",\"ezgphipt\",\"oqldnhwdfxgec\"]},\"providers\":[\"kdb\",\"bhsnimompxd\",\"mp\",\"fbdmoawhbdxxnm\"],\"customVersion\":\"iocqoydqyzhfny\",\"contentSchemaVersion\":\"bwdsaqwywayjin\",\"icon\":\"ktpr\",\"threatAnalysisTactics\":[\"nqltygy\",\"yxmuwgnw\",\"tmhwgencmoswcxlg\"],\"threatAnalysisTechniques\":[\"qxewsvqpifza\",\"ctyw\"],\"previewImages\":[\"aczprzrs\",\"cugvnpgsqlanuh\",\"srnps\",\"aghoeqiwpdxpd\"],\"previewImagesDark\":[\"ajq\",\"yplhsto\",\"yybwlysvp\"],\"packageId\":\"gqjdoglec\",\"packageKind\":\"Standalone\",\"packageName\":\"ivsiirxcxppqpsin\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"dataxbesbwcizyj\\\"\",\"dependantTemplates\":[{}]}]},\"etag\":\"asjrseqpo\",\"id\":\"hgksqwzuosyyxl\",\"name\":\"dxzudfar\",\"type\":\"ayrdyrowgi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TemplateModel response = manager.contentTemplates() + .getWithResponse("jbjjlxsv", "zbggsnanojtyh", "hzxzazofr", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("asjrseqpo", response.etag()); + Assertions.assertEquals("xjdgaimktnsowsz", response.contentId()); + Assertions.assertEquals("flhxikrgokyngar", response.contentProductId()); + Assertions.assertEquals("ut", response.packageVersion()); + Assertions.assertEquals("xgas", response.version()); + Assertions.assertEquals("natnp", response.displayName()); + Assertions.assertEquals(Kind.WORKBOOK_TEMPLATE, response.contentKind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, response.source().kind()); + Assertions.assertEquals("qysgmiixngekcwe", response.source().name()); + Assertions.assertEquals("qtkdginmhlgpefqq", response.source().sourceId()); + Assertions.assertEquals("yowrwvbqv", response.author().name()); + Assertions.assertEquals("qgqrsopqgiqf", response.author().email()); + Assertions.assertEquals("tl", response.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, response.support().tier()); + Assertions.assertEquals("cgugslpvyk", response.support().name()); + Assertions.assertEquals("uhfaabi", response.support().email()); + Assertions.assertEquals("slocdkpvv", response.support().link()); + Assertions.assertEquals("khdxnzj", response.dependencies().contentId()); + Assertions.assertEquals(Kind.AUTOMATION_RULE, response.dependencies().kind()); + Assertions.assertEquals("hiztfmibw", response.dependencies().version()); + Assertions.assertEquals("hydajckgwtb", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().operator()); + Assertions.assertEquals("nbascjighm", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WATCHLIST, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("ayyhtiyxehmni", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("yb", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("mmyznwrcfqwkqu", response.categories().domains().get(0)); + Assertions.assertEquals("ohwi", response.categories().verticals().get(0)); + Assertions.assertEquals("sosndnypxnsjj", response.providers().get(0)); + Assertions.assertEquals("csjhp", response.customVersion()); + Assertions.assertEquals("jgczpdio", response.contentSchemaVersion()); + Assertions.assertEquals("tjylimzvj", response.icon()); + Assertions.assertEquals("mtcacwmabehrfys", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("avlwwpvjr", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("wokuxedpqwzzzi", response.previewImages().get(0)); + Assertions.assertEquals("xjgxrhajrubcvu", response.previewImagesDark().get(0)); + Assertions.assertEquals("clkbwkmwdrvkb", response.packageId()); + Assertions.assertEquals(PackageKind.SOLUTION, response.packageKind()); + Assertions.assertEquals("nvkh", response.packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesInstallWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesInstallWithResponseMockTests.java new file mode 100644 index 000000000000..7c1a4dc67bba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesInstallWithResponseMockTests.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import com.azure.resourcemanager.securityinsights.models.TemplateModel; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentTemplatesInstallWithResponseMockTests { + @Test + public void testInstallWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"fudlrxbsuftpvgm\",\"contentProductId\":\"itcuvmlltasuf\",\"packageVersion\":\"fpzeszvegawbm\",\"version\":\"gmbirvvv\",\"displayName\":\"qxisav\",\"contentKind\":\"Solution\",\"source\":{\"kind\":\"Community\",\"name\":\"vlhibridagwuv\",\"sourceId\":\"ymoqv\"},\"author\":{\"name\":\"rynziudmhedhryg\",\"email\":\"gvu\",\"link\":\"xjwzt\"},\"support\":{\"tier\":\"Community\",\"name\":\"llfz\",\"email\":\"h\",\"link\":\"bccffsbz\"},\"dependencies\":{\"contentId\":\"f\",\"kind\":\"HuntingQuery\",\"version\":\"j\",\"name\":\"ud\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"bchpzvqzm\",\"kind\":\"ResourcesDataConnector\",\"version\":\"jwhonnqudexnicq\",\"name\":\"fqttfqgdoowgqooi\",\"operator\":\"OR\",\"criteria\":[{},{},{}]}]},\"categories\":{\"domains\":[\"dhkjiwfv\"],\"verticals\":[\"freq\",\"flrrtju\",\"ikqzd\"]},\"providers\":[\"alxpmiytpjiscis\",\"lkwi\",\"vlsljutawgyl\",\"odrfclehlopipv\"],\"customVersion\":\"yjlyxduxhopyavcb\",\"contentSchemaVersion\":\"embvfa\",\"icon\":\"xjoa\",\"threatAnalysisTactics\":[\"mumfbk\",\"xzrycvacspzj\",\"syph\",\"eoqmaqhikc\"],\"threatAnalysisTechniques\":[\"uvosbba\",\"rbqooxvprq\",\"xqhqgip\"],\"previewImages\":[\"nkngjnhxufocsk\",\"fijdtpedvhfpfses\",\"ywcre\"],\"previewImagesDark\":[\"hqqozhesb\",\"qwnmfjktd\",\"d\"],\"packageId\":\"kztaluuu\",\"packageKind\":\"Standalone\",\"packageName\":\"oat\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datawvxhef\\\"\",\"dependantTemplates\":[{\"contentId\":\"lhi\",\"contentProductId\":\"azg\",\"packageVersion\":\"orppso\",\"version\":\"cvywty\",\"displayName\":\"ln\",\"contentKind\":\"AutomationRule\",\"source\":{\"kind\":\"Community\",\"name\":\"yosa\",\"sourceId\":\"s\"},\"author\":{\"name\":\"xoxjlvvvzpj\",\"email\":\"yintgkveogeld\",\"link\":\"b\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"ibobk\",\"email\":\"ujaag\",\"link\":\"iwuux\"},\"dependencies\":{\"contentId\":\"zmsivqegmpfzbrh\",\"kind\":\"Workbook\",\"version\":\"tkrsjspziiev\",\"name\":\"t\",\"operator\":\"OR\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"oy\",\"asqdhbfttptsdee\",\"uovanagl\",\"acsfbmb\"],\"verticals\":[\"fqkuxgyumoamqx\",\"luslxytiobjle\"]},\"providers\":[\"blob\",\"nfpdilhzgjjeo\",\"ctbgo\"],\"customVersion\":\"xs\",\"contentSchemaVersion\":\"bqlbnu\",\"icon\":\"fzawkkze\",\"threatAnalysisTactics\":[\"pyoqfbjpclboioj\"],\"threatAnalysisTechniques\":[\"hwwyhxzythxzrv\",\"fs\"],\"previewImages\":[\"dhhwfrm\",\"ooke\"],\"previewImagesDark\":[\"fexakctlcps\"],\"packageId\":\"ncco\",\"packageKind\":\"Standalone\",\"packageName\":\"mdievkmr\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datayiheheimuqqmd\\\"\",\"dependantTemplates\":[{},{}]}]},\"etag\":\"fmrmwdfypsypmthf\",\"id\":\"zlafc\",\"name\":\"dl\",\"type\":\"hhkdeviwpzhfxv\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TemplateModel response = manager.contentTemplates() + .define("lnomqbdvjl") + .withExistingWorkspace("zjedycjisxspn", "fydphl") + .withEtag("dotpcvd") + .withContentId("lbpehvjpgllrhnlx") + .withContentProductId("pgzybezmyjqpdchd") + .withPackageVersion("vkm") + .withVersion("pxzgj") + .withDisplayName("mtskto") + .withContentKind(Kind.NOTEBOOK) + .withSource(new MetadataSource().withKind(SourceKind.SOLUTION).withName("dpjsoko").withSourceId("grf")) + .withAuthor(new MetadataAuthor().withName("wdmaenwhqafzgzm") + .withEmail("jqnienctwbimh") + .withLink("ognnwxrdllrqamfj")) + .withSupport(new MetadataSupport().withTier(SupportTier.COMMUNITY) + .withName("pnbyx") + .withEmail("ubvidpskdzs") + .withLink("hvzgliu")) + .withDependencies(new MetadataDependencies().withContentId("tgsd") + .withKind(Kind.STANDALONE) + .withVersion("ddxoatlprsrkennn") + .withName("v") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("pv") + .withKind(Kind.CUSTOM_DETECTION) + .withVersion("fplgxc") + .withName("ctbxpuisfjamgn") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("iyycoflj") + .withKind(Kind.ANALYTICS_RULE) + .withVersion("walipbuqkdieu") + .withName("wsak") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())), + new MetadataDependencies().withContentId("f") + .withKind(Kind.HUNTING_QUERY) + .withVersion("moonnriah") + .withName("gzkdbmjzob") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies()))))) + .withCategories(new MetadataCategories().withDomains(Arrays.asList("pelokptteojxhwg")) + .withVerticals(Arrays.asList("x", "rpwjgkxvkjd"))) + .withProviders(Arrays.asList("nqmmwwtzxsvwqi")) + .withCustomVersion("rh") + .withContentSchemaVersion("gaaaxigafa") + .withIcon("too") + .withThreatAnalysisTactics(Arrays.asList("d", "blpdtcyvgbhb", "plavgfbvr")) + .withThreatAnalysisTechniques(Arrays.asList("uexqweyslwlppoh")) + .withPreviewImages(Arrays.asList("galexyiygkadtwd", "gb")) + .withPreviewImagesDark(Arrays.asList("f", "xcjdobsgvz", "jkwltnsnhuvmok", "hsclpnb")) + .withPackageId("nlodkqr") + .withPackageKind(PackageKind.SOLUTION) + .withPackageName("tixawoyzgaevr") + .withMainTemplate("\"dataccpzmhoplqtzg\"") + .create(); + + Assertions.assertEquals("fmrmwdfypsypmthf", response.etag()); + Assertions.assertEquals("fudlrxbsuftpvgm", response.contentId()); + Assertions.assertEquals("itcuvmlltasuf", response.contentProductId()); + Assertions.assertEquals("fpzeszvegawbm", response.packageVersion()); + Assertions.assertEquals("gmbirvvv", response.version()); + Assertions.assertEquals("qxisav", response.displayName()); + Assertions.assertEquals(Kind.SOLUTION, response.contentKind()); + Assertions.assertEquals(SourceKind.COMMUNITY, response.source().kind()); + Assertions.assertEquals("vlhibridagwuv", response.source().name()); + Assertions.assertEquals("ymoqv", response.source().sourceId()); + Assertions.assertEquals("rynziudmhedhryg", response.author().name()); + Assertions.assertEquals("gvu", response.author().email()); + Assertions.assertEquals("xjwzt", response.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, response.support().tier()); + Assertions.assertEquals("llfz", response.support().name()); + Assertions.assertEquals("h", response.support().email()); + Assertions.assertEquals("bccffsbz", response.support().link()); + Assertions.assertEquals("f", response.dependencies().contentId()); + Assertions.assertEquals(Kind.HUNTING_QUERY, response.dependencies().kind()); + Assertions.assertEquals("j", response.dependencies().version()); + Assertions.assertEquals("ud", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().operator()); + Assertions.assertEquals("bchpzvqzm", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("jwhonnqudexnicq", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("fqttfqgdoowgqooi", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("dhkjiwfv", response.categories().domains().get(0)); + Assertions.assertEquals("freq", response.categories().verticals().get(0)); + Assertions.assertEquals("alxpmiytpjiscis", response.providers().get(0)); + Assertions.assertEquals("yjlyxduxhopyavcb", response.customVersion()); + Assertions.assertEquals("embvfa", response.contentSchemaVersion()); + Assertions.assertEquals("xjoa", response.icon()); + Assertions.assertEquals("mumfbk", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("uvosbba", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("nkngjnhxufocsk", response.previewImages().get(0)); + Assertions.assertEquals("hqqozhesb", response.previewImagesDark().get(0)); + Assertions.assertEquals("kztaluuu", response.packageId()); + Assertions.assertEquals(PackageKind.STANDALONE, response.packageKind()); + Assertions.assertEquals("oat", response.packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationsListMockTests.java new file mode 100644 index 000000000000..99a313b98620 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ContentTemplatesOperationsListMockTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import com.azure.resourcemanager.securityinsights.models.TemplateModel; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ContentTemplatesOperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"contentId\":\"gnnvmguzq\",\"contentProductId\":\"wwmekmsnmfjbe\",\"packageVersion\":\"zfrxfy\",\"version\":\"ypxcqmdeecd\",\"displayName\":\"jsizyhp\",\"contentKind\":\"HuntingQuery\",\"source\":{\"kind\":\"Community\",\"name\":\"twhmadhism\",\"sourceId\":\"kqtfyuy\"},\"author\":{\"name\":\"shchxueaitzgew\",\"email\":\"wibtkr\",\"link\":\"gbzrlfsewusqupkr\"},\"support\":{\"tier\":\"Partner\",\"name\":\"wozwjinxyrte\",\"email\":\"vzslttkpirku\",\"link\":\"eeczhsdp\"},\"dependencies\":{\"contentId\":\"bmahuwxodddqzew\",\"kind\":\"CustomDetection\",\"version\":\"gso\",\"name\":\"kdclbzq\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"mp\",\"kind\":\"Notebook\",\"version\":\"e\",\"name\":\"utuaysxhfupvq\",\"operator\":\"AND\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"ywmcipuye\",\"hhdrmgaifgyxkgqw\"],\"verticals\":[\"hxpcxqc\",\"nkxhc\",\"dhx\"]},\"providers\":[\"llfwxdouuyzpa\",\"jahjxgedtmzh\",\"fhk\"],\"customVersion\":\"acgukierdq\",\"contentSchemaVersion\":\"assiiilcmrgahsc\",\"icon\":\"yxgcgbvieqonsbu\",\"threatAnalysisTactics\":[\"xdivqopxunoox\",\"kmknac\",\"fzcytbhdjpagwsz\",\"wggzfeye\"],\"threatAnalysisTechniques\":[\"dfyo\",\"zwigvqgce\"],\"previewImages\":[\"jgedxpbpjw\",\"nnvd\",\"baodi\",\"txqsohehh\"],\"previewImagesDark\":[\"wvijdr\",\"q\"],\"packageId\":\"vhzkfyvhren\",\"packageKind\":\"Solution\",\"packageName\":\"xqfghlos\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datakpcmtsbandesalv\\\"\",\"dependantTemplates\":[{\"contentId\":\"ljm\",\"contentProductId\":\"d\",\"packageVersion\":\"zvtfyqeogwbs\",\"version\":\"iwxhc\",\"displayName\":\"fgqmdbazggrgao\",\"contentKind\":\"Standalone\",\"source\":{\"kind\":\"Community\",\"name\":\"poyanir\",\"sourceId\":\"dsdmacydqa\"},\"author\":{\"name\":\"vwxubgulyzjkasx\",\"email\":\"roh\",\"link\":\"bd\"},\"support\":{\"tier\":\"Community\",\"name\":\"so\",\"email\":\"puaptpuwek\",\"link\":\"l\"},\"dependencies\":{\"contentId\":\"tcljopivtwxvc\",\"kind\":\"Notebook\",\"version\":\"kkcjjnq\",\"name\":\"joayaj\",\"operator\":\"OR\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"pgfbzbxe\"],\"verticals\":[\"okfrhfafxcgjucm\"]},\"providers\":[\"dulvuefsrx\",\"scdbbwej\"],\"customVersion\":\"geqpa\",\"contentSchemaVersion\":\"lfscosf\",\"icon\":\"otvneteehndfpflf\",\"threatAnalysisTactics\":[\"fnaoehk\",\"pkssjbw\",\"wxdgcfcf\",\"yy\"],\"threatAnalysisTechniques\":[\"x\",\"slrbwwkbywodh\"],\"previewImages\":[\"ofsxjikyd\"],\"previewImagesDark\":[\"huixqwo\",\"gwcxdmxhuw\",\"dfahky\"],\"packageId\":\"udk\",\"packageKind\":\"Solution\",\"packageName\":\"opyckmn\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataoudjmdayqkg\\\"\",\"dependantTemplates\":[{}]},{\"contentId\":\"rne\",\"contentProductId\":\"v\",\"packageVersion\":\"ovpwrqcfzo\",\"version\":\"lzliizb\",\"displayName\":\"jumulhfq\",\"contentKind\":\"Playbook\",\"source\":{\"kind\":\"Solution\",\"name\":\"hldnrptrqcapbkf\",\"sourceId\":\"wzbkrbqpzdpujywj\"},\"author\":{\"name\":\"qzzkplqmca\",\"email\":\"eiauveeng\",\"link\":\"gfpqwwugfw\"},\"support\":{\"tier\":\"Partner\",\"name\":\"ewbqaibkye\",\"email\":\"feehdy\",\"link\":\"ybztlylhdxcjqdvc\"},\"dependencies\":{\"contentId\":\"zkui\",\"kind\":\"CustomDetection\",\"version\":\"hvecjhbttmhneqd\",\"name\":\"ieyxxid\",\"operator\":\"AND\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"aacse\",\"onljsfcryq\",\"rsjqtdjeyd\"],\"verticals\":[\"iml\",\"yzezci\"]},\"providers\":[\"rvyaqlqgyuiboely\",\"duzap\"],\"customVersion\":\"todprrqca\",\"contentSchemaVersion\":\"ytxj\",\"icon\":\"dpczmz\",\"threatAnalysisTactics\":[\"cehfw\",\"ecleaqaviqs\",\"ylwp\",\"rc\"],\"threatAnalysisTechniques\":[\"cnwmd\",\"bsotknhfxpveru\",\"ckrzwraqaptqy\",\"nlyuyopwwnqoub\"],\"previewImages\":[\"svfzjjflcx\",\"osyl\"],\"previewImagesDark\":[\"p\",\"jujbqrfw\",\"pwvpnbgy\"],\"packageId\":\"mckzeaia\",\"packageKind\":\"Solution\",\"packageName\":\"vlfsctjqpzqivfg\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataicxwuyrydlvf\\\"\",\"dependantTemplates\":[{}]}]},\"etag\":\"wfljjatjmnd\",\"id\":\"cdum\",\"name\":\"qhatckomdyfj\",\"type\":\"skvzvkddaeiep\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.contentTemplatesOperations() + .list("cnurhsmghhbtu", "jcua", "ctxy", "mwshrz", "yycnnwajxvoti", "lwme", false, 702323994, 699270353, + "lwugpkunvy", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wfljjatjmnd", response.iterator().next().etag()); + Assertions.assertEquals("gnnvmguzq", response.iterator().next().contentId()); + Assertions.assertEquals("wwmekmsnmfjbe", response.iterator().next().contentProductId()); + Assertions.assertEquals("zfrxfy", response.iterator().next().packageVersion()); + Assertions.assertEquals("ypxcqmdeecd", response.iterator().next().version()); + Assertions.assertEquals("jsizyhp", response.iterator().next().displayName()); + Assertions.assertEquals(Kind.HUNTING_QUERY, response.iterator().next().contentKind()); + Assertions.assertEquals(SourceKind.COMMUNITY, response.iterator().next().source().kind()); + Assertions.assertEquals("twhmadhism", response.iterator().next().source().name()); + Assertions.assertEquals("kqtfyuy", response.iterator().next().source().sourceId()); + Assertions.assertEquals("shchxueaitzgew", response.iterator().next().author().name()); + Assertions.assertEquals("wibtkr", response.iterator().next().author().email()); + Assertions.assertEquals("gbzrlfsewusqupkr", response.iterator().next().author().link()); + Assertions.assertEquals(SupportTier.PARTNER, response.iterator().next().support().tier()); + Assertions.assertEquals("wozwjinxyrte", response.iterator().next().support().name()); + Assertions.assertEquals("vzslttkpirku", response.iterator().next().support().email()); + Assertions.assertEquals("eeczhsdp", response.iterator().next().support().link()); + Assertions.assertEquals("bmahuwxodddqzew", response.iterator().next().dependencies().contentId()); + Assertions.assertEquals(Kind.CUSTOM_DETECTION, response.iterator().next().dependencies().kind()); + Assertions.assertEquals("gso", response.iterator().next().dependencies().version()); + Assertions.assertEquals("kdclbzq", response.iterator().next().dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.iterator().next().dependencies().operator()); + Assertions.assertEquals("mp", response.iterator().next().dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.NOTEBOOK, response.iterator().next().dependencies().criteria().get(0).kind()); + Assertions.assertEquals("e", response.iterator().next().dependencies().criteria().get(0).version()); + Assertions.assertEquals("utuaysxhfupvq", response.iterator().next().dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + response.iterator().next().dependencies().criteria().get(0).operator()); + Assertions.assertEquals("ywmcipuye", response.iterator().next().categories().domains().get(0)); + Assertions.assertEquals("hxpcxqc", response.iterator().next().categories().verticals().get(0)); + Assertions.assertEquals("llfwxdouuyzpa", response.iterator().next().providers().get(0)); + Assertions.assertEquals("acgukierdq", response.iterator().next().customVersion()); + Assertions.assertEquals("assiiilcmrgahsc", response.iterator().next().contentSchemaVersion()); + Assertions.assertEquals("yxgcgbvieqonsbu", response.iterator().next().icon()); + Assertions.assertEquals("xdivqopxunoox", response.iterator().next().threatAnalysisTactics().get(0)); + Assertions.assertEquals("dfyo", response.iterator().next().threatAnalysisTechniques().get(0)); + Assertions.assertEquals("jgedxpbpjw", response.iterator().next().previewImages().get(0)); + Assertions.assertEquals("wvijdr", response.iterator().next().previewImagesDark().get(0)); + Assertions.assertEquals("vhzkfyvhren", response.iterator().next().packageId()); + Assertions.assertEquals(PackageKind.SOLUTION, response.iterator().next().packageKind()); + Assertions.assertEquals("xqfghlos", response.iterator().next().packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CountQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CountQueryTests.java new file mode 100644 index 000000000000..9089c74a3896 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CountQueryTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.ConditionProperties; +import com.azure.resourcemanager.securityinsights.models.CountQuery; +import com.azure.resourcemanager.securityinsights.models.Operator; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CountQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CountQuery model = BinaryData.fromString( + "{\"properties\":{\"condition\":{\"stixObjectType\":\"gpqwgiq\",\"clauses\":[{\"clauseConnective\":\"Or\",\"field\":\"skmbuihtqfvyqmm\",\"operator\":\"LessThan\",\"values\":[\"guvlieeg\",\"nqwhfjoxse\",\"jscgqcr\",\"aucftotedhjxdl\"]},{\"clauseConnective\":\"And\",\"field\":\"f\",\"operator\":\"GreaterThanEqual\",\"values\":[\"qvjy\",\"m\",\"msknaxrh\",\"jwqufudpypboql\"]},{\"clauseConnective\":\"Or\",\"field\":\"fpwmajvwfi\",\"operator\":\"StringNotStartsWith\",\"values\":[\"jjrvsvhmsmrihdd\",\"bwlbqn\",\"dderrxyiwuzpsvcm\",\"sfstyyy\"]}],\"conditionConnective\":\"Or\"}}}") + .toObject(CountQuery.class); + Assertions.assertEquals("skmbuihtqfvyqmm", model.condition().clauses().get(0).field()); + Assertions.assertEquals(Operator.LESS_THAN, model.condition().clauses().get(0).operator()); + Assertions.assertEquals("guvlieeg", model.condition().clauses().get(0).values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CountQuery model = new CountQuery().withCondition(new ConditionProperties().withClauses(Arrays.asList( + new ConditionClause().withField("skmbuihtqfvyqmm") + .withOperator(Operator.LESS_THAN) + .withValues(Arrays.asList("guvlieeg", "nqwhfjoxse", "jscgqcr", "aucftotedhjxdl")), + new ConditionClause().withField("f") + .withOperator(Operator.GREATER_THAN_EQUAL) + .withValues(Arrays.asList("qvjy", "m", "msknaxrh", "jwqufudpypboql")), + new ConditionClause().withField("fpwmajvwfi") + .withOperator(Operator.STRING_NOT_STARTS_WITH) + .withValues(Arrays.asList("jjrvsvhmsmrihdd", "bwlbqn", "dderrxyiwuzpsvcm", "sfstyyy"))))); + model = BinaryData.fromObject(model).toObject(CountQuery.class); + Assertions.assertEquals("skmbuihtqfvyqmm", model.condition().clauses().get(0).field()); + Assertions.assertEquals(Operator.LESS_THAN, model.condition().clauses().get(0).operator()); + Assertions.assertEquals("guvlieeg", model.condition().clauses().get(0).values().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomEntityQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomEntityQueryTests.java new file mode 100644 index 000000000000..87166b71bcb7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomEntityQueryTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CustomEntityQuery; +import org.junit.jupiter.api.Assertions; + +public final class CustomEntityQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomEntityQuery model = BinaryData.fromString( + "{\"kind\":\"CustomEntityQuery\",\"etag\":\"hubymfp\",\"id\":\"ikze\",\"name\":\"qnnfywt\",\"type\":\"qowsdlkhczygpmg\"}") + .toObject(CustomEntityQuery.class); + Assertions.assertEquals("hubymfp", model.etag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomEntityQuery model = new CustomEntityQuery().withEtag("hubymfp"); + model = BinaryData.fromObject(model).toObject(CustomEntityQuery.class); + Assertions.assertEquals("hubymfp", model.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomPermissionDetailsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomPermissionDetailsTests.java new file mode 100644 index 000000000000..a19421a76783 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomPermissionDetailsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +import org.junit.jupiter.api.Assertions; + +public final class CustomPermissionDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomPermissionDetails model = BinaryData.fromString("{\"name\":\"ye\",\"description\":\"ebunauc\"}") + .toObject(CustomPermissionDetails.class); + Assertions.assertEquals("ye", model.name()); + Assertions.assertEquals("ebunauc", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomPermissionDetails model = new CustomPermissionDetails().withName("ye").withDescription("ebunauc"); + model = BinaryData.fromObject(model).toObject(CustomPermissionDetails.class); + Assertions.assertEquals("ye", model.name()); + Assertions.assertEquals("ebunauc", model.description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectionsConfigTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectionsConfigTests.java new file mode 100644 index 000000000000..d032d254ea19 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectionsConfigTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectionsConfig; +import org.junit.jupiter.api.Assertions; + +public final class CustomizableConnectionsConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomizableConnectionsConfig model + = BinaryData.fromString("{\"templateSpecName\":\"vvjbhvhdiqayf\",\"templateSpecVersion\":\"uiyuosnu\"}") + .toObject(CustomizableConnectionsConfig.class); + Assertions.assertEquals("vvjbhvhdiqayf", model.templateSpecName()); + Assertions.assertEquals("uiyuosnu", model.templateSpecVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomizableConnectionsConfig model = new CustomizableConnectionsConfig().withTemplateSpecName("vvjbhvhdiqayf") + .withTemplateSpecVersion("uiyuosnu"); + model = BinaryData.fromObject(model).toObject(CustomizableConnectionsConfig.class); + Assertions.assertEquals("vvjbhvhdiqayf", model.templateSpecName()); + Assertions.assertEquals("uiyuosnu", model.templateSpecVersion()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionPropertiesTests.java new file mode 100644 index 000000000000..1335900dcb1a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionPropertiesTests.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.CustomizableConnectorDefinitionProperties; +import com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion; +import com.azure.resourcemanager.securityinsights.models.ConnectorDataType; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectionsConfig; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.azure.resourcemanager.securityinsights.models.GraphQuery; +import com.azure.resourcemanager.securityinsights.models.InstructionStep; +import com.azure.resourcemanager.securityinsights.models.InstructionStepDetails; +import com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CustomizableConnectorDefinitionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomizableConnectorDefinitionProperties model = BinaryData.fromString( + "{\"createdTimeUtc\":\"2021-08-10T12:59:38Z\",\"lastModifiedUtc\":\"2021-01-01T20:44Z\",\"connectorUiConfig\":{\"id\":\"dbtwaokbavly\",\"title\":\"taaknwfrkebsmhp\",\"publisher\":\"ujd\",\"descriptionMarkdown\":\"gatolekscbctnan\",\"graphQueries\":[{\"metricName\":\"mwbzxpdc\",\"legend\":\"dpkawnsnl\",\"baseQuery\":\"imouxwksqmudmfco\"},{\"metricName\":\"bicziuswswj\",\"legend\":\"kbqsjhbtqqvyfscy\",\"baseQuery\":\"fwbivqvo\"},{\"metricName\":\"fuy\",\"legend\":\"wvbhlimbyq\",\"baseQuery\":\"crood\"},{\"metricName\":\"ikcdrdaasax\",\"legend\":\"obsmf\",\"baseQuery\":\"wiyjvzuko\"}],\"dataTypes\":[{\"name\":\"nawnvz\",\"lastDataReceivedQuery\":\"lnk\"}],\"connectivityCriteria\":[{\"type\":\"wsxvjab\",\"value\":[\"axuyvymcnud\"]},{\"type\":\"doabhj\",\"value\":[\"qweuip\",\"pvksmit\"]},{\"type\":\"sqxtltclkrdpq\",\"value\":[\"yrfrak\",\"ldgrcw\",\"cmfcnrjajq\"]},{\"type\":\"atxjtiel\",\"value\":[\"gxxgfb\",\"mtlpqagyno\"]}],\"availability\":{\"status\":11976518,\"isPreview\":true},\"permissions\":{\"tenant\":[\"incryqxzx\"],\"licenses\":[\"ibmq\"],\"resourceProvider\":[{\"provider\":\"ymqruqguhfupet\",\"permissionsDisplayText\":\"svvoqsbpkflanfk\",\"providerDisplayName\":\"xsyaowuzowpuoh\",\"scope\":\"Workspace\",\"requiredPermissions\":{\"read\":true,\"write\":true,\"delete\":false,\"action\":true}},{\"provider\":\"ztiochluti\",\"permissionsDisplayText\":\"mqrud\",\"providerDisplayName\":\"izcbfzmcrunfhiuc\",\"scope\":\"ResourceGroup\",\"requiredPermissions\":{\"read\":true,\"write\":false,\"delete\":true,\"action\":false}}],\"customs\":[{\"name\":\"umzued\",\"description\":\"yzbfvxovqkx\"},{\"name\":\"uxqggvqrnhyhl\",\"description\":\"cjsqggjhffbxr\"}]},\"instructionSteps\":[{\"title\":\"ijpeuql\",\"description\":\"x\",\"instructions\":[{\"parameters\":\"\\\"datatvxwmwwmjswenaww\\\"\",\"type\":\"me\"}],\"innerSteps\":[{\"title\":\"ioulndhzyoe\",\"description\":\"ht\",\"instructions\":[{\"parameters\":\"\\\"datah\\\"\",\"type\":\"vidmytzl\"},{\"parameters\":\"\\\"dataglxpnovyoanfbcsw\\\"\",\"type\":\"agyw\"},{\"parameters\":\"\\\"datat\\\"\",\"type\":\"igvjrktp\"},{\"parameters\":\"\\\"dataaeukyawohpm\\\"\",\"type\":\"hqnucs\"}],\"innerSteps\":[{},{},{},{}]}]},{\"title\":\"i\",\"description\":\"jtdlp\",\"instructions\":[{\"parameters\":\"\\\"datanjg\\\"\",\"type\":\"zlsvbzfcpuoeed\"},{\"parameters\":\"\\\"datajcciklhsyek\\\"\",\"type\":\"drenxol\"},{\"parameters\":\"\\\"datai\\\"\",\"type\":\"ehqbeivdlhydwbdb\"},{\"parameters\":\"\\\"datagrlpuny\\\"\",\"type\":\"jlkesmmpath\"}],\"innerSteps\":[{\"title\":\"h\",\"description\":\"an\",\"instructions\":[{\"parameters\":\"\\\"datallbvgwzsfftedous\\\"\",\"type\":\"ktjtgra\"},{\"parameters\":\"\\\"dataaqo\\\"\",\"type\":\"fkbebauzl\"}],\"innerSteps\":[{},{}]}]},{\"title\":\"xwpfhnjzud\",\"description\":\"pzkg\",\"instructions\":[{\"parameters\":\"\\\"dataoywhczzqrhmngqbe\\\"\",\"type\":\"ygisrz\"}],\"innerSteps\":[{\"title\":\"d\",\"description\":\"jch\",\"instructions\":[{\"parameters\":\"\\\"datapwctofl\\\"\",\"type\":\"seac\"},{\"parameters\":\"\\\"datahztxkbrfgd\\\"\",\"type\":\"wjiyewhfjsrwq\"},{\"parameters\":\"\\\"dataxet\\\"\",\"type\":\"gcwvrrmdqntycna\"}],\"innerSteps\":[{},{},{},{}]},{\"title\":\"maxgnuyeamcmhudf\",\"description\":\"cehokw\",\"instructions\":[{\"parameters\":\"\\\"datatwloesqr\\\"\",\"type\":\"gvrbny\"},{\"parameters\":\"\\\"dataukoila\\\"\",\"type\":\"iduw\"}],\"innerSteps\":[{}]}]},{\"title\":\"pjlh\",\"description\":\"xpzruzythqkk\",\"instructions\":[{\"parameters\":\"\\\"datagxvellv\\\"\",\"type\":\"lnx\"}],\"innerSteps\":[{\"title\":\"tmujdtvmc\",\"description\":\"ymffhmjpddnyx\",\"instructions\":[{\"parameters\":\"\\\"datav\\\"\",\"type\":\"zmzqmzjqrb\"},{\"parameters\":\"\\\"datapv\\\"\",\"type\":\"mdyfoebojtj\"},{\"parameters\":\"\\\"datapglaoh\\\"\",\"type\":\"qk\"},{\"parameters\":\"\\\"datajtnqjil\\\"\",\"type\":\"ywkdcwmqsy\"}],\"innerSteps\":[{},{},{},{}]},{\"title\":\"hxdqaol\",\"description\":\"lnkkbjpjvlywltmf\",\"instructions\":[{\"parameters\":\"\\\"databjwhlwyjfnqzocr\\\"\",\"type\":\"zgczeu\"},{\"parameters\":\"\\\"datatgxdncaqt\\\"\",\"type\":\"iekoif\"}],\"innerSteps\":[{},{}]},{\"title\":\"ttzgixgyrihlg\",\"description\":\"behlqtxnr\",\"instructions\":[{\"parameters\":\"\\\"datandrndpgf\\\"\",\"type\":\"odhda\"},{\"parameters\":\"\\\"dataotwfhipxwgsab\\\"\",\"type\":\"c\"},{\"parameters\":\"\\\"datapowzafcz\\\"\",\"type\":\"umljcirvpef\"}],\"innerSteps\":[{}]},{\"title\":\"ei\",\"description\":\"tjnsx\",\"instructions\":[{\"parameters\":\"\\\"datalnsjhw\\\"\",\"type\":\"uyx\"},{\"parameters\":\"\\\"databxqvmvuayt\\\"\",\"type\":\"adxkxeqbwpntghy\"}],\"innerSteps\":[{}]}]}],\"logo\":\"cdrnxsl\",\"isConnectivityCriteriasMatchSome\":true},\"connectionsConfig\":{\"templateSpecName\":\"ladltxkpbqhvfd\",\"templateSpecVersion\":\"qjwkrhwz\"}}") + .toObject(CustomizableConnectorDefinitionProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T12:59:38Z"), model.createdTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T20:44Z"), model.lastModifiedUtc()); + Assertions.assertEquals("dbtwaokbavly", model.connectorUiConfig().id()); + Assertions.assertEquals("taaknwfrkebsmhp", model.connectorUiConfig().title()); + Assertions.assertEquals("ujd", model.connectorUiConfig().publisher()); + Assertions.assertEquals("gatolekscbctnan", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("mwbzxpdc", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("dpkawnsnl", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("imouxwksqmudmfco", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("nawnvz", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("lnk", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals("wsxvjab", model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("axuyvymcnud", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(11976518, model.connectorUiConfig().availability().status()); + Assertions.assertTrue(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals("incryqxzx", model.connectorUiConfig().permissions().tenant().get(0)); + Assertions.assertEquals("ibmq", model.connectorUiConfig().permissions().licenses().get(0)); + Assertions.assertEquals("ymqruqguhfupet", + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("svvoqsbpkflanfk", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("xsyaowuzowpuoh", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.WORKSPACE, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions + .assertTrue(model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertTrue( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertFalse( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertTrue( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertEquals("umzued", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("yzbfvxovqkx", model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("ijpeuql", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("x", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals("me", model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("ioulndhzyoe", + model.connectorUiConfig().instructionSteps().get(0).innerSteps().get(0).title()); + Assertions.assertEquals("ht", + model.connectorUiConfig().instructionSteps().get(0).innerSteps().get(0).description()); + Assertions.assertEquals("vidmytzl", + model.connectorUiConfig().instructionSteps().get(0).innerSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("cdrnxsl", model.connectorUiConfig().logo()); + Assertions.assertTrue(model.connectorUiConfig().isConnectivityCriteriasMatchSome()); + Assertions.assertEquals("ladltxkpbqhvfd", model.connectionsConfig().templateSpecName()); + Assertions.assertEquals("qjwkrhwz", model.connectionsConfig().templateSpecVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomizableConnectorDefinitionProperties model = new CustomizableConnectorDefinitionProperties() + .withCreatedTimeUtc(OffsetDateTime.parse("2021-08-10T12:59:38Z")) + .withLastModifiedUtc(OffsetDateTime.parse("2021-01-01T20:44Z")) + .withConnectorUiConfig(new CustomizableConnectorUiConfig().withId("dbtwaokbavly") + .withTitle("taaknwfrkebsmhp") + .withPublisher("ujd") + .withDescriptionMarkdown("gatolekscbctnan") + .withGraphQueries(Arrays.asList( + new GraphQuery().withMetricName("mwbzxpdc") + .withLegend("dpkawnsnl") + .withBaseQuery("imouxwksqmudmfco"), + new GraphQuery().withMetricName("bicziuswswj") + .withLegend("kbqsjhbtqqvyfscy") + .withBaseQuery("fwbivqvo"), + new GraphQuery().withMetricName("fuy").withLegend("wvbhlimbyq").withBaseQuery("crood"), + new GraphQuery().withMetricName("ikcdrdaasax").withLegend("obsmf").withBaseQuery("wiyjvzuko"))) + .withDataTypes( + Arrays.asList(new ConnectorDataType().withName("nawnvz").withLastDataReceivedQuery("lnk"))) + .withConnectivityCriteria(Arrays.asList( + new ConnectivityCriterion().withType("wsxvjab").withValue(Arrays.asList("axuyvymcnud")), + new ConnectivityCriterion().withType("doabhj").withValue(Arrays.asList("qweuip", "pvksmit")), + new ConnectivityCriterion().withType("sqxtltclkrdpq") + .withValue(Arrays.asList("yrfrak", "ldgrcw", "cmfcnrjajq")), + new ConnectivityCriterion().withType("atxjtiel").withValue(Arrays.asList("gxxgfb", "mtlpqagyno")))) + .withAvailability(new ConnectorDefinitionsAvailability().withStatus(11976518).withIsPreview(true)) + .withPermissions(new ConnectorDefinitionsPermissions().withTenant(Arrays.asList("incryqxzx")) + .withLicenses(Arrays.asList("ibmq")) + .withResourceProvider(Arrays.asList( + new ConnectorDefinitionsResourceProvider().withProvider("ymqruqguhfupet") + .withPermissionsDisplayText("svvoqsbpkflanfk") + .withProviderDisplayName("xsyaowuzowpuoh") + .withScope(ProviderPermissionsScope.WORKSPACE) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(true) + .withWrite(true) + .withDelete(false) + .withAction(true)), + new ConnectorDefinitionsResourceProvider().withProvider("ztiochluti") + .withPermissionsDisplayText("mqrud") + .withProviderDisplayName("izcbfzmcrunfhiuc") + .withScope(ProviderPermissionsScope.RESOURCE_GROUP) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(true) + .withWrite(false) + .withDelete(true) + .withAction(false)))) + .withCustoms( + Arrays.asList(new CustomPermissionDetails().withName("umzued").withDescription("yzbfvxovqkx"), + new CustomPermissionDetails().withName("uxqggvqrnhyhl").withDescription("cjsqggjhffbxr")))) + .withInstructionSteps(Arrays.asList( + new InstructionStep().withTitle("ijpeuql") + .withDescription("x") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datatvxwmwwmjswenaww\"").withType("me"))) + .withInnerSteps(Arrays.asList(new InstructionStep().withTitle("ioulndhzyoe") + .withDescription("ht") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datah\"").withType("vidmytzl"), + new InstructionStepDetails().withParameters("\"dataglxpnovyoanfbcsw\"") + .withType("agyw"), + new InstructionStepDetails().withParameters("\"datat\"").withType("igvjrktp"), + new InstructionStepDetails().withParameters("\"dataaeukyawohpm\"").withType("hqnucs"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep(), + new InstructionStep(), new InstructionStep())))), + new InstructionStep().withTitle("i") + .withDescription("jtdlp") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datanjg\"").withType("zlsvbzfcpuoeed"), + new InstructionStepDetails().withParameters("\"datajcciklhsyek\"").withType("drenxol"), + new InstructionStepDetails().withParameters("\"datai\"").withType("ehqbeivdlhydwbdb"), + new InstructionStepDetails().withParameters("\"datagrlpuny\"").withType("jlkesmmpath"))) + .withInnerSteps(Arrays.asList(new InstructionStep().withTitle("h") + .withDescription("an") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datallbvgwzsfftedous\"") + .withType("ktjtgra"), + new InstructionStepDetails().withParameters("\"dataaqo\"").withType("fkbebauzl"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep())))), + new InstructionStep().withTitle("xwpfhnjzud") + .withDescription("pzkg") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"dataoywhczzqrhmngqbe\"").withType("ygisrz"))) + .withInnerSteps(Arrays.asList(new InstructionStep().withTitle("d") + .withDescription("jch") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datapwctofl\"").withType("seac"), + new InstructionStepDetails().withParameters("\"datahztxkbrfgd\"") + .withType("wjiyewhfjsrwq"), + new InstructionStepDetails().withParameters("\"dataxet\"").withType("gcwvrrmdqntycna"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep(), + new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("maxgnuyeamcmhudf") + .withDescription("cehokw") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datatwloesqr\"").withType("gvrbny"), + new InstructionStepDetails().withParameters("\"dataukoila\"").withType("iduw"))) + .withInnerSteps(Arrays.asList(new InstructionStep())))), + new InstructionStep().withTitle("pjlh") + .withDescription("xpzruzythqkk") + .withInstructions(Arrays + .asList(new InstructionStepDetails().withParameters("\"datagxvellv\"").withType("lnx"))) + .withInnerSteps(Arrays.asList( + new InstructionStep().withTitle("tmujdtvmc") + .withDescription("ymffhmjpddnyx") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datav\"").withType("zmzqmzjqrb"), + new InstructionStepDetails().withParameters("\"datapv\"").withType("mdyfoebojtj"), + new InstructionStepDetails().withParameters("\"datapglaoh\"").withType("qk"), + new InstructionStepDetails().withParameters("\"datajtnqjil\"") + .withType("ywkdcwmqsy"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep(), + new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("hxdqaol") + .withDescription("lnkkbjpjvlywltmf") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"databjwhlwyjfnqzocr\"") + .withType("zgczeu"), + new InstructionStepDetails().withParameters("\"datatgxdncaqt\"") + .withType("iekoif"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("ttzgixgyrihlg") + .withDescription("behlqtxnr") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datandrndpgf\"").withType("odhda"), + new InstructionStepDetails().withParameters("\"dataotwfhipxwgsab\"").withType("c"), + new InstructionStepDetails().withParameters("\"datapowzafcz\"") + .withType("umljcirvpef"))) + .withInnerSteps(Arrays.asList(new InstructionStep())), + new InstructionStep().withTitle("ei") + .withDescription("tjnsx") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datalnsjhw\"").withType("uyx"), + new InstructionStepDetails().withParameters("\"databxqvmvuayt\"") + .withType("adxkxeqbwpntghy"))) + .withInnerSteps(Arrays.asList(new InstructionStep())))))) + .withLogo("cdrnxsl") + .withIsConnectivityCriteriasMatchSome(true)) + .withConnectionsConfig(new CustomizableConnectionsConfig().withTemplateSpecName("ladltxkpbqhvfd") + .withTemplateSpecVersion("qjwkrhwz")); + model = BinaryData.fromObject(model).toObject(CustomizableConnectorDefinitionProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-10T12:59:38Z"), model.createdTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-01T20:44Z"), model.lastModifiedUtc()); + Assertions.assertEquals("dbtwaokbavly", model.connectorUiConfig().id()); + Assertions.assertEquals("taaknwfrkebsmhp", model.connectorUiConfig().title()); + Assertions.assertEquals("ujd", model.connectorUiConfig().publisher()); + Assertions.assertEquals("gatolekscbctnan", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("mwbzxpdc", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("dpkawnsnl", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("imouxwksqmudmfco", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("nawnvz", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("lnk", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals("wsxvjab", model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("axuyvymcnud", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(11976518, model.connectorUiConfig().availability().status()); + Assertions.assertTrue(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals("incryqxzx", model.connectorUiConfig().permissions().tenant().get(0)); + Assertions.assertEquals("ibmq", model.connectorUiConfig().permissions().licenses().get(0)); + Assertions.assertEquals("ymqruqguhfupet", + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("svvoqsbpkflanfk", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("xsyaowuzowpuoh", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.WORKSPACE, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions + .assertTrue(model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertTrue( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertFalse( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertTrue( + model.connectorUiConfig().permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertEquals("umzued", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("yzbfvxovqkx", model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("ijpeuql", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("x", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals("me", model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("ioulndhzyoe", + model.connectorUiConfig().instructionSteps().get(0).innerSteps().get(0).title()); + Assertions.assertEquals("ht", + model.connectorUiConfig().instructionSteps().get(0).innerSteps().get(0).description()); + Assertions.assertEquals("vidmytzl", + model.connectorUiConfig().instructionSteps().get(0).innerSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("cdrnxsl", model.connectorUiConfig().logo()); + Assertions.assertTrue(model.connectorUiConfig().isConnectivityCriteriasMatchSome()); + Assertions.assertEquals("ladltxkpbqhvfd", model.connectionsConfig().templateSpecName()); + Assertions.assertEquals("qjwkrhwz", model.connectionsConfig().templateSpecVersion()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionTests.java new file mode 100644 index 000000000000..8fdbcf6543fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorDefinitionTests.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion; +import com.azure.resourcemanager.securityinsights.models.ConnectorDataType; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectionsConfig; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorDefinition; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.azure.resourcemanager.securityinsights.models.GraphQuery; +import com.azure.resourcemanager.securityinsights.models.InstructionStep; +import com.azure.resourcemanager.securityinsights.models.InstructionStepDetails; +import com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CustomizableConnectorDefinitionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomizableConnectorDefinition model = BinaryData.fromString( + "{\"kind\":\"Customizable\",\"properties\":{\"createdTimeUtc\":\"2021-11-24T15:35:51Z\",\"lastModifiedUtc\":\"2021-08-24T01:07:06Z\",\"connectorUiConfig\":{\"id\":\"glesrwvaexhd\",\"title\":\"trceqnkbrupob\",\"publisher\":\"hdmljz\",\"descriptionMarkdown\":\"cvumepjpbi\",\"graphQueries\":[{\"metricName\":\"zpphepif\",\"legend\":\"xleqircc\",\"baseQuery\":\"cly\"},{\"metricName\":\"cgxvrpj\",\"legend\":\"vczuodacpune\",\"baseQuery\":\"tepdjxqes\"},{\"metricName\":\"oy\",\"legend\":\"uiylpc\",\"baseQuery\":\"aewse\"}],\"dataTypes\":[{\"name\":\"eskwxeg\",\"lastDataReceivedQuery\":\"phrgfnzhctm\"}],\"connectivityCriteria\":[{\"type\":\"sghpbcbcpzarpze\",\"value\":[\"dldtzmpyp\"]},{\"type\":\"fcpczshnuqndaiz\",\"value\":[\"kh\",\"ytus\"]},{\"type\":\"xhmt\",\"value\":[\"egw\",\"iukvzwydwt\",\"haokgkskjiv\"]}],\"availability\":{\"status\":1659687624,\"isPreview\":false},\"permissions\":{\"tenant\":[\"u\",\"peexpgeumilhwuit\",\"dexyionofninbdb\"],\"licenses\":[\"cw\",\"qrs\",\"pcbbprtugav\"],\"resourceProvider\":[{\"provider\":\"cyksivmfo\",\"permissionsDisplayText\":\"dr\",\"providerDisplayName\":\"bfcmkrfts\",\"scope\":\"Subscription\",\"requiredPermissions\":{}},{\"provider\":\"wjjxsgm\",\"permissionsDisplayText\":\"awvifdxke\",\"providerDisplayName\":\"if\",\"scope\":\"Subscription\",\"requiredPermissions\":{}},{\"provider\":\"cjxwkloozrvtxvcm\",\"permissionsDisplayText\":\"funlcpxxvi\",\"providerDisplayName\":\"yeyng\",\"scope\":\"Workspace\",\"requiredPermissions\":{}}],\"customs\":[{\"name\":\"quv\",\"description\":\"ygg\"}]},\"instructionSteps\":[{\"title\":\"crdcueljti\",\"description\":\"xmfqryarvsxzqbg\",\"instructions\":[{\"parameters\":\"\\\"datakayspthz\\\"\",\"type\":\"dubtlmj\"},{\"parameters\":\"\\\"datagblioskkfmkm\\\"\",\"type\":\"djxyxgbkkqvjcteo\"},{\"parameters\":\"\\\"datadlrslskk\\\"\",\"type\":\"pxvjnzd\"}],\"innerSteps\":[{}]},{\"title\":\"ojhpcnabxzfsn\",\"description\":\"ytexvzilmhivzk\",\"instructions\":[{\"parameters\":\"\\\"datancknrzdajlsk\\\"\",\"type\":\"ptjxulweuc\"},{\"parameters\":\"\\\"datarthxqlehmcg\\\"\",\"type\":\"jei\"}],\"innerSteps\":[{},{},{}]},{\"title\":\"oka\",\"description\":\"fejvqn\",\"instructions\":[{\"parameters\":\"\\\"databqd\\\"\",\"type\":\"bzfivfok\"},{\"parameters\":\"\\\"dataysthhza\\\"\",\"type\":\"jfwyyrlhgenuze\"},{\"parameters\":\"\\\"datagvkvebaqszll\\\"\",\"type\":\"zlsmmdqgmihzpim\"}],\"innerSteps\":[{}]}],\"logo\":\"nxtminklog\",\"isConnectivityCriteriasMatchSome\":false},\"connectionsConfig\":{\"templateSpecName\":\"zarhzvqnsqktcmbj\",\"templateSpecVersion\":\"zzoslpkyb\"}},\"etag\":\"lwkzpgajsqjcem\",\"id\":\"mfuvqarwzxuqr\",\"name\":\"bluimmbw\",\"type\":\"sfgtdmbvxekra\"}") + .toObject(CustomizableConnectorDefinition.class); + Assertions.assertEquals("lwkzpgajsqjcem", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T15:35:51Z"), model.createdTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T01:07:06Z"), model.lastModifiedUtc()); + Assertions.assertEquals("glesrwvaexhd", model.connectorUiConfig().id()); + Assertions.assertEquals("trceqnkbrupob", model.connectorUiConfig().title()); + Assertions.assertEquals("hdmljz", model.connectorUiConfig().publisher()); + Assertions.assertEquals("cvumepjpbi", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("zpphepif", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("xleqircc", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("cly", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("eskwxeg", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("phrgfnzhctm", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals("sghpbcbcpzarpze", model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("dldtzmpyp", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(1659687624, model.connectorUiConfig().availability().status()); + Assertions.assertFalse(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals("u", model.connectorUiConfig().permissions().tenant().get(0)); + Assertions.assertEquals("cw", model.connectorUiConfig().permissions().licenses().get(0)); + Assertions.assertEquals("cyksivmfo", + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("dr", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("bfcmkrfts", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.SUBSCRIPTION, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions.assertEquals("quv", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("ygg", model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("crdcueljti", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("xmfqryarvsxzqbg", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals("dubtlmj", + model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("nxtminklog", model.connectorUiConfig().logo()); + Assertions.assertFalse(model.connectorUiConfig().isConnectivityCriteriasMatchSome()); + Assertions.assertEquals("zarhzvqnsqktcmbj", model.connectionsConfig().templateSpecName()); + Assertions.assertEquals("zzoslpkyb", model.connectionsConfig().templateSpecVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomizableConnectorDefinition model = new CustomizableConnectorDefinition().withEtag("lwkzpgajsqjcem") + .withCreatedTimeUtc(OffsetDateTime.parse("2021-11-24T15:35:51Z")) + .withLastModifiedUtc(OffsetDateTime.parse("2021-08-24T01:07:06Z")) + .withConnectorUiConfig(new CustomizableConnectorUiConfig().withId("glesrwvaexhd") + .withTitle("trceqnkbrupob") + .withPublisher("hdmljz") + .withDescriptionMarkdown("cvumepjpbi") + .withGraphQueries(Arrays.asList( + new GraphQuery().withMetricName("zpphepif").withLegend("xleqircc").withBaseQuery("cly"), + new GraphQuery().withMetricName("cgxvrpj").withLegend("vczuodacpune").withBaseQuery("tepdjxqes"), + new GraphQuery().withMetricName("oy").withLegend("uiylpc").withBaseQuery("aewse"))) + .withDataTypes( + Arrays.asList(new ConnectorDataType().withName("eskwxeg").withLastDataReceivedQuery("phrgfnzhctm"))) + .withConnectivityCriteria(Arrays.asList( + new ConnectivityCriterion().withType("sghpbcbcpzarpze").withValue(Arrays.asList("dldtzmpyp")), + new ConnectivityCriterion().withType("fcpczshnuqndaiz").withValue(Arrays.asList("kh", "ytus")), + new ConnectivityCriterion().withType("xhmt") + .withValue(Arrays.asList("egw", "iukvzwydwt", "haokgkskjiv")))) + .withAvailability(new ConnectorDefinitionsAvailability().withStatus(1659687624).withIsPreview(false)) + .withPermissions(new ConnectorDefinitionsPermissions() + .withTenant(Arrays.asList("u", "peexpgeumilhwuit", "dexyionofninbdb")) + .withLicenses(Arrays.asList("cw", "qrs", "pcbbprtugav")) + .withResourceProvider(Arrays.asList( + new ConnectorDefinitionsResourceProvider().withProvider("cyksivmfo") + .withPermissionsDisplayText("dr") + .withProviderDisplayName("bfcmkrfts") + .withScope(ProviderPermissionsScope.SUBSCRIPTION) + .withRequiredPermissions(new ResourceProviderRequiredPermissions()), + new ConnectorDefinitionsResourceProvider().withProvider("wjjxsgm") + .withPermissionsDisplayText("awvifdxke") + .withProviderDisplayName("if") + .withScope(ProviderPermissionsScope.SUBSCRIPTION) + .withRequiredPermissions(new ResourceProviderRequiredPermissions()), + new ConnectorDefinitionsResourceProvider().withProvider("cjxwkloozrvtxvcm") + .withPermissionsDisplayText("funlcpxxvi") + .withProviderDisplayName("yeyng") + .withScope(ProviderPermissionsScope.WORKSPACE) + .withRequiredPermissions(new ResourceProviderRequiredPermissions()))) + .withCustoms(Arrays.asList(new CustomPermissionDetails().withName("quv").withDescription("ygg")))) + .withInstructionSteps(Arrays.asList( + new InstructionStep().withTitle("crdcueljti") + .withDescription("xmfqryarvsxzqbg") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datakayspthz\"").withType("dubtlmj"), + new InstructionStepDetails().withParameters("\"datagblioskkfmkm\"") + .withType("djxyxgbkkqvjcteo"), + new InstructionStepDetails().withParameters("\"datadlrslskk\"").withType("pxvjnzd"))) + .withInnerSteps(Arrays.asList(new InstructionStep())), + new InstructionStep().withTitle("ojhpcnabxzfsn") + .withDescription("ytexvzilmhivzk") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datancknrzdajlsk\"").withType("ptjxulweuc"), + new InstructionStepDetails().withParameters("\"datarthxqlehmcg\"").withType("jei"))) + .withInnerSteps( + Arrays.asList(new InstructionStep(), new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("oka") + .withDescription("fejvqn") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"databqd\"").withType("bzfivfok"), + new InstructionStepDetails().withParameters("\"dataysthhza\"").withType("jfwyyrlhgenuze"), + new InstructionStepDetails().withParameters("\"datagvkvebaqszll\"") + .withType("zlsmmdqgmihzpim"))) + .withInnerSteps(Arrays.asList(new InstructionStep())))) + .withLogo("nxtminklog") + .withIsConnectivityCriteriasMatchSome(false)) + .withConnectionsConfig(new CustomizableConnectionsConfig().withTemplateSpecName("zarhzvqnsqktcmbj") + .withTemplateSpecVersion("zzoslpkyb")); + model = BinaryData.fromObject(model).toObject(CustomizableConnectorDefinition.class); + Assertions.assertEquals("lwkzpgajsqjcem", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T15:35:51Z"), model.createdTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T01:07:06Z"), model.lastModifiedUtc()); + Assertions.assertEquals("glesrwvaexhd", model.connectorUiConfig().id()); + Assertions.assertEquals("trceqnkbrupob", model.connectorUiConfig().title()); + Assertions.assertEquals("hdmljz", model.connectorUiConfig().publisher()); + Assertions.assertEquals("cvumepjpbi", model.connectorUiConfig().descriptionMarkdown()); + Assertions.assertEquals("zpphepif", model.connectorUiConfig().graphQueries().get(0).metricName()); + Assertions.assertEquals("xleqircc", model.connectorUiConfig().graphQueries().get(0).legend()); + Assertions.assertEquals("cly", model.connectorUiConfig().graphQueries().get(0).baseQuery()); + Assertions.assertEquals("eskwxeg", model.connectorUiConfig().dataTypes().get(0).name()); + Assertions.assertEquals("phrgfnzhctm", model.connectorUiConfig().dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals("sghpbcbcpzarpze", model.connectorUiConfig().connectivityCriteria().get(0).type()); + Assertions.assertEquals("dldtzmpyp", model.connectorUiConfig().connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(1659687624, model.connectorUiConfig().availability().status()); + Assertions.assertFalse(model.connectorUiConfig().availability().isPreview()); + Assertions.assertEquals("u", model.connectorUiConfig().permissions().tenant().get(0)); + Assertions.assertEquals("cw", model.connectorUiConfig().permissions().licenses().get(0)); + Assertions.assertEquals("cyksivmfo", + model.connectorUiConfig().permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("dr", + model.connectorUiConfig().permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("bfcmkrfts", + model.connectorUiConfig().permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.SUBSCRIPTION, + model.connectorUiConfig().permissions().resourceProvider().get(0).scope()); + Assertions.assertEquals("quv", model.connectorUiConfig().permissions().customs().get(0).name()); + Assertions.assertEquals("ygg", model.connectorUiConfig().permissions().customs().get(0).description()); + Assertions.assertEquals("crdcueljti", model.connectorUiConfig().instructionSteps().get(0).title()); + Assertions.assertEquals("xmfqryarvsxzqbg", model.connectorUiConfig().instructionSteps().get(0).description()); + Assertions.assertEquals("dubtlmj", + model.connectorUiConfig().instructionSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("nxtminklog", model.connectorUiConfig().logo()); + Assertions.assertFalse(model.connectorUiConfig().isConnectivityCriteriasMatchSome()); + Assertions.assertEquals("zarhzvqnsqktcmbj", model.connectionsConfig().templateSpecName()); + Assertions.assertEquals("zzoslpkyb", model.connectionsConfig().templateSpecVersion()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorUiConfigTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorUiConfigTests.java new file mode 100644 index 000000000000..f9f66b70d391 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomizableConnectorUiConfigTests.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConnectivityCriterion; +import com.azure.resourcemanager.securityinsights.models.ConnectorDataType; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsAvailability; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsPermissions; +import com.azure.resourcemanager.securityinsights.models.ConnectorDefinitionsResourceProvider; +import com.azure.resourcemanager.securityinsights.models.CustomPermissionDetails; +import com.azure.resourcemanager.securityinsights.models.CustomizableConnectorUiConfig; +import com.azure.resourcemanager.securityinsights.models.GraphQuery; +import com.azure.resourcemanager.securityinsights.models.InstructionStep; +import com.azure.resourcemanager.securityinsights.models.InstructionStepDetails; +import com.azure.resourcemanager.securityinsights.models.ProviderPermissionsScope; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CustomizableConnectorUiConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomizableConnectorUiConfig model = BinaryData.fromString( + "{\"id\":\"nojisgglmvok\",\"title\":\"tuz\",\"publisher\":\"jctibpvbkae\",\"descriptionMarkdown\":\"xsmzygdf\",\"graphQueries\":[{\"metricName\":\"kwseivmakxhyso\",\"legend\":\"ljuxl\",\"baseQuery\":\"bectvtfjmskdch\"}],\"dataTypes\":[{\"name\":\"iubavlzwpvgm\",\"lastDataReceivedQuery\":\"a\"},{\"name\":\"kzaz\",\"lastDataReceivedQuery\":\"gokedgjqafkm\"},{\"name\":\"rokzrthqetwpq\",\"lastDataReceivedQuery\":\"tvaoznqn\"},{\"name\":\"xiezeagmceit\",\"lastDataReceivedQuery\":\"ugedh\"}],\"connectivityCriteria\":[{\"type\":\"jstlzmblsyj\",\"value\":[\"lctaeb\",\"syrled\"]}],\"availability\":{\"status\":1880463040,\"isPreview\":false},\"permissions\":{\"tenant\":[\"qigdx\"],\"licenses\":[\"geafgfosehxlzsxe\",\"ppkkwaaeskyf\",\"lp\"],\"resourceProvider\":[{\"provider\":\"toyrplixlajml\",\"permissionsDisplayText\":\"pq\",\"providerDisplayName\":\"evhamfowg\",\"scope\":\"Workspace\",\"requiredPermissions\":{\"read\":true,\"write\":true,\"delete\":false,\"action\":true}},{\"provider\":\"zwaqxofqo\",\"permissionsDisplayText\":\"chiqbplvfid\",\"providerDisplayName\":\"sztekxby\",\"scope\":\"Workspace\",\"requiredPermissions\":{\"read\":true,\"write\":false,\"delete\":false,\"action\":false}}],\"customs\":[{\"name\":\"qadagrhr\",\"description\":\"icxdwyjfo\"},{\"name\":\"xwyovcxjsgbip\",\"description\":\"ukdveksbuhoduc\"},{\"name\":\"v\",\"description\":\"scrdp\"},{\"name\":\"bfdyjduss\",\"description\":\"yszekbhwlka\"}]},\"instructionSteps\":[{\"title\":\"krehbfrnuybfflj\",\"description\":\"imreoag\",\"instructions\":[{\"parameters\":\"\\\"dataaadusrexxfa\\\"\",\"type\":\"sqwudohzilfmnli\"},{\"parameters\":\"\\\"datapsimsf\\\"\",\"type\":\"ypofqpmbhyqgs\"}],\"innerSteps\":[{\"title\":\"ttjxophgerhsmvgo\",\"description\":\"wzm\",\"instructions\":[{\"parameters\":\"\\\"datari\\\"\",\"type\":\"ysfn\"},{\"parameters\":\"\\\"datamsqywwwmhkruwae\\\"\",\"type\":\"rympmlq\"},{\"parameters\":\"\\\"datain\\\"\",\"type\":\"zduewihapfjii\"}],\"innerSteps\":[{}]},{\"title\":\"iqfl\",\"description\":\"jh\",\"instructions\":[{\"parameters\":\"\\\"databi\\\"\",\"type\":\"dfsbwceivb\"},{\"parameters\":\"\\\"datazipbwxgoooxzp\\\"\",\"type\":\"admskx\"},{\"parameters\":\"\\\"datanpd\\\"\",\"type\":\"zigjsugswhgsaodk\"}],\"innerSteps\":[{},{},{},{}]},{\"title\":\"afoctohz\",\"description\":\"quvwsxbgn\",\"instructions\":[{\"parameters\":\"\\\"datarvqchoadhrsxqvzv\\\"\",\"type\":\"pabdsrg\"},{\"parameters\":\"\\\"dataajglzrsubklr\\\"\",\"type\":\"hjnlt\"},{\"parameters\":\"\\\"dataetjdvqydieqqkwa\\\"\",\"type\":\"uwdxvqzxoebwgj\"},{\"parameters\":\"\\\"databibanbau\\\"\",\"type\":\"wtzvpakloz\"}],\"innerSteps\":[{},{}]}]},{\"title\":\"rpejp\",\"description\":\"s\",\"instructions\":[{\"parameters\":\"\\\"datatttk\\\"\",\"type\":\"s\"}],\"innerSteps\":[{\"title\":\"rswgkpjhboyikeb\",\"description\":\"hkslgwlokhueoij\",\"instructions\":[{\"parameters\":\"\\\"dataqypzqzufgs\\\"\",\"type\":\"fejyvdwtfxptpqa\"},{\"parameters\":\"\\\"dataamkncfgy\\\"\",\"type\":\"mxsnxocuul\"}],\"innerSteps\":[{}]},{\"title\":\"poy\",\"description\":\"wwdjuxdbdl\",\"instructions\":[{\"parameters\":\"\\\"datadyrcvuqb\\\"\",\"type\":\"gzlrqhbj\"},{\"parameters\":\"\\\"dataqogdx\\\"\",\"type\":\"bsfp\"},{\"parameters\":\"\\\"dataxxtjlflecomi\\\"\",\"type\":\"xojjl\"},{\"parameters\":\"\\\"dataxxdhilzzdzzqjm\\\"\",\"type\":\"ezay\"}],\"innerSteps\":[{},{},{}]},{\"title\":\"bqlotokhtvwtazn\",\"description\":\"qww\",\"instructions\":[{\"parameters\":\"\\\"datayofgwhnkbtlwljss\\\"\",\"type\":\"ctsnldkpwol\"},{\"parameters\":\"\\\"dataisubxbteog\\\"\",\"type\":\"gfii\"},{\"parameters\":\"\\\"datarykwlefk\\\"\",\"type\":\"xqceazfpxgn\"}],\"innerSteps\":[{},{}]},{\"title\":\"vluyqqaios\",\"description\":\"cyvaifppuacvfy\",\"instructions\":[{\"parameters\":\"\\\"datapsfx\\\"\",\"type\":\"jdhsoy\"}],\"innerSteps\":[{},{},{},{}]}]}],\"logo\":\"tyqft\",\"isConnectivityCriteriasMatchSome\":false}") + .toObject(CustomizableConnectorUiConfig.class); + Assertions.assertEquals("nojisgglmvok", model.id()); + Assertions.assertEquals("tuz", model.title()); + Assertions.assertEquals("jctibpvbkae", model.publisher()); + Assertions.assertEquals("xsmzygdf", model.descriptionMarkdown()); + Assertions.assertEquals("kwseivmakxhyso", model.graphQueries().get(0).metricName()); + Assertions.assertEquals("ljuxl", model.graphQueries().get(0).legend()); + Assertions.assertEquals("bectvtfjmskdch", model.graphQueries().get(0).baseQuery()); + Assertions.assertEquals("iubavlzwpvgm", model.dataTypes().get(0).name()); + Assertions.assertEquals("a", model.dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals("jstlzmblsyj", model.connectivityCriteria().get(0).type()); + Assertions.assertEquals("lctaeb", model.connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(1880463040, model.availability().status()); + Assertions.assertFalse(model.availability().isPreview()); + Assertions.assertEquals("qigdx", model.permissions().tenant().get(0)); + Assertions.assertEquals("geafgfosehxlzsxe", model.permissions().licenses().get(0)); + Assertions.assertEquals("toyrplixlajml", model.permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("pq", model.permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("evhamfowg", model.permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.WORKSPACE, + model.permissions().resourceProvider().get(0).scope()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertFalse(model.permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertEquals("qadagrhr", model.permissions().customs().get(0).name()); + Assertions.assertEquals("icxdwyjfo", model.permissions().customs().get(0).description()); + Assertions.assertEquals("krehbfrnuybfflj", model.instructionSteps().get(0).title()); + Assertions.assertEquals("imreoag", model.instructionSteps().get(0).description()); + Assertions.assertEquals("sqwudohzilfmnli", model.instructionSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("ttjxophgerhsmvgo", model.instructionSteps().get(0).innerSteps().get(0).title()); + Assertions.assertEquals("wzm", model.instructionSteps().get(0).innerSteps().get(0).description()); + Assertions.assertEquals("ysfn", + model.instructionSteps().get(0).innerSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("tyqft", model.logo()); + Assertions.assertFalse(model.isConnectivityCriteriasMatchSome()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomizableConnectorUiConfig model = new CustomizableConnectorUiConfig().withId("nojisgglmvok") + .withTitle("tuz") + .withPublisher("jctibpvbkae") + .withDescriptionMarkdown("xsmzygdf") + .withGraphQueries(Arrays.asList( + new GraphQuery().withMetricName("kwseivmakxhyso").withLegend("ljuxl").withBaseQuery("bectvtfjmskdch"))) + .withDataTypes( + Arrays.asList(new ConnectorDataType().withName("iubavlzwpvgm").withLastDataReceivedQuery("a"), + new ConnectorDataType().withName("kzaz").withLastDataReceivedQuery("gokedgjqafkm"), + new ConnectorDataType().withName("rokzrthqetwpq").withLastDataReceivedQuery("tvaoznqn"), + new ConnectorDataType().withName("xiezeagmceit").withLastDataReceivedQuery("ugedh"))) + .withConnectivityCriteria(Arrays.asList( + new ConnectivityCriterion().withType("jstlzmblsyj").withValue(Arrays.asList("lctaeb", "syrled")))) + .withAvailability(new ConnectorDefinitionsAvailability().withStatus(1880463040).withIsPreview(false)) + .withPermissions(new ConnectorDefinitionsPermissions().withTenant(Arrays.asList("qigdx")) + .withLicenses(Arrays.asList("geafgfosehxlzsxe", "ppkkwaaeskyf", "lp")) + .withResourceProvider(Arrays.asList( + new ConnectorDefinitionsResourceProvider().withProvider("toyrplixlajml") + .withPermissionsDisplayText("pq") + .withProviderDisplayName("evhamfowg") + .withScope(ProviderPermissionsScope.WORKSPACE) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(true) + .withWrite(true) + .withDelete(false) + .withAction(true)), + new ConnectorDefinitionsResourceProvider().withProvider("zwaqxofqo") + .withPermissionsDisplayText("chiqbplvfid") + .withProviderDisplayName("sztekxby") + .withScope(ProviderPermissionsScope.WORKSPACE) + .withRequiredPermissions(new ResourceProviderRequiredPermissions().withRead(true) + .withWrite(false) + .withDelete(false) + .withAction(false)))) + .withCustoms( + Arrays.asList(new CustomPermissionDetails().withName("qadagrhr").withDescription("icxdwyjfo"), + new CustomPermissionDetails().withName("xwyovcxjsgbip").withDescription("ukdveksbuhoduc"), + new CustomPermissionDetails().withName("v").withDescription("scrdp"), + new CustomPermissionDetails().withName("bfdyjduss").withDescription("yszekbhwlka")))) + .withInstructionSteps(Arrays.asList( + new InstructionStep().withTitle("krehbfrnuybfflj") + .withDescription("imreoag") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"dataaadusrexxfa\"").withType("sqwudohzilfmnli"), + new InstructionStepDetails().withParameters("\"datapsimsf\"").withType("ypofqpmbhyqgs"))) + .withInnerSteps(Arrays.asList( + new InstructionStep().withTitle("ttjxophgerhsmvgo") + .withDescription("wzm") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datari\"").withType("ysfn"), + new InstructionStepDetails().withParameters("\"datamsqywwwmhkruwae\"") + .withType("rympmlq"), + new InstructionStepDetails().withParameters("\"datain\"").withType("zduewihapfjii"))) + .withInnerSteps(Arrays.asList(new InstructionStep())), + new InstructionStep().withTitle("iqfl") + .withDescription("jh") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"databi\"").withType("dfsbwceivb"), + new InstructionStepDetails().withParameters("\"datazipbwxgoooxzp\"").withType("admskx"), + new InstructionStepDetails().withParameters("\"datanpd\"") + .withType("zigjsugswhgsaodk"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep(), + new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("afoctohz") + .withDescription("quvwsxbgn") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datarvqchoadhrsxqvzv\"") + .withType("pabdsrg"), + new InstructionStepDetails().withParameters("\"dataajglzrsubklr\"").withType("hjnlt"), + new InstructionStepDetails().withParameters("\"dataetjdvqydieqqkwa\"") + .withType("uwdxvqzxoebwgj"), + new InstructionStepDetails().withParameters("\"databibanbau\"").withType("wtzvpakloz"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep())))), + new InstructionStep().withTitle("rpejp") + .withDescription("s") + .withInstructions( + Arrays.asList(new InstructionStepDetails().withParameters("\"datatttk\"").withType("s"))) + .withInnerSteps(Arrays.asList( + new InstructionStep().withTitle("rswgkpjhboyikeb") + .withDescription("hkslgwlokhueoij") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"dataqypzqzufgs\"") + .withType("fejyvdwtfxptpqa"), + new InstructionStepDetails().withParameters("\"dataamkncfgy\"").withType("mxsnxocuul"))) + .withInnerSteps(Arrays.asList(new InstructionStep())), + new InstructionStep().withTitle("poy") + .withDescription("wwdjuxdbdl") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datadyrcvuqb\"").withType("gzlrqhbj"), + new InstructionStepDetails().withParameters("\"dataqogdx\"").withType("bsfp"), + new InstructionStepDetails().withParameters("\"dataxxtjlflecomi\"").withType("xojjl"), + new InstructionStepDetails().withParameters("\"dataxxdhilzzdzzqjm\"").withType("ezay"))) + .withInnerSteps( + Arrays.asList(new InstructionStep(), new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("bqlotokhtvwtazn") + .withDescription("qww") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datayofgwhnkbtlwljss\"") + .withType("ctsnldkpwol"), + new InstructionStepDetails().withParameters("\"dataisubxbteog\"").withType("gfii"), + new InstructionStepDetails().withParameters("\"datarykwlefk\"") + .withType("xqceazfpxgn"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("vluyqqaios") + .withDescription("cyvaifppuacvfy") + .withInstructions(Arrays + .asList(new InstructionStepDetails().withParameters("\"datapsfx\"").withType("jdhsoy"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep(), + new InstructionStep(), new InstructionStep())))))) + .withLogo("tyqft") + .withIsConnectivityCriteriasMatchSome(false); + model = BinaryData.fromObject(model).toObject(CustomizableConnectorUiConfig.class); + Assertions.assertEquals("nojisgglmvok", model.id()); + Assertions.assertEquals("tuz", model.title()); + Assertions.assertEquals("jctibpvbkae", model.publisher()); + Assertions.assertEquals("xsmzygdf", model.descriptionMarkdown()); + Assertions.assertEquals("kwseivmakxhyso", model.graphQueries().get(0).metricName()); + Assertions.assertEquals("ljuxl", model.graphQueries().get(0).legend()); + Assertions.assertEquals("bectvtfjmskdch", model.graphQueries().get(0).baseQuery()); + Assertions.assertEquals("iubavlzwpvgm", model.dataTypes().get(0).name()); + Assertions.assertEquals("a", model.dataTypes().get(0).lastDataReceivedQuery()); + Assertions.assertEquals("jstlzmblsyj", model.connectivityCriteria().get(0).type()); + Assertions.assertEquals("lctaeb", model.connectivityCriteria().get(0).value().get(0)); + Assertions.assertEquals(1880463040, model.availability().status()); + Assertions.assertFalse(model.availability().isPreview()); + Assertions.assertEquals("qigdx", model.permissions().tenant().get(0)); + Assertions.assertEquals("geafgfosehxlzsxe", model.permissions().licenses().get(0)); + Assertions.assertEquals("toyrplixlajml", model.permissions().resourceProvider().get(0).provider()); + Assertions.assertEquals("pq", model.permissions().resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("evhamfowg", model.permissions().resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(ProviderPermissionsScope.WORKSPACE, + model.permissions().resourceProvider().get(0).scope()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertFalse(model.permissions().resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertTrue(model.permissions().resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertEquals("qadagrhr", model.permissions().customs().get(0).name()); + Assertions.assertEquals("icxdwyjfo", model.permissions().customs().get(0).description()); + Assertions.assertEquals("krehbfrnuybfflj", model.instructionSteps().get(0).title()); + Assertions.assertEquals("imreoag", model.instructionSteps().get(0).description()); + Assertions.assertEquals("sqwudohzilfmnli", model.instructionSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("ttjxophgerhsmvgo", model.instructionSteps().get(0).innerSteps().get(0).title()); + Assertions.assertEquals("wzm", model.instructionSteps().get(0).innerSteps().get(0).description()); + Assertions.assertEquals("ysfn", + model.instructionSteps().get(0).innerSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("tyqft", model.logo()); + Assertions.assertFalse(model.isConnectivityCriteriasMatchSome()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsPermissionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsPermissionTests.java new file mode 100644 index 000000000000..70c0ab6571cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsPermissionTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CustomsPermission; +import org.junit.jupiter.api.Assertions; + +public final class CustomsPermissionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CustomsPermission model + = BinaryData.fromString("{\"name\":\"hhmvf\",\"description\":\"apj\"}").toObject(CustomsPermission.class); + Assertions.assertEquals("hhmvf", model.name()); + Assertions.assertEquals("apj", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CustomsPermission model = new CustomsPermission().withName("hhmvf").withDescription("apj"); + model = BinaryData.fromObject(model).toObject(CustomsPermission.class); + Assertions.assertEquals("hhmvf", model.name()); + Assertions.assertEquals("apj", model.description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsTests.java new file mode 100644 index 000000000000..325f8da41aba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/CustomsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Customs; +import org.junit.jupiter.api.Assertions; + +public final class CustomsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Customs model + = BinaryData.fromString("{\"name\":\"kghpcv\",\"description\":\"qirvtk\"}").toObject(Customs.class); + Assertions.assertEquals("kghpcv", model.name()); + Assertions.assertEquals("qirvtk", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Customs model = new Customs().withName("kghpcv").withDescription("qirvtk"); + model = BinaryData.fromObject(model).toObject(Customs.class); + Assertions.assertEquals("kghpcv", model.name()); + Assertions.assertEquals("qirvtk", model.description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DCRConfigurationTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DCRConfigurationTests.java new file mode 100644 index 000000000000..ed14e9853beb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DCRConfigurationTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import org.junit.jupiter.api.Assertions; + +public final class DCRConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DCRConfiguration model = BinaryData.fromString( + "{\"dataCollectionEndpoint\":\"py\",\"dataCollectionRuleImmutableId\":\"gleofjsbgbw\",\"streamName\":\"zvdajfwnncf\"}") + .toObject(DCRConfiguration.class); + Assertions.assertEquals("py", model.dataCollectionEndpoint()); + Assertions.assertEquals("gleofjsbgbw", model.dataCollectionRuleImmutableId()); + Assertions.assertEquals("zvdajfwnncf", model.streamName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DCRConfiguration model = new DCRConfiguration().withDataCollectionEndpoint("py") + .withDataCollectionRuleImmutableId("gleofjsbgbw") + .withStreamName("zvdajfwnncf"); + model = BinaryData.fromObject(model).toObject(DCRConfiguration.class); + Assertions.assertEquals("py", model.dataCollectionEndpoint()); + Assertions.assertEquals("gleofjsbgbw", model.dataCollectionRuleImmutableId()); + Assertions.assertEquals("zvdajfwnncf", model.streamName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDataTypeCommonTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDataTypeCommonTests.java index 0c5ff0f456d6..c6a77c79e512 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDataTypeCommonTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDataTypeCommonTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionArmCollectionWrapperTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionArmCollectionWrapperTests.java new file mode 100644 index 000000000000..8eca9e43256a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionArmCollectionWrapperTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.DataConnectorDefinitionArmCollectionWrapper; +import org.junit.jupiter.api.Assertions; + +public final class DataConnectorDefinitionArmCollectionWrapperTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataConnectorDefinitionArmCollectionWrapper model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"DataConnectorDefinition\",\"etag\":\"lvhyibdrqrswhbu\",\"id\":\"pyrowtj\",\"name\":\"xztfwfqchvczevj\",\"type\":\"nctagfyvrtpqpem\"}],\"nextLink\":\"cgkrepdqhqy\"}") + .toObject(DataConnectorDefinitionArmCollectionWrapper.class); + Assertions.assertEquals("lvhyibdrqrswhbu", model.value().get(0).etag()); + Assertions.assertEquals("cgkrepdqhqy", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionInnerTests.java new file mode 100644 index 000000000000..ecfcedaca4eb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionInnerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import org.junit.jupiter.api.Assertions; + +public final class DataConnectorDefinitionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataConnectorDefinitionInner model = BinaryData.fromString( + "{\"kind\":\"DataConnectorDefinition\",\"etag\":\"csqhtkbtnqlrng\",\"id\":\"mbiipsnawwlqk\",\"name\":\"nxhhl\",\"type\":\"xricctkwmuqq\"}") + .toObject(DataConnectorDefinitionInner.class); + Assertions.assertEquals("csqhtkbtnqlrng", model.etag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataConnectorDefinitionInner model = new DataConnectorDefinitionInner().withEtag("csqhtkbtnqlrng"); + model = BinaryData.fromObject(model).toObject(DataConnectorDefinitionInner.class); + Assertions.assertEquals("csqhtkbtnqlrng", model.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..97b24cdbe547 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorDefinitionInner; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinition; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DataConnectorDefinitionsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"DataConnectorDefinition\",\"etag\":\"fyxoqakvutede\",\"id\":\"o\",\"name\":\"qudjdwcw\",\"type\":\"acd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DataConnectorDefinition response = manager.dataConnectorDefinitions() + .createOrUpdateWithResponse("smvvxkcted", "af", "niffajniwbyzyjuy", + new DataConnectorDefinitionInner().withEtag("lbbugojd"), com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("fyxoqakvutede", response.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..7372c58ead07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DataConnectorDefinitionsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.dataConnectorDefinitions() + .deleteWithResponse("kcehxahnqjbavdbl", "e", "bbvitlnnpafu", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..aad612678731 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinition; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DataConnectorDefinitionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"DataConnectorDefinition\",\"etag\":\"khdsfgjb\",\"id\":\"bdukbglniwvxm\",\"name\":\"scejivo\",\"type\":\"xkonciacdloe\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + DataConnectorDefinition response = manager.dataConnectorDefinitions() + .getWithResponse("uflazfot", "p", "umamdorgl", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("khdsfgjb", response.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListMockTests.java new file mode 100644 index 000000000000..9aa411e54c49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorDefinitionsListMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDefinition; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DataConnectorDefinitionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"DataConnectorDefinition\",\"etag\":\"fnstla\",\"id\":\"dccte\",\"name\":\"vaajyitpyzgwihks\",\"type\":\"urz\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.dataConnectorDefinitions().list("wre", "bndr", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fnstla", response.iterator().next().etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorInnerTests.java index 579b5ac92354..c86d21639ee7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,15 +12,15 @@ public final class DataConnectorInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataConnectorInner model = BinaryData.fromString( - "{\"kind\":\"DataConnector\",\"etag\":\"masxazjpqyegu\",\"id\":\"hb\",\"name\":\"xhejjzzvdud\",\"type\":\"wdslfhotwmcy\"}") + "{\"kind\":\"DataConnector\",\"etag\":\"qwemvxqabckmzeo\",\"id\":\"nhgr\",\"name\":\"ohtwhlpuzj\",\"type\":\"ceezn\"}") .toObject(DataConnectorInner.class); - Assertions.assertEquals("masxazjpqyegu", model.etag()); + Assertions.assertEquals("qwemvxqabckmzeo", model.etag()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataConnectorInner model = new DataConnectorInner().withEtag("masxazjpqyegu"); + DataConnectorInner model = new DataConnectorInner().withEtag("qwemvxqabckmzeo"); model = BinaryData.fromObject(model).toObject(DataConnectorInner.class); - Assertions.assertEquals("masxazjpqyegu", model.etag()); + Assertions.assertEquals("qwemvxqabckmzeo", model.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorListTests.java index fbe497efe9c0..57cbf3118c52 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorListTests.java @@ -1,30 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; -import com.azure.resourcemanager.securityinsights.models.DataConnectorList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.DataConnectorList; import org.junit.jupiter.api.Assertions; public final class DataConnectorListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataConnectorList model = BinaryData.fromString( - "{\"nextLink\":\"xlzevgbmqjqabcy\",\"value\":[{\"kind\":\"DataConnector\",\"etag\":\"vkwlzuvccfwnf\",\"id\":\"acfi\",\"name\":\"nlebxetqgtzxd\",\"type\":\"nqbqqwxr\"},{\"kind\":\"DataConnector\",\"etag\":\"eallnwsubisnj\",\"id\":\"pmng\",\"name\":\"zscxaqwo\",\"type\":\"chcbonqvpkvlrxnj\"},{\"kind\":\"DataConnector\",\"etag\":\"seiphe\",\"id\":\"lokeyy\",\"name\":\"enjbdlwtgrhp\",\"type\":\"jp\"}]}") + "{\"value\":[{\"kind\":\"DataConnector\",\"etag\":\"k\",\"id\":\"abdu\",\"name\":\"vzm\",\"type\":\"ghnysvlpyeuu\"},{\"kind\":\"DataConnector\",\"etag\":\"pdixqbolxv\",\"id\":\"yqqegatxgrznm\",\"name\":\"inmtsdixchwkibm\",\"type\":\"jymncjcagai\"}],\"nextLink\":\"cqzoofjnqjsve\"}") .toObject(DataConnectorList.class); - Assertions.assertEquals("vkwlzuvccfwnf", model.value().get(0).etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataConnectorList model - = new DataConnectorList().withValue(Arrays.asList(new DataConnectorInner().withEtag("vkwlzuvccfwnf"), - new DataConnectorInner().withEtag("eallnwsubisnj"), new DataConnectorInner().withEtag("seiphe"))); - model = BinaryData.fromObject(model).toObject(DataConnectorList.class); - Assertions.assertEquals("vkwlzuvccfwnf", model.value().get(0).etag()); + Assertions.assertEquals("k", model.value().get(0).etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorTenantIdTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorTenantIdTests.java new file mode 100644 index 000000000000..2a706a6727b8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorTenantIdTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataConnectorTenantId; +import org.junit.jupiter.api.Assertions; + +public final class DataConnectorTenantIdTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataConnectorTenantId model + = BinaryData.fromString("{\"tenantId\":\"wyxqiclad\"}").toObject(DataConnectorTenantId.class); + Assertions.assertEquals("wyxqiclad", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataConnectorTenantId model = new DataConnectorTenantId().withTenantId("wyxqiclad"); + model = BinaryData.fromObject(model).toObject(DataConnectorTenantId.class); + Assertions.assertEquals("wyxqiclad", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorWithAlertsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorWithAlertsPropertiesTests.java index fd4dfa4c66c9..1c368fb57042 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorWithAlertsPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorWithAlertsPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,17 +15,17 @@ public final class DataConnectorWithAlertsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataConnectorWithAlertsProperties model - = BinaryData.fromString("{\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}}") + = BinaryData.fromString("{\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") .toObject(DataConnectorWithAlertsProperties.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DataConnectorWithAlertsProperties model = new DataConnectorWithAlertsProperties().withDataTypes(new AlertsDataTypeOfDataConnector() - .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); model = BinaryData.fromObject(model).toObject(DataConnectorWithAlertsProperties.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsTests.java new file mode 100644 index 000000000000..833dd56d87b3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCheckRequirementsTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataConnectorsCheckRequirements; + +public final class DataConnectorsCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataConnectorsCheckRequirements model = BinaryData.fromString("{\"kind\":\"DataConnectorsCheckRequirements\"}") + .toObject(DataConnectorsCheckRequirements.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DataConnectorsCheckRequirements model = new DataConnectorsCheckRequirements(); + model = BinaryData.fromObject(model).toObject(DataConnectorsCheckRequirements.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateWithResponseMockTests.java index 5ab11b4b5a40..4d25c8c92906 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.fluent.models.DataConnectorInner; @@ -22,20 +22,20 @@ public final class DataConnectorsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"kind\":\"DataConnector\",\"etag\":\"kemyil\",\"id\":\"dxjascowvfdj\",\"name\":\"pdxphlkksnmgzvyf\",\"type\":\"jd\"}"; + = "{\"kind\":\"DataConnector\",\"etag\":\"kpzdkiyww\",\"id\":\"vxuhzi\",\"name\":\"ranbtqejfqgh\",\"type\":\"adrvxb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataConnector response = manager.dataConnectors() - .createOrUpdateWithResponse("akizvoaikna", "lnuwiguy", "lykwphvxz", - new DataConnectorInner().withEtag("xhmpejtlkex"), com.azure.core.util.Context.NONE) + .createOrUpdateWithResponse("yfhqyli", "gnbhz", "eninaf", new DataConnectorInner().withEtag("gaocvetzkco"), + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("kemyil", response.etag()); + Assertions.assertEquals("kpzdkiyww", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteWithResponseMockTests.java index 9a211a7fa67f..37fd928ce250 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.dataConnectors() - .deleteWithResponse("zuqnwsithuqo", "yahluqwqulsutr", "bhxykfhyqezvqqug", com.azure.core.util.Context.NONE); + manager.dataConnectors().deleteWithResponse("y", "h", "jbcbrtiqpj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectWithResponseMockTests.java new file mode 100644 index 000000000000..e23ee4353534 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsDisconnectWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DataConnectorsDisconnectWithResponseMockTests { + @Test + public void testDisconnectWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.dataConnectors() + .disconnectWithResponse("baxny", "uygjwqmkakg", "lqznobsd", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetWithResponseMockTests.java index 79412e510d69..042a7318b8bf 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.DataConnector; @@ -21,19 +21,19 @@ public final class DataConnectorsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"DataConnector\",\"etag\":\"vitvqkjyaz\",\"id\":\"mtggmu\",\"name\":\"dchozfnkfexl\",\"type\":\"xn\"}"; + = "{\"kind\":\"DataConnector\",\"etag\":\"nfoaksjwiswzn\",\"id\":\"bhtleiwfiz\",\"name\":\"ehvq\",\"type\":\"ghltndsazg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataConnector response = manager.dataConnectors() - .getWithResponse("dbmairrhvhfnr", "cwnpqigtuujwouhd", "wsigrbjbxsj", com.azure.core.util.Context.NONE) + .getWithResponse("qubryhvbvjyfdw", "upjozgryoc", "wkphilyznbbcim", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vitvqkjyaz", response.etag()); + Assertions.assertEquals("nfoaksjwiswzn", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListMockTests.java index 888ca83eb5c1..599749d40fd4 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataConnectorsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.DataConnector; @@ -22,18 +22,18 @@ public final class DataConnectorsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"DataConnector\",\"etag\":\"vxrh\",\"id\":\"d\",\"name\":\"wrso\",\"type\":\"pl\"}]}"; + = "{\"value\":[{\"kind\":\"DataConnector\",\"etag\":\"mlhcp\",\"id\":\"gtnsxdjhztn\",\"name\":\"pkpmdlt\",\"type\":\"mfhde\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.dataConnectors().list("kpbafvafhl", "ylcc", com.azure.core.util.Context.NONE); + = manager.dataConnectors().list("akamhd", "luicrqxqjzm", com.azure.core.util.Context.NONE); - Assertions.assertEquals("vxrh", response.iterator().next().etag()); + Assertions.assertEquals("mlhcp", response.iterator().next().etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataTypeDefinitionsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataTypeDefinitionsTests.java new file mode 100644 index 000000000000..54c1154ec4c9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DataTypeDefinitionsTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeDefinitions; +import org.junit.jupiter.api.Assertions; + +public final class DataTypeDefinitionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DataTypeDefinitions model + = BinaryData.fromString("{\"dataType\":\"aemcezevftmh\"}").toObject(DataTypeDefinitions.class); + Assertions.assertEquals("aemcezevftmh", model.dataType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentInfoTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentInfoTests.java new file mode 100644 index 000000000000..ebb01be3486f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentInfoTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DeploymentFetchStatus; +import com.azure.resourcemanager.securityinsights.models.DeploymentInfo; +import com.azure.resourcemanager.securityinsights.models.DeploymentResult; +import com.azure.resourcemanager.securityinsights.models.DeploymentState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DeploymentInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DeploymentInfo model = BinaryData.fromString( + "{\"deploymentFetchStatus\":\"NotFound\",\"deployment\":{\"deploymentId\":\"il\",\"deploymentState\":\"Canceling\",\"deploymentResult\":\"Success\",\"deploymentTime\":\"2021-02-09T08:34:42Z\",\"deploymentLogsUrl\":\"djgd\"},\"message\":\"iggq\"}") + .toObject(DeploymentInfo.class); + Assertions.assertEquals(DeploymentFetchStatus.NOT_FOUND, model.deploymentFetchStatus()); + Assertions.assertEquals("il", model.deployment().deploymentId()); + Assertions.assertEquals(DeploymentState.CANCELING, model.deployment().deploymentState()); + Assertions.assertEquals(DeploymentResult.SUCCESS, model.deployment().deploymentResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T08:34:42Z"), model.deployment().deploymentTime()); + Assertions.assertEquals("djgd", model.deployment().deploymentLogsUrl()); + Assertions.assertEquals("iggq", model.message()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentTests.java new file mode 100644 index 000000000000..504e6e20899c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DeploymentTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Deployment; +import com.azure.resourcemanager.securityinsights.models.DeploymentResult; +import com.azure.resourcemanager.securityinsights.models.DeploymentState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class DeploymentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Deployment model = BinaryData.fromString( + "{\"deploymentId\":\"eqfcbuulpy\",\"deploymentState\":\"In_Progress\",\"deploymentResult\":\"Canceled\",\"deploymentTime\":\"2021-03-26T19:23:55Z\",\"deploymentLogsUrl\":\"tujcyoh\"}") + .toObject(Deployment.class); + Assertions.assertEquals("eqfcbuulpy", model.deploymentId()); + Assertions.assertEquals(DeploymentState.IN_PROGRESS, model.deploymentState()); + Assertions.assertEquals(DeploymentResult.CANCELED, model.deploymentResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-26T19:23:55Z"), model.deploymentTime()); + Assertions.assertEquals("tujcyoh", model.deploymentLogsUrl()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityPropertiesTests.java index df4d0ccaf097..574cfe9c2138 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class DnsEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DnsEntityProperties model = BinaryData.fromString( - "{\"dnsServerIpEntityId\":\"jcxcjxgrytfmpcyc\",\"domainName\":\"rmcaykgg\",\"hostIpAddressEntityId\":\"xu\",\"ipAddressEntityIds\":[\"ksxwpnd\",\"cpfnznthjtwkja\",\"srxuzvoam\"],\"additionalData\":{\"os\":\"dataq\",\"ltlaprltzkatbhj\":\"datagbzahgxqdlyr\",\"gunbtgfebwlnbm\":\"dataznnbsoqeqalarvl\"},\"friendlyName\":\"reeudzqavb\"}") + "{\"dnsServerIpEntityId\":\"nfpubntnbatz\",\"domainName\":\"qs\",\"hostIpAddressEntityId\":\"saaelca\",\"ipAddressEntityIds\":[\"ju\",\"plrvkmjcwmjvlg\",\"ggcvk\"],\"additionalData\":{\"psfxsf\":\"\\\"dataizrzb\\\"\",\"ukoveofi\":\"\\\"dataztlvtmvagbwidqlv\\\"\",\"z\":\"\\\"datarvjfnmjmvlw\\\"\",\"lfojuidjp\":\"\\\"dataiblkujr\\\"\"},\"friendlyName\":\"yjucejikzoeo\"}") .toObject(DnsEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DnsEntityProperties model = new DnsEntityProperties(); - model = BinaryData.fromObject(model).toObject(DnsEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityTests.java index a59f5e31e132..97b9a422cefe 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/DnsEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class DnsEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DnsEntity model = BinaryData.fromString( - "{\"kind\":\"DnsResolution\",\"properties\":{\"dnsServerIpEntityId\":\"mikzeb\",\"domainName\":\"bsmswziqgf\",\"hostIpAddressEntityId\":\"okzrus\",\"ipAddressEntityIds\":[\"hczznvf\",\"ycjsx\",\"wwixzvumw\"],\"additionalData\":{\"djh\":\"datahndvnoamldsehao\",\"pelnjetag\":\"dataflzokxco\",\"npbs\":\"datatsxoatftgz\"},\"friendlyName\":\"e\"},\"id\":\"occsr\",\"name\":\"ozihmipgawt\",\"type\":\"xp\"}") + "{\"kind\":\"DnsResolution\",\"properties\":{\"dnsServerIpEntityId\":\"oclu\",\"domainName\":\"pqmem\",\"hostIpAddressEntityId\":\"jk\",\"ipAddressEntityIds\":[\"kyujxsglhsrrr\",\"ejylmbkzu\"],\"additionalData\":{\"uzzjgnrefq\":\"\\\"datagrfihotjewlp\\\"\",\"oihiqak\":\"\\\"datahqo\\\"\",\"brkwpzdqt\":\"\\\"datadiw\\\"\"},\"friendlyName\":\"cspodaqax\"},\"id\":\"pie\",\"name\":\"gbebjf\",\"type\":\"lbmoichd\"}") .toObject(DnsEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DnsEntity model = new DnsEntity(); - model = BinaryData.fromObject(model).toObject(DnsEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..313a06392854 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365CheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class Dynamics365CheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Dynamics365CheckRequirementsProperties model = BinaryData.fromString("{\"tenantId\":\"rgiuztqefzyp\"}") + .toObject(Dynamics365CheckRequirementsProperties.class); + Assertions.assertEquals("rgiuztqefzyp", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Dynamics365CheckRequirementsProperties model + = new Dynamics365CheckRequirementsProperties().withTenantId("rgiuztqefzyp"); + model = BinaryData.fromObject(model).toObject(Dynamics365CheckRequirementsProperties.class); + Assertions.assertEquals("rgiuztqefzyp", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsTests.java new file mode 100644 index 000000000000..9ef27fcf4ec5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365CheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Dynamics365CheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class Dynamics365CheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Dynamics365CheckRequirements model + = BinaryData.fromString("{\"kind\":\"Dynamics365\",\"properties\":{\"tenantId\":\"grs\"}}") + .toObject(Dynamics365CheckRequirements.class); + Assertions.assertEquals("grs", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Dynamics365CheckRequirements model = new Dynamics365CheckRequirements().withTenantId("grs"); + model = BinaryData.fromObject(model).toObject(Dynamics365CheckRequirements.class); + Assertions.assertEquals("grs", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesDynamics365CdsActivitiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesDynamics365CdsActivitiesTests.java new file mode 100644 index 000000000000..65322237b890 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesDynamics365CdsActivitiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities; +import org.junit.jupiter.api.Assertions; + +public final class Dynamics365DataConnectorDataTypesDynamics365CdsActivitiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Dynamics365DataConnectorDataTypesDynamics365CdsActivities model + = BinaryData.fromString("{\"state\":\"Disabled\"}") + .toObject(Dynamics365DataConnectorDataTypesDynamics365CdsActivities.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Dynamics365DataConnectorDataTypesDynamics365CdsActivities model + = new Dynamics365DataConnectorDataTypesDynamics365CdsActivities().withState(DataTypeState.DISABLED); + model = BinaryData.fromObject(model).toObject(Dynamics365DataConnectorDataTypesDynamics365CdsActivities.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesTests.java new file mode 100644 index 000000000000..475039a0352b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorDataTypesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities; +import org.junit.jupiter.api.Assertions; + +public final class Dynamics365DataConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Dynamics365DataConnectorDataTypes model + = BinaryData.fromString("{\"dynamics365CdsActivities\":{\"state\":\"Enabled\"}}") + .toObject(Dynamics365DataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.dynamics365CdsActivities().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Dynamics365DataConnectorDataTypes model = new Dynamics365DataConnectorDataTypes().withDynamics365CdsActivities( + new Dynamics365DataConnectorDataTypesDynamics365CdsActivities().withState(DataTypeState.ENABLED)); + model = BinaryData.fromObject(model).toObject(Dynamics365DataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.dynamics365CdsActivities().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorPropertiesTests.java new file mode 100644 index 000000000000..214dcd0f4cbc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.Dynamics365DataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Dynamics365DataConnectorDataTypesDynamics365CdsActivities; +import org.junit.jupiter.api.Assertions; + +public final class Dynamics365DataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Dynamics365DataConnectorProperties model = BinaryData + .fromString( + "{\"dataTypes\":{\"dynamics365CdsActivities\":{\"state\":\"Disabled\"}},\"tenantId\":\"ybnxgztlcgc\"}") + .toObject(Dynamics365DataConnectorProperties.class); + Assertions.assertEquals("ybnxgztlcgc", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().dynamics365CdsActivities().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Dynamics365DataConnectorProperties model = new Dynamics365DataConnectorProperties().withTenantId("ybnxgztlcgc") + .withDataTypes(new Dynamics365DataConnectorDataTypes().withDynamics365CdsActivities( + new Dynamics365DataConnectorDataTypesDynamics365CdsActivities().withState(DataTypeState.DISABLED))); + model = BinaryData.fromObject(model).toObject(Dynamics365DataConnectorProperties.class); + Assertions.assertEquals("ybnxgztlcgc", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().dynamics365CdsActivities().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorTests.java new file mode 100644 index 000000000000..1af2a8db612e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Dynamics365DataConnectorTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +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 org.junit.jupiter.api.Assertions; + +public final class Dynamics365DataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Dynamics365DataConnector model = BinaryData.fromString( + "{\"kind\":\"Dynamics365\",\"properties\":{\"dataTypes\":{\"dynamics365CdsActivities\":{\"state\":\"Disabled\"}},\"tenantId\":\"gftrqrejdaahuqim\"},\"etag\":\"ahlfxlmuifmuadj\",\"id\":\"snc\",\"name\":\"kiioshj\",\"type\":\"cz\"}") + .toObject(Dynamics365DataConnector.class); + Assertions.assertEquals("ahlfxlmuifmuadj", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().dynamics365CdsActivities().state()); + Assertions.assertEquals("gftrqrejdaahuqim", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Dynamics365DataConnector model = new Dynamics365DataConnector().withEtag("ahlfxlmuifmuadj") + .withDataTypes(new Dynamics365DataConnectorDataTypes().withDynamics365CdsActivities( + new Dynamics365DataConnectorDataTypesDynamics365CdsActivities().withState(DataTypeState.DISABLED))) + .withTenantId("gftrqrejdaahuqim"); + model = BinaryData.fromObject(model).toObject(Dynamics365DataConnector.class); + Assertions.assertEquals("ahlfxlmuifmuadj", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().dynamics365CdsActivities().state()); + Assertions.assertEquals("gftrqrejdaahuqim", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainBodyTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainBodyTests.java new file mode 100644 index 000000000000..6a50e93767d9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainBodyTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import org.junit.jupiter.api.Assertions; + +public final class EnrichmentDomainBodyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EnrichmentDomainBody model + = BinaryData.fromString("{\"domain\":\"agdfmglzlh\"}").toObject(EnrichmentDomainBody.class); + Assertions.assertEquals("agdfmglzlh", model.domain()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EnrichmentDomainBody model = new EnrichmentDomainBody().withDomain("agdfmglzlh"); + model = BinaryData.fromObject(model).toObject(EnrichmentDomainBody.class); + Assertions.assertEquals("agdfmglzlh", model.domain()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactTests.java new file mode 100644 index 000000000000..78037ef9a341 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisContact; +import org.junit.jupiter.api.Assertions; + +public final class EnrichmentDomainWhoisContactTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EnrichmentDomainWhoisContact model = BinaryData.fromString( + "{\"name\":\"mpmngnzscxaqwoo\",\"org\":\"cbonqvpk\",\"street\":[\"xnj\",\"ase\",\"pheoflokeyy\",\"enjbdlwtgrhp\"],\"city\":\"pj\",\"state\":\"asxazjpqyegualhb\",\"postal\":\"hejjz\",\"country\":\"dudgwdslfhot\",\"phone\":\"cynpwlbjnp\",\"fax\":\"cftadeh\",\"email\":\"ltyfsop\"}") + .toObject(EnrichmentDomainWhoisContact.class); + Assertions.assertEquals("mpmngnzscxaqwoo", model.name()); + Assertions.assertEquals("cbonqvpk", model.org()); + Assertions.assertEquals("xnj", model.street().get(0)); + Assertions.assertEquals("pj", model.city()); + Assertions.assertEquals("asxazjpqyegualhb", model.state()); + Assertions.assertEquals("hejjz", model.postal()); + Assertions.assertEquals("dudgwdslfhot", model.country()); + Assertions.assertEquals("cynpwlbjnp", model.phone()); + Assertions.assertEquals("cftadeh", model.fax()); + Assertions.assertEquals("ltyfsop", model.email()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactsTests.java new file mode 100644 index 000000000000..88e17ed9ffc5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisContactsTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisContacts; +import org.junit.jupiter.api.Assertions; + +public final class EnrichmentDomainWhoisContactsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EnrichmentDomainWhoisContacts model = BinaryData.fromString( + "{\"admin\":{\"name\":\"shurzafbljjgpbto\",\"org\":\"jmkljavbqidtqajz\",\"street\":[\"pku\"],\"city\":\"krlkhbzhfepg\",\"state\":\"qex\",\"postal\":\"ocxscpaierhhbcs\",\"country\":\"ummajtjaod\",\"phone\":\"bnbdxkqpxokajion\",\"fax\":\"mexgstxgcp\",\"email\":\"gmaajrm\"},\"billing\":{\"name\":\"wzrlovmclwhij\",\"org\":\"ejctbzaqsqsycb\",\"street\":[\"k\",\"ukdkexxppofmxa\",\"c\",\"jpgd\"],\"city\":\"ocjjxhvpmouexh\",\"state\":\"xibqeojnx\",\"postal\":\"zvddntwndeicbtwn\",\"country\":\"aoqvuh\",\"phone\":\"cffcyddglmj\",\"fax\":\"jqkwpyeicx\",\"email\":\"ciwqvhk\"},\"registrant\":{\"name\":\"uigdtopbobjog\",\"org\":\"e\",\"street\":[\"m\"],\"city\":\"hrzayvvtpgvdf\",\"state\":\"otkftutqxlngx\",\"postal\":\"fgugnxkrxdqmid\",\"country\":\"hzrvqd\",\"phone\":\"bhj\",\"fax\":\"igeho\",\"email\":\"bowsk\"},\"tech\":{\"name\":\"ktzlcuiywg\",\"org\":\"wgndrvynhzgpp\",\"street\":[\"gyncocpecfvmmc\",\"ofsx\",\"zevgb\"],\"city\":\"jqabcypmivkwlzuv\",\"state\":\"fwnfnb\",\"postal\":\"fionl\",\"country\":\"x\",\"phone\":\"qgtz\",\"fax\":\"pnqbqqwxrjfe\",\"email\":\"lnwsubisn\"}}") + .toObject(EnrichmentDomainWhoisContacts.class); + Assertions.assertEquals("shurzafbljjgpbto", model.admin().name()); + Assertions.assertEquals("jmkljavbqidtqajz", model.admin().org()); + Assertions.assertEquals("pku", model.admin().street().get(0)); + Assertions.assertEquals("krlkhbzhfepg", model.admin().city()); + Assertions.assertEquals("qex", model.admin().state()); + Assertions.assertEquals("ocxscpaierhhbcs", model.admin().postal()); + Assertions.assertEquals("ummajtjaod", model.admin().country()); + Assertions.assertEquals("bnbdxkqpxokajion", model.admin().phone()); + Assertions.assertEquals("mexgstxgcp", model.admin().fax()); + Assertions.assertEquals("gmaajrm", model.admin().email()); + Assertions.assertEquals("wzrlovmclwhij", model.billing().name()); + Assertions.assertEquals("ejctbzaqsqsycb", model.billing().org()); + Assertions.assertEquals("k", model.billing().street().get(0)); + Assertions.assertEquals("ocjjxhvpmouexh", model.billing().city()); + Assertions.assertEquals("xibqeojnx", model.billing().state()); + Assertions.assertEquals("zvddntwndeicbtwn", model.billing().postal()); + Assertions.assertEquals("aoqvuh", model.billing().country()); + Assertions.assertEquals("cffcyddglmj", model.billing().phone()); + Assertions.assertEquals("jqkwpyeicx", model.billing().fax()); + Assertions.assertEquals("ciwqvhk", model.billing().email()); + Assertions.assertEquals("uigdtopbobjog", model.registrant().name()); + Assertions.assertEquals("e", model.registrant().org()); + Assertions.assertEquals("m", model.registrant().street().get(0)); + Assertions.assertEquals("hrzayvvtpgvdf", model.registrant().city()); + Assertions.assertEquals("otkftutqxlngx", model.registrant().state()); + Assertions.assertEquals("fgugnxkrxdqmid", model.registrant().postal()); + Assertions.assertEquals("hzrvqd", model.registrant().country()); + Assertions.assertEquals("bhj", model.registrant().phone()); + Assertions.assertEquals("igeho", model.registrant().fax()); + Assertions.assertEquals("bowsk", model.registrant().email()); + Assertions.assertEquals("ktzlcuiywg", model.tech().name()); + Assertions.assertEquals("wgndrvynhzgpp", model.tech().org()); + Assertions.assertEquals("gyncocpecfvmmc", model.tech().street().get(0)); + Assertions.assertEquals("jqabcypmivkwlzuv", model.tech().city()); + Assertions.assertEquals("fwnfnb", model.tech().state()); + Assertions.assertEquals("fionl", model.tech().postal()); + Assertions.assertEquals("x", model.tech().country()); + Assertions.assertEquals("qgtz", model.tech().phone()); + Assertions.assertEquals("pnqbqqwxrjfe", model.tech().fax()); + Assertions.assertEquals("lnwsubisn", model.tech().email()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisDetailsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisDetailsTests.java new file mode 100644 index 000000000000..3cbe0184468f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisDetailsTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisDetails; +import org.junit.jupiter.api.Assertions; + +public final class EnrichmentDomainWhoisDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EnrichmentDomainWhoisDetails model = BinaryData.fromString( + "{\"registrar\":{\"name\":\"emv\",\"abuseContactEmail\":\"fkufublj\",\"abuseContactPhone\":\"xqeofjaeqjhqjba\",\"ianaId\":\"msmjqulngsntn\",\"url\":\"bkzgcwrwclx\",\"whoisServer\":\"rljdouskcqv\"},\"contacts\":{\"admin\":{\"name\":\"cjdkwtnhxbnjbi\",\"org\":\"qrglssainqpjwn\",\"street\":[\"jfm\",\"pee\"],\"city\":\"mgxsab\",\"state\":\"qduujitcjczdz\",\"postal\":\"ndhkrw\",\"country\":\"appd\",\"phone\":\"dkvwrwjfe\",\"fax\":\"nhutjeltmrldhugj\",\"email\":\"datqxhocdgeabl\"},\"billing\":{\"name\":\"uticndvkaozwyif\",\"org\":\"hxh\",\"street\":[\"k\",\"tyxolniwpwc\",\"kjfkg\",\"awxklr\"],\"city\":\"lwckbasyypnddhs\",\"state\":\"bacphejko\",\"postal\":\"nqgoulzndli\",\"country\":\"yqkgfg\",\"phone\":\"madgakeqsrxyb\",\"fax\":\"qedqytbciqfoufl\",\"email\":\"nkzsmodmglou\"},\"registrant\":{\"name\":\"kwtmutduqktapspw\",\"org\":\"uertumk\",\"street\":[\"vqwhbmdgbbjfd\",\"gmbmbexppbh\",\"q\",\"rolfpfp\"],\"city\":\"lgbquxig\",\"state\":\"jgzjaoyfhrtx\",\"postal\":\"n\",\"country\":\"kujysvlejuvfq\",\"phone\":\"rlyxwjkcprbnw\",\"fax\":\"gjvtbv\",\"email\":\"sszdnru\"},\"tech\":{\"name\":\"uhmuouqfprwzwbn\",\"org\":\"itnwuizgazxufi\",\"street\":[\"kyfi\",\"rfidfvzwdz\"],\"city\":\"tymw\",\"state\":\"dkfthwxmnt\",\"postal\":\"waopvkmijcmmxd\",\"country\":\"fufsrpymzi\",\"phone\":\"sezcxtb\",\"fax\":\"gfycc\",\"email\":\"ewmdw\"}},\"nameServers\":[\"iachbo\",\"sflnrosfqp\",\"eeh\",\"zvypyqrimzinp\"],\"statuses\":[\"jdkirsoodqx\"]}") + .toObject(EnrichmentDomainWhoisDetails.class); + Assertions.assertEquals("emv", model.registrar().name()); + Assertions.assertEquals("fkufublj", model.registrar().abuseContactEmail()); + Assertions.assertEquals("xqeofjaeqjhqjba", model.registrar().abuseContactPhone()); + Assertions.assertEquals("msmjqulngsntn", model.registrar().ianaId()); + Assertions.assertEquals("bkzgcwrwclx", model.registrar().url()); + Assertions.assertEquals("rljdouskcqv", model.registrar().whoisServer()); + Assertions.assertEquals("cjdkwtnhxbnjbi", model.contacts().admin().name()); + Assertions.assertEquals("qrglssainqpjwn", model.contacts().admin().org()); + Assertions.assertEquals("jfm", model.contacts().admin().street().get(0)); + Assertions.assertEquals("mgxsab", model.contacts().admin().city()); + Assertions.assertEquals("qduujitcjczdz", model.contacts().admin().state()); + Assertions.assertEquals("ndhkrw", model.contacts().admin().postal()); + Assertions.assertEquals("appd", model.contacts().admin().country()); + Assertions.assertEquals("dkvwrwjfe", model.contacts().admin().phone()); + Assertions.assertEquals("nhutjeltmrldhugj", model.contacts().admin().fax()); + Assertions.assertEquals("datqxhocdgeabl", model.contacts().admin().email()); + Assertions.assertEquals("uticndvkaozwyif", model.contacts().billing().name()); + Assertions.assertEquals("hxh", model.contacts().billing().org()); + Assertions.assertEquals("k", model.contacts().billing().street().get(0)); + Assertions.assertEquals("lwckbasyypnddhs", model.contacts().billing().city()); + Assertions.assertEquals("bacphejko", model.contacts().billing().state()); + Assertions.assertEquals("nqgoulzndli", model.contacts().billing().postal()); + Assertions.assertEquals("yqkgfg", model.contacts().billing().country()); + Assertions.assertEquals("madgakeqsrxyb", model.contacts().billing().phone()); + Assertions.assertEquals("qedqytbciqfoufl", model.contacts().billing().fax()); + Assertions.assertEquals("nkzsmodmglou", model.contacts().billing().email()); + Assertions.assertEquals("kwtmutduqktapspw", model.contacts().registrant().name()); + Assertions.assertEquals("uertumk", model.contacts().registrant().org()); + Assertions.assertEquals("vqwhbmdgbbjfd", model.contacts().registrant().street().get(0)); + Assertions.assertEquals("lgbquxig", model.contacts().registrant().city()); + Assertions.assertEquals("jgzjaoyfhrtx", model.contacts().registrant().state()); + Assertions.assertEquals("n", model.contacts().registrant().postal()); + Assertions.assertEquals("kujysvlejuvfq", model.contacts().registrant().country()); + Assertions.assertEquals("rlyxwjkcprbnw", model.contacts().registrant().phone()); + Assertions.assertEquals("gjvtbv", model.contacts().registrant().fax()); + Assertions.assertEquals("sszdnru", model.contacts().registrant().email()); + Assertions.assertEquals("uhmuouqfprwzwbn", model.contacts().tech().name()); + Assertions.assertEquals("itnwuizgazxufi", model.contacts().tech().org()); + Assertions.assertEquals("kyfi", model.contacts().tech().street().get(0)); + Assertions.assertEquals("tymw", model.contacts().tech().city()); + Assertions.assertEquals("dkfthwxmnt", model.contacts().tech().state()); + Assertions.assertEquals("waopvkmijcmmxd", model.contacts().tech().postal()); + Assertions.assertEquals("fufsrpymzi", model.contacts().tech().country()); + Assertions.assertEquals("sezcxtb", model.contacts().tech().phone()); + Assertions.assertEquals("gfycc", model.contacts().tech().fax()); + Assertions.assertEquals("ewmdw", model.contacts().tech().email()); + Assertions.assertEquals("iachbo", model.nameServers().get(0)); + Assertions.assertEquals("jdkirsoodqx", model.statuses().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisInnerTests.java new file mode 100644 index 000000000000..4359bc209b90 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisInnerTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EnrichmentDomainWhoisInner; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class EnrichmentDomainWhoisInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EnrichmentDomainWhoisInner model = BinaryData.fromString( + "{\"domain\":\"rifkwm\",\"server\":\"ktsizntocipaou\",\"created\":\"2020-12-20T01:06:39Z\",\"updated\":\"2021-09-24T19:20:40Z\",\"expires\":\"2021-11-23T20:05:54Z\",\"parsedWhois\":{\"registrar\":{\"name\":\"yf\",\"abuseContactEmail\":\"fogknygjofjdde\",\"abuseContactPhone\":\"rd\",\"ianaId\":\"pewnw\",\"url\":\"itjz\",\"whoisServer\":\"lusarh\"},\"contacts\":{\"admin\":{\"name\":\"qhsmyurkdtml\",\"org\":\"ekuksjtx\",\"street\":[\"dmpa\"],\"city\":\"ryuanzwuxzdxtay\",\"state\":\"hmwhfpmrqo\",\"postal\":\"tu\",\"country\":\"nryrtihf\",\"phone\":\"ijbpzvgnwzsymgl\",\"fax\":\"fcyzkohdbihanufh\",\"email\":\"bj\"},\"billing\":{\"name\":\"git\",\"org\":\"qhabifpikxwcz\",\"street\":[\"cnpqxuhivyqniwby\",\"rkxvdum\",\"grtfwvu\"],\"city\":\"gaudcc\",\"state\":\"h\",\"postal\":\"cnyejhkryhtnapcz\",\"country\":\"okjye\",\"phone\":\"kvnipjoxz\",\"fax\":\"chgejspodm\",\"email\":\"lzydehojwyahux\"},\"registrant\":{\"name\":\"mqnjaqw\",\"org\":\"jsprozvcpute\",\"street\":[\"wmfdatscmdvpjhul\"],\"city\":\"uvm\",\"state\":\"ozkrwfndiodjpslw\",\"postal\":\"dpvwryoqpsoaccta\",\"country\":\"kljla\",\"phone\":\"cr\",\"fax\":\"fdfdosygexpa\",\"email\":\"akhmsbzjhcrz\"},\"tech\":{\"name\":\"phlxa\",\"org\":\"thqt\",\"street\":[\"jbp\",\"zfsinzgvf\",\"jrwzox\"],\"city\":\"tfell\",\"state\":\"fziton\",\"postal\":\"qfpjk\",\"country\":\"xofpdvhpfxxypi\",\"phone\":\"nmayhuybb\",\"fax\":\"odepoogin\",\"email\":\"amiheognarxz\"}},\"nameServers\":[\"eotusivyevc\",\"iqihn\"],\"statuses\":[\"gbwjzrnf\",\"gxg\"]}}") + .toObject(EnrichmentDomainWhoisInner.class); + Assertions.assertEquals("rifkwm", model.domain()); + Assertions.assertEquals("ktsizntocipaou", model.server()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-20T01:06:39Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T19:20:40Z"), model.updated()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-23T20:05:54Z"), model.expires()); + Assertions.assertEquals("yf", model.parsedWhois().registrar().name()); + Assertions.assertEquals("fogknygjofjdde", model.parsedWhois().registrar().abuseContactEmail()); + Assertions.assertEquals("rd", model.parsedWhois().registrar().abuseContactPhone()); + Assertions.assertEquals("pewnw", model.parsedWhois().registrar().ianaId()); + Assertions.assertEquals("itjz", model.parsedWhois().registrar().url()); + Assertions.assertEquals("lusarh", model.parsedWhois().registrar().whoisServer()); + Assertions.assertEquals("qhsmyurkdtml", model.parsedWhois().contacts().admin().name()); + Assertions.assertEquals("ekuksjtx", model.parsedWhois().contacts().admin().org()); + Assertions.assertEquals("dmpa", model.parsedWhois().contacts().admin().street().get(0)); + Assertions.assertEquals("ryuanzwuxzdxtay", model.parsedWhois().contacts().admin().city()); + Assertions.assertEquals("hmwhfpmrqo", model.parsedWhois().contacts().admin().state()); + Assertions.assertEquals("tu", model.parsedWhois().contacts().admin().postal()); + Assertions.assertEquals("nryrtihf", model.parsedWhois().contacts().admin().country()); + Assertions.assertEquals("ijbpzvgnwzsymgl", model.parsedWhois().contacts().admin().phone()); + Assertions.assertEquals("fcyzkohdbihanufh", model.parsedWhois().contacts().admin().fax()); + Assertions.assertEquals("bj", model.parsedWhois().contacts().admin().email()); + Assertions.assertEquals("git", model.parsedWhois().contacts().billing().name()); + Assertions.assertEquals("qhabifpikxwcz", model.parsedWhois().contacts().billing().org()); + Assertions.assertEquals("cnpqxuhivyqniwby", model.parsedWhois().contacts().billing().street().get(0)); + Assertions.assertEquals("gaudcc", model.parsedWhois().contacts().billing().city()); + Assertions.assertEquals("h", model.parsedWhois().contacts().billing().state()); + Assertions.assertEquals("cnyejhkryhtnapcz", model.parsedWhois().contacts().billing().postal()); + Assertions.assertEquals("okjye", model.parsedWhois().contacts().billing().country()); + Assertions.assertEquals("kvnipjoxz", model.parsedWhois().contacts().billing().phone()); + Assertions.assertEquals("chgejspodm", model.parsedWhois().contacts().billing().fax()); + Assertions.assertEquals("lzydehojwyahux", model.parsedWhois().contacts().billing().email()); + Assertions.assertEquals("mqnjaqw", model.parsedWhois().contacts().registrant().name()); + Assertions.assertEquals("jsprozvcpute", model.parsedWhois().contacts().registrant().org()); + Assertions.assertEquals("wmfdatscmdvpjhul", model.parsedWhois().contacts().registrant().street().get(0)); + Assertions.assertEquals("uvm", model.parsedWhois().contacts().registrant().city()); + Assertions.assertEquals("ozkrwfndiodjpslw", model.parsedWhois().contacts().registrant().state()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.parsedWhois().contacts().registrant().postal()); + Assertions.assertEquals("kljla", model.parsedWhois().contacts().registrant().country()); + Assertions.assertEquals("cr", model.parsedWhois().contacts().registrant().phone()); + Assertions.assertEquals("fdfdosygexpa", model.parsedWhois().contacts().registrant().fax()); + Assertions.assertEquals("akhmsbzjhcrz", model.parsedWhois().contacts().registrant().email()); + Assertions.assertEquals("phlxa", model.parsedWhois().contacts().tech().name()); + Assertions.assertEquals("thqt", model.parsedWhois().contacts().tech().org()); + Assertions.assertEquals("jbp", model.parsedWhois().contacts().tech().street().get(0)); + Assertions.assertEquals("tfell", model.parsedWhois().contacts().tech().city()); + Assertions.assertEquals("fziton", model.parsedWhois().contacts().tech().state()); + Assertions.assertEquals("qfpjk", model.parsedWhois().contacts().tech().postal()); + Assertions.assertEquals("xofpdvhpfxxypi", model.parsedWhois().contacts().tech().country()); + Assertions.assertEquals("nmayhuybb", model.parsedWhois().contacts().tech().phone()); + Assertions.assertEquals("odepoogin", model.parsedWhois().contacts().tech().fax()); + Assertions.assertEquals("amiheognarxz", model.parsedWhois().contacts().tech().email()); + Assertions.assertEquals("eotusivyevc", model.parsedWhois().nameServers().get(0)); + Assertions.assertEquals("gbwjzrnf", model.parsedWhois().statuses().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisRegistrarDetailsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisRegistrarDetailsTests.java new file mode 100644 index 000000000000..1ff195829f45 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentDomainWhoisRegistrarDetailsTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisRegistrarDetails; +import org.junit.jupiter.api.Assertions; + +public final class EnrichmentDomainWhoisRegistrarDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EnrichmentDomainWhoisRegistrarDetails model = BinaryData.fromString( + "{\"name\":\"rmnohj\",\"abuseContactEmail\":\"kwh\",\"abuseContactPhone\":\"oifiyipjxsqwpgr\",\"ianaId\":\"znorcj\",\"url\":\"snb\",\"whoisServer\":\"qabnmoc\"}") + .toObject(EnrichmentDomainWhoisRegistrarDetails.class); + Assertions.assertEquals("rmnohj", model.name()); + Assertions.assertEquals("kwh", model.abuseContactEmail()); + Assertions.assertEquals("oifiyipjxsqwpgr", model.abuseContactPhone()); + Assertions.assertEquals("znorcj", model.ianaId()); + Assertions.assertEquals("snb", model.url()); + Assertions.assertEquals("qabnmoc", model.whoisServer()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentIpAddressBodyTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentIpAddressBodyTests.java new file mode 100644 index 000000000000..4f5910491773 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EnrichmentIpAddressBodyTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EnrichmentIpAddressBody; +import org.junit.jupiter.api.Assertions; + +public final class EnrichmentIpAddressBodyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EnrichmentIpAddressBody model + = BinaryData.fromString("{\"ipAddress\":\"mhquvgjxp\"}").toObject(EnrichmentIpAddressBody.class); + Assertions.assertEquals("mhquvgjxp", model.ipAddress()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EnrichmentIpAddressBody model = new EnrichmentIpAddressBody().withIpAddress("mhquvgjxp"); + model = BinaryData.fromObject(model).toObject(EnrichmentIpAddressBody.class); + Assertions.assertEquals("mhquvgjxp", model.ipAddress()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandWithResponseMockTests.java new file mode 100644 index 000000000000..3bcf13668972 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesExpandWithResponseMockTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import com.azure.resourcemanager.securityinsights.models.EntityExpandResponse; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesExpandWithResponseMockTests { + @Test + public void testExpandWithResponse() throws Exception { + String responseStr + = "{\"metaData\":{\"aggregations\":[{\"aggregationType\":\"kizyx\",\"count\":1084127281,\"displayName\":\"n\",\"entityKind\":\"Ip\"},{\"aggregationType\":\"jwipfryivpe\",\"count\":1897378159,\"displayName\":\"rpdxygf\",\"entityKind\":\"Nic\"},{\"aggregationType\":\"seme\",\"count\":1631359782,\"displayName\":\"dmmowftfrqebrjo\",\"entityKind\":\"SecurityAlert\"},{\"aggregationType\":\"efekfxmgjywwidnr\",\"count\":1069900763,\"displayName\":\"kvhuiadyh\",\"entityKind\":\"Malware\"}]},\"value\":{\"entities\":[{\"kind\":\"Entity\",\"id\":\"gapfdwhwbead\",\"name\":\"kuqnkoskflnj\",\"type\":\"y\"},{\"kind\":\"Entity\",\"id\":\"jeevmbhemr\",\"name\":\"bz\",\"type\":\"tsspwwexb\"},{\"kind\":\"Entity\",\"id\":\"brepe\",\"name\":\"rlieeocyarvsfz\",\"type\":\"cscootfsgilwis\"},{\"kind\":\"Entity\",\"id\":\"zpzitustrtrf\",\"name\":\"ogknocshmpcjqt\",\"type\":\"zbirb\"}],\"edges\":[{\"targetEntityId\":\"fjqpxydpamctzmwr\",\"additionalData\":{\"ojs\":\"\\\"datadgunsjssr\\\"\",\"pgkxyrsppbghy\":\"\\\"datakoue\\\"\",\"awlqvuwsqmwqsgy\":\"\\\"datakgg\\\"\"}},{\"targetEntityId\":\"nostn\",\"additionalData\":{\"zjnkgdsursumb\":\"\\\"datarpk\\\"\",\"qpsvoxs\":\"\\\"datairkb\\\"\"}}]}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EntityExpandResponse response = manager.entities() + .expandWithResponse("wvilky", "tnriyhdbbj", "sjmc", + new EntityExpandParameters().withEndTime(OffsetDateTime.parse("2021-07-31T16:20:45Z")) + .withExpansionId("jenbxtkghrrx") + .withStartTime(OffsetDateTime.parse("2021-09-05T20:45:20Z")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("kizyx", response.metaData().aggregations().get(0).aggregationType()); + Assertions.assertEquals(1084127281, response.metaData().aggregations().get(0).count()); + Assertions.assertEquals("n", response.metaData().aggregations().get(0).displayName()); + Assertions.assertEquals(EntityKindEnum.IP, response.metaData().aggregations().get(0).entityKind()); + Assertions.assertEquals("fjqpxydpamctzmwr", response.value().edges().get(0).targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsWithResponseMockTests.java new file mode 100644 index 000000000000..60e8e61cf675 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetInsightsWithResponseMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsResponse; +import com.azure.resourcemanager.securityinsights.models.GetInsightsError; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesGetInsightsWithResponseMockTests { + @Test + public void testGetInsightsWithResponse() throws Exception { + String responseStr + = "{\"metaData\":{\"totalCount\":1630673267,\"errors\":[{\"kind\":\"Insight\",\"queryId\":\"ikvdfszxbupsx\",\"errorMessage\":\"oj\"}]},\"value\":[{\"queryId\":\"gqkhyvtajwkrxm\",\"queryTimeInterval\":{\"startTime\":\"2021-04-04T09:41:56Z\",\"endTime\":\"2021-01-02T01:17:37Z\"},\"tableQueryResults\":{\"columns\":[{},{},{}],\"rows\":[[\"kzbo\",\"jbyssprkbzr\",\"ljwfncsaa\",\"lcpgzmxrgppqajd\"],[\"unntqqguhv\"]]},\"chartQueryResults\":[{\"columns\":[{},{},{},{}],\"rows\":[[],[]]},{\"columns\":[{},{},{}],\"rows\":[[],[]]}]},{\"queryId\":\"fwfuxdtpjcs\",\"queryTimeInterval\":{\"startTime\":\"2021-01-09T07:34:22Z\",\"endTime\":\"2021-10-05T11:53:07Z\"},\"tableQueryResults\":{\"columns\":[{},{},{}],\"rows\":[[\"f\",\"tq\",\"mbdsgqxacidu\",\"b\"]]},\"chartQueryResults\":[{\"columns\":[{},{},{}],\"rows\":[[],[],[]]},{\"columns\":[{}],\"rows\":[[]]},{\"columns\":[{},{},{},{}],\"rows\":[[],[],[]]}]},{\"queryId\":\"yylekubiwv\",\"queryTimeInterval\":{\"startTime\":\"2021-11-29T12:23:21Z\",\"endTime\":\"2021-03-16T11:38:03Z\"},\"tableQueryResults\":{\"columns\":[{},{},{}],\"rows\":[[\"wjvfisloqut\",\"kbzwgjupjbdqmnk\",\"ajqsshupx\"],[\"tnurkmerqza\",\"uwome\"],[\"vvtjwdlduvimgtce\",\"rmxoxtap\",\"fbj\",\"bkj\"]]},\"chartQueryResults\":[{\"columns\":[{},{},{},{}],\"rows\":[[],[],[],[]]}]},{\"queryId\":\"vc\",\"queryTimeInterval\":{\"startTime\":\"2021-02-21T23:15:24Z\",\"endTime\":\"2021-04-29T03:13:59Z\"},\"tableQueryResults\":{\"columns\":[{},{}],\"rows\":[[\"izprv\"],[\"a\",\"ajxdrg\",\"puxpzslm\"],[\"ypzrycchqzkfges\"]]},\"chartQueryResults\":[{\"columns\":[{},{},{},{}],\"rows\":[[],[],[],[]]},{\"columns\":[{}],\"rows\":[[],[]]},{\"columns\":[{},{}],\"rows\":[[]]}]}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EntityGetInsightsResponse response = manager.entities() + .getInsightsWithResponse("hnzsckfuzuchot", "z", "qhqh", + new EntityGetInsightsParameters().withStartTime(OffsetDateTime.parse("2021-05-26T06:09:36Z")) + .withEndTime(OffsetDateTime.parse("2021-08-10T17:22:29Z")) + .withAddDefaultExtendedTimeRange(true) + .withInsightQueryIds(Arrays.asList("awwl", "sdazqcemcotwfuo")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(1630673267, response.metaData().totalCount()); + Assertions.assertEquals(GetInsightsError.INSIGHT, response.metaData().errors().get(0).kind()); + Assertions.assertEquals("ikvdfszxbupsx", response.metaData().errors().get(0).queryId()); + Assertions.assertEquals("oj", response.metaData().errors().get(0).errorMessage()); + Assertions.assertEquals("gqkhyvtajwkrxm", response.value().get(0).queryId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-04T09:41:56Z"), + response.value().get(0).queryTimeInterval().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-02T01:17:37Z"), + response.value().get(0).queryTimeInterval().endTime()); + Assertions.assertEquals("kzbo", response.value().get(0).tableQueryResults().rows().get(0).get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java new file mode 100644 index 000000000000..c71378d5812b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineKind; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesGetTimelinesListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + String responseStr + = "{\"metaData\":{\"totalCount\":1819451335,\"aggregations\":[{\"count\":2113245920,\"kind\":\"Anomaly\"},{\"count\":1381680700,\"kind\":\"Activity\"},{\"count\":222118864,\"kind\":\"SecurityAlert\"},{\"count\":1629493159,\"kind\":\"Activity\"}],\"errors\":[{\"kind\":\"SecurityAlert\",\"queryId\":\"jeitkfhzvscndb\",\"errorMessage\":\"lscokafaqqipv\"},{\"kind\":\"Anomaly\",\"queryId\":\"zsss\",\"errorMessage\":\"ncghgi\"},{\"kind\":\"Anomaly\",\"queryId\":\"otx\",\"errorMessage\":\"dbxzhadm\"}]},\"value\":[{\"kind\":\"EntityTimelineItem\"},{\"kind\":\"EntityTimelineItem\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EntityTimelineResponse response = manager.entitiesGetTimelines() + .listWithResponse("yuhoxulevp", "birhgjmphyacd", "jmpnvgkxs", + new EntityTimelineParameters() + .withKinds(Arrays.asList(EntityTimelineKind.SECURITY_ALERT, EntityTimelineKind.BOOKMARK, + EntityTimelineKind.BOOKMARK, EntityTimelineKind.BOOKMARK)) + .withStartTime(OffsetDateTime.parse("2021-03-01T00:07:04Z")) + .withEndTime(OffsetDateTime.parse("2021-08-01T22:45:02Z")) + .withNumberOfBucket(1992312292), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(1819451335, response.metaData().totalCount()); + Assertions.assertEquals(2113245920, response.metaData().aggregations().get(0).count()); + Assertions.assertEquals(EntityTimelineKind.ANOMALY, response.metaData().aggregations().get(0).kind()); + Assertions.assertEquals(EntityTimelineKind.SECURITY_ALERT, response.metaData().errors().get(0).kind()); + Assertions.assertEquals("jeitkfhzvscndb", response.metaData().errors().get(0).queryId()); + Assertions.assertEquals("lscokafaqqipv", response.metaData().errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetWithResponseMockTests.java new file mode 100644 index 000000000000..d3cfa436cc60 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Entity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"Entity\",\"id\":\"cjssqpkmbry\",\"name\":\"vshkvupbzqwwtt\",\"type\":\"jyiwuve\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Entity response = manager.entities() + .getWithResponse("fmbvmajcmpohjdvf", "vbwawymahboi", "diuyqdjk", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListMockTests.java new file mode 100644 index 000000000000..00b9b53567f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Entity; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"Entity\",\"id\":\"gupshoofas\",\"name\":\"yyvdjoorbuuhbcc\",\"type\":\"bcvtelmdr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.entities().list("ya", "bjvv", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesMockTests.java new file mode 100644 index 000000000000..f0412502ee10 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesQueriesMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityItemQueryKind; +import com.azure.resourcemanager.securityinsights.models.EntityQueryItem; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesQueriesMockTests { + @Test + public void testQueries() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"EntityQueryItem\",\"id\":\"amxyjqhwsojnbb\",\"name\":\"vmowyzxq\",\"type\":\"hml\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.entities() + .queries("xumuuyblolruf", "mg", "lbq", EntityItemQueryKind.INSIGHT, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("vmowyzxq", response.iterator().next().name()); + Assertions.assertEquals("hml", response.iterator().next().type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java new file mode 100644 index 000000000000..88e6e3dd9be5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Relation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesRelationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"vwrc\",\"relatedResourceName\":\"hllmblls\",\"relatedResourceType\":\"fdrimoopfr\",\"relatedResourceKind\":\"jjrhxornuoqpob\"},\"etag\":\"rsdx\",\"id\":\"mq\",\"name\":\"vxbqyavcxj\",\"type\":\"lseoixqp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.entitiesRelations() + .list("gvjmllzykalbaumm", "dwqiucpj", "r", "bssjtjwzelx", "ftt", 1897092555, "ylvrofhhitjhh", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("rsdx", response.iterator().next().etag()); + Assertions.assertEquals("vwrc", response.iterator().next().relatedResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRunPlaybookWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRunPlaybookWithResponseMockTests.java new file mode 100644 index 000000000000..ba8ed436c2cc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRunPlaybookWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityManualTriggerRequestBody; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntitiesRunPlaybookWithResponseMockTests { + @Test + public void testRunPlaybookWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.entities() + .runPlaybookWithResponse("asvghphlbk", "uhmblni", "mviaasdexsrglxlj", + new EntityManualTriggerRequestBody().withIncidentArmId("vk") + .withTenantId("ovzespdipdxq") + .withLogicAppsResourceId("pdjomddadwosjxy"), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsPropertiesTests.java new file mode 100644 index 000000000000..dbcb591e2943 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityAnalyticsProperties; +import com.azure.resourcemanager.securityinsights.models.EntityProviders; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class EntityAnalyticsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityAnalyticsProperties model + = BinaryData.fromString("{\"entityProviders\":[\"ActiveDirectory\",\"ActiveDirectory\"]}") + .toObject(EntityAnalyticsProperties.class); + Assertions.assertEquals(EntityProviders.ACTIVE_DIRECTORY, model.entityProviders().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EntityAnalyticsProperties model = new EntityAnalyticsProperties() + .withEntityProviders(Arrays.asList(EntityProviders.ACTIVE_DIRECTORY, EntityProviders.ACTIVE_DIRECTORY)); + model = BinaryData.fromObject(model).toObject(EntityAnalyticsProperties.class); + Assertions.assertEquals(EntityProviders.ACTIVE_DIRECTORY, model.entityProviders().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsTests.java new file mode 100644 index 000000000000..705116a6178e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityAnalyticsTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityAnalytics; +import com.azure.resourcemanager.securityinsights.models.EntityProviders; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class EntityAnalyticsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityAnalytics model = BinaryData.fromString( + "{\"kind\":\"EntityAnalytics\",\"properties\":{\"entityProviders\":[\"ActiveDirectory\",\"AzureActiveDirectory\"]},\"etag\":\"aksinpaamihwbg\",\"id\":\"wt\",\"name\":\"pbgchcgsfzhb\",\"type\":\"kiy\"}") + .toObject(EntityAnalytics.class); + Assertions.assertEquals("aksinpaamihwbg", model.etag()); + Assertions.assertEquals(EntityProviders.ACTIVE_DIRECTORY, model.entityProviders().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EntityAnalytics model = new EntityAnalytics().withEtag("aksinpaamihwbg") + .withEntityProviders( + Arrays.asList(EntityProviders.ACTIVE_DIRECTORY, EntityProviders.AZURE_ACTIVE_DIRECTORY)); + model = BinaryData.fromObject(model).toObject(EntityAnalytics.class); + Assertions.assertEquals("aksinpaamihwbg", model.etag()); + Assertions.assertEquals(EntityProviders.ACTIVE_DIRECTORY, model.entityProviders().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityCommonPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityCommonPropertiesTests.java index cb5087123e13..b63de8a9fba8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityCommonPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityCommonPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -10,9 +10,10 @@ public final class EntityCommonPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - EntityCommonProperties model - = BinaryData.fromString("{\"additionalData\":{\"ac\":\"dataygpfqb\"},\"friendlyName\":\"pzfqrhhuaoppp\"}") - .toObject(EntityCommonProperties.class); + EntityCommonProperties model = BinaryData + .fromString( + "{\"additionalData\":{\"sxypruuu\":\"\\\"datahlwntsjgq\\\"\"},\"friendlyName\":\"nchrszizoyu\"}") + .toObject(EntityCommonProperties.class); } @org.junit.jupiter.api.Test diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityEdgesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityEdgesTests.java new file mode 100644 index 000000000000..509309c453bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityEdgesTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityEdges; +import org.junit.jupiter.api.Assertions; + +public final class EntityEdgesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityEdges model = BinaryData + .fromString("{\"targetEntityId\":\"lpe\",\"additionalData\":{\"ujqbbgsimwejl\":\"\\\"datanxlue\\\"\"}}") + .toObject(EntityEdges.class); + Assertions.assertEquals("lpe", model.targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandParametersTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandParametersTests.java new file mode 100644 index 000000000000..0c969b71e936 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandParametersTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityExpandParameters; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class EntityExpandParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityExpandParameters model = BinaryData + .fromString( + "{\"endTime\":\"2020-12-24T04:32Z\",\"expansionId\":\"hbo\",\"startTime\":\"2021-05-24T15:32:06Z\"}") + .toObject(EntityExpandParameters.class); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T04:32Z"), model.endTime()); + Assertions.assertEquals("hbo", model.expansionId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T15:32:06Z"), model.startTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EntityExpandParameters model + = new EntityExpandParameters().withEndTime(OffsetDateTime.parse("2020-12-24T04:32Z")) + .withExpansionId("hbo") + .withStartTime(OffsetDateTime.parse("2021-05-24T15:32:06Z")); + model = BinaryData.fromObject(model).toObject(EntityExpandParameters.class); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T04:32Z"), model.endTime()); + Assertions.assertEquals("hbo", model.expansionId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-24T15:32:06Z"), model.startTime()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseInnerTests.java new file mode 100644 index 000000000000..9b028213e2b2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityExpandResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; +import org.junit.jupiter.api.Assertions; + +public final class EntityExpandResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityExpandResponseInner model = BinaryData.fromString( + "{\"metaData\":{\"aggregations\":[{\"aggregationType\":\"b\",\"count\":292113362,\"displayName\":\"pdweoft\",\"entityKind\":\"SecurityAlert\"},{\"aggregationType\":\"w\",\"count\":397944901,\"displayName\":\"s\",\"entityKind\":\"FileHash\"},{\"aggregationType\":\"tqkmvjanxvzf\",\"count\":27888858,\"displayName\":\"tj\",\"entityKind\":\"Url\"}]},\"value\":{\"entities\":[{\"kind\":\"Entity\",\"id\":\"fjxtvlxxzqfc\",\"name\":\"rr\",\"type\":\"omxeezwyhjmb\"},{\"kind\":\"Entity\",\"id\":\"qegm\",\"name\":\"db\",\"type\":\"ohcwhpyv\"}],\"edges\":[{\"targetEntityId\":\"etszwcan\",\"additionalData\":{\"nsm\":\"\\\"dataekwuyckyvn\\\"\",\"ujqjtotdxp\":\"\\\"dataffiwjbctvbp\\\"\",\"wuusiecktybh\":\"\\\"datascsl\\\"\"}},{\"targetEntityId\":\"xidhhxomil\",\"additionalData\":{\"il\":\"\\\"datajxdugxwj\\\"\"}},{\"targetEntityId\":\"rslaatep\",\"additionalData\":{\"xr\":\"\\\"datajjzgxqgqw\\\"\",\"tqqykbkkteozejog\":\"\\\"datagtvh\\\"\"}},{\"targetEntityId\":\"orvvmvmcofnqh\",\"additionalData\":{\"li\":\"\\\"datanosn\\\"\",\"z\":\"\\\"datak\\\"\",\"etyalht\":\"\\\"dataj\\\"\",\"ttcucrcm\":\"\\\"datamknazgbjbhrpgiq\\\"\"}}]}}") + .toObject(EntityExpandResponseInner.class); + Assertions.assertEquals("b", model.metaData().aggregations().get(0).aggregationType()); + Assertions.assertEquals(292113362, model.metaData().aggregations().get(0).count()); + Assertions.assertEquals("pdweoft", model.metaData().aggregations().get(0).displayName()); + Assertions.assertEquals(EntityKindEnum.SECURITY_ALERT, model.metaData().aggregations().get(0).entityKind()); + Assertions.assertEquals("etszwcan", model.value().edges().get(0).targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseValueTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseValueTests.java new file mode 100644 index 000000000000..ad61597efbf2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityExpandResponseValueTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityExpandResponseValue; +import org.junit.jupiter.api.Assertions; + +public final class EntityExpandResponseValueTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityExpandResponseValue model = BinaryData.fromString( + "{\"entities\":[{\"kind\":\"Entity\",\"id\":\"ejzltka\",\"name\":\"zfjsxscbd\",\"type\":\"xapgrcqebmvrdjom\"}],\"edges\":[{\"targetEntityId\":\"bvvdlsflxkqesd\",\"additionalData\":{\"nmphymcqidkltvdh\":\"\\\"datasbgzanco\\\"\",\"bntojovfny\":\"\\\"datanufbxwei\\\"\"}},{\"targetEntityId\":\"dhuihaouwudhuao\",\"additionalData\":{\"qprlobruge\":\"\\\"datakehwvumosqirca\\\"\",\"kjyczcmtagelajdy\":\"\\\"datacv\\\"\",\"eqyxqfmzsiz\":\"\\\"datal\\\"\"}},{\"targetEntityId\":\"ravrcjkjymg\",\"additionalData\":{\"merghski\":\"\\\"datacxhnqxgzxlerm\\\"\",\"pkcbkfukdljq\":\"\\\"datahnp\\\"\",\"loowwzizznyufp\":\"\\\"datavtsdydshkpafy\\\"\"}},{\"targetEntityId\":\"stifgufyjf\",\"additionalData\":{\"mzqhrqp\":\"\\\"dataiyvndjokgwes\\\"\"}}]}") + .toObject(EntityExpandResponseValue.class); + Assertions.assertEquals("bvvdlsflxkqesd", model.edges().get(0).targetEntityId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityFieldMappingTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityFieldMappingTests.java new file mode 100644 index 000000000000..47e57db7104e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityFieldMappingTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityFieldMapping; +import org.junit.jupiter.api.Assertions; + +public final class EntityFieldMappingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityFieldMapping model = BinaryData.fromString("{\"identifier\":\"ypusuvjslczwci\",\"value\":\"jsllfryvd\"}") + .toObject(EntityFieldMapping.class); + Assertions.assertEquals("ypusuvjslczwci", model.identifier()); + Assertions.assertEquals("jsllfryvd", model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EntityFieldMapping model = new EntityFieldMapping().withIdentifier("ypusuvjslczwci").withValue("jsllfryvd"); + model = BinaryData.fromObject(model).toObject(EntityFieldMapping.class); + Assertions.assertEquals("ypusuvjslczwci", model.identifier()); + Assertions.assertEquals("jsllfryvd", model.value()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsParametersTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsParametersTests.java new file mode 100644 index 000000000000..beff50f0b41b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsParametersTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityGetInsightsParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class EntityGetInsightsParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityGetInsightsParameters model = BinaryData.fromString( + "{\"startTime\":\"2021-09-02T06:46:50Z\",\"endTime\":\"2021-10-19T09:26:03Z\",\"addDefaultExtendedTimeRange\":false,\"insightQueryIds\":[\"epmaxfnzlpqmp\"]}") + .toObject(EntityGetInsightsParameters.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T06:46:50Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T09:26:03Z"), model.endTime()); + Assertions.assertFalse(model.addDefaultExtendedTimeRange()); + Assertions.assertEquals("epmaxfnzlpqmp", model.insightQueryIds().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EntityGetInsightsParameters model + = new EntityGetInsightsParameters().withStartTime(OffsetDateTime.parse("2021-09-02T06:46:50Z")) + .withEndTime(OffsetDateTime.parse("2021-10-19T09:26:03Z")) + .withAddDefaultExtendedTimeRange(false) + .withInsightQueryIds(Arrays.asList("epmaxfnzlpqmp")); + model = BinaryData.fromObject(model).toObject(EntityGetInsightsParameters.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T06:46:50Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T09:26:03Z"), model.endTime()); + Assertions.assertFalse(model.addDefaultExtendedTimeRange()); + Assertions.assertEquals("epmaxfnzlpqmp", model.insightQueryIds().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsResponseInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsResponseInnerTests.java new file mode 100644 index 000000000000..182c922721ce --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityGetInsightsResponseInnerTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityGetInsightsResponseInner; +import com.azure.resourcemanager.securityinsights.models.GetInsightsError; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class EntityGetInsightsResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityGetInsightsResponseInner model = BinaryData.fromString( + "{\"metaData\":{\"totalCount\":683126430,\"errors\":[{\"kind\":\"Insight\",\"queryId\":\"lblmrtuxyprhfcae\",\"errorMessage\":\"oifq\"},{\"kind\":\"Insight\",\"queryId\":\"jflobhahqmomf\",\"errorMessage\":\"corkfrocgbmxl\"}]},\"value\":[{\"queryId\":\"ezb\",\"queryTimeInterval\":{\"startTime\":\"2021-11-29T13:58:26Z\",\"endTime\":\"2021-10-21T19:04:09Z\"},\"tableQueryResults\":{\"columns\":[{\"type\":\"qfygpny\",\"name\":\"dzuqscag\"}],\"rows\":[[\"uprsytqzsslhmg\",\"fniv\"],[\"pfduiol\"]]},\"chartQueryResults\":[{\"columns\":[{},{},{}],\"rows\":[[\"j\",\"oqzucfzluczdq\"]]},{\"columns\":[{},{},{}],\"rows\":[[\"mvhvz\",\"elbprn\"],[\"jywzcqyg\",\"mnwsvh\",\"ngqiw\"]]},{\"columns\":[{},{}],\"rows\":[[\"drrp\",\"rehkunsbfjhh\",\"w\",\"pkvegeatt\"]]}]},{\"queryId\":\"kgtzqnwqsttewu\",\"queryTimeInterval\":{\"startTime\":\"2021-06-06T05:06:24Z\",\"endTime\":\"2021-09-26T18:01:55Z\"},\"tableQueryResults\":{\"columns\":[{\"type\":\"flpd\",\"name\":\"fnonpiyuxlvrhp\"}],\"rows\":[[\"wonleqflvtlr\",\"bs\"],[\"huy\",\"uninttlnrjdszd\"],[\"ziciqppoqvgpn\"]]},\"chartQueryResults\":[{\"columns\":[{}],\"rows\":[[\"nox\",\"oxtfn\",\"essfepgckncj\"],[\"vsnvbtqdxfmj\",\"mjnhjlu\"]]},{\"columns\":[{}],\"rows\":[[\"pubdx\",\"kdlhzwhc\",\"kvbos\"],[\"fdizhrjq\",\"yayt\",\"slyekcgn\"],[\"arlcjiwgsxfaiocw\",\"gujjgn\",\"grzxbarcbpaefzqs\",\"mjw\"],[\"jcytesmfucrtfo\",\"q\",\"uauzmz\",\"vrtrfz\"]]}]},{\"queryId\":\"ezvhj\",\"queryTimeInterval\":{\"startTime\":\"2021-02-13T17:41:55Z\",\"endTime\":\"2021-07-24T06:37:34Z\"},\"tableQueryResults\":{\"columns\":[{\"type\":\"ahswtvdkxb\",\"name\":\"sgfenffdxb\"},{\"type\":\"fqjchivdrij\",\"name\":\"xndmuvar\"},{\"type\":\"mzjotprrmuh\",\"name\":\"htuzlxiwyopgar\"}],\"rows\":[[\"wrapczdojqy\",\"zesi\",\"iysnjqyowaadc\"],[\"azab\",\"ndtsewkaupw\",\"lzyckremgjlm\"]]},\"chartQueryResults\":[{\"columns\":[{},{},{}],\"rows\":[[\"xxhyrkqakofa\",\"freprfvm\",\"inwteyrqsh\"],[\"bcejopylbl\",\"sp\"],[\"wcspimtcvvf\"]]},{\"columns\":[{},{}],\"rows\":[[\"fs\",\"xizhqikmgo\",\"liqemcdiiisklbo\",\"xxupjxv\"],[\"kfkgenjqn\"],[\"jwkosnyxigf\",\"ujjcxgdqmrlhn\",\"kwopswnyinxupr\"],[\"yxwjezb\",\"qployu\",\"kdcpvu\",\"trsvjmnsvujnjkt\"]]},{\"columns\":[{},{}],\"rows\":[[\"jisepkdbxotfbj\",\"mp\",\"oclannmxynlsuq\",\"wzstrktg\"],[\"atr\"]]}]},{\"queryId\":\"jktfinf\",\"queryTimeInterval\":{\"startTime\":\"2021-06-07T22:58:26Z\",\"endTime\":\"2021-05-04T09:19:28Z\"},\"tableQueryResults\":{\"columns\":[{\"type\":\"kqicruoo\",\"name\":\"jflsgaojb\"},{\"type\":\"pqsdoc\",\"name\":\"zpujzflmcdsg\"}],\"rows\":[[\"uj\",\"swlluunxhfwlfxzf\",\"u\",\"eupcknecexkgrv\"],[\"sjdmngsytqpdzfyx\",\"nwaw\"]]},\"chartQueryResults\":[{\"columns\":[{},{},{}],\"rows\":[[\"qfbifo\",\"fjxdwdrp\"],[\"q\",\"krfmbwotfcuuu\"]]}]}]}") + .toObject(EntityGetInsightsResponseInner.class); + Assertions.assertEquals(683126430, model.metaData().totalCount()); + Assertions.assertEquals(GetInsightsError.INSIGHT, model.metaData().errors().get(0).kind()); + Assertions.assertEquals("lblmrtuxyprhfcae", model.metaData().errors().get(0).queryId()); + Assertions.assertEquals("oifq", model.metaData().errors().get(0).errorMessage()); + Assertions.assertEquals("ezb", model.value().get(0).queryId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-29T13:58:26Z"), + model.value().get(0).queryTimeInterval().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T19:04:09Z"), + model.value().get(0).queryTimeInterval().endTime()); + Assertions.assertEquals("qfygpny", model.value().get(0).tableQueryResults().columns().get(0).type()); + Assertions.assertEquals("dzuqscag", model.value().get(0).tableQueryResults().columns().get(0).name()); + Assertions.assertEquals("uprsytqzsslhmg", model.value().get(0).tableQueryResults().rows().get(0).get(0)); + Assertions.assertEquals("j", model.value().get(0).chartQueryResults().get(0).rows().get(0).get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemQueryTimeIntervalTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemQueryTimeIntervalTests.java new file mode 100644 index 000000000000..72bf93fce54e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemQueryTimeIntervalTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityInsightItemQueryTimeInterval; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class EntityInsightItemQueryTimeIntervalTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityInsightItemQueryTimeInterval model + = BinaryData.fromString("{\"startTime\":\"2021-08-22T07:48:03Z\",\"endTime\":\"2021-03-28T02:32:22Z\"}") + .toObject(EntityInsightItemQueryTimeInterval.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-22T07:48:03Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-28T02:32:22Z"), model.endTime()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemTests.java new file mode 100644 index 000000000000..7fde916cb927 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityInsightItemTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityInsightItem; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class EntityInsightItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityInsightItem model = BinaryData.fromString( + "{\"queryId\":\"jhxzubfjzabbwzgv\",\"queryTimeInterval\":{\"startTime\":\"2021-01-22T05:11:34Z\",\"endTime\":\"2021-07-28T04:21:43Z\"},\"tableQueryResults\":{\"columns\":[{\"type\":\"xspsaig\",\"name\":\"kmvyxzerejrk\"},{\"type\":\"jbyetjxryoptaei\",\"name\":\"hlbecgih\"}],\"rows\":[[\"mnrrabo\",\"rwwxywpj\",\"spboxhifp\",\"skpeswyhhmifjua\"],[\"wwv\",\"mmp\",\"glyuqvcmla\"],[\"bzbqufpnezsjzaym\",\"dror\",\"yogzmsimehtcu\"]]},\"chartQueryResults\":[{\"columns\":[{\"type\":\"qhyhni\",\"name\":\"tnsugisno\"},{\"type\":\"nwnghojov\",\"name\":\"y\"},{\"type\":\"ic\",\"name\":\"xxf\"}],\"rows\":[[\"rtnuguefxxijteb\",\"veywetkrhlolmcn\",\"epfgsvbbvaqdl\"],[\"petlrn\",\"detawevxehue\",\"dxljzvdovbrble\"]]},{\"columns\":[{\"type\":\"daqccddcbnygd\",\"name\":\"cxwbp\"},{\"type\":\"ykdigqzlrznda\",\"name\":\"nidmjqmvytg\"}],\"rows\":[[\"arhqt\"],[\"caz\"]]},{\"columns\":[{\"type\":\"dzffzjwztsmpchg\",\"name\":\"y\"}],\"rows\":[[\"yatigfgfrrkdk\"],[\"zgoryw\",\"vojtvmdevdlhqv\",\"ka\"]]},{\"columns\":[{\"type\":\"hssrlvkpkp\",\"name\":\"cmaccebx\"},{\"type\":\"pyicy\",\"name\":\"peslhw\"},{\"type\":\"kgv\",\"name\":\"cpumdd\"},{\"type\":\"ajk\",\"name\":\"yddt\"}],\"rows\":[[\"dvafnbfbqve\",\"qnxhgk\",\"rdw\",\"ejpec\"]]}]}") + .toObject(EntityInsightItem.class); + Assertions.assertEquals("jhxzubfjzabbwzgv", model.queryId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T05:11:34Z"), model.queryTimeInterval().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-28T04:21:43Z"), model.queryTimeInterval().endTime()); + Assertions.assertEquals("xspsaig", model.tableQueryResults().columns().get(0).type()); + Assertions.assertEquals("kmvyxzerejrk", model.tableQueryResults().columns().get(0).name()); + Assertions.assertEquals("mnrrabo", model.tableQueryResults().rows().get(0).get(0)); + Assertions.assertEquals("qhyhni", model.chartQueryResults().get(0).columns().get(0).type()); + Assertions.assertEquals("tnsugisno", model.chartQueryResults().get(0).columns().get(0).name()); + Assertions.assertEquals("rtnuguefxxijteb", model.chartQueryResults().get(0).rows().get(0).get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityListTests.java new file mode 100644 index 000000000000..48a7387dea07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityListTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.EntityList; +import org.junit.jupiter.api.Assertions; + +public final class EntityListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityList model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"Entity\",\"id\":\"bmps\",\"name\":\"fey\",\"type\":\"qlocvvujexaygl\"},{\"kind\":\"Entity\",\"id\":\"kgjn\",\"name\":\"zpaslavxjfiuo\",\"type\":\"pieidzlvssqy\"}],\"nextLink\":\"opac\"}") + .toObject(EntityList.class); + Assertions.assertEquals("opac", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityManualTriggerRequestBodyTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityManualTriggerRequestBodyTests.java new file mode 100644 index 000000000000..ec15691698bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityManualTriggerRequestBodyTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityManualTriggerRequestBody; +import org.junit.jupiter.api.Assertions; + +public final class EntityManualTriggerRequestBodyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityManualTriggerRequestBody model = BinaryData.fromString( + "{\"incidentArmId\":\"hydv\",\"tenantId\":\"mfngpmillxgjsci\",\"logicAppsResourceId\":\"wgsoriobijeiydy\"}") + .toObject(EntityManualTriggerRequestBody.class); + Assertions.assertEquals("hydv", model.incidentArmId()); + Assertions.assertEquals("mfngpmillxgjsci", model.tenantId()); + Assertions.assertEquals("wgsoriobijeiydy", model.logicAppsResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EntityManualTriggerRequestBody model = new EntityManualTriggerRequestBody().withIncidentArmId("hydv") + .withTenantId("mfngpmillxgjsci") + .withLogicAppsResourceId("wgsoriobijeiydy"); + model = BinaryData.fromObject(model).toObject(EntityManualTriggerRequestBody.class); + Assertions.assertEquals("hydv", model.incidentArmId()); + Assertions.assertEquals("mfngpmillxgjsci", model.tenantId()); + Assertions.assertEquals("wgsoriobijeiydy", model.logicAppsResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityMappingTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityMappingTests.java index 3bea88c7d839..8449e842cd24 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityMappingTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityMappingTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,20 +15,23 @@ public final class EntityMappingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EntityMapping model = BinaryData.fromString( - "{\"entityType\":\"AzureResource\",\"fieldMappings\":[{\"identifier\":\"vmm\",\"columnName\":\"pqfrtqlkz\"}]}") + "{\"entityType\":\"FileHash\",\"fieldMappings\":[{\"identifier\":\"uu\",\"columnName\":\"fqka\"},{\"identifier\":\"wiipfpub\",\"columnName\":\"bwwift\"},{\"identifier\":\"qkvpuvksgplsakn\",\"columnName\":\"fsynljphuop\"},{\"identifier\":\"dlqiyntorzih\",\"columnName\":\"osjswsr\"}]}") .toObject(EntityMapping.class); - Assertions.assertEquals(EntityMappingType.AZURE_RESOURCE, model.entityType()); - Assertions.assertEquals("vmm", model.fieldMappings().get(0).identifier()); - Assertions.assertEquals("pqfrtqlkz", model.fieldMappings().get(0).columnName()); + Assertions.assertEquals(EntityMappingType.FILE_HASH, model.entityType()); + Assertions.assertEquals("uu", model.fieldMappings().get(0).identifier()); + Assertions.assertEquals("fqka", model.fieldMappings().get(0).columnName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EntityMapping model = new EntityMapping().withEntityType(EntityMappingType.AZURE_RESOURCE) - .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("vmm").withColumnName("pqfrtqlkz"))); + EntityMapping model = new EntityMapping().withEntityType(EntityMappingType.FILE_HASH) + .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("uu").withColumnName("fqka"), + new FieldMapping().withIdentifier("wiipfpub").withColumnName("bwwift"), + new FieldMapping().withIdentifier("qkvpuvksgplsakn").withColumnName("fsynljphuop"), + new FieldMapping().withIdentifier("dlqiyntorzih").withColumnName("osjswsr"))); model = BinaryData.fromObject(model).toObject(EntityMapping.class); - Assertions.assertEquals(EntityMappingType.AZURE_RESOURCE, model.entityType()); - Assertions.assertEquals("vmm", model.fieldMappings().get(0).identifier()); - Assertions.assertEquals("pqfrtqlkz", model.fieldMappings().get(0).columnName()); + Assertions.assertEquals(EntityMappingType.FILE_HASH, model.entityType()); + Assertions.assertEquals("uu", model.fieldMappings().get(0).identifier()); + Assertions.assertEquals("fqka", model.fieldMappings().get(0).columnName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..ed23b7479901 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.CustomEntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQuery; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntityQueriesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"EntityQuery\",\"etag\":\"udifierxxorsdvu\",\"id\":\"qfksjll\",\"name\":\"gmd\",\"type\":\"aihlvrsqci\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EntityQuery response = manager.entityQueries() + .createOrUpdateWithResponse("vsxmyzss", "bs", "qhei", new CustomEntityQuery().withEtag("zebmmjaigaxwqip"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("udifierxxorsdvu", response.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesDeleteWithResponseMockTests.java similarity index 75% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsDeleteWithResponseMockTests.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesDeleteWithResponseMockTests.java index 98fa7318d7fd..637635deb6f1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WatchlistsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -15,7 +15,7 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class WatchlistsDeleteWithResponseMockTests { +public final class EntityQueriesDeleteWithResponseMockTests { @Test public void testDeleteWithResponse() throws Exception { String responseStr = "{}"; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.watchlists().deleteWithResponse("csklhsidsjt", "lpbnin", "gazlsvbz", com.azure.core.util.Context.NONE); + manager.entityQueries().deleteWithResponse("mirybwga", "cv", "kynemazgtbyn", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetWithResponseMockTests.java new file mode 100644 index 000000000000..a59de29b14aa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityQuery; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntityQueriesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"EntityQuery\",\"etag\":\"b\",\"id\":\"paeyw\",\"name\":\"ftvyzuyqzjfvb\",\"type\":\"yyjvzlscyz\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EntityQuery response = manager.entityQueries() + .getWithResponse("iojsrhgpi", "yeuvwysbmebf", "bznl", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("b", response.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListMockTests.java new file mode 100644 index 000000000000..16d19d3663f8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueriesListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityQuery; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntityQueriesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"EntityQuery\",\"etag\":\"buovsv\",\"id\":\"pcxdkm\",\"name\":\"vparyub\",\"type\":\"yhmlp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.entityQueries() + .list("shcawexgeqoj", "vuzxxkojjp", EntityQueryTemplateKind.ANOMALY, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("buovsv", response.iterator().next().etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryInnerTests.java new file mode 100644 index 000000000000..13a2e89c7395 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryInner; +import org.junit.jupiter.api.Assertions; + +public final class EntityQueryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityQueryInner model = BinaryData + .fromString( + "{\"kind\":\"EntityQuery\",\"etag\":\"oi\",\"id\":\"wxxbht\",\"name\":\"syio\",\"type\":\"emqwtq\"}") + .toObject(EntityQueryInner.class); + Assertions.assertEquals("oi", model.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemInnerTests.java new file mode 100644 index 000000000000..56581b3b6131 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryItemInner; +import org.junit.jupiter.api.Assertions; + +public final class EntityQueryItemInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityQueryItemInner model = BinaryData + .fromString( + "{\"kind\":\"EntityQueryItem\",\"id\":\"iqasif\",\"name\":\"nsnst\",\"type\":\"wqpjnxjkhtupsvy\"}") + .toObject(EntityQueryItemInner.class); + Assertions.assertEquals("nsnst", model.name()); + Assertions.assertEquals("wqpjnxjkhtupsvy", model.type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesDataTypesItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesDataTypesItemTests.java new file mode 100644 index 000000000000..da187ec62197 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesDataTypesItemTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityQueryItemPropertiesDataTypesItem; +import org.junit.jupiter.api.Assertions; + +public final class EntityQueryItemPropertiesDataTypesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityQueryItemPropertiesDataTypesItem model = BinaryData.fromString("{\"dataType\":\"jlvkrkegtyczupp\"}") + .toObject(EntityQueryItemPropertiesDataTypesItem.class); + Assertions.assertEquals("jlvkrkegtyczupp", model.dataType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesTests.java new file mode 100644 index 000000000000..584632d64858 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryItemPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityQueryItemProperties; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import org.junit.jupiter.api.Assertions; + +public final class EntityQueryItemPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityQueryItemProperties model = BinaryData.fromString( + "{\"dataTypes\":[{\"dataType\":\"fasfod\"}],\"inputEntityType\":\"RegistryKey\",\"requiredInputFieldsSets\":[[\"ngtwyuskwgq\"]],\"entitiesFilter\":\"\\\"datataumd\\\"\"}") + .toObject(EntityQueryItemProperties.class); + Assertions.assertEquals("fasfod", model.dataTypes().get(0).dataType()); + Assertions.assertEquals(EntityType.REGISTRY_KEY, model.inputEntityType()); + Assertions.assertEquals("ngtwyuskwgq", model.requiredInputFieldsSets().get(0).get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryListTests.java new file mode 100644 index 000000000000..a00f80f8b1ef --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryListTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.EntityQueryList; +import org.junit.jupiter.api.Assertions; + +public final class EntityQueryListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityQueryList model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"EntityQuery\",\"etag\":\"xjfsg\",\"id\":\"spoebnx\",\"name\":\"qcowscuyfql\",\"type\":\"m\"},{\"kind\":\"EntityQuery\",\"etag\":\"qhsujkafuzp\",\"id\":\"qpwnikxkcajgr\",\"name\":\"rct\",\"type\":\"vgoo\"},{\"kind\":\"EntityQuery\",\"etag\":\"sazmzl\",\"id\":\"xitmhxxrqic\",\"name\":\"zfvwjdthkvpyeyoa\",\"type\":\"inmpnqupdkjrzfwk\"}],\"nextLink\":\"uobdxw\"}") + .toObject(EntityQueryList.class); + Assertions.assertEquals("xjfsg", model.value().get(0).etag()); + Assertions.assertEquals("uobdxw", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateInnerTests.java new file mode 100644 index 000000000000..5b41c67ce7cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityQueryTemplateInner; + +public final class EntityQueryTemplateInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityQueryTemplateInner model = BinaryData + .fromString( + "{\"kind\":\"EntityQueryTemplate\",\"id\":\"dcclcvqsr\",\"name\":\"p\",\"type\":\"ylcvwbzmfx\"}") + .toObject(EntityQueryTemplateInner.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateListTests.java new file mode 100644 index 000000000000..84aefbc55f25 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplateListTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.EntityQueryTemplateList; +import org.junit.jupiter.api.Assertions; + +public final class EntityQueryTemplateListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityQueryTemplateList model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"EntityQueryTemplate\",\"id\":\"okjyghzt\",\"name\":\"smiwtpcflc\",\"type\":\"zswwvwi\"}],\"nextLink\":\"djtvbf\"}") + .toObject(EntityQueryTemplateList.class); + Assertions.assertEquals("djtvbf", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetWithResponseMockTests.java new file mode 100644 index 000000000000..3287fd3fffdf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplate; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntityQueryTemplatesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"EntityQueryTemplate\",\"id\":\"emzdnvnooklgren\",\"name\":\"qsgert\",\"type\":\"icemgsnc\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EntityQueryTemplate response = manager.entityQueryTemplates() + .getWithResponse("devotucnzbpocum", "z", "t", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListMockTests.java new file mode 100644 index 000000000000..d38ce59b8ff0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityQueryTemplatesListMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplate; +import com.azure.resourcemanager.securityinsights.models.EntityQueryTemplateKind; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntityQueryTemplatesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"EntityQueryTemplate\",\"id\":\"bnunpxswmccykbvi\",\"name\":\"a\",\"type\":\"pxlxbofdchb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.entityQueryTemplates() + .list("bd", "kphaed", EntityQueryTemplateKind.GUIDED_INSIGHT, com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java new file mode 100644 index 000000000000..bd7eac473a5b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Relation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EntityRelationsGetRelationWithResponseMockTests { + @Test + public void testGetRelationWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"relatedResourceId\":\"qjrytymfnojjh\",\"relatedResourceName\":\"nthjqgovviv\",\"relatedResourceType\":\"xytrafettwytavp\",\"relatedResourceKind\":\"lgyql\"},\"etag\":\"lgspy\",\"id\":\"apnhhvp\",\"name\":\"ukourqviyf\",\"type\":\"segwez\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Relation response = manager.entityRelations() + .getRelationWithResponse("iznnnadn", "isbpxlserq", "xnhfcccdutxybnjb", "mpmeglolpotclmb", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("lgspy", response.etag()); + Assertions.assertEquals("qjrytymfnojjh", response.relatedResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTests.java index 7239b099fd7a..db64e9db9155 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class EntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Entity model = BinaryData - .fromString("{\"kind\":\"Entity\",\"id\":\"eqx\",\"name\":\"lzdahzxctobgbkdm\",\"type\":\"izpost\"}") + .fromString("{\"kind\":\"Entity\",\"id\":\"jvzuy\",\"name\":\"urmlmuo\",\"type\":\"olbauirop\"}") .toObject(Entity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Entity model = new Entity(); - model = BinaryData.fromObject(model).toObject(Entity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineItemTests.java new file mode 100644 index 000000000000..7fd2bc30d2a4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineItemTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineItem; + +public final class EntityTimelineItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityTimelineItem model + = BinaryData.fromString("{\"kind\":\"EntityTimelineItem\"}").toObject(EntityTimelineItem.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineParametersTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineParametersTests.java new file mode 100644 index 000000000000..47057f95e71a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineParametersTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineKind; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class EntityTimelineParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityTimelineParameters model = BinaryData.fromString( + "{\"kinds\":[\"SecurityAlert\",\"Bookmark\",\"Anomaly\",\"SecurityAlert\"],\"startTime\":\"2021-02-13T16:54:44Z\",\"endTime\":\"2021-04-28T10:30:03Z\",\"numberOfBucket\":325882080}") + .toObject(EntityTimelineParameters.class); + Assertions.assertEquals(EntityTimelineKind.SECURITY_ALERT, model.kinds().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T16:54:44Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T10:30:03Z"), model.endTime()); + Assertions.assertEquals(325882080, model.numberOfBucket()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EntityTimelineParameters model = new EntityTimelineParameters() + .withKinds(Arrays.asList(EntityTimelineKind.SECURITY_ALERT, EntityTimelineKind.BOOKMARK, + EntityTimelineKind.ANOMALY, EntityTimelineKind.SECURITY_ALERT)) + .withStartTime(OffsetDateTime.parse("2021-02-13T16:54:44Z")) + .withEndTime(OffsetDateTime.parse("2021-04-28T10:30:03Z")) + .withNumberOfBucket(325882080); + model = BinaryData.fromObject(model).toObject(EntityTimelineParameters.class); + Assertions.assertEquals(EntityTimelineKind.SECURITY_ALERT, model.kinds().get(0)); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T16:54:44Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-28T10:30:03Z"), model.endTime()); + Assertions.assertEquals(325882080, model.numberOfBucket()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineResponseInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineResponseInnerTests.java new file mode 100644 index 000000000000..24cfacf71c7a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityTimelineResponseInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EntityTimelineResponseInner; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineKind; +import org.junit.jupiter.api.Assertions; + +public final class EntityTimelineResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EntityTimelineResponseInner model = BinaryData.fromString( + "{\"metaData\":{\"totalCount\":518423321,\"aggregations\":[{\"count\":1899683134,\"kind\":\"Activity\"},{\"count\":1701791293,\"kind\":\"Activity\"},{\"count\":1279247430,\"kind\":\"Activity\"},{\"count\":2129223340,\"kind\":\"SecurityAlert\"}],\"errors\":[{\"kind\":\"Activity\",\"queryId\":\"wb\",\"errorMessage\":\"judxzfvna\"}]},\"value\":[{\"kind\":\"EntityTimelineItem\"}]}") + .toObject(EntityTimelineResponseInner.class); + Assertions.assertEquals(518423321, model.metaData().totalCount()); + Assertions.assertEquals(1899683134, model.metaData().aggregations().get(0).count()); + Assertions.assertEquals(EntityTimelineKind.ACTIVITY, model.metaData().aggregations().get(0).kind()); + Assertions.assertEquals(EntityTimelineKind.ACTIVITY, model.metaData().errors().get(0).kind()); + Assertions.assertEquals("wb", model.metaData().errors().get(0).queryId()); + Assertions.assertEquals("judxzfvna", model.metaData().errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ErrorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ErrorTests.java new file mode 100644 index 000000000000..45311491b78f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ErrorTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Error; +import org.junit.jupiter.api.Assertions; + +public final class ErrorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Error model = BinaryData.fromString("{\"memberResourceName\":\"lkpajio\",\"errorMessage\":\"ybyilhdbb\"}") + .toObject(Error.class); + Assertions.assertEquals("lkpajio", model.memberResourceName()); + Assertions.assertEquals("ybyilhdbb", model.errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EventGroupingSettingsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EventGroupingSettingsTests.java index 7c33747a8e54..ba7876308e8f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EventGroupingSettingsTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EventGroupingSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueriesPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueriesPropertiesTests.java new file mode 100644 index 000000000000..5973ffd620bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueriesPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ExpansionEntityQueriesProperties; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import org.junit.jupiter.api.Assertions; + +public final class ExpansionEntityQueriesPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExpansionEntityQueriesProperties model = BinaryData.fromString( + "{\"dataSources\":[\"hdosmbngkq\",\"gxzduvxdmxe\",\"atmdmn\"],\"displayName\":\"enxoirxyddm\",\"inputEntityType\":\"Host\",\"inputFields\":[\"sj\",\"zsoxznntwgk\",\"yohpsapzupzwwytb\"],\"outputEntityTypes\":[\"DNS\",\"File\",\"Nic\"],\"queryTemplate\":\"mkgfmxpqkjnp\"}") + .toObject(ExpansionEntityQueriesProperties.class); + Assertions.assertEquals("hdosmbngkq", model.dataSources().get(0)); + Assertions.assertEquals("enxoirxyddm", model.displayName()); + Assertions.assertEquals(EntityType.HOST, model.inputEntityType()); + Assertions.assertEquals("sj", model.inputFields().get(0)); + Assertions.assertEquals(EntityType.DNS, model.outputEntityTypes().get(0)); + Assertions.assertEquals("mkgfmxpqkjnp", model.queryTemplate()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueryTests.java new file mode 100644 index 000000000000..ca7ba3700c16 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionEntityQueryTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import com.azure.resourcemanager.securityinsights.models.ExpansionEntityQuery; +import org.junit.jupiter.api.Assertions; + +public final class ExpansionEntityQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExpansionEntityQuery model = BinaryData.fromString( + "{\"kind\":\"Expansion\",\"properties\":{\"dataSources\":[\"yksik\",\"wanvmwdvgjqcrbko\"],\"displayName\":\"nbnfg\",\"inputEntityType\":\"CloudApplication\",\"inputFields\":[\"bepgcmahiwfry\",\"w\",\"ch\"],\"outputEntityTypes\":[\"RegistryValue\",\"RegistryKey\",\"URL\",\"SecurityGroup\"],\"queryTemplate\":\"hfyf\"},\"etag\":\"ibjepzwhj\",\"id\":\"fdgbggcjxzhbl\",\"name\":\"vwehsu\",\"type\":\"ym\"}") + .toObject(ExpansionEntityQuery.class); + Assertions.assertEquals("ibjepzwhj", model.etag()); + Assertions.assertEquals("yksik", model.dataSources().get(0)); + Assertions.assertEquals("nbnfg", model.displayName()); + Assertions.assertEquals(EntityType.CLOUD_APPLICATION, model.inputEntityType()); + Assertions.assertEquals("bepgcmahiwfry", model.inputFields().get(0)); + Assertions.assertEquals(EntityType.REGISTRY_VALUE, model.outputEntityTypes().get(0)); + Assertions.assertEquals("hfyf", model.queryTemplate()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultAggregationTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultAggregationTests.java new file mode 100644 index 000000000000..4a9c9a93b1a4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultAggregationTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultAggregation; +import org.junit.jupiter.api.Assertions; + +public final class ExpansionResultAggregationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExpansionResultAggregation model = BinaryData + .fromString( + "{\"aggregationType\":\"bun\",\"count\":1314097120,\"displayName\":\"klwzlw\",\"entityKind\":\"File\"}") + .toObject(ExpansionResultAggregation.class); + Assertions.assertEquals("bun", model.aggregationType()); + Assertions.assertEquals(1314097120, model.count()); + Assertions.assertEquals("klwzlw", model.displayName()); + Assertions.assertEquals(EntityKindEnum.FILE, model.entityKind()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultsMetadataTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultsMetadataTests.java new file mode 100644 index 000000000000..c6319242ff94 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ExpansionResultsMetadataTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; +import com.azure.resourcemanager.securityinsights.models.ExpansionResultsMetadata; +import org.junit.jupiter.api.Assertions; + +public final class ExpansionResultsMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ExpansionResultsMetadata model = BinaryData.fromString( + "{\"aggregations\":[{\"aggregationType\":\"p\",\"count\":1700902589,\"displayName\":\"wifhbksldttohq\",\"entityKind\":\"FileHash\"},{\"aggregationType\":\"aihtgsiqikvllrh\",\"count\":69943210,\"displayName\":\"glxkoikmtrawrqk\",\"entityKind\":\"Url\"}]}") + .toObject(ExpansionResultsMetadata.class); + Assertions.assertEquals("p", model.aggregations().get(0).aggregationType()); + Assertions.assertEquals(1700902589, model.aggregations().get(0).count()); + Assertions.assertEquals("wifhbksldttohq", model.aggregations().get(0).displayName()); + Assertions.assertEquals(EntityKindEnum.FILE_HASH, model.aggregations().get(0).entityKind()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnSettingsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnSettingsPropertiesTests.java new file mode 100644 index 000000000000..6c69dae7dba4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnSettingsPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.EyesOnSettingsProperties; + +public final class EyesOnSettingsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EyesOnSettingsProperties model + = BinaryData.fromString("{\"isEnabled\":true}").toObject(EyesOnSettingsProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EyesOnSettingsProperties model = new EyesOnSettingsProperties(); + model = BinaryData.fromObject(model).toObject(EyesOnSettingsProperties.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnTests.java new file mode 100644 index 000000000000..de54cf17ace6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EyesOnTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EyesOn; +import org.junit.jupiter.api.Assertions; + +public final class EyesOnTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EyesOn model = BinaryData.fromString( + "{\"kind\":\"EyesOn\",\"properties\":{\"isEnabled\":true},\"etag\":\"jhorlxkpy\",\"id\":\"ennycntr\",\"name\":\"xxwtdmbqjtsuh\",\"type\":\"htoxtdyqav\"}") + .toObject(EyesOn.class); + Assertions.assertEquals("jhorlxkpy", model.etag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EyesOn model = new EyesOn().withEtag("jhorlxkpy"); + model = BinaryData.fromObject(model).toObject(EyesOn.class); + Assertions.assertEquals("jhorlxkpy", model.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FieldMappingTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FieldMappingTests.java index 57c75fb49fe3..f585536d1191 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FieldMappingTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FieldMappingTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,17 +11,17 @@ public final class FieldMappingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FieldMapping model = BinaryData.fromString("{\"identifier\":\"gnitgvkxlzyq\",\"columnName\":\"fegcea\"}") + FieldMapping model = BinaryData.fromString("{\"identifier\":\"lyzrpzbchckqqzqi\",\"columnName\":\"iysui\"}") .toObject(FieldMapping.class); - Assertions.assertEquals("gnitgvkxlzyq", model.identifier()); - Assertions.assertEquals("fegcea", model.columnName()); + Assertions.assertEquals("lyzrpzbchckqqzqi", model.identifier()); + Assertions.assertEquals("iysui", model.columnName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FieldMapping model = new FieldMapping().withIdentifier("gnitgvkxlzyq").withColumnName("fegcea"); + FieldMapping model = new FieldMapping().withIdentifier("lyzrpzbchckqqzqi").withColumnName("iysui"); model = BinaryData.fromObject(model).toObject(FieldMapping.class); - Assertions.assertEquals("gnitgvkxlzyq", model.identifier()); - Assertions.assertEquals("fegcea", model.columnName()); + Assertions.assertEquals("lyzrpzbchckqqzqi", model.identifier()); + Assertions.assertEquals("iysui", model.columnName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityPropertiesTests.java index 2d185bff6a29..4b9d88c4348c 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class FileEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileEntityProperties model = BinaryData.fromString( - "{\"directory\":\"fl\",\"fileHashEntityIds\":[\"pizruwnpqxpxiw\",\"cng\"],\"fileName\":\"aas\",\"hostEntityId\":\"xtmkzjvkviir\",\"additionalData\":{\"ra\":\"datagrwsdp\",\"ctctbrxkjz\":\"datazvzbglbyv\",\"bkgozxwopdbydpi\":\"datargxffmshkw\",\"nugj\":\"dataqaclnapxbiy\"},\"friendlyName\":\"fsmfcttuxuuyi\"}") + "{\"directory\":\"hlgmltxdwhmoz\",\"fileHashEntityIds\":[\"zvlnsnnjz\",\"pafolp\"],\"fileName\":\"wamxqzrag\",\"hostEntityId\":\"dphtv\",\"additionalData\":{\"vl\":\"\\\"dataa\\\"\"},\"friendlyName\":\"c\"}") .toObject(FileEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileEntityProperties model = new FileEntityProperties(); - model = BinaryData.fromObject(model).toObject(FileEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityTests.java index cb653344df22..727234e71744 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class FileEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileEntity model = BinaryData.fromString( - "{\"kind\":\"File\",\"properties\":{\"directory\":\"mjxlyyzglgouw\",\"fileHashEntityIds\":[\"jjyuojqtobax\",\"j\"],\"fileName\":\"tu\",\"hostEntityId\":\"bfjkw\",\"additionalData\":{\"njqhdenxa\":\"datankqbhsyrq\"},\"friendlyName\":\"kpak\"},\"id\":\"ifmjnn\",\"name\":\"wtqabpxuckp\",\"type\":\"gqoweyirdhlisn\"}") + "{\"kind\":\"File\",\"properties\":{\"directory\":\"zejet\",\"fileHashEntityIds\":[\"nt\"],\"fileName\":\"yjuzkdb\",\"hostEntityId\":\"o\",\"additionalData\":{\"pcrrk\":\"\\\"datazvhqjwtrhtgvg\\\"\"},\"friendlyName\":\"awjmjsmw\"},\"id\":\"kcdxfzzzw\",\"name\":\"jafi\",\"type\":\"lhguyn\"}") .toObject(FileEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileEntity model = new FileEntity(); - model = BinaryData.fromObject(model).toObject(FileEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityPropertiesTests.java index 4d0a6e821493..b2009962234f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class FileHashEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileHashEntityProperties model = BinaryData.fromString( - "{\"algorithm\":\"SHA1\",\"hashValue\":\"spshckfkyjp\",\"additionalData\":{\"yogtieyujtvczkcn\":\"databpssdfp\",\"unjdx\":\"dataxrx\",\"ivbgkcv\":\"dataglnkvxlxpagl\"},\"friendlyName\":\"pzvuqdflvo\"}") + "{\"algorithm\":\"Unknown\",\"hashValue\":\"euachtomfl\",\"additionalData\":{\"ycxnmskw\":\"\\\"dataswfpfmd\\\"\",\"shhkvpedw\":\"\\\"dataqjjyslurl\\\"\",\"wwsko\":\"\\\"dataslsrhmpq\\\"\",\"josovyrrl\":\"\\\"datadcbrwimuvq\\\"\"},\"friendlyName\":\"esi\"}") .toObject(FileHashEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileHashEntityProperties model = new FileHashEntityProperties(); - model = BinaryData.fromObject(model).toObject(FileHashEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityTests.java index a770310685e8..98ae14a40f3b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileHashEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class FileHashEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileHashEntity model = BinaryData.fromString( - "{\"kind\":\"FileHash\",\"properties\":{\"algorithm\":\"SHA256AC\",\"hashValue\":\"iquvrehm\",\"additionalData\":{\"ytqj\":\"datahvsujztc\",\"auunfprnjletlx\":\"dataw\",\"ddoui\":\"datamr\"},\"friendlyName\":\"mowaziynknlqwzdv\"},\"id\":\"w\",\"name\":\"xqszdtmaajquh\",\"type\":\"xylrjvmtygjbmz\"}") + "{\"kind\":\"FileHash\",\"properties\":{\"algorithm\":\"SHA1\",\"hashValue\":\"zknmzlanrupd\",\"additionalData\":{\"mqrhvthl\":\"\\\"dataphcnzqtpj\\\"\",\"xetlgydlhqv\":\"\\\"dataiwdcxsmlzzhzd\\\"\",\"pxy\":\"\\\"datan\\\"\",\"klbyulidwcw\":\"\\\"dataafiqgeaarbgjekg\\\"\"},\"friendlyName\":\"zegjonfhjirwgdn\"},\"id\":\"brfkspz\",\"name\":\"zmtksjci\",\"type\":\"digsxcdgl\"}") .toObject(FileHashEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileHashEntity model = new FileHashEntity(); - model = BinaryData.fromObject(model).toObject(FileHashEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportInnerTests.java new file mode 100644 index 000000000000..e7b24c1e1c1d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportInnerTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.FileImportInner; +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import org.junit.jupiter.api.Assertions; + +public final class FileImportInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileImportInner model = BinaryData.fromString( + "{\"properties\":{\"ingestionMode\":\"Unspecified\",\"contentType\":\"BasicIndicator\",\"createdTimeUTC\":\"2021-02-09T05:43Z\",\"errorFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"cjnqs\",\"fileSize\":1162756602,\"fileContentUri\":\"wumxqukrcd\",\"deleteStatus\":\"NotDeleted\"},\"errorsPreview\":[{\"recordIndex\":818162808,\"errorMessages\":[\"hfknebw\",\"ddpnyzcwyj\",\"mkaqldqabnwvpaq\",\"qxfbbigcfddofx\"]},{\"recordIndex\":1805953851,\"errorMessages\":[\"yyrqaedwov\",\"cytjgoea\",\"okrwfmihw\"]},{\"recordIndex\":1692846196,\"errorMessages\":[\"dbfobdc\",\"vothmkhjaoz\"]},{\"recordIndex\":1068263979,\"errorMessages\":[\"njhbp\",\"elhscmyhrhjv\",\"zfq\"]}],\"importFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"dwpppqwojoe\",\"fileSize\":963964714,\"fileContentUri\":\"fytdxmly\",\"deleteStatus\":\"Unspecified\"},\"ingestedRecordCount\":2002965612,\"source\":\"apbkrbuoggtdl\",\"state\":\"IngestedWithErrors\",\"totalRecordCount\":1615187796,\"validRecordCount\":923809848,\"filesValidUntilTimeUTC\":\"2021-08-04T06:07:53Z\",\"importValidUntilTimeUTC\":\"2021-04-01T20:44:47Z\"},\"id\":\"ylzeohlpsftq\",\"name\":\"rvmhvbvvcpwt\",\"type\":\"suspnhmzy\"}") + .toObject(FileImportInner.class); + Assertions.assertEquals(IngestionMode.UNSPECIFIED, model.ingestionMode()); + Assertions.assertEquals(FileImportContentType.BASIC_INDICATOR, model.contentType()); + Assertions.assertEquals(FileFormat.JSON, model.importFile().fileFormat()); + Assertions.assertEquals("dwpppqwojoe", model.importFile().fileName()); + Assertions.assertEquals(963964714, model.importFile().fileSize()); + Assertions.assertEquals("apbkrbuoggtdl", model.source()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileImportInner model = new FileImportInner().withIngestionMode(IngestionMode.UNSPECIFIED) + .withContentType(FileImportContentType.BASIC_INDICATOR) + .withImportFile( + new FileMetadata().withFileFormat(FileFormat.JSON).withFileName("dwpppqwojoe").withFileSize(963964714)) + .withSource("apbkrbuoggtdl"); + model = BinaryData.fromObject(model).toObject(FileImportInner.class); + Assertions.assertEquals(IngestionMode.UNSPECIFIED, model.ingestionMode()); + Assertions.assertEquals(FileImportContentType.BASIC_INDICATOR, model.contentType()); + Assertions.assertEquals(FileFormat.JSON, model.importFile().fileFormat()); + Assertions.assertEquals("dwpppqwojoe", model.importFile().fileName()); + Assertions.assertEquals(963964714, model.importFile().fileSize()); + Assertions.assertEquals("apbkrbuoggtdl", model.source()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportListTests.java new file mode 100644 index 000000000000..3fcc8e313580 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportListTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.FileImportList; +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import org.junit.jupiter.api.Assertions; + +public final class FileImportListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileImportList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"ingestionMode\":\"IngestOnlyIfAllAreValid\",\"contentType\":\"BasicIndicator\",\"createdTimeUTC\":\"2021-05-05T05:59:54Z\",\"errorFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"xsytrtexegwmr\",\"fileSize\":1630129066,\"fileContentUri\":\"iwh\",\"deleteStatus\":\"NotDeleted\"},\"errorsPreview\":[{\"recordIndex\":1084626507,\"errorMessages\":[\"dilo\",\"kajwj\",\"riarsbcl\",\"anhz\"]},{\"recordIndex\":2065281004,\"errorMessages\":[\"izbaxd\",\"gzkztxfex\"]},{\"recordIndex\":1286624977,\"errorMessages\":[\"jmlxppdnd\",\"kfevui\",\"u\",\"ibfkcjytq\"]},{\"recordIndex\":1032502385,\"errorMessages\":[\"qqfopvno\",\"m\"]}],\"importFile\":{\"fileFormat\":\"Unspecified\",\"fileName\":\"fhoxqlyoazyfbk\",\"fileSize\":1743354358,\"fileContentUri\":\"zmxojzsvmai\",\"deleteStatus\":\"NotDeleted\"},\"ingestedRecordCount\":1122859032,\"source\":\"hyejt\",\"state\":\"InProgress\",\"totalRecordCount\":536354268,\"validRecordCount\":1822341615,\"filesValidUntilTimeUTC\":\"2021-02-06T20:29:42Z\",\"importValidUntilTimeUTC\":\"2021-06-18T02:03:50Z\"},\"id\":\"ck\",\"name\":\"hbamyqsok\",\"type\":\"npu\"},{\"properties\":{\"ingestionMode\":\"IngestAnyValidRecords\",\"contentType\":\"Unspecified\",\"createdTimeUTC\":\"2021-04-22T03:22:19Z\",\"errorFile\":{\"fileFormat\":\"CSV\",\"fileName\":\"ixiujz\",\"fileSize\":1953058413,\"fileContentUri\":\"xgkrswksykkbxk\",\"deleteStatus\":\"Deleted\"},\"errorsPreview\":[{\"recordIndex\":1407065162,\"errorMessages\":[\"zokn\",\"uqddlggbqaolgzu\"]},{\"recordIndex\":1938217945,\"errorMessages\":[\"kvggcmfns\",\"f\",\"tpkmixwe\",\"zlscgs\"]}],\"importFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"qvxgvohdb\",\"fileSize\":321022043,\"fileContentUri\":\"moevvude\",\"deleteStatus\":\"Unspecified\"},\"ingestedRecordCount\":342131546,\"source\":\"annvwx\",\"state\":\"Unspecified\",\"totalRecordCount\":808498774,\"validRecordCount\":1095276485,\"filesValidUntilTimeUTC\":\"2021-06-29T20:43:34Z\",\"importValidUntilTimeUTC\":\"2021-11-19T03:02:07Z\"},\"id\":\"gayb\",\"name\":\"rhhogalgxnw\",\"type\":\"mzvztauebpa\"},{\"properties\":{\"ingestionMode\":\"Unspecified\",\"contentType\":\"StixIndicator\",\"createdTimeUTC\":\"2021-06-21T18:19Z\",\"errorFile\":{\"fileFormat\":\"CSV\",\"fileName\":\"bzzghvdfeu\",\"fileSize\":72612929,\"fileContentUri\":\"v\",\"deleteStatus\":\"NotDeleted\"},\"errorsPreview\":[{\"recordIndex\":319568229,\"errorMessages\":[\"okj\",\"nzxezriwgo\"]},{\"recordIndex\":1144814497,\"errorMessages\":[\"qksa\",\"ap\",\"j\"]},{\"recordIndex\":353257456,\"errorMessages\":[\"benwsdfp\",\"daah\",\"frcqkl\"]}],\"importFile\":{\"fileFormat\":\"Unspecified\",\"fileName\":\"pireszyaqgomlbmf\",\"fileSize\":2069183833,\"fileContentUri\":\"kfe\",\"deleteStatus\":\"NotDeleted\"},\"ingestedRecordCount\":234558475,\"source\":\"wkyeahhhutpu\",\"state\":\"IngestedWithErrors\",\"totalRecordCount\":513740770,\"validRecordCount\":1689542796,\"filesValidUntilTimeUTC\":\"2021-07-22T07:43:55Z\",\"importValidUntilTimeUTC\":\"2021-08-22T06:10:26Z\"},\"id\":\"pinowrerjp\",\"name\":\"ptchdwyq\",\"type\":\"idqimlgbbfj\"},{\"properties\":{\"ingestionMode\":\"Unspecified\",\"contentType\":\"StixIndicator\",\"createdTimeUTC\":\"2021-05-29T21:11:51Z\",\"errorFile\":{\"fileFormat\":\"Unspecified\",\"fileName\":\"mheftyaphqeofyt\",\"fileSize\":1740383696,\"fileContentUri\":\"owm\",\"deleteStatus\":\"Unspecified\"},\"errorsPreview\":[{\"recordIndex\":1437411763,\"errorMessages\":[\"ccqvjfdgfqpm\",\"u\",\"pjhcfaaradciovmu\"]},{\"recordIndex\":1992907746,\"errorMessages\":[\"rblwalao\",\"snqebaotbp\",\"gcsmanxxr\",\"qfmdqecvtam\"]},{\"recordIndex\":15878740,\"errorMessages\":[\"ob\",\"ewwpsibxov\",\"qoqjrkblndy\"]},{\"recordIndex\":557977002,\"errorMessages\":[\"cvtqnzjcyqqzhemb\",\"bwna\",\"ba\"]}],\"importFile\":{\"fileFormat\":\"Unspecified\",\"fileName\":\"jdleajvmvvlooubs\",\"fileSize\":1215867583,\"fileContentUri\":\"jeop\",\"deleteStatus\":\"NotDeleted\"},\"ingestedRecordCount\":1929084172,\"source\":\"jomlupfazus\",\"state\":\"InProgress\",\"totalRecordCount\":1119212267,\"validRecordCount\":699312756,\"filesValidUntilTimeUTC\":\"2021-01-23T17:53:26Z\",\"importValidUntilTimeUTC\":\"2021-11-17T15:05:58Z\"},\"id\":\"gdqyxajc\",\"name\":\"grcavqc\",\"type\":\"yzoqzkmqcwwsjnk\"}],\"nextLink\":\"xepbntqq\"}") + .toObject(FileImportList.class); + Assertions.assertEquals(IngestionMode.INGEST_ONLY_IF_ALL_ARE_VALID, model.value().get(0).ingestionMode()); + Assertions.assertEquals(FileImportContentType.BASIC_INDICATOR, model.value().get(0).contentType()); + Assertions.assertEquals(FileFormat.UNSPECIFIED, model.value().get(0).importFile().fileFormat()); + Assertions.assertEquals("fhoxqlyoazyfbk", model.value().get(0).importFile().fileName()); + Assertions.assertEquals(1743354358, model.value().get(0).importFile().fileSize()); + Assertions.assertEquals("hyejt", model.value().get(0).source()); + Assertions.assertEquals("xepbntqq", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportPropertiesTests.java new file mode 100644 index 000000000000..74a3fb212f88 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportPropertiesTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.FileImportProperties; +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import org.junit.jupiter.api.Assertions; + +public final class FileImportPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileImportProperties model = BinaryData.fromString( + "{\"ingestionMode\":\"IngestAnyValidRecords\",\"contentType\":\"Unspecified\",\"createdTimeUTC\":\"2021-02-04T23:37:30Z\",\"errorFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"tf\",\"fileSize\":1368842231,\"fileContentUri\":\"cycsyo\",\"deleteStatus\":\"Unspecified\"},\"errorsPreview\":[{\"recordIndex\":794938778,\"errorMessages\":[\"atvcsxr\",\"hnmizhvprhqq\"]},{\"recordIndex\":970534013,\"errorMessages\":[\"eh\",\"kplobzgottaksadz\",\"ghmmtbtdvucfvvra\"]}],\"importFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"rdeewl\",\"fileSize\":1560893844,\"fileContentUri\":\"cbwkdwjyj\",\"deleteStatus\":\"NotDeleted\"},\"ingestedRecordCount\":4784017,\"source\":\"roo\",\"state\":\"WaitingForUpload\",\"totalRecordCount\":996337614,\"validRecordCount\":1939573984,\"filesValidUntilTimeUTC\":\"2021-10-14T22:27:36Z\",\"importValidUntilTimeUTC\":\"2021-08-10T14:55:35Z\"}") + .toObject(FileImportProperties.class); + Assertions.assertEquals(IngestionMode.INGEST_ANY_VALID_RECORDS, model.ingestionMode()); + Assertions.assertEquals(FileImportContentType.UNSPECIFIED, model.contentType()); + Assertions.assertEquals(FileFormat.JSON, model.importFile().fileFormat()); + Assertions.assertEquals("rdeewl", model.importFile().fileName()); + Assertions.assertEquals(1560893844, model.importFile().fileSize()); + Assertions.assertEquals("roo", model.source()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileImportProperties model + = new FileImportProperties().withIngestionMode(IngestionMode.INGEST_ANY_VALID_RECORDS) + .withContentType(FileImportContentType.UNSPECIFIED) + .withImportFile( + new FileMetadata().withFileFormat(FileFormat.JSON).withFileName("rdeewl").withFileSize(1560893844)) + .withSource("roo"); + model = BinaryData.fromObject(model).toObject(FileImportProperties.class); + Assertions.assertEquals(IngestionMode.INGEST_ANY_VALID_RECORDS, model.ingestionMode()); + Assertions.assertEquals(FileImportContentType.UNSPECIFIED, model.contentType()); + Assertions.assertEquals(FileFormat.JSON, model.importFile().fileFormat()); + Assertions.assertEquals("rdeewl", model.importFile().fileName()); + Assertions.assertEquals(1560893844, model.importFile().fileSize()); + Assertions.assertEquals("roo", model.source()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsCreateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsCreateWithResponseMockTests.java new file mode 100644 index 000000000000..2f9ce55c0f83 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsCreateWithResponseMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImport; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileImportsCreateWithResponseMockTests { + @Test + public void testCreateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"ingestionMode\":\"Unspecified\",\"contentType\":\"BasicIndicator\",\"createdTimeUTC\":\"2021-06-20T01:26:05Z\",\"errorFile\":{\"fileFormat\":\"CSV\",\"fileName\":\"wbobawlntenhnq\",\"fileSize\":1697787563,\"fileContentUri\":\"hbehhehotqorrvwl\",\"deleteStatus\":\"NotDeleted\"},\"errorsPreview\":[{\"recordIndex\":1380824509,\"errorMessages\":[\"lvgjirjkkr\",\"yfds\",\"rtkevimrupg\",\"vjmandrvvjokl\"]},{\"recordIndex\":1436605183,\"errorMessages\":[\"dtwxfj\",\"pko\"]}],\"importFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"fmqf\",\"fileSize\":2128738130,\"fileContentUri\":\"puvwlfzjrjglacpz\",\"deleteStatus\":\"Unspecified\"},\"ingestedRecordCount\":1798135541,\"source\":\"slwujkeyt\",\"state\":\"Ingested\",\"totalRecordCount\":1943585210,\"validRecordCount\":1759306978,\"filesValidUntilTimeUTC\":\"2021-03-13T23:48:23Z\",\"importValidUntilTimeUTC\":\"2021-08-16T04:53:10Z\"},\"id\":\"ytqtvatujphqvfx\",\"name\":\"vogwgh\",\"type\":\"oxwpiqkkmpfnwdr\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileImport response = manager.fileImports() + .define("fiksjpkig") + .withExistingWorkspace("xjwn", "rskyrttnrikss") + .withIngestionMode(IngestionMode.INGEST_ANY_VALID_RECORDS) + .withContentType(FileImportContentType.BASIC_INDICATOR) + .withImportFile( + new FileMetadata().withFileFormat(FileFormat.JSON).withFileName("vkqjpovjvv").withFileSize(712572826)) + .withSource("qfl") + .create(); + + Assertions.assertEquals(IngestionMode.UNSPECIFIED, response.ingestionMode()); + Assertions.assertEquals(FileImportContentType.BASIC_INDICATOR, response.contentType()); + Assertions.assertEquals(FileFormat.JSON, response.importFile().fileFormat()); + Assertions.assertEquals("fmqf", response.importFile().fileName()); + Assertions.assertEquals(2128738130, response.importFile().fileSize()); + Assertions.assertEquals("slwujkeyt", response.source()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetWithResponseMockTests.java new file mode 100644 index 000000000000..1d3eaf08abd0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsGetWithResponseMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImport; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileImportsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"ingestionMode\":\"IngestOnlyIfAllAreValid\",\"contentType\":\"Unspecified\",\"createdTimeUTC\":\"2021-03-17T03:57:06Z\",\"errorFile\":{\"fileFormat\":\"JSON\",\"fileName\":\"wqhz\",\"fileSize\":568085330,\"fileContentUri\":\"gvygmtywivbuit\",\"deleteStatus\":\"NotDeleted\"},\"errorsPreview\":[{\"recordIndex\":1299612880,\"errorMessages\":[\"rsxykw\"]}],\"importFile\":{\"fileFormat\":\"CSV\",\"fileName\":\"dudj\",\"fileSize\":528999835,\"fileContentUri\":\"xpsnnnxhg\",\"deleteStatus\":\"Unspecified\"},\"ingestedRecordCount\":629280086,\"source\":\"ylnd\",\"state\":\"InProgress\",\"totalRecordCount\":1221270848,\"validRecordCount\":1744231547,\"filesValidUntilTimeUTC\":\"2021-04-17T18:37:10Z\",\"importValidUntilTimeUTC\":\"2021-09-05T10:24:07Z\"},\"id\":\"khdnpnmrxjdfkql\",\"name\":\"ai\",\"type\":\"fyvqua\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileImport response = manager.fileImports() + .getWithResponse("acfskzwesetutq", "sojwoixt", "nakytzcmagvs", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(IngestionMode.INGEST_ONLY_IF_ALL_ARE_VALID, response.ingestionMode()); + Assertions.assertEquals(FileImportContentType.UNSPECIFIED, response.contentType()); + Assertions.assertEquals(FileFormat.CSV, response.importFile().fileFormat()); + Assertions.assertEquals("dudj", response.importFile().fileName()); + Assertions.assertEquals(528999835, response.importFile().fileSize()); + Assertions.assertEquals("ylnd", response.source()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListMockTests.java new file mode 100644 index 000000000000..b16547552c5a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileImportsListMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileImport; +import com.azure.resourcemanager.securityinsights.models.FileImportContentType; +import com.azure.resourcemanager.securityinsights.models.IngestionMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileImportsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"ingestionMode\":\"Unspecified\",\"contentType\":\"BasicIndicator\",\"createdTimeUTC\":\"2021-07-05T16:21:41Z\",\"errorFile\":{\"fileFormat\":\"Unspecified\",\"fileName\":\"qhvhc\",\"fileSize\":1265477916,\"fileContentUri\":\"wif\",\"deleteStatus\":\"NotDeleted\"},\"errorsPreview\":[{\"recordIndex\":845310548,\"errorMessages\":[\"aawyy\",\"zwoeqljlwfq\",\"fywwzsipkhqhvktc\"]}],\"importFile\":{\"fileFormat\":\"CSV\",\"fileName\":\"dkhohspkgxemv\",\"fileSize\":227315085,\"fileContentUri\":\"rjzbxxxqfrntzbh\",\"deleteStatus\":\"Deleted\"},\"ingestedRecordCount\":189698058,\"source\":\"fauvgt\",\"state\":\"Ingested\",\"totalRecordCount\":899359452,\"validRecordCount\":1935531272,\"filesValidUntilTimeUTC\":\"2021-02-04T00:15Z\",\"importValidUntilTimeUTC\":\"2021-05-28T07:02:21Z\"},\"id\":\"fbmrwhk\",\"name\":\"efcooptmdspddxgu\",\"type\":\"iosibgolaxuy\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.fileImports() + .list("vywkbie", "yvakqah", "pgnapkpaie", "oxvoaoavezwcl", 1506879609, "ml", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(IngestionMode.UNSPECIFIED, response.iterator().next().ingestionMode()); + Assertions.assertEquals(FileImportContentType.BASIC_INDICATOR, response.iterator().next().contentType()); + Assertions.assertEquals(FileFormat.CSV, response.iterator().next().importFile().fileFormat()); + Assertions.assertEquals("dkhohspkgxemv", response.iterator().next().importFile().fileName()); + Assertions.assertEquals(227315085, response.iterator().next().importFile().fileSize()); + Assertions.assertEquals("fauvgt", response.iterator().next().source()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileMetadataTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileMetadataTests.java new file mode 100644 index 000000000000..cb62c120e430 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FileMetadataTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.FileFormat; +import com.azure.resourcemanager.securityinsights.models.FileMetadata; +import org.junit.jupiter.api.Assertions; + +public final class FileMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileMetadata model = BinaryData.fromString( + "{\"fileFormat\":\"Unspecified\",\"fileName\":\"ftrnighminuwqxu\",\"fileSize\":393957969,\"fileContentUri\":\"bgwfmsxjwdylwx\",\"deleteStatus\":\"NotDeleted\"}") + .toObject(FileMetadata.class); + Assertions.assertEquals(FileFormat.UNSPECIFIED, model.fileFormat()); + Assertions.assertEquals("ftrnighminuwqxu", model.fileName()); + Assertions.assertEquals(393957969, model.fileSize()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileMetadata model = new FileMetadata().withFileFormat(FileFormat.UNSPECIFIED) + .withFileName("ftrnighminuwqxu") + .withFileSize(393957969); + model = BinaryData.fromObject(model).toObject(FileMetadata.class); + Assertions.assertEquals(FileFormat.UNSPECIFIED, model.fileFormat()); + Assertions.assertEquals("ftrnighminuwqxu", model.fileName()); + Assertions.assertEquals(393957969, model.fileSize()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRulePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRulePropertiesTests.java index 69d1642b07d7..e30689a4f691 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRulePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRulePropertiesTests.java @@ -1,29 +1,133 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleProperties; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionScenarioExclusionPattern; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSettings; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class FusionAlertRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FusionAlertRuleProperties model = BinaryData.fromString( - "{\"alertRuleTemplateName\":\"f\",\"description\":\"mrqemvvhmx\",\"displayName\":\"rjfut\",\"enabled\":true,\"lastModifiedUtc\":\"2021-07-27T22:13:32Z\",\"severity\":\"Informational\",\"tactics\":[\"Persistence\",\"Impact\",\"ResourceDevelopment\"],\"techniques\":[\"nmwcpmgu\",\"adraufactkahzo\"]}") + "{\"alertRuleTemplateName\":\"hibnuqqkpika\",\"description\":\"gvtqagnbuynh\",\"displayName\":\"gg\",\"enabled\":false,\"sourceSettings\":[{\"enabled\":true,\"sourceName\":\"iarbutrcvpna\",\"sourceSubTypes\":[{\"enabled\":false,\"sourceSubTypeName\":\"jrunmpxtt\",\"sourceSubTypeDisplayName\":\"hrbnlankxmyskpbh\",\"severityFilters\":{\"isSupported\":true,\"filters\":[{\"severity\":\"High\",\"enabled\":true},{\"severity\":\"High\",\"enabled\":false}]}},{\"enabled\":false,\"sourceSubTypeName\":\"y\",\"sourceSubTypeDisplayName\":\"rsyn\",\"severityFilters\":{\"isSupported\":true,\"filters\":[{\"severity\":\"High\",\"enabled\":false},{\"severity\":\"Medium\",\"enabled\":false}]}},{\"enabled\":false,\"sourceSubTypeName\":\"fclhaaxdbabphlwr\",\"sourceSubTypeDisplayName\":\"fkts\",\"severityFilters\":{\"isSupported\":true,\"filters\":[{\"severity\":\"Informational\",\"enabled\":true},{\"severity\":\"Medium\",\"enabled\":true},{\"severity\":\"Medium\",\"enabled\":true}]}},{\"enabled\":false,\"sourceSubTypeName\":\"zt\",\"sourceSubTypeDisplayName\":\"twwrqp\",\"severityFilters\":{\"isSupported\":true,\"filters\":[{\"severity\":\"Medium\",\"enabled\":true},{\"severity\":\"Low\",\"enabled\":true}]}}]},{\"enabled\":true,\"sourceName\":\"exzfeyue\",\"sourceSubTypes\":[{\"enabled\":false,\"sourceSubTypeName\":\"xujwbhqwalmuzyo\",\"sourceSubTypeDisplayName\":\"epdkzja\",\"severityFilters\":{\"isSupported\":false,\"filters\":[{\"severity\":\"Informational\",\"enabled\":false},{\"severity\":\"Low\",\"enabled\":true},{\"severity\":\"Informational\",\"enabled\":false}]}}]},{\"enabled\":false,\"sourceName\":\"bniwdj\",\"sourceSubTypes\":[{\"enabled\":false,\"sourceSubTypeName\":\"s\",\"sourceSubTypeDisplayName\":\"pgn\",\"severityFilters\":{\"isSupported\":false,\"filters\":[{\"severity\":\"Medium\",\"enabled\":true},{\"severity\":\"Medium\",\"enabled\":false},{\"severity\":\"Low\",\"enabled\":false}]}}]}],\"scenarioExclusionPatterns\":[{\"exclusionPattern\":\"abgl\",\"dateAddedInUTC\":\"uhxwtctyqiklbbov\"},{\"exclusionPattern\":\"lwzbhvgyugu\",\"dateAddedInUTC\":\"svmkfssxquk\"},{\"exclusionPattern\":\"fpl\",\"dateAddedInUTC\":\"mg\"}],\"lastModifiedUtc\":\"2021-08-18T07:20:43Z\",\"severity\":\"Informational\",\"tactics\":[\"Exfiltration\"],\"techniques\":[\"lpvlopw\",\"yighxpk\"],\"subTechniques\":[\"baiuebbaumny\"]}") .toObject(FusionAlertRuleProperties.class); - Assertions.assertEquals("f", model.alertRuleTemplateName()); - Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("hibnuqqkpika", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.sourceSettings().get(0).enabled()); + Assertions.assertEquals("iarbutrcvpna", model.sourceSettings().get(0).sourceName()); + Assertions.assertFalse(model.sourceSettings().get(0).sourceSubTypes().get(0).enabled()); + Assertions.assertEquals("jrunmpxtt", model.sourceSettings().get(0).sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertEquals(AlertSeverity.HIGH, + model.sourceSettings().get(0).sourceSubTypes().get(0).severityFilters().filters().get(0).severity()); + Assertions.assertTrue( + model.sourceSettings().get(0).sourceSubTypes().get(0).severityFilters().filters().get(0).enabled()); + Assertions.assertEquals("abgl", model.scenarioExclusionPatterns().get(0).exclusionPattern()); + Assertions.assertEquals("uhxwtctyqiklbbov", model.scenarioExclusionPatterns().get(0).dateAddedInUTC()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FusionAlertRuleProperties model - = new FusionAlertRuleProperties().withAlertRuleTemplateName("f").withEnabled(true); + = new FusionAlertRuleProperties().withAlertRuleTemplateName("hibnuqqkpika") + .withEnabled(false) + .withSourceSettings( + Arrays + .asList( + new FusionSourceSettings().withEnabled(true) + .withSourceName("iarbutrcvpna") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("jrunmpxtt") + .withSeverityFilters(new FusionSubTypeSeverityFilter() + .withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.HIGH) + .withEnabled(false)))), + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("y") + .withSeverityFilters( + new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH) + .withEnabled(false), + new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.MEDIUM) + .withEnabled(false)))), + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("fclhaaxdbabphlwr") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters( + Arrays.asList(new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true)))), + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("zt") + .withSeverityFilters( + new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.LOW) + .withEnabled(true)))))), + new FusionSourceSettings().withEnabled(true) + .withSourceName("exzfeyue") + .withSourceSubTypes(Arrays.asList(new FusionSourceSubTypeSetting() + .withEnabled(false) + .withSourceSubTypeName("xujwbhqwalmuzyo") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(false), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem() + .withSeverity(AlertSeverity.INFORMATIONAL) + .withEnabled(false)))))), + new FusionSourceSettings().withEnabled(false) + .withSourceName("bniwdj") + .withSourceSubTypes(Arrays.asList(new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("s") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM) + .withEnabled(false), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.LOW) + .withEnabled(false)))))))) + .withScenarioExclusionPatterns(Arrays.asList( + new FusionScenarioExclusionPattern().withExclusionPattern("abgl") + .withDateAddedInUTC("uhxwtctyqiklbbov"), + new FusionScenarioExclusionPattern().withExclusionPattern("lwzbhvgyugu") + .withDateAddedInUTC("svmkfssxquk"), + new FusionScenarioExclusionPattern().withExclusionPattern("fpl").withDateAddedInUTC("mg"))); model = BinaryData.fromObject(model).toObject(FusionAlertRuleProperties.class); - Assertions.assertEquals("f", model.alertRuleTemplateName()); - Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("hibnuqqkpika", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.sourceSettings().get(0).enabled()); + Assertions.assertEquals("iarbutrcvpna", model.sourceSettings().get(0).sourceName()); + Assertions.assertFalse(model.sourceSettings().get(0).sourceSubTypes().get(0).enabled()); + Assertions.assertEquals("jrunmpxtt", model.sourceSettings().get(0).sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertEquals(AlertSeverity.HIGH, + model.sourceSettings().get(0).sourceSubTypes().get(0).severityFilters().filters().get(0).severity()); + Assertions.assertTrue( + model.sourceSettings().get(0).sourceSubTypes().get(0).severityFilters().filters().get(0).enabled()); + Assertions.assertEquals("abgl", model.scenarioExclusionPatterns().get(0).exclusionPattern()); + Assertions.assertEquals("uhxwtctyqiklbbov", model.scenarioExclusionPatterns().get(0).dateAddedInUTC()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplatePropertiesTests.java index d0ef7ad830b0..6b84ca226b73 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplatePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplatePropertiesTests.java @@ -1,57 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.FusionAlertRuleTemplateProperties; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.TemplateStatus; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class FusionAlertRuleTemplatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FusionAlertRuleTemplateProperties model = BinaryData.fromString( - "{\"alertRulesCreatedByTemplateCount\":1160749519,\"createdDateUTC\":\"2021-08-23T04:49:10Z\",\"lastUpdatedDateUTC\":\"2021-11-08T12:58:30Z\",\"description\":\"onmacjekniz\",\"displayName\":\"qvci\",\"requiredDataConnectors\":[{\"connectorId\":\"fgmblrrilbywdxsm\",\"dataTypes\":[\"wrwfscjfnyns\",\"qujizdvo\"]}],\"status\":\"Installed\",\"severity\":\"Informational\",\"tactics\":[\"CommandAndControl\"],\"techniques\":[\"lgy\",\"vutpthjoxo\",\"smsks\"]}") + "{\"alertRulesCreatedByTemplateCount\":1019109775,\"createdDateUTC\":\"2021-02-02T04:40:45Z\",\"lastUpdatedDateUTC\":\"2021-08-05T22:36:10Z\",\"description\":\"wslolbqp\",\"displayName\":\"zlmvfelfktgp\",\"requiredDataConnectors\":[{\"connectorId\":\"wjxeznoigbr\",\"dataTypes\":[\"mw\"]}],\"status\":\"NotAvailable\",\"severity\":\"High\",\"tactics\":[\"PreAttack\",\"ImpairProcessControl\"],\"techniques\":[\"qkagfhsxt\",\"augzxnfaazpxdtn\"],\"subTechniques\":[\"kqjjlwuenvrkp\",\"ou\"],\"sourceSettings\":[{\"sourceName\":\"rebqaaysjk\",\"sourceSubTypes\":[{\"sourceSubTypeName\":\"tnqttezlwfffiak\",\"sourceSubTypeDisplayName\":\"pqqmted\",\"severityFilter\":{\"isSupported\":true,\"severityFilters\":[\"High\",\"Low\",\"Low\"]}},{\"sourceSubTypeName\":\"yeozphvwauyqncy\",\"sourceSubTypeDisplayName\":\"p\",\"severityFilter\":{\"isSupported\":true,\"severityFilters\":[\"Low\"]}}]}]}") .toObject(FusionAlertRuleTemplateProperties.class); - Assertions.assertEquals(1160749519, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("onmacjekniz", model.description()); - Assertions.assertEquals("qvci", model.displayName()); - Assertions.assertEquals("fgmblrrilbywdxsm", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("wrwfscjfnyns", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); - Assertions.assertEquals(AttackTactic.COMMAND_AND_CONTROL, model.tactics().get(0)); - Assertions.assertEquals("lgy", model.techniques().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FusionAlertRuleTemplateProperties model - = new FusionAlertRuleTemplateProperties().withAlertRulesCreatedByTemplateCount(1160749519) - .withDescription("onmacjekniz") - .withDisplayName("qvci") - .withRequiredDataConnectors( - Arrays.asList(new AlertRuleTemplateDataSource().withConnectorId("fgmblrrilbywdxsm") - .withDataTypes(Arrays.asList("wrwfscjfnyns", "qujizdvo")))) - .withStatus(TemplateStatus.INSTALLED) - .withSeverity(AlertSeverity.INFORMATIONAL) - .withTactics(Arrays.asList(AttackTactic.COMMAND_AND_CONTROL)) - .withTechniques(Arrays.asList("lgy", "vutpthjoxo", "smsks")); - model = BinaryData.fromObject(model).toObject(FusionAlertRuleTemplateProperties.class); - Assertions.assertEquals(1160749519, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("onmacjekniz", model.description()); - Assertions.assertEquals("qvci", model.displayName()); - Assertions.assertEquals("fgmblrrilbywdxsm", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("wrwfscjfnyns", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); - Assertions.assertEquals(AttackTactic.COMMAND_AND_CONTROL, model.tactics().get(0)); - Assertions.assertEquals("lgy", model.techniques().get(0)); + Assertions.assertEquals(1019109775, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("wslolbqp", model.description()); + Assertions.assertEquals("zlmvfelfktgp", model.displayName()); + Assertions.assertEquals("wjxeznoigbr", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("mw", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.NOT_AVAILABLE, model.status()); + Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); + Assertions.assertEquals(AttackTactic.PRE_ATTACK, model.tactics().get(0)); + Assertions.assertEquals("qkagfhsxt", model.techniques().get(0)); + Assertions.assertEquals("kqjjlwuenvrkp", model.subTechniques().get(0)); + Assertions.assertEquals("rebqaaysjk", model.sourceSettings().get(0).sourceName()); + Assertions.assertEquals("tnqttezlwfffiak", + model.sourceSettings().get(0).sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertTrue(model.sourceSettings().get(0).sourceSubTypes().get(0).severityFilter().isSupported()); + Assertions.assertEquals(AlertSeverity.HIGH, + model.sourceSettings().get(0).sourceSubTypes().get(0).severityFilter().severityFilters().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplateTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplateTests.java index 47e14a6b2e58..4ab7f36d6ca9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplateTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTemplateTests.java @@ -1,62 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.FusionAlertRuleTemplate; import com.azure.resourcemanager.securityinsights.models.TemplateStatus; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class FusionAlertRuleTemplateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FusionAlertRuleTemplate model = BinaryData.fromString( - "{\"kind\":\"Fusion\",\"properties\":{\"alertRulesCreatedByTemplateCount\":73539511,\"createdDateUTC\":\"2021-02-15T15:09:11Z\",\"lastUpdatedDateUTC\":\"2021-07-09T07:02:02Z\",\"description\":\"pshneekulfgslq\",\"displayName\":\"kwdlenrdsutujba\",\"requiredDataConnectors\":[{\"connectorId\":\"o\",\"dataTypes\":[\"nyfln\",\"rwm\",\"uvwpklvxwmyg\",\"xpgpq\"]},{\"connectorId\":\"isze\",\"dataTypes\":[\"bjcrxgibbdaxco\"]},{\"connectorId\":\"ozauorsukokwb\",\"dataTypes\":[\"hlvnuuepzlr\"]},{\"connectorId\":\"wzsoldweyuqdunv\",\"dataTypes\":[\"rwrbi\",\"rk\",\"alywjhhgdn\"]}],\"status\":\"NotAvailable\",\"severity\":\"Low\",\"tactics\":[\"PreAttack\",\"PreAttack\",\"Exfiltration\"],\"techniques\":[\"xggdufi\"]},\"id\":\"dieuzaofj\",\"name\":\"hvcyyysfg\",\"type\":\"otcubi\"}") + "{\"kind\":\"Fusion\",\"properties\":{\"alertRulesCreatedByTemplateCount\":1621102365,\"createdDateUTC\":\"2021-07-20T22:13:57Z\",\"lastUpdatedDateUTC\":\"2021-07-11T17:45Z\",\"description\":\"hbotzingamvppho\",\"displayName\":\"qzudphq\",\"requiredDataConnectors\":[{\"connectorId\":\"kfwynw\",\"dataTypes\":[\"bvkayh\",\"tnvyqiatkzwp\",\"npwzcjaes\",\"vvsccyajguq\"]},{\"connectorId\":\"wygzlvdnkfxusem\",\"dataTypes\":[\"rmuhapfcq\",\"psqxq\",\"psvuoymgc\",\"elvezrypq\"]},{\"connectorId\":\"feo\",\"dataTypes\":[\"qwkyhkobop\",\"xedk\"]},{\"connectorId\":\"epbqpcrfkbw\",\"dataTypes\":[\"njv\",\"dw\",\"lpqekf\",\"nkhtjsyingw\"]}],\"status\":\"Installed\",\"severity\":\"High\",\"tactics\":[\"InhibitResponseFunction\",\"Collection\",\"DefenseEvasion\"],\"techniques\":[\"ypgik\",\"gszywk\"],\"subTechniques\":[\"ryuzh\",\"hkjoqr\",\"qqaatjinrvgou\"],\"sourceSettings\":[{\"sourceName\":\"iibfggj\",\"sourceSubTypes\":[{\"sourceSubTypeName\":\"lvrwxkvtkk\",\"sourceSubTypeDisplayName\":\"lqwjygvjayvblm\",\"severityFilter\":{\"isSupported\":true}},{\"sourceSubTypeName\":\"k\",\"sourceSubTypeDisplayName\":\"hbxvvyhgsopbyrqu\",\"severityFilter\":{\"isSupported\":false}}]},{\"sourceName\":\"g\",\"sourceSubTypes\":[{\"sourceSubTypeName\":\"wz\",\"sourceSubTypeDisplayName\":\"nhlmctlpdng\",\"severityFilter\":{\"isSupported\":true}}]},{\"sourceName\":\"vgbmhr\",\"sourceSubTypes\":[{\"sourceSubTypeName\":\"wmyijejveg\",\"sourceSubTypeDisplayName\":\"bpnaixexccbdre\",\"severityFilter\":{\"isSupported\":true}}]},{\"sourceName\":\"hcexdrrvqa\",\"sourceSubTypes\":[{\"sourceSubTypeName\":\"ghtpw\",\"sourceSubTypeDisplayName\":\"nhyjsv\",\"severityFilter\":{\"isSupported\":true}},{\"sourceSubTypeName\":\"cxzbfvoowvr\",\"sourceSubTypeDisplayName\":\"t\",\"severityFilter\":{\"isSupported\":true}},{\"sourceSubTypeName\":\"qp\",\"sourceSubTypeDisplayName\":\"ostronz\",\"severityFilter\":{\"isSupported\":true}}]}]},\"id\":\"gfipnsxk\",\"name\":\"cwaekrrjre\",\"type\":\"fxtsgum\"}") .toObject(FusionAlertRuleTemplate.class); - Assertions.assertEquals(73539511, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("pshneekulfgslq", model.description()); - Assertions.assertEquals("kwdlenrdsutujba", model.displayName()); - Assertions.assertEquals("o", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("nyfln", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.NOT_AVAILABLE, model.status()); - Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(AttackTactic.PRE_ATTACK, model.tactics().get(0)); - Assertions.assertEquals("xggdufi", model.techniques().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FusionAlertRuleTemplate model = new FusionAlertRuleTemplate().withAlertRulesCreatedByTemplateCount(73539511) - .withDescription("pshneekulfgslq") - .withDisplayName("kwdlenrdsutujba") - .withRequiredDataConnectors(Arrays.asList( - new AlertRuleTemplateDataSource().withConnectorId("o") - .withDataTypes(Arrays.asList("nyfln", "rwm", "uvwpklvxwmyg", "xpgpq")), - new AlertRuleTemplateDataSource().withConnectorId("isze") - .withDataTypes(Arrays.asList("bjcrxgibbdaxco")), - new AlertRuleTemplateDataSource().withConnectorId("ozauorsukokwb") - .withDataTypes(Arrays.asList("hlvnuuepzlr")), - new AlertRuleTemplateDataSource().withConnectorId("wzsoldweyuqdunv") - .withDataTypes(Arrays.asList("rwrbi", "rk", "alywjhhgdn")))) - .withStatus(TemplateStatus.NOT_AVAILABLE) - .withSeverity(AlertSeverity.LOW) - .withTactics(Arrays.asList(AttackTactic.PRE_ATTACK, AttackTactic.PRE_ATTACK, AttackTactic.EXFILTRATION)) - .withTechniques(Arrays.asList("xggdufi")); - model = BinaryData.fromObject(model).toObject(FusionAlertRuleTemplate.class); - Assertions.assertEquals(73539511, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("pshneekulfgslq", model.description()); - Assertions.assertEquals("kwdlenrdsutujba", model.displayName()); - Assertions.assertEquals("o", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("nyfln", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.NOT_AVAILABLE, model.status()); - Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(AttackTactic.PRE_ATTACK, model.tactics().get(0)); - Assertions.assertEquals("xggdufi", model.techniques().get(0)); + Assertions.assertEquals(1621102365, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("hbotzingamvppho", model.description()); + Assertions.assertEquals("qzudphq", model.displayName()); + Assertions.assertEquals("kfwynw", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("bvkayh", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); + Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); + Assertions.assertEquals(AttackTactic.INHIBIT_RESPONSE_FUNCTION, model.tactics().get(0)); + Assertions.assertEquals("ypgik", model.techniques().get(0)); + Assertions.assertEquals("ryuzh", model.subTechniques().get(0)); + Assertions.assertEquals("iibfggj", model.sourceSettings().get(0).sourceName()); + Assertions.assertEquals("lvrwxkvtkk", + model.sourceSettings().get(0).sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertTrue(model.sourceSettings().get(0).sourceSubTypes().get(0).severityFilter().isSupported()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTests.java index 40e43a427efb..c21bf18fbb6a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionAlertRuleTests.java @@ -1,31 +1,108 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.FusionAlertRule; +import com.azure.resourcemanager.securityinsights.models.FusionScenarioExclusionPattern; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSettings; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class FusionAlertRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FusionAlertRule model = BinaryData.fromString( - "{\"kind\":\"Fusion\",\"properties\":{\"alertRuleTemplateName\":\"btx\",\"description\":\"gfwsrtaw\",\"displayName\":\"ezbrhubskh\",\"enabled\":false,\"lastModifiedUtc\":\"2021-09-21T02:12:50Z\",\"severity\":\"High\",\"tactics\":[\"CredentialAccess\",\"Exfiltration\",\"CredentialAccess\"],\"techniques\":[\"bvleorfmluiqtqzf\"]},\"etag\":\"yvnqqybaryeuay\",\"id\":\"qabqgzslesjcb\",\"name\":\"ernntiewdjcvbquw\",\"type\":\"behwagohb\"}") + "{\"kind\":\"Fusion\",\"properties\":{\"alertRuleTemplateName\":\"th\",\"description\":\"m\",\"displayName\":\"yvshxmz\",\"enabled\":false,\"sourceSettings\":[{\"enabled\":true,\"sourceName\":\"ggi\",\"sourceSubTypes\":[{\"enabled\":true,\"sourceSubTypeName\":\"burvjxxjnspy\",\"sourceSubTypeDisplayName\":\"tko\",\"severityFilters\":{}},{\"enabled\":false,\"sourceSubTypeName\":\"kouknvudwtiu\",\"sourceSubTypeDisplayName\":\"ldngkpoci\",\"severityFilters\":{}},{\"enabled\":true,\"sourceSubTypeName\":\"z\",\"sourceSubTypeDisplayName\":\"o\",\"severityFilters\":{}}]},{\"enabled\":true,\"sourceName\":\"ukgjnpiucgygevq\",\"sourceSubTypes\":[{\"enabled\":false,\"sourceSubTypeName\":\"pmr\",\"sourceSubTypeDisplayName\":\"izcdrqjsd\",\"severityFilters\":{}},{\"enabled\":true,\"sourceSubTypeName\":\"dnfyhxdeoejzicwi\",\"sourceSubTypeDisplayName\":\"jttgzf\",\"severityFilters\":{}},{\"enabled\":false,\"sourceSubTypeName\":\"shcbkhajdeyeamdp\",\"sourceSubTypeDisplayName\":\"g\",\"severityFilters\":{}},{\"enabled\":true,\"sourceSubTypeName\":\"pbuxwgipwhon\",\"sourceSubTypeDisplayName\":\"kgshwa\",\"severityFilters\":{}}]},{\"enabled\":false,\"sourceName\":\"ixzbinjeputtmryw\",\"sourceSubTypes\":[{\"enabled\":true,\"sourceSubTypeName\":\"qftiy\",\"sourceSubTypeDisplayName\":\"rnkcqvyxlw\",\"severityFilters\":{}},{\"enabled\":false,\"sourceSubTypeName\":\"lsicohoqqnwv\",\"sourceSubTypeDisplayName\":\"yav\",\"severityFilters\":{}},{\"enabled\":true,\"sourceSubTypeName\":\"heun\",\"sourceSubTypeDisplayName\":\"qhgyxzkonocukok\",\"severityFilters\":{}},{\"enabled\":true,\"sourceSubTypeName\":\"axuconuq\",\"sourceSubTypeDisplayName\":\"fkbey\",\"severityFilters\":{}}]},{\"enabled\":true,\"sourceName\":\"wrmjmwvvjektc\",\"sourceSubTypes\":[{\"enabled\":true,\"sourceSubTypeName\":\"hwlrsf\",\"sourceSubTypeDisplayName\":\"zpwv\",\"severityFilters\":{}},{\"enabled\":false,\"sourceSubTypeName\":\"dqgbiqylihkaetc\",\"sourceSubTypeDisplayName\":\"vfcivfsnkymuc\",\"severityFilters\":{}}]}],\"scenarioExclusionPatterns\":[{\"exclusionPattern\":\"jf\",\"dateAddedInUTC\":\"ebrjcxe\"},{\"exclusionPattern\":\"fuwutttxf\",\"dateAddedInUTC\":\"jrbirphxepcyv\"},{\"exclusionPattern\":\"hfnljkyq\",\"dateAddedInUTC\":\"j\"}],\"lastModifiedUtc\":\"2021-01-29T11:34:22Z\",\"severity\":\"Low\",\"tactics\":[\"PrivilegeEscalation\",\"InhibitResponseFunction\"],\"techniques\":[\"jljyoxgv\",\"ltbgsncghkj\",\"szzhbijhtxfvgxbf\"],\"subTechniques\":[\"nehmpvecx\",\"odebfqkkrbmpu\",\"gr\"]},\"etag\":\"flz\",\"id\":\"bxzpuzycisp\",\"name\":\"qzahmgkbrp\",\"type\":\"y\"}") .toObject(FusionAlertRule.class); - Assertions.assertEquals("yvnqqybaryeuay", model.etag()); - Assertions.assertEquals("btx", model.alertRuleTemplateName()); - Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals("flz", model.etag()); + Assertions.assertEquals("th", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.sourceSettings().get(0).enabled()); + Assertions.assertEquals("ggi", model.sourceSettings().get(0).sourceName()); + Assertions.assertTrue(model.sourceSettings().get(0).sourceSubTypes().get(0).enabled()); + Assertions.assertEquals("burvjxxjnspy", + model.sourceSettings().get(0).sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertEquals("jf", model.scenarioExclusionPatterns().get(0).exclusionPattern()); + Assertions.assertEquals("ebrjcxe", model.scenarioExclusionPatterns().get(0).dateAddedInUTC()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FusionAlertRule model - = new FusionAlertRule().withEtag("yvnqqybaryeuay").withAlertRuleTemplateName("btx").withEnabled(false); + FusionAlertRule model = new FusionAlertRule().withEtag("flz") + .withAlertRuleTemplateName("th") + .withEnabled(false) + .withSourceSettings(Arrays.asList( + new FusionSourceSettings().withEnabled(true) + .withSourceName("ggi") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("burvjxxjnspy") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("kouknvudwtiu") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("z") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))), + new FusionSourceSettings().withEnabled(true) + .withSourceName("ukgjnpiucgygevq") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("pmr") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("dnfyhxdeoejzicwi") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("shcbkhajdeyeamdp") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("pbuxwgipwhon") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))), + new FusionSourceSettings().withEnabled(false) + .withSourceName("ixzbinjeputtmryw") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("qftiy") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("lsicohoqqnwv") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("heun") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("axuconuq") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))), + new FusionSourceSettings().withEnabled(true) + .withSourceName("wrmjmwvvjektc") + .withSourceSubTypes(Arrays.asList( + new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("hwlrsf") + .withSeverityFilters(new FusionSubTypeSeverityFilter()), + new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("dqgbiqylihkaetc") + .withSeverityFilters(new FusionSubTypeSeverityFilter()))))) + .withScenarioExclusionPatterns(Arrays.asList( + new FusionScenarioExclusionPattern().withExclusionPattern("jf").withDateAddedInUTC("ebrjcxe"), + new FusionScenarioExclusionPattern().withExclusionPattern("fuwutttxf") + .withDateAddedInUTC("jrbirphxepcyv"), + new FusionScenarioExclusionPattern().withExclusionPattern("hfnljkyq").withDateAddedInUTC("j"))); model = BinaryData.fromObject(model).toObject(FusionAlertRule.class); - Assertions.assertEquals("yvnqqybaryeuay", model.etag()); - Assertions.assertEquals("btx", model.alertRuleTemplateName()); - Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals("flz", model.etag()); + Assertions.assertEquals("th", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.sourceSettings().get(0).enabled()); + Assertions.assertEquals("ggi", model.sourceSettings().get(0).sourceName()); + Assertions.assertTrue(model.sourceSettings().get(0).sourceSubTypes().get(0).enabled()); + Assertions.assertEquals("burvjxxjnspy", + model.sourceSettings().get(0).sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertEquals("jf", model.scenarioExclusionPatterns().get(0).exclusionPattern()); + Assertions.assertEquals("ebrjcxe", model.scenarioExclusionPatterns().get(0).dateAddedInUTC()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionScenarioExclusionPatternTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionScenarioExclusionPatternTests.java new file mode 100644 index 000000000000..03b44b0986d8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionScenarioExclusionPatternTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.FusionScenarioExclusionPattern; +import org.junit.jupiter.api.Assertions; + +public final class FusionScenarioExclusionPatternTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionScenarioExclusionPattern model + = BinaryData.fromString("{\"exclusionPattern\":\"nmic\",\"dateAddedInUTC\":\"kvceoveilovnotyf\"}") + .toObject(FusionScenarioExclusionPattern.class); + Assertions.assertEquals("nmic", model.exclusionPattern()); + Assertions.assertEquals("kvceoveilovnotyf", model.dateAddedInUTC()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FusionScenarioExclusionPattern model + = new FusionScenarioExclusionPattern().withExclusionPattern("nmic").withDateAddedInUTC("kvceoveilovnotyf"); + model = BinaryData.fromObject(model).toObject(FusionScenarioExclusionPattern.class); + Assertions.assertEquals("nmic", model.exclusionPattern()); + Assertions.assertEquals("kvceoveilovnotyf", model.dateAddedInUTC()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSettingsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSettingsTests.java new file mode 100644 index 000000000000..03809d0ff964 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSettingsTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSettings; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FusionSourceSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionSourceSettings model = BinaryData.fromString( + "{\"enabled\":true,\"sourceName\":\"ped\",\"sourceSubTypes\":[{\"enabled\":true,\"sourceSubTypeName\":\"a\",\"sourceSubTypeDisplayName\":\"khsmtxpsiebt\",\"severityFilters\":{\"isSupported\":true,\"filters\":[{\"severity\":\"Medium\",\"enabled\":false}]}}]}") + .toObject(FusionSourceSettings.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("ped", model.sourceName()); + Assertions.assertTrue(model.sourceSubTypes().get(0).enabled()); + Assertions.assertEquals("a", model.sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertEquals(AlertSeverity.MEDIUM, + model.sourceSubTypes().get(0).severityFilters().filters().get(0).severity()); + Assertions.assertFalse(model.sourceSubTypes().get(0).severityFilters().filters().get(0).enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FusionSourceSettings model = new FusionSourceSettings().withEnabled(true) + .withSourceName("ped") + .withSourceSubTypes(Arrays.asList(new FusionSourceSubTypeSetting().withEnabled(true) + .withSourceSubTypeName("a") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM).withEnabled(false)))))); + model = BinaryData.fromObject(model).toObject(FusionSourceSettings.class); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("ped", model.sourceName()); + Assertions.assertTrue(model.sourceSubTypes().get(0).enabled()); + Assertions.assertEquals("a", model.sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertEquals(AlertSeverity.MEDIUM, + model.sourceSubTypes().get(0).severityFilters().filters().get(0).severity()); + Assertions.assertFalse(model.sourceSubTypes().get(0).severityFilters().filters().get(0).enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSubTypeSettingTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSubTypeSettingTests.java new file mode 100644 index 000000000000..00c6592aa2dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSourceSubTypeSettingTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionSourceSubTypeSetting; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FusionSourceSubTypeSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionSourceSubTypeSetting model = BinaryData.fromString( + "{\"enabled\":false,\"sourceSubTypeName\":\"skrdqmhjj\",\"sourceSubTypeDisplayName\":\"tldwkyzxuutk\",\"severityFilters\":{\"isSupported\":false,\"filters\":[{\"severity\":\"Informational\",\"enabled\":true},{\"severity\":\"Informational\",\"enabled\":true},{\"severity\":\"Informational\",\"enabled\":true}]}}") + .toObject(FusionSourceSubTypeSetting.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("skrdqmhjj", model.sourceSubTypeName()); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severityFilters().filters().get(0).severity()); + Assertions.assertTrue(model.severityFilters().filters().get(0).enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FusionSourceSubTypeSetting model = new FusionSourceSubTypeSetting().withEnabled(false) + .withSourceSubTypeName("skrdqmhjj") + .withSeverityFilters(new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL).withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL).withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL).withEnabled(true)))); + model = BinaryData.fromObject(model).toObject(FusionSourceSubTypeSetting.class); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("skrdqmhjj", model.sourceSubTypeName()); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severityFilters().filters().get(0).severity()); + Assertions.assertTrue(model.severityFilters().filters().get(0).enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFilterTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFilterTests.java new file mode 100644 index 000000000000..9bed4d19c53b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFilterTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFilter; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FusionSubTypeSeverityFilterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionSubTypeSeverityFilter model = BinaryData.fromString( + "{\"isSupported\":true,\"filters\":[{\"severity\":\"Informational\",\"enabled\":true},{\"severity\":\"Medium\",\"enabled\":true},{\"severity\":\"High\",\"enabled\":false}]}") + .toObject(FusionSubTypeSeverityFilter.class); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.filters().get(0).severity()); + Assertions.assertTrue(model.filters().get(0).enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FusionSubTypeSeverityFilter model = new FusionSubTypeSeverityFilter().withFilters(Arrays.asList( + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL).withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.MEDIUM).withEnabled(true), + new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.HIGH).withEnabled(false))); + model = BinaryData.fromObject(model).toObject(FusionSubTypeSeverityFilter.class); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.filters().get(0).severity()); + Assertions.assertTrue(model.filters().get(0).enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFiltersItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFiltersItemTests.java new file mode 100644 index 000000000000..d58586d2c52b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionSubTypeSeverityFiltersItemTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionSubTypeSeverityFiltersItem; +import org.junit.jupiter.api.Assertions; + +public final class FusionSubTypeSeverityFiltersItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionSubTypeSeverityFiltersItem model + = BinaryData.fromString("{\"severity\":\"Informational\",\"enabled\":false}") + .toObject(FusionSubTypeSeverityFiltersItem.class); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FusionSubTypeSeverityFiltersItem model + = new FusionSubTypeSeverityFiltersItem().withSeverity(AlertSeverity.INFORMATIONAL).withEnabled(false); + model = BinaryData.fromObject(model).toObject(FusionSubTypeSeverityFiltersItem.class); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSettingTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSettingTests.java new file mode 100644 index 000000000000..e51ba9fc0dd1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSettingTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionTemplateSourceSetting; +import org.junit.jupiter.api.Assertions; + +public final class FusionTemplateSourceSettingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionTemplateSourceSetting model = BinaryData.fromString( + "{\"sourceName\":\"dscwxqupevzhf\",\"sourceSubTypes\":[{\"sourceSubTypeName\":\"txhojujb\",\"sourceSubTypeDisplayName\":\"elmcuvhixbjxyfw\",\"severityFilter\":{\"isSupported\":false,\"severityFilters\":[\"Informational\"]}},{\"sourceSubTypeName\":\"ool\",\"sourceSubTypeDisplayName\":\"tpkiwkkbnujry\",\"severityFilter\":{\"isSupported\":true,\"severityFilters\":[\"Low\"]}},{\"sourceSubTypeName\":\"bfpncurdo\",\"sourceSubTypeDisplayName\":\"iithtywu\",\"severityFilter\":{\"isSupported\":false,\"severityFilters\":[\"Informational\",\"High\",\"Medium\"]}}]}") + .toObject(FusionTemplateSourceSetting.class); + Assertions.assertEquals("dscwxqupevzhf", model.sourceName()); + Assertions.assertEquals("txhojujb", model.sourceSubTypes().get(0).sourceSubTypeName()); + Assertions.assertFalse(model.sourceSubTypes().get(0).severityFilter().isSupported()); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, + model.sourceSubTypes().get(0).severityFilter().severityFilters().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSubTypeTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSubTypeTests.java new file mode 100644 index 000000000000..28f43da8a9c6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSourceSubTypeTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionTemplateSourceSubType; +import org.junit.jupiter.api.Assertions; + +public final class FusionTemplateSourceSubTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionTemplateSourceSubType model = BinaryData.fromString( + "{\"sourceSubTypeName\":\"qknfd\",\"sourceSubTypeDisplayName\":\"wjchrdg\",\"severityFilter\":{\"isSupported\":true,\"severityFilters\":[\"Low\"]}}") + .toObject(FusionTemplateSourceSubType.class); + Assertions.assertEquals("qknfd", model.sourceSubTypeName()); + Assertions.assertTrue(model.severityFilter().isSupported()); + Assertions.assertEquals(AlertSeverity.LOW, model.severityFilter().severityFilters().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSubTypeSeverityFilterTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSubTypeSeverityFilterTests.java new file mode 100644 index 000000000000..6d396f839e08 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/FusionTemplateSubTypeSeverityFilterTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.FusionTemplateSubTypeSeverityFilter; +import org.junit.jupiter.api.Assertions; + +public final class FusionTemplateSubTypeSeverityFilterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FusionTemplateSubTypeSeverityFilter model + = BinaryData.fromString("{\"isSupported\":true,\"severityFilters\":[\"High\",\"High\"]}") + .toObject(FusionTemplateSubTypeSeverityFilter.class); + Assertions.assertTrue(model.isSupported()); + Assertions.assertEquals(AlertSeverity.HIGH, model.severityFilters().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthModelTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthModelTests.java new file mode 100644 index 000000000000..767aea081cc1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthModelTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GCPAuthModel; +import org.junit.jupiter.api.Assertions; + +public final class GCPAuthModelTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GCPAuthModel model = BinaryData.fromString( + "{\"type\":\"GCP\",\"serviceAccountEmail\":\"hks\",\"projectNumber\":\"auwazcgwd\",\"workloadIdentityProviderId\":\"riwgybjp\"}") + .toObject(GCPAuthModel.class); + Assertions.assertEquals("hks", model.serviceAccountEmail()); + Assertions.assertEquals("auwazcgwd", model.projectNumber()); + Assertions.assertEquals("riwgybjp", model.workloadIdentityProviderId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GCPAuthModel model = new GCPAuthModel().withServiceAccountEmail("hks") + .withProjectNumber("auwazcgwd") + .withWorkloadIdentityProviderId("riwgybjp"); + model = BinaryData.fromObject(model).toObject(GCPAuthModel.class); + Assertions.assertEquals("hks", model.serviceAccountEmail()); + Assertions.assertEquals("auwazcgwd", model.projectNumber()); + Assertions.assertEquals("riwgybjp", model.workloadIdentityProviderId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthPropertiesTests.java new file mode 100644 index 000000000000..b3c6fefea554 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPAuthPropertiesTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GCPAuthProperties; +import org.junit.jupiter.api.Assertions; + +public final class GCPAuthPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GCPAuthProperties model = BinaryData.fromString( + "{\"serviceAccountEmail\":\"yimyccgrvk\",\"projectNumber\":\"xzznnui\",\"workloadIdentityProviderId\":\"ersejeg\"}") + .toObject(GCPAuthProperties.class); + Assertions.assertEquals("yimyccgrvk", model.serviceAccountEmail()); + Assertions.assertEquals("xzznnui", model.projectNumber()); + Assertions.assertEquals("ersejeg", model.workloadIdentityProviderId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GCPAuthProperties model = new GCPAuthProperties().withServiceAccountEmail("yimyccgrvk") + .withProjectNumber("xzznnui") + .withWorkloadIdentityProviderId("ersejeg"); + model = BinaryData.fromObject(model).toObject(GCPAuthProperties.class); + Assertions.assertEquals("yimyccgrvk", model.serviceAccountEmail()); + Assertions.assertEquals("xzznnui", model.projectNumber()); + Assertions.assertEquals("ersejeg", model.workloadIdentityProviderId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..ca6d13934e56 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorPropertiesTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.GCPDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.GCPAuthProperties; +import com.azure.resourcemanager.securityinsights.models.GCPRequestProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GCPDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GCPDataConnectorProperties model = BinaryData.fromString( + "{\"connectorDefinitionName\":\"jwsuoardnag\",\"auth\":{\"serviceAccountEmail\":\"tpufpbpgnrholhu\",\"projectNumber\":\"bfwxiplkys\",\"workloadIdentityProviderId\":\"l\"},\"request\":{\"projectId\":\"yjprxslw\",\"subscriptionNames\":[\"mcvht\",\"bzjhfvhuwzb\",\"pcqzg\"]},\"dcrConfig\":{\"dataCollectionEndpoint\":\"otjecohmxvvl\",\"dataCollectionRuleImmutableId\":\"rskapbxwieexu\",\"streamName\":\"aderltfokyk\"}}") + .toObject(GCPDataConnectorProperties.class); + Assertions.assertEquals("jwsuoardnag", model.connectorDefinitionName()); + Assertions.assertEquals("tpufpbpgnrholhu", model.auth().serviceAccountEmail()); + Assertions.assertEquals("bfwxiplkys", model.auth().projectNumber()); + Assertions.assertEquals("l", model.auth().workloadIdentityProviderId()); + Assertions.assertEquals("yjprxslw", model.request().projectId()); + Assertions.assertEquals("mcvht", model.request().subscriptionNames().get(0)); + Assertions.assertEquals("otjecohmxvvl", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("rskapbxwieexu", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("aderltfokyk", model.dcrConfig().streamName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GCPDataConnectorProperties model = new GCPDataConnectorProperties().withConnectorDefinitionName("jwsuoardnag") + .withAuth(new GCPAuthProperties().withServiceAccountEmail("tpufpbpgnrholhu") + .withProjectNumber("bfwxiplkys") + .withWorkloadIdentityProviderId("l")) + .withRequest(new GCPRequestProperties().withProjectId("yjprxslw") + .withSubscriptionNames(Arrays.asList("mcvht", "bzjhfvhuwzb", "pcqzg"))) + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint("otjecohmxvvl") + .withDataCollectionRuleImmutableId("rskapbxwieexu") + .withStreamName("aderltfokyk")); + model = BinaryData.fromObject(model).toObject(GCPDataConnectorProperties.class); + Assertions.assertEquals("jwsuoardnag", model.connectorDefinitionName()); + Assertions.assertEquals("tpufpbpgnrholhu", model.auth().serviceAccountEmail()); + Assertions.assertEquals("bfwxiplkys", model.auth().projectNumber()); + Assertions.assertEquals("l", model.auth().workloadIdentityProviderId()); + Assertions.assertEquals("yjprxslw", model.request().projectId()); + Assertions.assertEquals("mcvht", model.request().subscriptionNames().get(0)); + Assertions.assertEquals("otjecohmxvvl", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("rskapbxwieexu", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("aderltfokyk", model.dcrConfig().streamName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorTests.java new file mode 100644 index 000000000000..1a5fc0266c07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPDataConnectorTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.GCPAuthProperties; +import com.azure.resourcemanager.securityinsights.models.GCPDataConnector; +import com.azure.resourcemanager.securityinsights.models.GCPRequestProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GCPDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GCPDataConnector model = BinaryData.fromString( + "{\"kind\":\"GCP\",\"properties\":{\"connectorDefinitionName\":\"o\",\"auth\":{\"serviceAccountEmail\":\"gj\",\"projectNumber\":\"mi\",\"workloadIdentityProviderId\":\"uydoccnx\"},\"request\":{\"projectId\":\"hanzbuiad\",\"subscriptionNames\":[\"atecaa\",\"sdohz\"]},\"dcrConfig\":{\"dataCollectionEndpoint\":\"ucbdaom\",\"dataCollectionRuleImmutableId\":\"wiinjdllw\",\"streamName\":\"tlepowavvqxua\"}},\"etag\":\"cqwulynkgfcfd\",\"id\":\"wsikxxtclhuulr\",\"name\":\"qbyokvjgbzsxebr\",\"type\":\"lttfyhc\"}") + .toObject(GCPDataConnector.class); + Assertions.assertEquals("cqwulynkgfcfd", model.etag()); + Assertions.assertEquals("o", model.connectorDefinitionName()); + Assertions.assertEquals("gj", model.auth().serviceAccountEmail()); + Assertions.assertEquals("mi", model.auth().projectNumber()); + Assertions.assertEquals("uydoccnx", model.auth().workloadIdentityProviderId()); + Assertions.assertEquals("hanzbuiad", model.request().projectId()); + Assertions.assertEquals("atecaa", model.request().subscriptionNames().get(0)); + Assertions.assertEquals("ucbdaom", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("wiinjdllw", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("tlepowavvqxua", model.dcrConfig().streamName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GCPDataConnector model = new GCPDataConnector().withEtag("cqwulynkgfcfd") + .withConnectorDefinitionName("o") + .withAuth(new GCPAuthProperties().withServiceAccountEmail("gj") + .withProjectNumber("mi") + .withWorkloadIdentityProviderId("uydoccnx")) + .withRequest(new GCPRequestProperties().withProjectId("hanzbuiad") + .withSubscriptionNames(Arrays.asList("atecaa", "sdohz"))) + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint("ucbdaom") + .withDataCollectionRuleImmutableId("wiinjdllw") + .withStreamName("tlepowavvqxua")); + model = BinaryData.fromObject(model).toObject(GCPDataConnector.class); + Assertions.assertEquals("cqwulynkgfcfd", model.etag()); + Assertions.assertEquals("o", model.connectorDefinitionName()); + Assertions.assertEquals("gj", model.auth().serviceAccountEmail()); + Assertions.assertEquals("mi", model.auth().projectNumber()); + Assertions.assertEquals("uydoccnx", model.auth().workloadIdentityProviderId()); + Assertions.assertEquals("hanzbuiad", model.request().projectId()); + Assertions.assertEquals("atecaa", model.request().subscriptionNames().get(0)); + Assertions.assertEquals("ucbdaom", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("wiinjdllw", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("tlepowavvqxua", model.dcrConfig().streamName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPRequestPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPRequestPropertiesTests.java new file mode 100644 index 000000000000..f33ef2e8c767 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GCPRequestPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GCPRequestProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GCPRequestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GCPRequestProperties model = BinaryData + .fromString("{\"projectId\":\"rkjguwrjmwvvbt\",\"subscriptionNames\":[\"kxxi\",\"wgxql\",\"ekotjgxi\"]}") + .toObject(GCPRequestProperties.class); + Assertions.assertEquals("rkjguwrjmwvvbt", model.projectId()); + Assertions.assertEquals("kxxi", model.subscriptionNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GCPRequestProperties model = new GCPRequestProperties().withProjectId("rkjguwrjmwvvbt") + .withSubscriptionNames(Arrays.asList("kxxi", "wgxql", "ekotjgxi")); + model = BinaryData.fromObject(model).toObject(GCPRequestProperties.class); + Assertions.assertEquals("rkjguwrjmwvvbt", model.projectId()); + Assertions.assertEquals("kxxi", model.subscriptionNames().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsErrorKindTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsErrorKindTests.java new file mode 100644 index 000000000000..ecd070e7c372 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsErrorKindTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GetInsightsError; +import com.azure.resourcemanager.securityinsights.models.GetInsightsErrorKind; +import org.junit.jupiter.api.Assertions; + +public final class GetInsightsErrorKindTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetInsightsErrorKind model + = BinaryData.fromString("{\"kind\":\"Insight\",\"queryId\":\"f\",\"errorMessage\":\"ekiooanduewfhv\"}") + .toObject(GetInsightsErrorKind.class); + Assertions.assertEquals(GetInsightsError.INSIGHT, model.kind()); + Assertions.assertEquals("f", model.queryId()); + Assertions.assertEquals("ekiooanduewfhv", model.errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsResultsMetadataTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsResultsMetadataTests.java new file mode 100644 index 000000000000..f247beac178d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetInsightsResultsMetadataTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GetInsightsError; +import com.azure.resourcemanager.securityinsights.models.GetInsightsResultsMetadata; +import org.junit.jupiter.api.Assertions; + +public final class GetInsightsResultsMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetInsightsResultsMetadata model = BinaryData.fromString( + "{\"totalCount\":1496958360,\"errors\":[{\"kind\":\"Insight\",\"queryId\":\"gayiawohfmhnn\",\"errorMessage\":\"mecjjkmqenhaidzr\"},{\"kind\":\"Insight\",\"queryId\":\"gloiovsl\",\"errorMessage\":\"ivqsuvwtenb\"},{\"kind\":\"Insight\",\"queryId\":\"jpk\",\"errorMessage\":\"cyoaqxukui\"}]}") + .toObject(GetInsightsResultsMetadata.class); + Assertions.assertEquals(1496958360, model.totalCount()); + Assertions.assertEquals(GetInsightsError.INSIGHT, model.errors().get(0).kind()); + Assertions.assertEquals("gayiawohfmhnn", model.errors().get(0).queryId()); + Assertions.assertEquals("mecjjkmqenhaidzr", model.errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetQueriesResponseTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetQueriesResponseTests.java new file mode 100644 index 000000000000..fc1cccf95f13 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetQueriesResponseTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.GetQueriesResponse; +import org.junit.jupiter.api.Assertions; + +public final class GetQueriesResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetQueriesResponse model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"EntityQueryItem\",\"id\":\"pjzobdwbcpr\",\"name\":\"wkuh\",\"type\":\"tnaczkfwfatga\"},{\"kind\":\"EntityQueryItem\",\"id\":\"hnskivdwgtqcume\",\"name\":\"aaqgoqbdiuycs\",\"type\":\"kowkrbhzhr\"},{\"kind\":\"EntityQueryItem\",\"id\":\"htmqowi\",\"name\":\"sfgqgucyhfaimqv\",\"type\":\"uozkgyf\"},{\"kind\":\"EntityQueryItem\",\"id\":\"oehgfmqmskkixvlz\",\"name\":\"plhpevasynt\",\"type\":\"jy\"}],\"nextLink\":\"lbqrvvbqvknmpecq\"}") + .toObject(GetQueriesResponse.class); + Assertions.assertEquals("wkuh", model.value().get(0).name()); + Assertions.assertEquals("tnaczkfwfatga", model.value().get(0).type()); + Assertions.assertEquals("lbqrvvbqvknmpecq", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java new file mode 100644 index 000000000000..b92f610977bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Recommendation; +import com.azure.resourcemanager.securityinsights.models.State; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GetRecommendationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"recommendationTypeId\":\"fjdiwzgwmumuc\",\"state\":\"Dismissed\",\"title\":\"q\",\"description\":\"hscvaqdxge\",\"creationTimeUtc\":\"2021-09-05T11:29:27Z\",\"lastEvaluatedTimeUtc\":\"2021-03-05T04:37:39Z\",\"lastModifiedTimeUtc\":\"2021-07-06T04:43:57Z\",\"suggestions\":[{\"suggestionTypeId\":\"tqkgavgoullxpayl\",\"title\":\"rast\",\"description\":\"kskkziebm\",\"action\":\"yodfmp\",\"additionalProperties\":{\"txbrdbwwqtxpfo\":\"x\",\"rlkdoukqscmdsjg\":\"rfvhbbnoevk\",\"lgu\":\"ws\"}},{\"suggestionTypeId\":\"peqlhhmbyfacexp\",\"title\":\"pqykicesqpvmoxil\",\"description\":\"pkqiqs\",\"action\":\"iubemxmuygmr\",\"additionalProperties\":{\"yngm\":\"bngcafmophtkyzsg\",\"g\":\"wvcnv\",\"roqxrvycjdni\":\"xqhysuapdns\"}}],\"resourceId\":\"ggyxmpmsacbamto\",\"additionalProperties\":{\"gz\":\"amoyxdigk\",\"fiottdawgkaohh\":\"ylqhqeosxdsxil\"}},\"etag\":\"tyhypi\",\"id\":\"jjjfcysk\",\"name\":\"nkkxoicb\",\"type\":\"smfvltbocqhv\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.getRecommendations().list("eratvpkg", "wrmujizdmh", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("tyhypi", response.iterator().next().etag()); + Assertions.assertEquals("fjdiwzgwmumuc", response.iterator().next().recommendationTypeId()); + Assertions.assertEquals(State.DISMISSED, response.iterator().next().state()); + Assertions.assertEquals("q", response.iterator().next().title()); + Assertions.assertEquals("hscvaqdxge", response.iterator().next().description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T11:29:27Z"), + response.iterator().next().creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T04:37:39Z"), + response.iterator().next().lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T04:43:57Z"), + response.iterator().next().lastModifiedTimeUtc()); + Assertions.assertEquals("tqkgavgoullxpayl", response.iterator().next().suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("rast", response.iterator().next().suggestions().get(0).title()); + Assertions.assertEquals("kskkziebm", response.iterator().next().suggestions().get(0).description()); + Assertions.assertEquals("yodfmp", response.iterator().next().suggestions().get(0).action()); + Assertions.assertEquals("x", + response.iterator().next().suggestions().get(0).additionalProperties().get("txbrdbwwqtxpfo")); + Assertions.assertEquals("ggyxmpmsacbamto", response.iterator().next().resourceId()); + Assertions.assertEquals("amoyxdigk", response.iterator().next().additionalProperties().get("gz")); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java new file mode 100644 index 000000000000..59b9e0a916e8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRun; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GetTriggeredAnalyticsRuleRunsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"executionTimeUtc\":\"2021-02-10T02:35:16Z\",\"ruleId\":\"vzqhv\",\"triggeredAnalyticsRuleRunId\":\"jdsnv\",\"provisioningState\":\"Canceled\",\"ruleRunAdditionalData\":{\"ozjrc\":\"\\\"dataani\\\"\"}},\"etag\":\"qugjalmzpfylq\",\"id\":\"wwvzn\",\"name\":\"dxcizropzgjle\",\"type\":\"cf\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.getTriggeredAnalyticsRuleRuns().list("moramsh", "vkuq", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("qugjalmzpfylq", response.iterator().next().etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T02:35:16Z"), + response.iterator().next().executionTimeUtc()); + Assertions.assertEquals("vzqhv", response.iterator().next().ruleId()); + Assertions.assertEquals("jdsnv", response.iterator().next().triggeredAnalyticsRuleRunId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java new file mode 100644 index 000000000000..b5bce29e9c8e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Recommendation; +import com.azure.resourcemanager.securityinsights.models.State; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GetsSingleRecommendationWithResponseMockTests { + @Test + public void testSingleRecommendationWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"recommendationTypeId\":\"wjrs\",\"state\":\"Dismissed\",\"title\":\"rykkhxawohs\",\"description\":\"e\",\"creationTimeUtc\":\"2021-04-14T11:58:22Z\",\"lastEvaluatedTimeUtc\":\"2021-05-10T22:32:39Z\",\"lastModifiedTimeUtc\":\"2021-06-25T05:05:03Z\",\"suggestions\":[{\"suggestionTypeId\":\"lweyzvrixcv\",\"title\":\"serltlhc\",\"description\":\"gjuopvkrmspksf\",\"action\":\"dmbxfy\",\"additionalProperties\":{\"xgoxsveiu\":\"iqvhfyv\",\"vygttd\":\"uxwnojvcrgqmbn\",\"ngguucp\":\"fjalpsycvcksz\",\"wffthbziieo\":\"tsxnu\"}}],\"resourceId\":\"bccccrauabdevj\",\"additionalProperties\":{\"bksvvyvoibvvuqwl\":\"cdxqgsteek\"}},\"etag\":\"zpyukrwvvhcgtc\",\"id\":\"qdcgobkcebzrtput\",\"name\":\"tjsk\",\"type\":\"kwtnqqiqckm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Recommendation response = manager.gets() + .singleRecommendationWithResponse("nootcyyupa", "d", "odhnzkmjoyby", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zpyukrwvvhcgtc", response.etag()); + Assertions.assertEquals("wjrs", response.recommendationTypeId()); + Assertions.assertEquals(State.DISMISSED, response.state()); + Assertions.assertEquals("rykkhxawohs", response.title()); + Assertions.assertEquals("e", response.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-14T11:58:22Z"), response.creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T22:32:39Z"), response.lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T05:05:03Z"), response.lastModifiedTimeUtc()); + Assertions.assertEquals("lweyzvrixcv", response.suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("serltlhc", response.suggestions().get(0).title()); + Assertions.assertEquals("gjuopvkrmspksf", response.suggestions().get(0).description()); + Assertions.assertEquals("dmbxfy", response.suggestions().get(0).action()); + Assertions.assertEquals("iqvhfyv", response.suggestions().get(0).additionalProperties().get("xgoxsveiu")); + Assertions.assertEquals("bccccrauabdevj", response.resourceId()); + Assertions.assertEquals("cdxqgsteek", response.additionalProperties().get("bksvvyvoibvvuqwl")); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubAuthModelTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubAuthModelTests.java new file mode 100644 index 000000000000..396b34f01f1f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubAuthModelTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GitHubAuthModel; +import org.junit.jupiter.api.Assertions; + +public final class GitHubAuthModelTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GitHubAuthModel model = BinaryData.fromString("{\"type\":\"GitHub\",\"installationId\":\"prwpxsoohu\"}") + .toObject(GitHubAuthModel.class); + Assertions.assertEquals("prwpxsoohu", model.installationId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GitHubAuthModel model = new GitHubAuthModel().withInstallationId("prwpxsoohu"); + model = BinaryData.fromObject(model).toObject(GitHubAuthModel.class); + Assertions.assertEquals("prwpxsoohu", model.installationId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubResourceInfoTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubResourceInfoTests.java new file mode 100644 index 000000000000..b069acbf6fb1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GitHubResourceInfoTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GitHubResourceInfo; +import org.junit.jupiter.api.Assertions; + +public final class GitHubResourceInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GitHubResourceInfo model + = BinaryData.fromString("{\"appInstallationId\":\"cv\"}").toObject(GitHubResourceInfo.class); + Assertions.assertEquals("cv", model.appInstallationId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueriesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueriesTests.java new file mode 100644 index 000000000000..324487340d5e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueriesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GraphQueries; +import org.junit.jupiter.api.Assertions; + +public final class GraphQueriesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphQueries model + = BinaryData.fromString("{\"metricName\":\"nbmxlx\",\"legend\":\"tygeqzus\",\"baseQuery\":\"oqcah\"}") + .toObject(GraphQueries.class); + Assertions.assertEquals("nbmxlx", model.metricName()); + Assertions.assertEquals("tygeqzus", model.legend()); + Assertions.assertEquals("oqcah", model.baseQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GraphQueries model = new GraphQueries().withMetricName("nbmxlx").withLegend("tygeqzus").withBaseQuery("oqcah"); + model = BinaryData.fromObject(model).toObject(GraphQueries.class); + Assertions.assertEquals("nbmxlx", model.metricName()); + Assertions.assertEquals("tygeqzus", model.legend()); + Assertions.assertEquals("oqcah", model.baseQuery()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueryTests.java new file mode 100644 index 000000000000..e590731cae9a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GraphQueryTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.GraphQuery; +import org.junit.jupiter.api.Assertions; + +public final class GraphQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GraphQuery model = BinaryData + .fromString("{\"metricName\":\"d\",\"legend\":\"boujstkfvv\",\"baseQuery\":\"shxcdedsuenygnxc\"}") + .toObject(GraphQuery.class); + Assertions.assertEquals("d", model.metricName()); + Assertions.assertEquals("boujstkfvv", model.legend()); + Assertions.assertEquals("shxcdedsuenygnxc", model.baseQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GraphQuery model + = new GraphQuery().withMetricName("d").withLegend("boujstkfvv").withBaseQuery("shxcdedsuenygnxc"); + model = BinaryData.fromObject(model).toObject(GraphQuery.class); + Assertions.assertEquals("d", model.metricName()); + Assertions.assertEquals("boujstkfvv", model.legend()); + Assertions.assertEquals("shxcdedsuenygnxc", model.baseQuery()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GroupingConfigurationTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GroupingConfigurationTests.java index 2f0651343ef9..0747945c2a9f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GroupingConfigurationTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GroupingConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -17,33 +17,33 @@ public final class GroupingConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { GroupingConfiguration model = BinaryData.fromString( - "{\"enabled\":true,\"reopenClosedIncident\":false,\"lookbackDuration\":\"PT10H40M44S\",\"matchingMethod\":\"AllEntities\",\"groupByEntities\":[\"MailCluster\",\"CloudApplication\"],\"groupByAlertDetails\":[\"Severity\"],\"groupByCustomDetails\":[\"f\"]}") + "{\"enabled\":true,\"reopenClosedIncident\":false,\"lookbackDuration\":\"PT121H20M37S\",\"matchingMethod\":\"AnyAlert\",\"groupByEntities\":[\"SecurityGroup\",\"Process\"],\"groupByAlertDetails\":[\"DisplayName\"],\"groupByCustomDetails\":[\"y\",\"hyrnxxmu\"]}") .toObject(GroupingConfiguration.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(false, model.reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT10H40M44S"), model.lookbackDuration()); - Assertions.assertEquals(MatchingMethod.ALL_ENTITIES, model.matchingMethod()); - Assertions.assertEquals(EntityMappingType.MAIL_CLUSTER, model.groupByEntities().get(0)); - Assertions.assertEquals(AlertDetail.SEVERITY, model.groupByAlertDetails().get(0)); - Assertions.assertEquals("f", model.groupByCustomDetails().get(0)); + Assertions.assertTrue(model.enabled()); + Assertions.assertFalse(model.reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT121H20M37S"), model.lookbackDuration()); + Assertions.assertEquals(MatchingMethod.ANY_ALERT, model.matchingMethod()); + Assertions.assertEquals(EntityMappingType.SECURITY_GROUP, model.groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.groupByAlertDetails().get(0)); + Assertions.assertEquals("y", model.groupByCustomDetails().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { GroupingConfiguration model = new GroupingConfiguration().withEnabled(true) .withReopenClosedIncident(false) - .withLookbackDuration(Duration.parse("PT10H40M44S")) - .withMatchingMethod(MatchingMethod.ALL_ENTITIES) - .withGroupByEntities(Arrays.asList(EntityMappingType.MAIL_CLUSTER, EntityMappingType.CLOUD_APPLICATION)) - .withGroupByAlertDetails(Arrays.asList(AlertDetail.SEVERITY)) - .withGroupByCustomDetails(Arrays.asList("f")); + .withLookbackDuration(Duration.parse("PT121H20M37S")) + .withMatchingMethod(MatchingMethod.ANY_ALERT) + .withGroupByEntities(Arrays.asList(EntityMappingType.SECURITY_GROUP, EntityMappingType.PROCESS)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails(Arrays.asList("y", "hyrnxxmu")); model = BinaryData.fromObject(model).toObject(GroupingConfiguration.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(false, model.reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT10H40M44S"), model.lookbackDuration()); - Assertions.assertEquals(MatchingMethod.ALL_ENTITIES, model.matchingMethod()); - Assertions.assertEquals(EntityMappingType.MAIL_CLUSTER, model.groupByEntities().get(0)); - Assertions.assertEquals(AlertDetail.SEVERITY, model.groupByAlertDetails().get(0)); - Assertions.assertEquals("f", model.groupByCustomDetails().get(0)); + Assertions.assertTrue(model.enabled()); + Assertions.assertFalse(model.reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT121H20M37S"), model.lookbackDuration()); + Assertions.assertEquals(MatchingMethod.ANY_ALERT, model.matchingMethod()); + Assertions.assertEquals(EntityMappingType.SECURITY_GROUP, model.groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.groupByAlertDetails().get(0)); + Assertions.assertEquals("y", model.groupByCustomDetails().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityPropertiesTests.java index 036363dcb872..ef20905941ff 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,15 +13,8 @@ public final class HostEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HostEntityProperties model = BinaryData.fromString( - "{\"azureID\":\"cugswvxwlmzqw\",\"dnsDomain\":\"tx\",\"hostName\":\"mxmcuqudtcvclxy\",\"isDomainJoined\":true,\"netBiosName\":\"vgfab\",\"ntDomain\":\"yjibuzphdugne\",\"omsAgentID\":\"n\",\"osFamily\":\"Unknown\",\"osVersion\":\"gjiuqhibto\",\"additionalData\":{\"edmurrxxge\":\"dataqw\",\"qylkmqpzoyhlf\":\"datapkt\"},\"friendlyName\":\"gwgcl\"}") + "{\"azureID\":\"lktgjc\",\"dnsDomain\":\"guxhem\",\"hostName\":\"ywaeeczgf\",\"isDomainJoined\":true,\"netBiosName\":\"lelssxblycsxzujk\",\"ntDomain\":\"lsmdesqplpvmjc\",\"omsAgentID\":\"ewbidyvteowxv\",\"osFamily\":\"Windows\",\"osVersion\":\"deugf\",\"additionalData\":{\"vuhx\":\"\\\"dataecpaxwkufyk\\\"\"},\"friendlyName\":\"mrutznabaobnsluj\"}") .toObject(HostEntityProperties.class); - Assertions.assertEquals(OSFamily.UNKNOWN, model.osFamily()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HostEntityProperties model = new HostEntityProperties().withOsFamily(OSFamily.UNKNOWN); - model = BinaryData.fromObject(model).toObject(HostEntityProperties.class); - Assertions.assertEquals(OSFamily.UNKNOWN, model.osFamily()); + Assertions.assertEquals(OSFamily.WINDOWS, model.osFamily()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityTests.java index 1ad82de931f9..7e9cf2c6c7e8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HostEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,15 +13,8 @@ public final class HostEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HostEntity model = BinaryData.fromString( - "{\"kind\":\"Host\",\"properties\":{\"azureID\":\"dibgqjxgpnrhgov\",\"dnsDomain\":\"pikqmh\",\"hostName\":\"owjrmzvuporqz\",\"isDomainJoined\":false,\"netBiosName\":\"dzvkfvxcnqmxq\",\"ntDomain\":\"wokmvkhlggd\",\"omsAgentID\":\"em\",\"osFamily\":\"IOS\",\"osVersion\":\"sz\",\"additionalData\":{\"ljfp\":\"datawtglxx\",\"pqcbfrmbodthsq\":\"datapicrmnzhrgmqgjsx\",\"fr\":\"datagvriibakclac\",\"vsg\":\"dataxousxauzl\"},\"friendlyName\":\"ohqfzizv\"},\"id\":\"mmkjsvthnwpztek\",\"name\":\"vmribiat\",\"type\":\"gplucfotangcfhny\"}") + "{\"kind\":\"Host\",\"properties\":{\"azureID\":\"tljqobbpih\",\"dnsDomain\":\"cecybmrqbrjbbmpx\",\"hostName\":\"vykfrexcrse\",\"isDomainJoined\":false,\"netBiosName\":\"s\",\"ntDomain\":\"udgzhxogjgg\",\"omsAgentID\":\"oujkxibdafh\",\"osFamily\":\"Windows\",\"osVersion\":\"yomkxfbvfbhdy\",\"additionalData\":{\"awzovgkk\":\"\\\"datapwpgddei\\\"\",\"sqowxwc\":\"\\\"datamuikjcjcaztbws\\\"\",\"czcswka\":\"\\\"datamlikytw\\\"\",\"yfdvlvhbwrnfxtgd\":\"\\\"datave\\\"\"},\"friendlyName\":\"qthe\"},\"id\":\"mnaoy\",\"name\":\"nkcoeqswankltyt\",\"type\":\"hdroznnh\"}") .toObject(HostEntity.class); - Assertions.assertEquals(OSFamily.IOS, model.osFamily()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HostEntity model = new HostEntity().withOsFamily(OSFamily.IOS); - model = BinaryData.fromObject(model).toObject(HostEntity.class); - Assertions.assertEquals(OSFamily.IOS, model.osFamily()); + Assertions.assertEquals(OSFamily.WINDOWS, model.osFamily()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentInnerTests.java new file mode 100644 index 000000000000..fe32998fe1cc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentInner; +import org.junit.jupiter.api.Assertions; + +public final class HuntCommentInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntCommentInner model = BinaryData.fromString( + "{\"properties\":{\"message\":\"qtcbjd\"},\"etag\":\"q\",\"id\":\"kxunsaujqgbb\",\"name\":\"vovoa\",\"type\":\"hgjsmbcsloy\"}") + .toObject(HuntCommentInner.class); + Assertions.assertEquals("q", model.etag()); + Assertions.assertEquals("qtcbjd", model.message()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HuntCommentInner model = new HuntCommentInner().withEtag("q").withMessage("qtcbjd"); + model = BinaryData.fromObject(model).toObject(HuntCommentInner.class); + Assertions.assertEquals("q", model.etag()); + Assertions.assertEquals("qtcbjd", model.message()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentListTests.java new file mode 100644 index 000000000000..eb0255bb9805 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.HuntCommentList; +import org.junit.jupiter.api.Assertions; + +public final class HuntCommentListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntCommentList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"message\":\"ronsdunr\"},\"etag\":\"vz\",\"id\":\"tqhgz\",\"name\":\"yxtrvfdbqsk\",\"type\":\"qjbvitptpvsffa\"}],\"nextLink\":\"hpiwrmu\"}") + .toObject(HuntCommentList.class); + Assertions.assertEquals("vz", model.value().get(0).etag()); + Assertions.assertEquals("ronsdunr", model.value().get(0).message()); + Assertions.assertEquals("hpiwrmu", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentPropertiesTests.java new file mode 100644 index 000000000000..f9e4cac15830 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntCommentProperties; +import org.junit.jupiter.api.Assertions; + +public final class HuntCommentPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntCommentProperties model + = BinaryData.fromString("{\"message\":\"sabdg\"}").toObject(HuntCommentProperties.class); + Assertions.assertEquals("sabdg", model.message()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HuntCommentProperties model = new HuntCommentProperties().withMessage("sabdg"); + model = BinaryData.fromObject(model).toObject(HuntCommentProperties.class); + Assertions.assertEquals("sabdg", model.message()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..68cc35d1fa5b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.HuntComment; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntCommentsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"message\":\"j\"},\"etag\":\"jh\",\"id\":\"iqfoqw\",\"name\":\"sqykqfserlsai\",\"type\":\"shh\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HuntComment response = manager.huntComments() + .define("vgchsgotgwerbpob") + .withExistingHunt("zvejqzyu", "kloke", "eowbpiie") + .withEtag("icgrxceivvm") + .withMessage("h") + .create(); + + Assertions.assertEquals("jh", response.etag()); + Assertions.assertEquals("j", response.message()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..62f0528bc37f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsDeleteWithResponseMockTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntCommentsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.huntComments() + .deleteWithResponse("lwckuvlz", "zjjtapvqjebtd", "sgkeexsozpkvy", "vtytwtfqpmpywwy", + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetWithResponseMockTests.java new file mode 100644 index 000000000000..060c46cac685 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.HuntComment; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntCommentsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"message\":\"xoyrgvrt\"},\"etag\":\"tmzglbplqhbrar\",\"id\":\"depsxufyqcqf\",\"name\":\"uhyeyxgxbgochpxp\",\"type\":\"wpwwsioozrugbdk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HuntComment response = manager.huntComments() + .getWithResponse("fcortoxsthjyyir", "buqmkmwdo", "nvyilho", "otdioxgs", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("tmzglbplqhbrar", response.etag()); + Assertions.assertEquals("xoyrgvrt", response.message()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListMockTests.java new file mode 100644 index 000000000000..b73a0da60ede --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntCommentsListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.HuntComment; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntCommentsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"message\":\"mojcmhycdxwvorzh\"},\"etag\":\"ocgfyltornvbhu\",\"id\":\"lwifbdwy\",\"name\":\"vcy\",\"type\":\"bbvkthre\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.huntComments() + .list("ukqmjcwdo", "cdqun", "uqco", "chdxjrrby", "bnkqps", 1037136965, "ouppzgdtuhd", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ocgfyltornvbhu", response.iterator().next().etag()); + Assertions.assertEquals("mojcmhycdxwvorzh", response.iterator().next().message()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntInnerTests.java new file mode 100644 index 000000000000..518929d29f23 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntInnerTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntInner; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class HuntInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntInner model = BinaryData.fromString( + "{\"properties\":{\"displayName\":\"gfgsq\",\"description\":\"ilefej\",\"status\":\"Backlog\",\"hypothesisStatus\":\"Validated\",\"attackTactics\":[\"CredentialAccess\",\"Impact\",\"PreAttack\"],\"attackTechniques\":[\"ttwknhajksbsyo\",\"j\"],\"labels\":[\"hgcydijnmcvj\",\"ssfcriqxzixtd\",\"xwmvcdkucpxpy\",\"frwrgorogeuvmkr\"],\"owner\":{\"email\":\"rsjsemlzofrsnq\",\"assignedTo\":\"jp\",\"objectId\":\"exutike\",\"userPrincipalName\":\"m\",\"ownerType\":\"User\"}},\"etag\":\"ub\",\"id\":\"dhvos\",\"name\":\"jzscuezalivdf\",\"type\":\"gq\"}") + .toObject(HuntInner.class); + Assertions.assertEquals("ub", model.etag()); + Assertions.assertEquals("gfgsq", model.displayName()); + Assertions.assertEquals("ilefej", model.description()); + Assertions.assertEquals(Status.BACKLOG, model.status()); + Assertions.assertEquals(HypothesisStatus.VALIDATED, model.hypothesisStatus()); + Assertions.assertEquals(AttackTactic.CREDENTIAL_ACCESS, model.attackTactics().get(0)); + Assertions.assertEquals("ttwknhajksbsyo", model.attackTechniques().get(0)); + Assertions.assertEquals("hgcydijnmcvj", model.labels().get(0)); + Assertions.assertEquals("rsjsemlzofrsnq", model.owner().email()); + Assertions.assertEquals("jp", model.owner().assignedTo()); + Assertions.assertEquals("exutike", model.owner().objectId()); + Assertions.assertEquals("m", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.owner().ownerType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HuntInner model = new HuntInner().withEtag("ub") + .withDisplayName("gfgsq") + .withDescription("ilefej") + .withStatus(Status.BACKLOG) + .withHypothesisStatus(HypothesisStatus.VALIDATED) + .withAttackTactics( + Arrays.asList(AttackTactic.CREDENTIAL_ACCESS, AttackTactic.IMPACT, AttackTactic.PRE_ATTACK)) + .withAttackTechniques(Arrays.asList("ttwknhajksbsyo", "j")) + .withLabels(Arrays.asList("hgcydijnmcvj", "ssfcriqxzixtd", "xwmvcdkucpxpy", "frwrgorogeuvmkr")) + .withOwner(new HuntOwner().withEmail("rsjsemlzofrsnq") + .withAssignedTo("jp") + .withObjectId("exutike") + .withUserPrincipalName("m") + .withOwnerType(OwnerType.USER)); + model = BinaryData.fromObject(model).toObject(HuntInner.class); + Assertions.assertEquals("ub", model.etag()); + Assertions.assertEquals("gfgsq", model.displayName()); + Assertions.assertEquals("ilefej", model.description()); + Assertions.assertEquals(Status.BACKLOG, model.status()); + Assertions.assertEquals(HypothesisStatus.VALIDATED, model.hypothesisStatus()); + Assertions.assertEquals(AttackTactic.CREDENTIAL_ACCESS, model.attackTactics().get(0)); + Assertions.assertEquals("ttwknhajksbsyo", model.attackTechniques().get(0)); + Assertions.assertEquals("hgcydijnmcvj", model.labels().get(0)); + Assertions.assertEquals("rsjsemlzofrsnq", model.owner().email()); + Assertions.assertEquals("jp", model.owner().assignedTo()); + Assertions.assertEquals("exutike", model.owner().objectId()); + Assertions.assertEquals("m", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.owner().ownerType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntListTests.java new file mode 100644 index 000000000000..c9a925580240 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntListTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.HuntList; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.Status; +import org.junit.jupiter.api.Assertions; + +public final class HuntListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"displayName\":\"kxmytzuaedr\",\"description\":\"hxg\",\"status\":\"Backlog\",\"hypothesisStatus\":\"Unknown\",\"attackTactics\":[\"InitialAccess\",\"DefenseEvasion\",\"Execution\"],\"attackTechniques\":[\"i\",\"mqyftgpqoswgf\",\"vjmghpakbqyhl\",\"ornfbm\"],\"labels\":[\"gkncjm\",\"bnyevztnjawrhule\",\"mqmbwpp\",\"irxbkitzmnhit\"],\"owner\":{\"email\":\"ucltjlxsgcemegdz\",\"assignedTo\":\"y\",\"objectId\":\"u\",\"userPrincipalName\":\"f\",\"ownerType\":\"Unknown\"}},\"etag\":\"f\",\"id\":\"ifnivlut\",\"name\":\"g\",\"type\":\"aacxauhvc\"},{\"properties\":{\"displayName\":\"xhklsqxt\",\"description\":\"iyygktsrjyxxoxwf\",\"status\":\"Backlog\",\"hypothesisStatus\":\"Validated\",\"attackTactics\":[\"CommandAndControl\"],\"attackTechniques\":[\"phsowbebsnbwutl\",\"uwmsu\"],\"labels\":[\"tihtgrafjajvkyxm\"],\"owner\":{\"email\":\"zvogtde\",\"assignedTo\":\"ennmkvaeuwqd\",\"objectId\":\"hhlbm\",\"userPrincipalName\":\"hfxnrpdhewokyqs\",\"ownerType\":\"Group\"}},\"etag\":\"sy\",\"id\":\"ihqbtod\",\"name\":\"fyxbvkvwzdmvd\",\"type\":\"qwcrugyo\"},{\"properties\":{\"displayName\":\"za\",\"description\":\"njdvv\",\"status\":\"Backlog\",\"hypothesisStatus\":\"Unknown\",\"attackTactics\":[\"LateralMovement\",\"Persistence\"],\"attackTechniques\":[\"ndqzbvbpsuv\",\"hxtozfgdk\",\"bkurklpiig\",\"uzkeutuip\"],\"labels\":[\"zjwaqdzqydewu\",\"xyll\",\"zzevtzqwczochwb\"],\"owner\":{\"email\":\"uynf\",\"assignedTo\":\"yvnhiysdhor\",\"objectId\":\"lhr\",\"userPrincipalName\":\"kiwlwkfflaqwmwq\",\"ownerType\":\"User\"}},\"etag\":\"lteatn\",\"id\":\"ef\",\"name\":\"jxnjtqbgy\",\"type\":\"ibt\"}],\"nextLink\":\"vxw\"}") + .toObject(HuntList.class); + Assertions.assertEquals("f", model.value().get(0).etag()); + Assertions.assertEquals("kxmytzuaedr", model.value().get(0).displayName()); + Assertions.assertEquals("hxg", model.value().get(0).description()); + Assertions.assertEquals(Status.BACKLOG, model.value().get(0).status()); + Assertions.assertEquals(HypothesisStatus.UNKNOWN, model.value().get(0).hypothesisStatus()); + Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.value().get(0).attackTactics().get(0)); + Assertions.assertEquals("i", model.value().get(0).attackTechniques().get(0)); + Assertions.assertEquals("gkncjm", model.value().get(0).labels().get(0)); + Assertions.assertEquals("ucltjlxsgcemegdz", model.value().get(0).owner().email()); + Assertions.assertEquals("y", model.value().get(0).owner().assignedTo()); + Assertions.assertEquals("u", model.value().get(0).owner().objectId()); + Assertions.assertEquals("f", model.value().get(0).owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.UNKNOWN, model.value().get(0).owner().ownerType()); + Assertions.assertEquals("vxw", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntOwnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntOwnerTests.java new file mode 100644 index 000000000000..be25f451a887 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntOwnerTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.OwnerType; +import org.junit.jupiter.api.Assertions; + +public final class HuntOwnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntOwner model = BinaryData.fromString( + "{\"email\":\"ojjfuktubcmunhgb\",\"assignedTo\":\"vxxvsbcuufkrfnkc\",\"objectId\":\"hkswxmfurqmw\",\"userPrincipalName\":\"wpntumotah\",\"ownerType\":\"User\"}") + .toObject(HuntOwner.class); + Assertions.assertEquals("ojjfuktubcmunhgb", model.email()); + Assertions.assertEquals("vxxvsbcuufkrfnkc", model.assignedTo()); + Assertions.assertEquals("hkswxmfurqmw", model.objectId()); + Assertions.assertEquals("wpntumotah", model.userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.ownerType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HuntOwner model = new HuntOwner().withEmail("ojjfuktubcmunhgb") + .withAssignedTo("vxxvsbcuufkrfnkc") + .withObjectId("hkswxmfurqmw") + .withUserPrincipalName("wpntumotah") + .withOwnerType(OwnerType.USER); + model = BinaryData.fromObject(model).toObject(HuntOwner.class); + Assertions.assertEquals("ojjfuktubcmunhgb", model.email()); + Assertions.assertEquals("vxxvsbcuufkrfnkc", model.assignedTo()); + Assertions.assertEquals("hkswxmfurqmw", model.objectId()); + Assertions.assertEquals("wpntumotah", model.userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.ownerType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntPropertiesTests.java new file mode 100644 index 000000000000..3e38ae02f6f0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntPropertiesTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntProperties; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class HuntPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntProperties model = BinaryData.fromString( + "{\"displayName\":\"hewcffrx\",\"description\":\"gezkhzpriqisse\",\"status\":\"Succeeded\",\"hypothesisStatus\":\"Validated\",\"attackTactics\":[\"InitialAccess\",\"CredentialAccess\",\"ImpairProcessControl\",\"PrivilegeEscalation\"],\"attackTechniques\":[\"sjnpckpluj\",\"duonbdawsa\"],\"labels\":[\"vvm\",\"bkxjar\",\"bbdddwokqx\"],\"owner\":{\"email\":\"xqkdyqjvzvcgrds\",\"assignedTo\":\"esfkqqxuhv\",\"objectId\":\"lbrouszxac\",\"userPrincipalName\":\"uk\",\"ownerType\":\"Group\"}}") + .toObject(HuntProperties.class); + Assertions.assertEquals("hewcffrx", model.displayName()); + Assertions.assertEquals("gezkhzpriqisse", model.description()); + Assertions.assertEquals(Status.SUCCEEDED, model.status()); + Assertions.assertEquals(HypothesisStatus.VALIDATED, model.hypothesisStatus()); + Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.attackTactics().get(0)); + Assertions.assertEquals("sjnpckpluj", model.attackTechniques().get(0)); + Assertions.assertEquals("vvm", model.labels().get(0)); + Assertions.assertEquals("xqkdyqjvzvcgrds", model.owner().email()); + Assertions.assertEquals("esfkqqxuhv", model.owner().assignedTo()); + Assertions.assertEquals("lbrouszxac", model.owner().objectId()); + Assertions.assertEquals("uk", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.GROUP, model.owner().ownerType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HuntProperties model = new HuntProperties().withDisplayName("hewcffrx") + .withDescription("gezkhzpriqisse") + .withStatus(Status.SUCCEEDED) + .withHypothesisStatus(HypothesisStatus.VALIDATED) + .withAttackTactics(Arrays.asList(AttackTactic.INITIAL_ACCESS, AttackTactic.CREDENTIAL_ACCESS, + AttackTactic.IMPAIR_PROCESS_CONTROL, AttackTactic.PRIVILEGE_ESCALATION)) + .withAttackTechniques(Arrays.asList("sjnpckpluj", "duonbdawsa")) + .withLabels(Arrays.asList("vvm", "bkxjar", "bbdddwokqx")) + .withOwner(new HuntOwner().withEmail("xqkdyqjvzvcgrds") + .withAssignedTo("esfkqqxuhv") + .withObjectId("lbrouszxac") + .withUserPrincipalName("uk") + .withOwnerType(OwnerType.GROUP)); + model = BinaryData.fromObject(model).toObject(HuntProperties.class); + Assertions.assertEquals("hewcffrx", model.displayName()); + Assertions.assertEquals("gezkhzpriqisse", model.description()); + Assertions.assertEquals(Status.SUCCEEDED, model.status()); + Assertions.assertEquals(HypothesisStatus.VALIDATED, model.hypothesisStatus()); + Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.attackTactics().get(0)); + Assertions.assertEquals("sjnpckpluj", model.attackTechniques().get(0)); + Assertions.assertEquals("vvm", model.labels().get(0)); + Assertions.assertEquals("xqkdyqjvzvcgrds", model.owner().email()); + Assertions.assertEquals("esfkqqxuhv", model.owner().assignedTo()); + Assertions.assertEquals("lbrouszxac", model.owner().objectId()); + Assertions.assertEquals("uk", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.GROUP, model.owner().ownerType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationInnerTests.java new file mode 100644 index 000000000000..c7f287ae18bd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationInnerTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationInner; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class HuntRelationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntRelationInner model = BinaryData.fromString( + "{\"properties\":{\"relatedResourceId\":\"gjw\",\"relatedResourceName\":\"fdwfbwxy\",\"relationType\":\"qtmg\",\"relatedResourceKind\":\"pdrmegajr\",\"labels\":[\"wymzskwqk\",\"g\"]},\"id\":\"eiphgliupqs\",\"name\":\"oobkjlca\",\"type\":\"sqcomjiqiincevx\"}") + .toObject(HuntRelationInner.class); + Assertions.assertEquals("gjw", model.relatedResourceId()); + Assertions.assertEquals("wymzskwqk", model.labels().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HuntRelationInner model + = new HuntRelationInner().withRelatedResourceId("gjw").withLabels(Arrays.asList("wymzskwqk", "g")); + model = BinaryData.fromObject(model).toObject(HuntRelationInner.class); + Assertions.assertEquals("gjw", model.relatedResourceId()); + Assertions.assertEquals("wymzskwqk", model.labels().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationListTests.java new file mode 100644 index 000000000000..986f04c0293c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.HuntRelationList; +import org.junit.jupiter.api.Assertions; + +public final class HuntRelationListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntRelationList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"relatedResourceId\":\"bmitaftazgcxsvq\",\"relatedResourceName\":\"quf\",\"relationType\":\"amxo\",\"relatedResourceKind\":\"gc\",\"labels\":[\"utehlka\",\"vtipquksxiknsg\",\"fu\",\"swhpcek\"]},\"id\":\"vmfnnbbxn\",\"name\":\"dfkkedeetxtpwcv\",\"type\":\"i\"},{\"properties\":{\"relatedResourceId\":\"sunjzijaciwmm\",\"relatedResourceName\":\"tqdonbzzs\",\"relationType\":\"zyviiwsu\",\"relatedResourceKind\":\"zhw\",\"labels\":[\"if\",\"zqqhbtfloilmkfb\",\"oiipjpn\"]},\"id\":\"yvuoikdlps\",\"name\":\"ntugfwi\",\"type\":\"qn\"},{\"properties\":{\"relatedResourceId\":\"clo\",\"relatedResourceName\":\"mvswxvjeleif\",\"relationType\":\"d\",\"relatedResourceKind\":\"wwulkrybpaevy\",\"labels\":[\"jec\",\"qkwakkchsfoulb\",\"rcxuibsdqbdyblp\",\"ctsmwpgweoqhbjq\"]},\"id\":\"fblerufol\",\"name\":\"c\",\"type\":\"hjucihbymjj\"},{\"properties\":{\"relatedResourceId\":\"pne\",\"relatedResourceName\":\"vjeazrah\",\"relationType\":\"hbimyiie\",\"relatedResourceKind\":\"mcthtpqgf\",\"labels\":[\"sizkdiuvflg\",\"hcw\"]},\"id\":\"wahcrxofgrutv\",\"name\":\"pccxziv\",\"type\":\"pmhz\"}],\"nextLink\":\"hhkvnnjdtujqz\"}") + .toObject(HuntRelationList.class); + Assertions.assertEquals("bmitaftazgcxsvq", model.value().get(0).relatedResourceId()); + Assertions.assertEquals("utehlka", model.value().get(0).labels().get(0)); + Assertions.assertEquals("hhkvnnjdtujqz", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationPropertiesTests.java new file mode 100644 index 000000000000..13b140f6ab1b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.HuntRelationProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class HuntRelationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HuntRelationProperties model = BinaryData.fromString( + "{\"relatedResourceId\":\"kdevpximzii\",\"relatedResourceName\":\"eqmduvtvodqxxpqh\",\"relationType\":\"qibtblmc\",\"relatedResourceKind\":\"j\",\"labels\":[\"otdofqv\",\"bq\",\"dqk\",\"sb\"]}") + .toObject(HuntRelationProperties.class); + Assertions.assertEquals("kdevpximzii", model.relatedResourceId()); + Assertions.assertEquals("otdofqv", model.labels().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HuntRelationProperties model = new HuntRelationProperties().withRelatedResourceId("kdevpximzii") + .withLabels(Arrays.asList("otdofqv", "bq", "dqk", "sb")); + model = BinaryData.fromObject(model).toObject(HuntRelationProperties.class); + Assertions.assertEquals("kdevpximzii", model.relatedResourceId()); + Assertions.assertEquals("otdofqv", model.labels().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..70bde219545b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.HuntRelation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntRelationsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"relatedResourceId\":\"lzxxkokipklfwnhf\",\"relatedResourceName\":\"qlrt\",\"relationType\":\"swq\",\"relatedResourceKind\":\"vljitbnhglrvlaro\",\"labels\":[\"mucr\",\"abgsdxtwqqukgo\",\"lvjgsk\",\"ksltunrwxsqvx\"]},\"id\":\"pccfwq\",\"name\":\"souqyzx\",\"type\":\"jehdklvqtm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HuntRelation response = manager.huntRelations() + .define("mldkci") + .withExistingHunt("pscw", "ltslfccyavy", "fmndrdqqjkeg") + .withRelatedResourceId("rz") + .withLabels(Arrays.asList("hvoiranxqnzssv", "ldtqykzmwdoqre")) + .create(); + + Assertions.assertEquals("lzxxkokipklfwnhf", response.relatedResourceId()); + Assertions.assertEquals("mucr", response.labels().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..66b8c1c3d459 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntRelationsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.huntRelations() + .deleteWithResponse("lfxejpo", "sgigs", "b", "xndyjwmglgstrzf", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..055255d3e52a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.HuntRelation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntRelationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"relatedResourceId\":\"wxsxbxdkmixurce\",\"relatedResourceName\":\"qmjqqau\",\"relationType\":\"gh\",\"relatedResourceKind\":\"bufkcnk\",\"labels\":[\"r\"]},\"id\":\"rshlheayod\",\"name\":\"vwnqbpxyofft\",\"type\":\"zovbhqels\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + HuntRelation response = manager.huntRelations() + .getWithResponse("tagwmzgvnojgm", "bkali", "oi", "kehpdssvlubdp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("wxsxbxdkmixurce", response.relatedResourceId()); + Assertions.assertEquals("r", response.labels().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListMockTests.java new file mode 100644 index 000000000000..190529ec6545 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntRelationsListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.HuntRelation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntRelationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"gizwywfhfptb\",\"relatedResourceName\":\"tvlpj\",\"relationType\":\"sl\",\"relatedResourceKind\":\"uzytxeaqig\",\"labels\":[\"tutet\",\"tgcidbrjwi\",\"ouepaqnfy\"]},\"id\":\"rcmcqppledxye\",\"name\":\"ttubtwelutrvdz\",\"type\":\"wp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.huntRelations() + .list("ehdzovkbcbefohny", "fhmljim", "gfvzvmtjcxig", "szxdbgl", "eet", 1234355189, "vm", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("gizwywfhfptb", response.iterator().next().relatedResourceId()); + Assertions.assertEquals("tutet", response.iterator().next().labels().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkPropertiesTests.java index 46643f03b04e..1ff3b1997d3f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkPropertiesTests.java @@ -1,72 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.HuntingBookmarkProperties; -import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; -import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class HuntingBookmarkPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HuntingBookmarkProperties model = BinaryData.fromString( - "{\"created\":\"2021-10-11T10:17:46Z\",\"createdBy\":{\"email\":\"tmnubexkpzksmon\",\"name\":\"mquxvypo\",\"objectId\":\"1a029c8d-3c73-415f-8868-734c270a6aaa\"},\"displayName\":\"kopkwhojvpajqgx\",\"eventTime\":\"2021-10-03T18:31:48Z\",\"labels\":[\"mbqfqvmk\",\"xozap\",\"helxprglya\"],\"notes\":\"dckcbc\",\"query\":\"ejrjxgciqibrho\",\"queryResult\":\"sdqrhzoymibmrq\",\"updated\":\"2021-07-29T17:32:56Z\",\"updatedBy\":{\"email\":\"wfluszdt\",\"name\":\"rkwofyyvoqa\",\"objectId\":\"895bc831-d67c-4667-917f-93047e66a631\"},\"incidentInfo\":{\"incidentId\":\"xpbtgiwbwo\",\"severity\":\"Medium\",\"title\":\"shrtdtkcnqxwb\",\"relationName\":\"kulpiujwaasi\"},\"additionalData\":{\"erpqlpqwcciuqg\":\"dataiobyu\"},\"friendlyName\":\"butauvfb\"}") + "{\"created\":\"2021-09-13T20:58:52Z\",\"createdBy\":{\"email\":\"eiookjbsah\",\"name\":\"dt\",\"objectId\":\"elqacslmot\"},\"displayName\":\"ebnfxofvc\",\"eventTime\":\"2021-06-12T15:09:08Z\",\"labels\":[\"razftxejwabmdujt\",\"vcopex\",\"m\",\"urbuhhlkyqltq\"],\"notes\":\"ogtu\",\"query\":\"kffdjktsys\",\"queryResult\":\"fvcl\",\"updated\":\"2021-04-19T23:13:15Z\",\"updatedBy\":{\"email\":\"uijtkbu\",\"name\":\"ogsf\",\"objectId\":\"ayiansharujtji\"},\"incidentInfo\":{\"incidentId\":\"zyjq\",\"severity\":\"Medium\",\"title\":\"kpqhjpenuygbq\",\"relationName\":\"qekewvnqvcd\"},\"additionalData\":{\"cmfdjwnlax\":\"\\\"dataa\\\"\",\"qikczvvita\":\"\\\"dataun\\\"\"},\"friendlyName\":\"xmfcsserxhtv\"}") .toObject(HuntingBookmarkProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:17:46Z"), model.created()); - Assertions.assertEquals(UUID.fromString("1a029c8d-3c73-415f-8868-734c270a6aaa"), model.createdBy().objectId()); - Assertions.assertEquals("kopkwhojvpajqgx", model.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T18:31:48Z"), model.eventTime()); - Assertions.assertEquals("mbqfqvmk", model.labels().get(0)); - Assertions.assertEquals("dckcbc", model.notes()); - Assertions.assertEquals("ejrjxgciqibrho", model.query()); - Assertions.assertEquals("sdqrhzoymibmrq", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T17:32:56Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("895bc831-d67c-4667-917f-93047e66a631"), model.updatedBy().objectId()); - Assertions.assertEquals("xpbtgiwbwo", model.incidentInfo().incidentId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T20:58:52Z"), model.created()); + Assertions.assertEquals("elqacslmot", model.createdBy().objectId()); + Assertions.assertEquals("ebnfxofvc", model.displayName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T15:09:08Z"), model.eventTime()); + Assertions.assertEquals("razftxejwabmdujt", model.labels().get(0)); + Assertions.assertEquals("ogtu", model.notes()); + Assertions.assertEquals("kffdjktsys", model.query()); + Assertions.assertEquals("fvcl", model.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-19T23:13:15Z"), model.updated()); + Assertions.assertEquals("ayiansharujtji", model.updatedBy().objectId()); + Assertions.assertEquals("zyjq", model.incidentInfo().incidentId()); Assertions.assertEquals(IncidentSeverity.MEDIUM, model.incidentInfo().severity()); - Assertions.assertEquals("shrtdtkcnqxwb", model.incidentInfo().title()); - Assertions.assertEquals("kulpiujwaasi", model.incidentInfo().relationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HuntingBookmarkProperties model - = new HuntingBookmarkProperties().withCreated(OffsetDateTime.parse("2021-10-11T10:17:46Z")) - .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("1a029c8d-3c73-415f-8868-734c270a6aaa"))) - .withDisplayName("kopkwhojvpajqgx") - .withEventTime(OffsetDateTime.parse("2021-10-03T18:31:48Z")) - .withLabels(Arrays.asList("mbqfqvmk", "xozap", "helxprglya")) - .withNotes("dckcbc") - .withQuery("ejrjxgciqibrho") - .withQueryResult("sdqrhzoymibmrq") - .withUpdated(OffsetDateTime.parse("2021-07-29T17:32:56Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("895bc831-d67c-4667-917f-93047e66a631"))) - .withIncidentInfo(new IncidentInfo().withIncidentId("xpbtgiwbwo") - .withSeverity(IncidentSeverity.MEDIUM) - .withTitle("shrtdtkcnqxwb") - .withRelationName("kulpiujwaasi")); - model = BinaryData.fromObject(model).toObject(HuntingBookmarkProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T10:17:46Z"), model.created()); - Assertions.assertEquals(UUID.fromString("1a029c8d-3c73-415f-8868-734c270a6aaa"), model.createdBy().objectId()); - Assertions.assertEquals("kopkwhojvpajqgx", model.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T18:31:48Z"), model.eventTime()); - Assertions.assertEquals("mbqfqvmk", model.labels().get(0)); - Assertions.assertEquals("dckcbc", model.notes()); - Assertions.assertEquals("ejrjxgciqibrho", model.query()); - Assertions.assertEquals("sdqrhzoymibmrq", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-29T17:32:56Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("895bc831-d67c-4667-917f-93047e66a631"), model.updatedBy().objectId()); - Assertions.assertEquals("xpbtgiwbwo", model.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.MEDIUM, model.incidentInfo().severity()); - Assertions.assertEquals("shrtdtkcnqxwb", model.incidentInfo().title()); - Assertions.assertEquals("kulpiujwaasi", model.incidentInfo().relationName()); + Assertions.assertEquals("kpqhjpenuygbq", model.incidentInfo().title()); + Assertions.assertEquals("qekewvnqvcd", model.incidentInfo().relationName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkTests.java index 8f324af18802..ba92dcc5aef2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntingBookmarkTests.java @@ -1,71 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.HuntingBookmark; -import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; -import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class HuntingBookmarkTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { HuntingBookmark model = BinaryData.fromString( - "{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-07-24T11:16:02Z\",\"createdBy\":{\"email\":\"bttdumorppxe\",\"name\":\"nzbtbhj\",\"objectId\":\"4bf124bc-99cc-4faa-85c8-ac8955183b5b\"},\"displayName\":\"lkfg\",\"eventTime\":\"2021-10-17T15:49:25Z\",\"labels\":[\"uel\"],\"notes\":\"hsd\",\"query\":\"htozfikdow\",\"queryResult\":\"uuvxz\",\"updated\":\"2021-05-22T14:25:48Z\",\"updatedBy\":{\"email\":\"thhqzonosggbh\",\"name\":\"hfwdsjnkaljutiis\",\"objectId\":\"c71c5eae-5991-47f9-b132-4c85e149f460\"},\"incidentInfo\":{\"incidentId\":\"fgdkzzew\",\"severity\":\"Medium\",\"title\":\"qcrailvpnppfufl\",\"relationName\":\"dmhdlxyjr\"},\"additionalData\":{\"bcvkcvqvpkeq\":\"datagafcnihgwqapnedg\",\"obzdopcjwvnhdl\":\"datacvdrhvoodsot\",\"mutwuoe\":\"datawmgxcxrsl\",\"yqsluic\":\"datarpkhjwn\"},\"friendlyName\":\"ggkzzlvmbmpa\"},\"id\":\"odfvuefywsbp\",\"name\":\"vmwy\",\"type\":\"rfouyftaakcpw\"}") + "{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-11-07T05:08:05Z\",\"createdBy\":{\"email\":\"nw\",\"name\":\"gajinnixjawrtmj\",\"objectId\":\"myccx\"},\"displayName\":\"zhcoxovnekhe\",\"eventTime\":\"2021-08-21T17:07:35Z\",\"labels\":[\"nrd\",\"jxtxrdc\",\"tjvidt\"],\"notes\":\"epu\",\"query\":\"lvyjtcvuwkas\",\"queryResult\":\"iesfuug\",\"updated\":\"2021-02-13T07:16:35Z\",\"updatedBy\":{\"email\":\"ecjxe\",\"name\":\"tuhxuicb\",\"objectId\":\"wmrswnjlxuzrh\"},\"incidentInfo\":{\"incidentId\":\"sxjb\",\"severity\":\"Informational\",\"title\":\"gpdohzj\",\"relationName\":\"tu\"},\"additionalData\":{\"cnwfepbnwgfmxjg\":\"\\\"datagebx\\\"\",\"jbgdlfgtdysnaquf\":\"\\\"datag\\\"\",\"zjrwdkqze\":\"\\\"dataqbctqha\\\"\",\"fza\":\"\\\"datayjleziunjx\\\"\"},\"friendlyName\":\"kwcegyamlbn\"},\"id\":\"qa\",\"name\":\"jjvpilguooqja\",\"type\":\"m\"}") .toObject(HuntingBookmark.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-24T11:16:02Z"), model.created()); - Assertions.assertEquals(UUID.fromString("4bf124bc-99cc-4faa-85c8-ac8955183b5b"), model.createdBy().objectId()); - Assertions.assertEquals("lkfg", model.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T15:49:25Z"), model.eventTime()); - Assertions.assertEquals("uel", model.labels().get(0)); - Assertions.assertEquals("hsd", model.notes()); - Assertions.assertEquals("htozfikdow", model.query()); - Assertions.assertEquals("uuvxz", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T14:25:48Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("c71c5eae-5991-47f9-b132-4c85e149f460"), model.updatedBy().objectId()); - Assertions.assertEquals("fgdkzzew", model.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.MEDIUM, model.incidentInfo().severity()); - Assertions.assertEquals("qcrailvpnppfufl", model.incidentInfo().title()); - Assertions.assertEquals("dmhdlxyjr", model.incidentInfo().relationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HuntingBookmark model = new HuntingBookmark().withCreated(OffsetDateTime.parse("2021-07-24T11:16:02Z")) - .withCreatedBy(new UserInfo().withObjectId(UUID.fromString("4bf124bc-99cc-4faa-85c8-ac8955183b5b"))) - .withDisplayName("lkfg") - .withEventTime(OffsetDateTime.parse("2021-10-17T15:49:25Z")) - .withLabels(Arrays.asList("uel")) - .withNotes("hsd") - .withQuery("htozfikdow") - .withQueryResult("uuvxz") - .withUpdated(OffsetDateTime.parse("2021-05-22T14:25:48Z")) - .withUpdatedBy(new UserInfo().withObjectId(UUID.fromString("c71c5eae-5991-47f9-b132-4c85e149f460"))) - .withIncidentInfo(new IncidentInfo().withIncidentId("fgdkzzew") - .withSeverity(IncidentSeverity.MEDIUM) - .withTitle("qcrailvpnppfufl") - .withRelationName("dmhdlxyjr")); - model = BinaryData.fromObject(model).toObject(HuntingBookmark.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-24T11:16:02Z"), model.created()); - Assertions.assertEquals(UUID.fromString("4bf124bc-99cc-4faa-85c8-ac8955183b5b"), model.createdBy().objectId()); - Assertions.assertEquals("lkfg", model.displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-17T15:49:25Z"), model.eventTime()); - Assertions.assertEquals("uel", model.labels().get(0)); - Assertions.assertEquals("hsd", model.notes()); - Assertions.assertEquals("htozfikdow", model.query()); - Assertions.assertEquals("uuvxz", model.queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T14:25:48Z"), model.updated()); - Assertions.assertEquals(UUID.fromString("c71c5eae-5991-47f9-b132-4c85e149f460"), model.updatedBy().objectId()); - Assertions.assertEquals("fgdkzzew", model.incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.MEDIUM, model.incidentInfo().severity()); - Assertions.assertEquals("qcrailvpnppfufl", model.incidentInfo().title()); - Assertions.assertEquals("dmhdlxyjr", model.incidentInfo().relationName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-07T05:08:05Z"), model.created()); + Assertions.assertEquals("myccx", model.createdBy().objectId()); + Assertions.assertEquals("zhcoxovnekhe", model.displayName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T17:07:35Z"), model.eventTime()); + Assertions.assertEquals("nrd", model.labels().get(0)); + Assertions.assertEquals("epu", model.notes()); + Assertions.assertEquals("lvyjtcvuwkas", model.query()); + Assertions.assertEquals("iesfuug", model.queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T07:16:35Z"), model.updated()); + Assertions.assertEquals("wmrswnjlxuzrh", model.updatedBy().objectId()); + Assertions.assertEquals("sxjb", model.incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.incidentInfo().severity()); + Assertions.assertEquals("gpdohzj", model.incidentInfo().title()); + Assertions.assertEquals("tu", model.incidentInfo().relationName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..354a4ed01789 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.Hunt; +import com.azure.resourcemanager.securityinsights.models.HuntOwner; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"displayName\":\"rnxrjmilogcn\",\"description\":\"fgqibb\",\"status\":\"New\",\"hypothesisStatus\":\"Invalidated\",\"attackTactics\":[\"DefenseEvasion\",\"ImpairProcessControl\"],\"attackTechniques\":[\"wyrsfj\",\"soyusrbuydeyhknt\",\"kdrblehenjstiwd\"],\"labels\":[\"bijikjf\",\"ib\"],\"owner\":{\"email\":\"bpojujpifxtg\",\"assignedTo\":\"avfjx\",\"objectId\":\"wx\",\"userPrincipalName\":\"auh\",\"ownerType\":\"User\"}},\"etag\":\"phovuvrs\",\"id\":\"wcxl\",\"name\":\"cohywfvyriawfww\",\"type\":\"gdkbdozsspfw\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Hunt response = manager.hunts() + .define("wmsnplqfivxfq") + .withExistingWorkspace("pifvpsmv", "sa") + .withEtag("hg") + .withDisplayName("jzgovmkplr") + .withDescription("kmpaxoeylpofaog") + .withStatus(Status.SUCCEEDED) + .withHypothesisStatus(HypothesisStatus.INVALIDATED) + .withAttackTactics( + Arrays.asList(AttackTactic.EXECUTION, AttackTactic.COLLECTION, AttackTactic.INITIAL_ACCESS)) + .withAttackTechniques(Arrays.asList("fskmkdr", "kdpn", "ldwcxjvexlutxcmc", "cotqocn")) + .withLabels(Arrays.asList("pvhduld")) + .withOwner(new HuntOwner().withEmail("bzzbrufk") + .withAssignedTo("lkpvaagrdf") + .withObjectId("glqdsphvosucryh") + .withUserPrincipalName("hthzfotfrfhrjkah") + .withOwnerType(OwnerType.GROUP)) + .create(); + + Assertions.assertEquals("phovuvrs", response.etag()); + Assertions.assertEquals("rnxrjmilogcn", response.displayName()); + Assertions.assertEquals("fgqibb", response.description()); + Assertions.assertEquals(Status.NEW, response.status()); + Assertions.assertEquals(HypothesisStatus.INVALIDATED, response.hypothesisStatus()); + Assertions.assertEquals(AttackTactic.DEFENSE_EVASION, response.attackTactics().get(0)); + Assertions.assertEquals("wyrsfj", response.attackTechniques().get(0)); + Assertions.assertEquals("bijikjf", response.labels().get(0)); + Assertions.assertEquals("bpojujpifxtg", response.owner().email()); + Assertions.assertEquals("avfjx", response.owner().assignedTo()); + Assertions.assertEquals("wx", response.owner().objectId()); + Assertions.assertEquals("auh", response.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, response.owner().ownerType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..69b52310996a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsDeleteWithResponseMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.hunts().deleteWithResponse("golfensibqi", "bpyjzvye", "lfs", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetWithResponseMockTests.java new file mode 100644 index 000000000000..707646ea2c7e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsGetWithResponseMockTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.Hunt; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"displayName\":\"usvidkz\",\"description\":\"dbvlsn\",\"status\":\"Backlog\",\"hypothesisStatus\":\"Unknown\",\"attackTactics\":[\"Persistence\",\"ResourceDevelopment\",\"CredentialAccess\"],\"attackTechniques\":[\"iktecs\",\"ocq\",\"eydaakett\"],\"labels\":[\"xviw\",\"sqjxxbsafqiw\",\"duotsyjzda\"],\"owner\":{\"email\":\"fzprhqomuzohnpk\",\"assignedTo\":\"klbddlnzmff\",\"objectId\":\"owlammvazvwzi\",\"userPrincipalName\":\"ijunmgdpxeivr\",\"ownerType\":\"Unknown\"}},\"etag\":\"nkgztfgcuz\",\"id\":\"rehdtqggzahngn\",\"name\":\"seiidfpwbybmxf\",\"type\":\"z\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Hunt response = manager.hunts() + .getWithResponse("zwmtsm", "aciypkh", "rgmgn", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("nkgztfgcuz", response.etag()); + Assertions.assertEquals("usvidkz", response.displayName()); + Assertions.assertEquals("dbvlsn", response.description()); + Assertions.assertEquals(Status.BACKLOG, response.status()); + Assertions.assertEquals(HypothesisStatus.UNKNOWN, response.hypothesisStatus()); + Assertions.assertEquals(AttackTactic.PERSISTENCE, response.attackTactics().get(0)); + Assertions.assertEquals("iktecs", response.attackTechniques().get(0)); + Assertions.assertEquals("xviw", response.labels().get(0)); + Assertions.assertEquals("fzprhqomuzohnpk", response.owner().email()); + Assertions.assertEquals("klbddlnzmff", response.owner().assignedTo()); + Assertions.assertEquals("owlammvazvwzi", response.owner().objectId()); + Assertions.assertEquals("ijunmgdpxeivr", response.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.UNKNOWN, response.owner().ownerType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsListMockTests.java new file mode 100644 index 000000000000..1bc54bb52d07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/HuntsListMockTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.Hunt; +import com.azure.resourcemanager.securityinsights.models.HypothesisStatus; +import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.Status; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class HuntsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"displayName\":\"xiikrjamzt\",\"description\":\"nmrgvty\",\"status\":\"Succeeded\",\"hypothesisStatus\":\"Invalidated\",\"attackTactics\":[\"Persistence\",\"Impact\",\"CommandAndControl\"],\"attackTechniques\":[\"hk\",\"gouzvegtnphnotrg\",\"yje\",\"govjdunbaetsdufe\"],\"labels\":[\"vkuz\",\"gzrzubdtzsac\",\"mhzpurnp\",\"kbxkzcfios\"],\"owner\":{\"email\":\"b\",\"assignedTo\":\"d\",\"objectId\":\"luvcwu\",\"userPrincipalName\":\"bhxoaqfpqfpkrmlb\",\"ownerType\":\"Group\"}},\"etag\":\"gzawfoqdnxu\",\"id\":\"fvnvscyutqwsynt\",\"name\":\"wrluqaqnlygfvbf\",\"type\":\"jbozkl\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.hunts() + .list("vz", "zvv", "rougalywgqrevb", "bheyxewcsk", 1545097931, "kwbprkf", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("gzawfoqdnxu", response.iterator().next().etag()); + Assertions.assertEquals("xiikrjamzt", response.iterator().next().displayName()); + Assertions.assertEquals("nmrgvty", response.iterator().next().description()); + Assertions.assertEquals(Status.SUCCEEDED, response.iterator().next().status()); + Assertions.assertEquals(HypothesisStatus.INVALIDATED, response.iterator().next().hypothesisStatus()); + Assertions.assertEquals(AttackTactic.PERSISTENCE, response.iterator().next().attackTactics().get(0)); + Assertions.assertEquals("hk", response.iterator().next().attackTechniques().get(0)); + Assertions.assertEquals("vkuz", response.iterator().next().labels().get(0)); + Assertions.assertEquals("b", response.iterator().next().owner().email()); + Assertions.assertEquals("d", response.iterator().next().owner().assignedTo()); + Assertions.assertEquals("luvcwu", response.iterator().next().owner().objectId()); + Assertions.assertEquals("bhxoaqfpqfpkrmlb", response.iterator().next().owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.GROUP, response.iterator().next().owner().ownerType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IdentityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IdentityTests.java new file mode 100644 index 000000000000..b6475e45996e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IdentityTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Identity; + +public final class IdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Identity model = BinaryData.fromString( + "{\"kind\":\"Identity\",\"properties\":{\"data\":{\"sevqjdxi\":\"\\\"datamydogrtfwzecgbxr\\\"\"},\"createdBy\":{\"email\":\"qbvanv\",\"name\":\"xnaaiitnkruyw\",\"objectId\":\"nksmaebdrxj\"},\"source\":\"rsea\",\"firstIngestedTimeUtc\":\"2021-06-02T14:59:31Z\",\"lastIngestedTimeUtc\":\"2021-05-16T06:58:24Z\",\"ingestionRulesVersion\":\"grqwfux\",\"lastUpdateMethod\":\"ue\",\"lastModifiedBy\":{\"email\":\"leketk\",\"name\":\"ptqhatfg\",\"objectId\":\"hbxgfhgkdms\"},\"lastUpdatedDateTimeUtc\":\"2021-07-20T04:19:17Z\",\"relationshipHints\":[{\"fieldName\":\"pqovu\",\"source\":\"vqihmqhqjd\"},{\"fieldName\":\"gcemjtiljxa\",\"source\":\"aly\"}]},\"id\":\"craxilzdxcm\",\"name\":\"dmdsypksfrhi\",\"type\":\"hxjou\"}") + .toObject(Identity.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAdditionalDataTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAdditionalDataTests.java index 98dc5f41208e..eb8e99f13084 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAdditionalDataTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAdditionalDataTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class IncidentAdditionalDataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentAdditionalData model = BinaryData.fromString( - "{\"alertsCount\":2118768153,\"bookmarksCount\":2142840160,\"commentsCount\":1096564755,\"alertProductNames\":[\"thsu\",\"ocmnyyazttbtwwrq\"],\"tactics\":[\"InhibitResponseFunction\",\"Impact\",\"LateralMovement\",\"PreAttack\"]}") + "{\"alertsCount\":1553275173,\"bookmarksCount\":382457292,\"commentsCount\":1584212400,\"alertProductNames\":[\"dvruzslzojhpctf\",\"mdxotngfdgu\"],\"tactics\":[\"Persistence\",\"InhibitResponseFunction\",\"Impact\",\"Discovery\"],\"techniques\":[\"yui\",\"absnmfpp\",\"ojeevy\",\"yhsgz\"],\"providerIncidentUrl\":\"zbgomfgbeg\",\"mergedIncidentNumber\":\"gleohi\",\"mergedIncidentUrl\":\"tnluankrr\"}") .toObject(IncidentAdditionalData.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncidentAdditionalData model = new IncidentAdditionalData(); - model = BinaryData.fromObject(model).toObject(IncidentAdditionalData.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAlertListInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAlertListInnerTests.java index 84c0736a4f91..c450c33ad3aa 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAlertListInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentAlertListInnerTests.java @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.IncidentAlertListInner; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; -import com.azure.resourcemanager.securityinsights.models.SecurityAlert; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class IncidentAlertListInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentAlertListInner model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"xytxhpzxbz\",\"alertType\":\"zabglcuhxwt\",\"compromisedEntity\":\"yqiklbbovplwzb\",\"confidenceLevel\":\"Unknown\",\"confidenceReasons\":[{\"reason\":\"uosvmkfssxqukk\",\"reasonType\":\"l\"}],\"confidenceScore\":81.71717361278654,\"confidenceScoreStatus\":\"Final\",\"description\":\"jzkdeslpvlopwi\",\"endTimeUtc\":\"2021-09-12T13:52:28Z\",\"intent\":\"Impact\",\"providerAlertId\":\"kdwzbaiuebbaumny\",\"processingEndTime\":\"2021-02-11T09:41:28Z\",\"productComponentName\":\"deoj\",\"productName\":\"bckhsmtxpsi\",\"productVersion\":\"tfhvpesapskrdqmh\",\"remediationSteps\":[\"htldwk\",\"zxuutkncwscwsvl\",\"otogtwrupqs\"],\"severity\":\"High\",\"startTimeUtc\":\"2021-05-08T10:21:40Z\",\"status\":\"InProgress\",\"systemAlertId\":\"vce\",\"tactics\":[\"Collection\"],\"timeGenerated\":\"2021-05-12T18:53:43Z\",\"vendorName\":\"notyfjfcnjbkcn\",\"alertLink\":\"hbttkphyw\",\"resourceIdentifiers\":[\"datajtoqne\",\"datamclfplphoxuscr\",\"dataabgy\",\"datapsbjta\"],\"additionalData\":{\"fjz\":\"datagxywpmue\",\"dsuyonobgla\":\"datafqkquj\",\"tcc\":\"datacq\"},\"friendlyName\":\"yudxytlmoy\"},\"id\":\"vwfudwpzntxhd\",\"name\":\"hl\",\"type\":\"qj\"}]}") + "{\"value\":[{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"yrcmjdmspofap\",\"alertType\":\"hryl\",\"compromisedEntity\":\"ofrzgb\",\"confidenceLevel\":\"Unknown\",\"confidenceReasons\":[{\"reason\":\"tkvnlvxbcuiiznkt\",\"reasonType\":\"ansnvp\"}],\"confidenceScore\":37.79009752932813,\"confidenceScoreStatus\":\"NotFinal\",\"description\":\"stbz\",\"endTimeUtc\":\"2021-05-18T23:48Z\",\"intent\":\"CredentialAccess\",\"providerAlertId\":\"qnyophzfyls\",\"processingEndTime\":\"2021-10-02T14:02:16Z\",\"productComponentName\":\"fbcunezz\",\"productName\":\"zelfwyfwl\",\"productVersion\":\"jwetnpsihcla\",\"remediationSteps\":[\"aylp\"],\"severity\":\"High\",\"startTimeUtc\":\"2021-08-23T02:35:52Z\",\"status\":\"Unknown\",\"systemAlertId\":\"cmwqkchcxwa\",\"tactics\":[\"ResourceDevelopment\",\"PrivilegeEscalation\",\"Exfiltration\"],\"timeGenerated\":\"2021-07-14T13:57:32Z\",\"vendorName\":\"xfdeqvhpsyl\",\"alertLink\":\"shk\",\"resourceIdentifiers\":[\"\\\"datambmxzjrgywwpgj\\\"\"],\"additionalData\":{\"aqutdewemxswvruu\":\"\\\"dataptfujgicgaaoept\\\"\",\"rtixokff\":\"\\\"datazzjgehkfki\\\"\"},\"friendlyName\":\"inljqepqwhixmo\"},\"id\":\"tshi\",\"name\":\"xgvelfclduccbird\",\"type\":\"vuwcobiegstmnin\"},{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"zcilnghg\",\"alertType\":\"ejjtbxqmul\",\"compromisedEntity\":\"lxqzvn\",\"confidenceLevel\":\"High\",\"confidenceReasons\":[{\"reason\":\"ucrwnami\",\"reasonType\":\"ebrqbsmswziqgfuh\"},{\"reason\":\"zruswh\",\"reasonType\":\"czznvfbycjsxj\"},{\"reason\":\"i\",\"reasonType\":\"vumwmxqh\"},{\"reason\":\"vnoamldseha\",\"reasonType\":\"djh\"}],\"confidenceScore\":24.296556466236364,\"confidenceScoreStatus\":\"NotFinal\",\"description\":\"coxpelnjeta\",\"endTimeUtc\":\"2021-01-18T20:04:57Z\",\"intent\":\"Exploitation\",\"providerAlertId\":\"atftgzpnpbsw\",\"processingEndTime\":\"2021-09-04T14:52:10Z\",\"productComponentName\":\"occsr\",\"productName\":\"zihmipgawtxxpky\",\"productVersion\":\"xcjxgrytfmpcy\",\"remediationSteps\":[\"rmcaykgg\",\"oxuztrksx\"],\"severity\":\"Medium\",\"startTimeUtc\":\"2021-05-07T07:31:07Z\",\"status\":\"New\",\"systemAlertId\":\"nznthjtw\",\"tactics\":[\"Exfiltration\",\"Discovery\"],\"timeGenerated\":\"2021-07-22T12:28:11Z\",\"vendorName\":\"zvoamktc\",\"alertLink\":\"os\",\"resourceIdentifiers\":[\"\\\"datazah\\\"\",\"\\\"dataxqdlyrtltlapr\\\"\"],\"additionalData\":{\"nnbsoqeqa\":\"\\\"datakatbhjm\\\"\",\"febwlnbmhyreeudz\":\"\\\"dataarvlagunbt\\\"\"},\"friendlyName\":\"vbpdqmjxlyyzglgo\"},\"id\":\"tlmj\",\"name\":\"yuojqtobaxk\",\"type\":\"eytu\"},{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"fjkwrusnkq\",\"alertType\":\"syrq\",\"compromisedEntity\":\"jqhden\",\"confidenceLevel\":\"Low\",\"confidenceReasons\":[{\"reason\":\"akdkifmjnnawtqab\",\"reasonType\":\"uckpggqoweyir\"}],\"confidenceScore\":24.11284431333247,\"confidenceScoreStatus\":\"Final\",\"description\":\"wfl\",\"endTimeUtc\":\"2020-12-29T01:03:02Z\",\"intent\":\"Persistence\",\"providerAlertId\":\"ruwnpqxpx\",\"processingEndTime\":\"2021-07-30T07:52:46Z\",\"productComponentName\":\"ngjsaasi\",\"productName\":\"tmkzjvkviirhgfgr\",\"productVersion\":\"dpgra\",\"remediationSteps\":[\"zb\",\"lbyvictctbrxkjzw\",\"gxffmshkwf\"],\"severity\":\"Medium\",\"startTimeUtc\":\"2021-02-06T21:53:12Z\",\"status\":\"InProgress\",\"systemAlertId\":\"pdbydpizqacln\",\"tactics\":[\"PreAttack\",\"Persistence\",\"Impact\",\"DefenseEvasion\"],\"timeGenerated\":\"2021-06-06T07:22:29Z\",\"vendorName\":\"j\",\"alertLink\":\"fsmfcttuxuuyi\",\"resourceIdentifiers\":[\"\\\"dataqoiquvrehmrnjhv\\\"\"],\"additionalData\":{\"t\":\"\\\"dataztczytq\\\"\",\"uunfprnjletlxsm\":\"\\\"datah\\\"\",\"nlqwzdvpiwhx\":\"\\\"datapddouifamowaziyn\\\"\"},\"friendlyName\":\"zdtmaajquhuxylrj\"},\"id\":\"ty\",\"name\":\"jbmzyospspsh\",\"type\":\"kfkyjp\"},{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"bpssdfp\",\"alertType\":\"ogtieyujtvczkcny\",\"compromisedEntity\":\"x\",\"confidenceLevel\":\"High\",\"confidenceReasons\":[{\"reason\":\"vg\",\"reasonType\":\"kvxlxpa\"}],\"confidenceScore\":61.18919316014264,\"confidenceScoreStatus\":\"NotApplicable\",\"description\":\"kc\",\"endTimeUtc\":\"2021-01-25T02:14:14Z\",\"intent\":\"Exfiltration\",\"providerAlertId\":\"uqdflvoni\",\"processingEndTime\":\"2021-06-12T04:55:31Z\",\"productComponentName\":\"ubcpzgpxti\",\"productName\":\"j\",\"productVersion\":\"idibgqjxgpn\",\"remediationSteps\":[\"ov\",\"gpikqmh\",\"ao\",\"jrmzvupor\"],\"severity\":\"Medium\",\"startTimeUtc\":\"2021-01-08T19:38:21Z\",\"status\":\"Resolved\",\"systemAlertId\":\"vkfvxcnqmxqpswok\",\"tactics\":[\"CredentialAccess\"],\"timeGenerated\":\"2021-12-01T08:12:15Z\",\"vendorName\":\"dhbemzqkzszu\",\"alertLink\":\"wtglxx\",\"resourceIdentifiers\":[\"\\\"datafpgpicrmnzhrgm\\\"\",\"\\\"datagjsxv\\\"\",\"\\\"dataqcbfrmbodths\\\"\"],\"additionalData\":{\"xousxauzl\":\"\\\"datavriibakclacjfr\\\"\",\"wohqfzizvu\":\"\\\"datavsg\\\"\",\"vmribiat\":\"\\\"datammkjsvthnwpztek\\\"\"},\"friendlyName\":\"plucfotangcfhnyk\"},\"id\":\"ugswvx\",\"name\":\"lmzqwmvtxnjmx\",\"type\":\"cuqudtcvclxy\"}]}") .toObject(IncidentAlertListInner.class); Assertions.assertEquals(AlertSeverity.HIGH, model.value().get(0).severity()); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncidentAlertListInner model = new IncidentAlertListInner() - .withValue(Arrays.asList(new SecurityAlert().withSeverity(AlertSeverity.HIGH))); - model = BinaryData.fromObject(model).toObject(IncidentAlertListInner.class); - Assertions.assertEquals(AlertSeverity.HIGH, model.value().get(0).severity()); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentBookmarkListInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentBookmarkListInnerTests.java index cdc5e8ccbc8c..f11265169106 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentBookmarkListInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentBookmarkListInnerTests.java @@ -1,100 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.IncidentBookmarkListInner; -import com.azure.resourcemanager.securityinsights.models.HuntingBookmark; -import com.azure.resourcemanager.securityinsights.models.IncidentInfo; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; -import com.azure.resourcemanager.securityinsights.models.UserInfo; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class IncidentBookmarkListInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentBookmarkListInner model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-03-12T03:59:06Z\",\"createdBy\":{\"email\":\"nrmfqjhhk\",\"name\":\"pvjymjhxxjyng\",\"objectId\":\"26664c69-561c-4b8e-a986-de91e1c01c3a\"},\"displayName\":\"ivkrtsw\",\"eventTime\":\"2021-05-30T10:12:47Z\",\"labels\":[\"szjfauvjfdxxivet\",\"t\",\"qaqtdoqmcbxvwvxy\",\"lqbhsf\"],\"notes\":\"blytk\",\"query\":\"lmpewwwfbkr\",\"queryResult\":\"nsvs\",\"updated\":\"2021-08-09T19:40:16Z\",\"updatedBy\":{\"email\":\"xc\",\"name\":\"bfovasrruvwbhsq\",\"objectId\":\"0ace2d25-4fd3-4679-a42d-1c2692bef03a\"},\"incidentInfo\":{\"incidentId\":\"cgjbirxbp\",\"severity\":\"Low\",\"title\":\"fbjfdtwssotftpvj\",\"relationName\":\"exilzznfqqnvwpmq\"},\"additionalData\":{\"jrybnwjewgdrjer\":\"datauoujmkcjhwqy\",\"gmifthnzd\":\"datanaenqpehindo\"},\"friendlyName\":\"sl\"},\"id\":\"ayqigynduhav\",\"name\":\"qlkth\",\"type\":\"maqolbgycduie\"},{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-07-05T23:49:12Z\",\"createdBy\":{\"email\":\"mvaolps\",\"name\":\"qlfmmdnbb\",\"objectId\":\"657cef19-7d3e-48be-a899-30180ad5dbbd\"},\"displayName\":\"zpswiydmc\",\"eventTime\":\"2021-03-06T05:36:52Z\",\"labels\":[\"xssadbzmnvdf\",\"n\",\"daodvxzbncblyl\"],\"notes\":\"tdbhhxsrzdzu\",\"query\":\"erscdntne\",\"queryResult\":\"iwjmygtdssls\",\"updated\":\"2021-06-02T21:20:03Z\",\"updatedBy\":{\"email\":\"riofzpyqse\",\"name\":\"abnetshh\",\"objectId\":\"ea075571-b064-48d2-89d6-dae2f96eb97a\"},\"incidentInfo\":{\"incidentId\":\"d\",\"severity\":\"Informational\",\"title\":\"iwubmwmbesldnk\",\"relationName\":\"tppjflcx\"},\"additionalData\":{\"qqkdltfzxmhhvhgu\":\"dataokonzmnsikvmkqz\",\"xtibqdxbxwakbog\":\"dataeodkwobda\",\"iplbpodxunkbebxm\":\"dataxndlkzgxhu\"},\"friendlyName\":\"yyntwl\"},\"id\":\"qtkoievs\",\"name\":\"otgqrlltmu\",\"type\":\"lauwzizxbmpgcjef\"}]}") + "{\"value\":[{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-02-08T16:03:53Z\",\"createdBy\":{\"email\":\"vpndp\",\"name\":\"ljpnwynudqll\",\"objectId\":\"auzpjlx\"},\"displayName\":\"ehuxiqhzlraym\",\"eventTime\":\"2021-09-30T08:56:45Z\",\"labels\":[\"kihmxrfdsajredn\",\"yyshtuwgmevua\",\"pwzyi\"],\"notes\":\"kgwl\",\"query\":\"xeqipx\",\"queryResult\":\"dyimsfay\",\"updated\":\"2021-07-01T11:25:11Z\",\"updatedBy\":{\"email\":\"vk\",\"name\":\"geslabnsmj\",\"objectId\":\"ynq\"},\"incidentInfo\":{\"incidentId\":\"kqsykvwjtqpke\",\"severity\":\"Low\",\"title\":\"tjcrspxklurccl\",\"relationName\":\"xa\"},\"additionalData\":{\"xigpxvkqmaupxvpi\":\"\\\"dataoytzpose\\\"\",\"ds\":\"\\\"datadfaifyzyzeyuube\\\"\",\"ytoithgygvfl\":\"\\\"datal\\\"\",\"rcyrucpcunnu\":\"\\\"datagvdihoynkrxwetwk\\\"\"},\"friendlyName\":\"qumoeno\"},\"id\":\"aienhqhsknd\",\"name\":\"elqkaadlkn\",\"type\":\"foanniyopetx\"},{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-05-23T05:00:26Z\",\"createdBy\":{\"email\":\"yxnu\",\"name\":\"ephblkwqpatvbqs\",\"objectId\":\"cjbctviv\"},\"displayName\":\"zqymtuowogtgits\",\"eventTime\":\"2021-07-27T11:23:25Z\",\"labels\":[\"zcdba\",\"fzndscxmxeatkd\"],\"notes\":\"wnrdjyibqbnaom\",\"query\":\"jrmkuhmaxljalf\",\"queryResult\":\"cjmobcanc\",\"updated\":\"2021-05-06T12:28:32Z\",\"updatedBy\":{\"email\":\"cwg\",\"name\":\"fgvaknokzwj\",\"objectId\":\"r\"},\"incidentInfo\":{\"incidentId\":\"xldzyyfytpqsix\",\"severity\":\"High\",\"title\":\"ujivyqlkjuvsm\",\"relationName\":\"slzoyov\"},\"additionalData\":{\"mx\":\"\\\"databpqvybefg\\\"\",\"vcuartrhun\":\"\\\"dataokcvtlubses\\\"\",\"reuykbbmnwagl\":\"\\\"datapirykycndzfqiv\\\"\"},\"friendlyName\":\"xoe\"},\"id\":\"nqlnfwmyymvqd\",\"name\":\"pb\",\"type\":\"fckdvez\"},{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-08-17T17:56:24Z\",\"createdBy\":{\"email\":\"zhddubbnqf\",\"name\":\"h\",\"objectId\":\"lehpavawu\"},\"displayName\":\"iqjtiogqgdmin\",\"eventTime\":\"2021-05-05T10:06:38Z\",\"labels\":[\"aj\",\"hi\"],\"notes\":\"spnbonhpcz\",\"query\":\"kmktpvwxqcseh\",\"queryResult\":\"khufmpqumqyjgydz\",\"updated\":\"2021-09-30T01:43:07Z\",\"updatedBy\":{\"email\":\"aeuzanh\",\"name\":\"nhsenwphpzfng\",\"objectId\":\"clid\"},\"incidentInfo\":{\"incidentId\":\"jwjj\",\"severity\":\"Low\",\"title\":\"eqrkuorhtss\",\"relationName\":\"qnmdvhazcvjy\"},\"additionalData\":{\"txtd\":\"\\\"dataswbqerzwxi\\\"\",\"ktg\":\"\\\"dataukvlb\\\"\",\"bewreswmowegmmut\":\"\\\"datastyoua\\\"\"},\"friendlyName\":\"xeyg\"},\"id\":\"igijiitnspxlz\",\"name\":\"es\",\"type\":\"grijwaiufanrayb\"},{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-08-23T01:59:28Z\",\"createdBy\":{\"email\":\"oj\",\"name\":\"dgrhydkygywezs\",\"objectId\":\"ec\"},\"displayName\":\"f\",\"eventTime\":\"2021-11-01T05:03:48Z\",\"labels\":[\"ieqvds\",\"a\"],\"notes\":\"ixqcahyhxalybxaw\",\"query\":\"ijpodtblxpkkwj\",\"queryResult\":\"odqhyk\",\"updated\":\"2021-01-21T07:18:03Z\",\"updatedBy\":{\"email\":\"emehllizh\",\"name\":\"umoqodkad\",\"objectId\":\"yibngqladywrxwh\"},\"incidentInfo\":{\"incidentId\":\"luvvad\",\"severity\":\"High\",\"title\":\"nuyemlowuo\",\"relationName\":\"lxlnwyrmo\"},\"additionalData\":{\"rfowtdvrfmvlih\":\"\\\"datalgmokzkl\\\"\",\"hdxlw\":\"\\\"datavjdrqcrjidhftuk\\\"\",\"zd\":\"\\\"dataojbf\\\"\",\"afr\":\"\\\"datafnjyix\\\"\"},\"friendlyName\":\"qxmbjroumzzn\"},\"id\":\"l\",\"name\":\"jrhuzgf\",\"type\":\"on\"}]}") .toObject(IncidentBookmarkListInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-12T03:59:06Z"), model.value().get(0).created()); - Assertions.assertEquals(UUID.fromString("26664c69-561c-4b8e-a986-de91e1c01c3a"), - model.value().get(0).createdBy().objectId()); - Assertions.assertEquals("ivkrtsw", model.value().get(0).displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-30T10:12:47Z"), model.value().get(0).eventTime()); - Assertions.assertEquals("szjfauvjfdxxivet", model.value().get(0).labels().get(0)); - Assertions.assertEquals("blytk", model.value().get(0).notes()); - Assertions.assertEquals("lmpewwwfbkr", model.value().get(0).query()); - Assertions.assertEquals("nsvs", model.value().get(0).queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T19:40:16Z"), model.value().get(0).updated()); - Assertions.assertEquals(UUID.fromString("0ace2d25-4fd3-4679-a42d-1c2692bef03a"), - model.value().get(0).updatedBy().objectId()); - Assertions.assertEquals("cgjbirxbp", model.value().get(0).incidentInfo().incidentId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T16:03:53Z"), model.value().get(0).created()); + Assertions.assertEquals("auzpjlx", model.value().get(0).createdBy().objectId()); + Assertions.assertEquals("ehuxiqhzlraym", model.value().get(0).displayName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-30T08:56:45Z"), model.value().get(0).eventTime()); + Assertions.assertEquals("kihmxrfdsajredn", model.value().get(0).labels().get(0)); + Assertions.assertEquals("kgwl", model.value().get(0).notes()); + Assertions.assertEquals("xeqipx", model.value().get(0).query()); + Assertions.assertEquals("dyimsfay", model.value().get(0).queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T11:25:11Z"), model.value().get(0).updated()); + Assertions.assertEquals("ynq", model.value().get(0).updatedBy().objectId()); + Assertions.assertEquals("kqsykvwjtqpke", model.value().get(0).incidentInfo().incidentId()); Assertions.assertEquals(IncidentSeverity.LOW, model.value().get(0).incidentInfo().severity()); - Assertions.assertEquals("fbjfdtwssotftpvj", model.value().get(0).incidentInfo().title()); - Assertions.assertEquals("exilzznfqqnvwpmq", model.value().get(0).incidentInfo().relationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncidentBookmarkListInner model - = new IncidentBookmarkListInner() - .withValue( - Arrays - .asList( - new HuntingBookmark().withCreated(OffsetDateTime.parse("2021-03-12T03:59:06Z")) - .withCreatedBy(new UserInfo() - .withObjectId(UUID.fromString("26664c69-561c-4b8e-a986-de91e1c01c3a"))) - .withDisplayName("ivkrtsw") - .withEventTime(OffsetDateTime.parse("2021-05-30T10:12:47Z")) - .withLabels(Arrays.asList("szjfauvjfdxxivet", "t", "qaqtdoqmcbxvwvxy", "lqbhsf")) - .withNotes("blytk") - .withQuery("lmpewwwfbkr") - .withQueryResult("nsvs") - .withUpdated(OffsetDateTime.parse("2021-08-09T19:40:16Z")) - .withUpdatedBy(new UserInfo() - .withObjectId(UUID.fromString("0ace2d25-4fd3-4679-a42d-1c2692bef03a"))) - .withIncidentInfo(new IncidentInfo() - .withIncidentId("cgjbirxbp") - .withSeverity(IncidentSeverity.LOW) - .withTitle("fbjfdtwssotftpvj") - .withRelationName("exilzznfqqnvwpmq")), - new HuntingBookmark().withCreated(OffsetDateTime.parse("2021-07-05T23:49:12Z")) - .withCreatedBy(new UserInfo() - .withObjectId(UUID.fromString("657cef19-7d3e-48be-a899-30180ad5dbbd"))) - .withDisplayName("zpswiydmc") - .withEventTime(OffsetDateTime.parse("2021-03-06T05:36:52Z")) - .withLabels(Arrays.asList("xssadbzmnvdf", "n", "daodvxzbncblyl")) - .withNotes("tdbhhxsrzdzu") - .withQuery("erscdntne") - .withQueryResult("iwjmygtdssls") - .withUpdated(OffsetDateTime.parse("2021-06-02T21:20:03Z")) - .withUpdatedBy(new UserInfo() - .withObjectId(UUID.fromString("ea075571-b064-48d2-89d6-dae2f96eb97a"))) - .withIncidentInfo(new IncidentInfo().withIncidentId("d") - .withSeverity(IncidentSeverity.INFORMATIONAL) - .withTitle("iwubmwmbesldnk") - .withRelationName("tppjflcx")))); - model = BinaryData.fromObject(model).toObject(IncidentBookmarkListInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-12T03:59:06Z"), model.value().get(0).created()); - Assertions.assertEquals(UUID.fromString("26664c69-561c-4b8e-a986-de91e1c01c3a"), - model.value().get(0).createdBy().objectId()); - Assertions.assertEquals("ivkrtsw", model.value().get(0).displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-30T10:12:47Z"), model.value().get(0).eventTime()); - Assertions.assertEquals("szjfauvjfdxxivet", model.value().get(0).labels().get(0)); - Assertions.assertEquals("blytk", model.value().get(0).notes()); - Assertions.assertEquals("lmpewwwfbkr", model.value().get(0).query()); - Assertions.assertEquals("nsvs", model.value().get(0).queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T19:40:16Z"), model.value().get(0).updated()); - Assertions.assertEquals(UUID.fromString("0ace2d25-4fd3-4679-a42d-1c2692bef03a"), - model.value().get(0).updatedBy().objectId()); - Assertions.assertEquals("cgjbirxbp", model.value().get(0).incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.LOW, model.value().get(0).incidentInfo().severity()); - Assertions.assertEquals("fbjfdtwssotftpvj", model.value().get(0).incidentInfo().title()); - Assertions.assertEquals("exilzznfqqnvwpmq", model.value().get(0).incidentInfo().relationName()); + Assertions.assertEquals("tjcrspxklurccl", model.value().get(0).incidentInfo().title()); + Assertions.assertEquals("xa", model.value().get(0).incidentInfo().relationName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentInnerTests.java index 6011d4e8e0b9..d1361682333b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,17 +12,17 @@ public final class IncidentCommentInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentCommentInner model = BinaryData.fromString( - "{\"properties\":{\"createdTimeUtc\":\"2021-09-15T00:41:47Z\",\"lastModifiedTimeUtc\":\"2021-02-25T17:15:42Z\",\"message\":\"kwqqtchealmf\",\"author\":{\"email\":\"aayg\",\"name\":\"wvgpiohg\",\"objectId\":\"536577d5-ac9a-4bef-9da3-73c391d07dd5\",\"userPrincipalName\":\"tfudxepx\"}},\"etag\":\"qagvrvm\",\"id\":\"k\",\"name\":\"kghimdblxgwimfnj\",\"type\":\"fjxwmsz\"}") + "{\"properties\":{\"message\":\"yljeknfqnwjjqx\",\"createdTimeUtc\":\"2021-07-31T14:46:40Z\",\"lastModifiedTimeUtc\":\"2021-08-13T21:12:33Z\",\"author\":{\"email\":\"xgkrh\",\"name\":\"ehycpn\",\"objectId\":\"awonoehrguqlhfw\",\"userPrincipalName\":\"bjzm\"}},\"etag\":\"rguyfa\",\"id\":\"kocbyg\",\"name\":\"thrmxkbcjwwdxo\",\"type\":\"rawppkeboozf\"}") .toObject(IncidentCommentInner.class); - Assertions.assertEquals("qagvrvm", model.etag()); - Assertions.assertEquals("kwqqtchealmf", model.message()); + Assertions.assertEquals("rguyfa", model.etag()); + Assertions.assertEquals("yljeknfqnwjjqx", model.message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentCommentInner model = new IncidentCommentInner().withEtag("qagvrvm").withMessage("kwqqtchealmf"); + IncidentCommentInner model = new IncidentCommentInner().withEtag("rguyfa").withMessage("yljeknfqnwjjqx"); model = BinaryData.fromObject(model).toObject(IncidentCommentInner.class); - Assertions.assertEquals("qagvrvm", model.etag()); - Assertions.assertEquals("kwqqtchealmf", model.message()); + Assertions.assertEquals("rguyfa", model.etag()); + Assertions.assertEquals("yljeknfqnwjjqx", model.message()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentListTests.java index 6281e4c854dd..5117977da27a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentListTests.java @@ -1,34 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.IncidentCommentInner; -import com.azure.resourcemanager.securityinsights.models.IncidentCommentList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.IncidentCommentList; import org.junit.jupiter.api.Assertions; public final class IncidentCommentListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentCommentList model = BinaryData.fromString( - "{\"nextLink\":\"uwhhmhykojoxafn\",\"value\":[{\"properties\":{\"createdTimeUtc\":\"2021-05-25T15:58:59Z\",\"lastModifiedTimeUtc\":\"2021-08-06T21:47:38Z\",\"message\":\"koymkcd\",\"author\":{\"email\":\"pkkpw\",\"name\":\"eqnovvqfovl\",\"objectId\":\"7db8bd37-c439-4a18-bced-10302abe1c35\",\"userPrincipalName\":\"wsuwsyr\"}},\"etag\":\"dsytgadgvr\",\"id\":\"aeneqnzarrwl\",\"name\":\"uu\",\"type\":\"jfqka\"},{\"properties\":{\"createdTimeUtc\":\"2021-05-07T16:01:38Z\",\"lastModifiedTimeUtc\":\"2021-07-18T18:26:22Z\",\"message\":\"fpubjibwwi\",\"author\":{\"email\":\"hqkvpuvksgplsak\",\"name\":\"n\",\"objectId\":\"a31a605e-c79b-4da1-b622-ce27a6acdd74\",\"userPrincipalName\":\"n\"}},\"etag\":\"ph\",\"id\":\"pxodlqiyntorzih\",\"name\":\"eosjswsr\",\"type\":\"slyzrpzbchckqq\"},{\"properties\":{\"createdTimeUtc\":\"2021-07-29T22:35:12Z\",\"lastModifiedTimeUtc\":\"2021-05-24T05:08:39Z\",\"message\":\"ysuiizynkedya\",\"author\":{\"email\":\"yhqmibzyhwi\",\"name\":\"mypyynpcdpu\",\"objectId\":\"2c168ef5-4595-41a6-8103-489a2cd8c1fd\",\"userPrincipalName\":\"g\"}},\"etag\":\"z\",\"id\":\"abikns\",\"name\":\"rgjhxb\",\"type\":\"dtlwwrlkd\"},{\"properties\":{\"createdTimeUtc\":\"2021-10-25T17:02:07Z\",\"lastModifiedTimeUtc\":\"2021-05-19T09:18:43Z\",\"message\":\"kotl\",\"author\":{\"email\":\"yhgsy\",\"name\":\"ogjltdtbnnhad\",\"objectId\":\"0f967ea4-5e96-433e-8a36-37e163fc0c6b\",\"userPrincipalName\":\"rkvcikhnvpa\"}},\"etag\":\"gxqquezik\",\"id\":\"ggxkallatmelwuip\",\"name\":\"ccjzkzivgvv\",\"type\":\"nayrhyrnxxmueedn\"}]}") + "{\"value\":[{\"properties\":{\"message\":\"bncgagdvcdqhftzb\",\"createdTimeUtc\":\"2021-07-16T10:49:50Z\",\"lastModifiedTimeUtc\":\"2021-03-08T23:03:54Z\",\"author\":{\"email\":\"f\",\"name\":\"tncwmhjobzrfpr\",\"objectId\":\"dc\",\"userPrincipalName\":\"yftcvbzwgwhg\"}},\"etag\":\"soauoorssatfyb\",\"id\":\"ufdmxuq\",\"name\":\"dqn\",\"type\":\"sttuxv\"},{\"properties\":{\"message\":\"q\",\"createdTimeUtc\":\"2021-11-20T23:55:58Z\",\"lastModifiedTimeUtc\":\"2021-05-21T09:05:51Z\",\"author\":{\"email\":\"ixhg\",\"name\":\"hx\",\"objectId\":\"dztgsqja\",\"userPrincipalName\":\"mar\"}},\"etag\":\"eibpgbrhbjdqkn\",\"id\":\"nmotpuwnnoh\",\"name\":\"mzngocfrjuy\",\"type\":\"wyiulaynosu\"},{\"properties\":{\"message\":\"fhaxttpf\",\"createdTimeUtc\":\"2021-12-01T05:34:34Z\",\"lastModifiedTimeUtc\":\"2021-10-02T04:45:34Z\",\"author\":{\"email\":\"qucumldda\",\"name\":\"ml\",\"objectId\":\"eot\",\"userPrincipalName\":\"uarigrj\"}},\"etag\":\"jlkq\",\"id\":\"krbzkuas\",\"name\":\"axklpruulh\",\"type\":\"l\"},{\"properties\":{\"message\":\"izwxvs\",\"createdTimeUtc\":\"2021-09-13T07:51:30Z\",\"lastModifiedTimeUtc\":\"2021-05-02T03:39:10Z\",\"author\":{\"email\":\"skyekgafxczv\",\"name\":\"ckwrtw\",\"objectId\":\"tyveszrtl\",\"userPrincipalName\":\"dhwynctacz\"}},\"etag\":\"jfmbbfnvjxitz\",\"id\":\"nkrtikl\",\"name\":\"mn\",\"type\":\"hql\"}],\"nextLink\":\"qksyiibhyxwbgbu\"}") .toObject(IncidentCommentList.class); - Assertions.assertEquals("dsytgadgvr", model.value().get(0).etag()); - Assertions.assertEquals("koymkcd", model.value().get(0).message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncidentCommentList model = new IncidentCommentList() - .withValue(Arrays.asList(new IncidentCommentInner().withEtag("dsytgadgvr").withMessage("koymkcd"), - new IncidentCommentInner().withEtag("ph").withMessage("fpubjibwwi"), - new IncidentCommentInner().withEtag("z").withMessage("ysuiizynkedya"), - new IncidentCommentInner().withEtag("gxqquezik").withMessage("kotl"))); - model = BinaryData.fromObject(model).toObject(IncidentCommentList.class); - Assertions.assertEquals("dsytgadgvr", model.value().get(0).etag()); - Assertions.assertEquals("koymkcd", model.value().get(0).message()); + Assertions.assertEquals("soauoorssatfyb", model.value().get(0).etag()); + Assertions.assertEquals("bncgagdvcdqhftzb", model.value().get(0).message()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentPropertiesTests.java index 356e74a26650..aa053961f1f0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,15 +12,15 @@ public final class IncidentCommentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentCommentProperties model = BinaryData.fromString( - "{\"createdTimeUtc\":\"2021-07-27T00:52:16Z\",\"lastModifiedTimeUtc\":\"2021-09-21T20:48:34Z\",\"message\":\"rey\",\"author\":{\"email\":\"ikf\",\"name\":\"wneaiv\",\"objectId\":\"7f3809ae-7018-4ecc-a220-1b8688af8bd9\",\"userPrincipalName\":\"zel\"}}") + "{\"message\":\"yacagae\",\"createdTimeUtc\":\"2021-06-25T20:43:04Z\",\"lastModifiedTimeUtc\":\"2021-10-31T05:47:48Z\",\"author\":{\"email\":\"mgd\",\"name\":\"gabdxfkuzbwjeco\",\"objectId\":\"vh\",\"userPrincipalName\":\"qbpel\"}}") .toObject(IncidentCommentProperties.class); - Assertions.assertEquals("rey", model.message()); + Assertions.assertEquals("yacagae", model.message()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentCommentProperties model = new IncidentCommentProperties().withMessage("rey"); + IncidentCommentProperties model = new IncidentCommentProperties().withMessage("yacagae"); model = BinaryData.fromObject(model).toObject(IncidentCommentProperties.class); - Assertions.assertEquals("rey", model.message()); + Assertions.assertEquals("yacagae", model.message()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateWithResponseMockTests.java index d09fe7e43daa..a419d21a9cf9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.IncidentComment; @@ -21,23 +21,23 @@ public final class IncidentCommentsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdTimeUtc\":\"2021-10-26T16:10:33Z\",\"lastModifiedTimeUtc\":\"2021-01-01T12:15:18Z\",\"message\":\"qkfrbzgowoxqmj\",\"author\":{\"email\":\"cxn\",\"name\":\"gxhlusr\",\"objectId\":\"2075d9be-78f7-465f-b998-fd1aebf9d9f2\",\"userPrincipalName\":\"simjceagbjqvlsu\"}},\"etag\":\"wzas\",\"id\":\"gon\",\"name\":\"yjfqipubyznc\",\"type\":\"k\"}"; + = "{\"properties\":{\"message\":\"dikdbqeahgsib\",\"createdTimeUtc\":\"2021-02-21T02:39:05Z\",\"lastModifiedTimeUtc\":\"2021-04-02T15:51:20Z\",\"author\":{\"email\":\"aznz\",\"name\":\"zfhh\",\"objectId\":\"yxkgnrya\",\"userPrincipalName\":\"fdxauihnb\"}},\"etag\":\"hkdwyehqnxuffgj\",\"id\":\"minhvdkqigppdqsq\",\"name\":\"apweaxthuhuruou\",\"type\":\"yotapstkdbn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IncidentComment response = manager.incidentComments() - .define("bxbhmedeilbj") - .withExistingIncident("cxetyvkunmignoh", "k", "gqogjwpindedva") - .withEtag("jsllfryvd") - .withMessage("zir") + .define("erizf") + .withExistingIncident("ukbwypcvqfz", "y", "x") + .withEtag("vgotbjnxozi") + .withMessage("lkovopqpfcdp") .create(); - Assertions.assertEquals("wzas", response.etag()); - Assertions.assertEquals("qkfrbzgowoxqmj", response.message()); + Assertions.assertEquals("hkdwyehqnxuffgj", response.etag()); + Assertions.assertEquals("dikdbqeahgsib", response.message()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteWithResponseMockTests.java index 02d7ab2004d9..449e176cd242 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.incidentComments() - .deleteWithResponse("iucijjcea", "lijjjrtvam", "a", "zknxkv", com.azure.core.util.Context.NONE); + .deleteWithResponse("gn", "umjmpgze", "uvfpsi", "pmeptnqsnpa", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetWithResponseMockTests.java index af3c5ceebfdb..03afee991e1f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.IncidentComment; @@ -21,20 +21,20 @@ public final class IncidentCommentsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdTimeUtc\":\"2021-02-21T09:44:27Z\",\"lastModifiedTimeUtc\":\"2020-12-24T02:22:44Z\",\"message\":\"p\",\"author\":{\"email\":\"zwv\",\"name\":\"rgyngydgrpxnca\",\"objectId\":\"7ab9689a-8b98-4836-bfe3-ad4c95c8e09b\",\"userPrincipalName\":\"aondjrkclamgg\"}},\"etag\":\"lmf\",\"id\":\"doqey\",\"name\":\"gltygxhqfgq\",\"type\":\"ayejsxtlgflwfgz\"}"; + = "{\"properties\":{\"message\":\"qjhghihkhjld\",\"createdTimeUtc\":\"2021-01-09T19:43:19Z\",\"lastModifiedTimeUtc\":\"2021-10-19T15:56:36Z\",\"author\":{\"email\":\"tgn\",\"name\":\"bjvmdkgvu\",\"objectId\":\"mlsuuhwuox\",\"userPrincipalName\":\"i\"}},\"etag\":\"zzjo\",\"id\":\"ygzjrkslqba\",\"name\":\"dbjxxc\",\"type\":\"uleimswxo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IncidentComment response = manager.incidentComments() - .getWithResponse("ilfjqqacdmk", "wxdcvjwcyz", "akeciqchx", "tuicds", com.azure.core.util.Context.NONE) + .getWithResponse("yheya", "ktutflhegoxefs", "hmdcoe", "xwgzszjq", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("lmf", response.etag()); - Assertions.assertEquals("p", response.message()); + Assertions.assertEquals("zzjo", response.etag()); + Assertions.assertEquals("qjhghihkhjld", response.message()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListMockTests.java index 0be32054f5bf..7e3338aad035 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentCommentsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.IncidentComment; @@ -22,20 +22,20 @@ public final class IncidentCommentsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"createdTimeUtc\":\"2021-11-12T06:00:22Z\",\"lastModifiedTimeUtc\":\"2021-11-20T04:49:09Z\",\"message\":\"yrqjcrga\",\"author\":{\"email\":\"z\",\"name\":\"fkb\",\"objectId\":\"bf85342e-23c3-46e5-8608-dea2e8692b16\",\"userPrincipalName\":\"orpdltbqct\"}},\"etag\":\"fg\",\"id\":\"saetgzdgvpyig\",\"name\":\"aqqilzdcduwjoed\",\"type\":\"ngucaifpaurww\"}]}"; + = "{\"value\":[{\"properties\":{\"message\":\"orjbyyxkcvah\",\"createdTimeUtc\":\"2021-03-29T08:15:27Z\",\"lastModifiedTimeUtc\":\"2021-08-28T02:55:30Z\",\"author\":{\"email\":\"ivwven\",\"name\":\"cyctakh\",\"objectId\":\"yholsmah\",\"userPrincipalName\":\"chvskq\"}},\"etag\":\"bigozrvlkl\",\"id\":\"rlysseo\",\"name\":\"ppgsfj\",\"type\":\"jgmogmcjnq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.incidentComments() - .list("gjyy", "pvelszerqze", "xoqeintxwalj", "lzoblqwaafr", "ulhmzyq", 2020132379, "dvaf", + .list("ks", "rrvjwbeeolmob", "qol", "fk", "dwzvhtgfdy", 1264521688, "phlwmivazfnbzcjm", com.azure.core.util.Context.NONE); - Assertions.assertEquals("fg", response.iterator().next().etag()); - Assertions.assertEquals("yrqjcrga", response.iterator().next().message()); + Assertions.assertEquals("bigozrvlkl", response.iterator().next().etag()); + Assertions.assertEquals("orjbyyxkcvah", response.iterator().next().message()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentConfigurationTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentConfigurationTests.java index 364c42cefb43..a758aa1fe0b4 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentConfigurationTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -18,37 +18,36 @@ public final class IncidentConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentConfiguration model = BinaryData.fromString( - "{\"createIncident\":true,\"groupingConfiguration\":{\"enabled\":false,\"reopenClosedIncident\":false,\"lookbackDuration\":\"PT218H45M39S\",\"matchingMethod\":\"AnyAlert\",\"groupByEntities\":[\"IP\",\"DNS\",\"Process\"],\"groupByAlertDetails\":[\"DisplayName\",\"DisplayName\"],\"groupByCustomDetails\":[\"izxfpxt\",\"qscjavftjuh\",\"qaz\",\"mtggu\"]}}") + "{\"createIncident\":true,\"groupingConfiguration\":{\"enabled\":true,\"reopenClosedIncident\":false,\"lookbackDuration\":\"PT177H46M56S\",\"matchingMethod\":\"AllEntities\",\"groupByEntities\":[\"File\",\"RegistryValue\"],\"groupByAlertDetails\":[\"Severity\"],\"groupByCustomDetails\":[\"gxqquezik\",\"wggxkallat\",\"elwuipi\"]}}") .toObject(IncidentConfiguration.class); - Assertions.assertEquals(true, model.createIncident()); - Assertions.assertEquals(false, model.groupingConfiguration().enabled()); - Assertions.assertEquals(false, model.groupingConfiguration().reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT218H45M39S"), model.groupingConfiguration().lookbackDuration()); - Assertions.assertEquals(MatchingMethod.ANY_ALERT, model.groupingConfiguration().matchingMethod()); - Assertions.assertEquals(EntityMappingType.IP, model.groupingConfiguration().groupByEntities().get(0)); - Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.groupingConfiguration().groupByAlertDetails().get(0)); - Assertions.assertEquals("izxfpxt", model.groupingConfiguration().groupByCustomDetails().get(0)); + Assertions.assertTrue(model.createIncident()); + Assertions.assertTrue(model.groupingConfiguration().enabled()); + Assertions.assertFalse(model.groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT177H46M56S"), model.groupingConfiguration().lookbackDuration()); + Assertions.assertEquals(MatchingMethod.ALL_ENTITIES, model.groupingConfiguration().matchingMethod()); + Assertions.assertEquals(EntityMappingType.FILE, model.groupingConfiguration().groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.SEVERITY, model.groupingConfiguration().groupByAlertDetails().get(0)); + Assertions.assertEquals("gxqquezik", model.groupingConfiguration().groupByCustomDetails().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { IncidentConfiguration model = new IncidentConfiguration().withCreateIncident(true) - .withGroupingConfiguration(new GroupingConfiguration().withEnabled(false) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) .withReopenClosedIncident(false) - .withLookbackDuration(Duration.parse("PT218H45M39S")) - .withMatchingMethod(MatchingMethod.ANY_ALERT) - .withGroupByEntities( - Arrays.asList(EntityMappingType.IP, EntityMappingType.DNS, EntityMappingType.PROCESS)) - .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME, AlertDetail.DISPLAY_NAME)) - .withGroupByCustomDetails(Arrays.asList("izxfpxt", "qscjavftjuh", "qaz", "mtggu"))); + .withLookbackDuration(Duration.parse("PT177H46M56S")) + .withMatchingMethod(MatchingMethod.ALL_ENTITIES) + .withGroupByEntities(Arrays.asList(EntityMappingType.FILE, EntityMappingType.REGISTRY_VALUE)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.SEVERITY)) + .withGroupByCustomDetails(Arrays.asList("gxqquezik", "wggxkallat", "elwuipi"))); model = BinaryData.fromObject(model).toObject(IncidentConfiguration.class); - Assertions.assertEquals(true, model.createIncident()); - Assertions.assertEquals(false, model.groupingConfiguration().enabled()); - Assertions.assertEquals(false, model.groupingConfiguration().reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT218H45M39S"), model.groupingConfiguration().lookbackDuration()); - Assertions.assertEquals(MatchingMethod.ANY_ALERT, model.groupingConfiguration().matchingMethod()); - Assertions.assertEquals(EntityMappingType.IP, model.groupingConfiguration().groupByEntities().get(0)); - Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.groupingConfiguration().groupByAlertDetails().get(0)); - Assertions.assertEquals("izxfpxt", model.groupingConfiguration().groupByCustomDetails().get(0)); + Assertions.assertTrue(model.createIncident()); + Assertions.assertTrue(model.groupingConfiguration().enabled()); + Assertions.assertFalse(model.groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT177H46M56S"), model.groupingConfiguration().lookbackDuration()); + Assertions.assertEquals(MatchingMethod.ALL_ENTITIES, model.groupingConfiguration().matchingMethod()); + Assertions.assertEquals(EntityMappingType.FILE, model.groupingConfiguration().groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.SEVERITY, model.groupingConfiguration().groupByAlertDetails().get(0)); + Assertions.assertEquals("gxqquezik", model.groupingConfiguration().groupByCustomDetails().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResponseInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResponseInnerTests.java index 1a31afb98b49..54c10d13be1d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResponseInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResponseInnerTests.java @@ -1,38 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.IncidentEntitiesResponseInner; -import com.azure.resourcemanager.securityinsights.models.Entity; import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; -import com.azure.resourcemanager.securityinsights.models.IncidentEntitiesResultsMetadata; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class IncidentEntitiesResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentEntitiesResponseInner model = BinaryData.fromString( - "{\"entities\":[{\"kind\":\"Entity\",\"id\":\"elsfeaen\",\"name\":\"abfatkl\",\"type\":\"dxbjhwuaanozj\"},{\"kind\":\"Entity\",\"id\":\"ph\",\"name\":\"oulpjrv\",\"type\":\"ag\"}],\"metaData\":[{\"count\":1902797615,\"entityKind\":\"RegistryValue\"},{\"count\":1837530813,\"entityKind\":\"AzureResource\"}]}") + "{\"entities\":[{\"kind\":\"Entity\",\"id\":\"sllywpvtio\",\"name\":\"zbpdbo\",\"type\":\"lgry\"},{\"kind\":\"Entity\",\"id\":\"iuas\",\"name\":\"growsoc\",\"type\":\"equygdjboqgrmtq\"},{\"kind\":\"Entity\",\"id\":\"qevadrmmw\",\"name\":\"uawvcmjzk\",\"type\":\"iidisczskoswoqiq\"}],\"metaData\":[{\"entityKind\":\"Bookmark\",\"count\":362948209}]}") .toObject(IncidentEntitiesResponseInner.class); - Assertions.assertEquals(1902797615, model.metadata().get(0).count()); - Assertions.assertEquals(EntityKindEnum.REGISTRY_VALUE, model.metadata().get(0).entityKind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncidentEntitiesResponseInner model - = new IncidentEntitiesResponseInner().withEntities(Arrays.asList(new Entity(), new Entity())) - .withMetadata(Arrays.asList( - new IncidentEntitiesResultsMetadata().withCount(1902797615) - .withEntityKind(EntityKindEnum.REGISTRY_VALUE), - new IncidentEntitiesResultsMetadata().withCount(1837530813) - .withEntityKind(EntityKindEnum.AZURE_RESOURCE))); - model = BinaryData.fromObject(model).toObject(IncidentEntitiesResponseInner.class); - Assertions.assertEquals(1902797615, model.metadata().get(0).count()); - Assertions.assertEquals(EntityKindEnum.REGISTRY_VALUE, model.metadata().get(0).entityKind()); + Assertions.assertEquals(EntityKindEnum.BOOKMARK, model.metadata().get(0).entityKind()); + Assertions.assertEquals(362948209, model.metadata().get(0).count()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResultsMetadataTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResultsMetadataTests.java index 1d0d29e8e276..ef2cba1933bb 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResultsMetadataTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentEntitiesResultsMetadataTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,18 +13,9 @@ public final class IncidentEntitiesResultsMetadataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentEntitiesResultsMetadata model - = BinaryData.fromString("{\"count\":1410903229,\"entityKind\":\"Bookmark\"}") + = BinaryData.fromString("{\"entityKind\":\"Account\",\"count\":1982738288}") .toObject(IncidentEntitiesResultsMetadata.class); - Assertions.assertEquals(1410903229, model.count()); - Assertions.assertEquals(EntityKindEnum.BOOKMARK, model.entityKind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncidentEntitiesResultsMetadata model - = new IncidentEntitiesResultsMetadata().withCount(1410903229).withEntityKind(EntityKindEnum.BOOKMARK); - model = BinaryData.fromObject(model).toObject(IncidentEntitiesResultsMetadata.class); - Assertions.assertEquals(1410903229, model.count()); - Assertions.assertEquals(EntityKindEnum.BOOKMARK, model.entityKind()); + Assertions.assertEquals(EntityKindEnum.ACCOUNT, model.entityKind()); + Assertions.assertEquals(1982738288, model.count()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInfoTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInfoTests.java index d0facbe005c3..cf83701df0e9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInfoTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,26 +12,25 @@ public final class IncidentInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - IncidentInfo model = BinaryData - .fromString( - "{\"incidentId\":\"pphrcgynco\",\"severity\":\"Medium\",\"title\":\"fvm\",\"relationName\":\"oo\"}") + IncidentInfo model = BinaryData.fromString( + "{\"incidentId\":\"ohkpigqfu\",\"severity\":\"Low\",\"title\":\"zmkw\",\"relationName\":\"snoxaxmqeqa\"}") .toObject(IncidentInfo.class); - Assertions.assertEquals("pphrcgynco", model.incidentId()); - Assertions.assertEquals(IncidentSeverity.MEDIUM, model.severity()); - Assertions.assertEquals("fvm", model.title()); - Assertions.assertEquals("oo", model.relationName()); + Assertions.assertEquals("ohkpigqfu", model.incidentId()); + Assertions.assertEquals(IncidentSeverity.LOW, model.severity()); + Assertions.assertEquals("zmkw", model.title()); + Assertions.assertEquals("snoxaxmqeqa", model.relationName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentInfo model = new IncidentInfo().withIncidentId("pphrcgynco") - .withSeverity(IncidentSeverity.MEDIUM) - .withTitle("fvm") - .withRelationName("oo"); + IncidentInfo model = new IncidentInfo().withIncidentId("ohkpigqfu") + .withSeverity(IncidentSeverity.LOW) + .withTitle("zmkw") + .withRelationName("snoxaxmqeqa"); model = BinaryData.fromObject(model).toObject(IncidentInfo.class); - Assertions.assertEquals("pphrcgynco", model.incidentId()); - Assertions.assertEquals(IncidentSeverity.MEDIUM, model.severity()); - Assertions.assertEquals("fvm", model.title()); - Assertions.assertEquals("oo", model.relationName()); + Assertions.assertEquals("ohkpigqfu", model.incidentId()); + Assertions.assertEquals(IncidentSeverity.LOW, model.severity()); + Assertions.assertEquals("zmkw", model.title()); + Assertions.assertEquals("snoxaxmqeqa", model.relationName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInnerTests.java index 94594dd5adc9..a790d3eeea69 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,69 +13,71 @@ import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import com.azure.resourcemanager.securityinsights.models.IncidentStatus; import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class IncidentInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentInner model = BinaryData.fromString( - "{\"properties\":{\"additionalData\":{\"alertsCount\":1288949880,\"bookmarksCount\":38028181,\"commentsCount\":1859867828,\"alertProductNames\":[\"agalpbuxwgipwhon\",\"wkgshwa\",\"kix\",\"bin\"],\"tactics\":[\"PreAttack\"]},\"classification\":\"TruePositive\",\"classificationComment\":\"rywn\",\"classificationReason\":\"InaccurateData\",\"createdTimeUtc\":\"2021-04-28T10:57:32Z\",\"description\":\"iyqzrnk\",\"firstActivityTimeUtc\":\"2021-04-18T03:15:34Z\",\"incidentUrl\":\"xlwhzlsicoh\",\"incidentNumber\":1969001145,\"labels\":[{\"labelName\":\"vlryavwhheunmmq\",\"labelType\":\"User\"}],\"lastActivityTimeUtc\":\"2021-05-31T23:19:13Z\",\"lastModifiedTimeUtc\":\"2021-09-15T07:07:36Z\",\"owner\":{\"email\":\"cukoklyaxuconu\",\"assignedTo\":\"zf\",\"objectId\":\"7669d900-4798-41a9-8c99-3dc89eac8fa5\",\"userPrincipalName\":\"ypewrmjmwvvjekt\",\"ownerType\":\"User\"},\"relatedAnalyticRuleIds\":[\"hwlrsf\",\"rzpwvlqdqgbiq\",\"lihkaetcktvfc\",\"vf\"],\"severity\":\"Informational\",\"status\":\"Closed\",\"title\":\"ymuctqhjfbebrj\"},\"etag\":\"erfuwuttt\",\"id\":\"vjrbirphxepcyvah\",\"name\":\"nljky\",\"type\":\"xjvuujqgidokg\"}") + "{\"properties\":{\"title\":\"pwbralllibphbqz\",\"description\":\"zakakankjpdn\",\"severity\":\"Informational\",\"status\":\"Active\",\"classification\":\"TruePositive\",\"classificationReason\":\"SuspiciousButExpected\",\"classificationComment\":\"hjlmu\",\"owner\":{\"email\":\"primr\",\"assignedTo\":\"pteecjme\",\"objectId\":\"ls\",\"userPrincipalName\":\"asylwx\",\"ownerType\":\"Unknown\"},\"labels\":[{\"labelName\":\"weoohguufuzboyj\",\"labelType\":\"User\"},{\"labelName\":\"wtzolbaemwmdxmeb\",\"labelType\":\"AutoAssigned\"}],\"firstActivityTimeUtc\":\"2021-10-27T12:40:12Z\",\"lastActivityTimeUtc\":\"2021-02-25T11:43:19Z\",\"lastModifiedTimeUtc\":\"2021-02-27T02:34:35Z\",\"createdTimeUtc\":\"2021-02-11T19:19:05Z\",\"incidentNumber\":125446577,\"additionalData\":{\"alertsCount\":1992463367,\"bookmarksCount\":180775994,\"commentsCount\":1695920381,\"alertProductNames\":[\"tibxyijddtvqctt\",\"dija\",\"ukm\"],\"tactics\":[\"DefenseEvasion\",\"Execution\",\"Execution\"],\"techniques\":[\"dzaapmudqme\",\"wig\",\"ibudqwy\"],\"providerIncidentUrl\":\"beybpmzznrtffyaq\",\"mergedIncidentNumber\":\"mhh\",\"mergedIncidentUrl\":\"oqaqhvseufuq\"},\"relatedAnalyticRuleIds\":[\"pdlc\",\"qlsismjqfrddg\",\"mquhio\"],\"incidentUrl\":\"sjuivfcdisyir\",\"providerName\":\"zhczexrxzbujrtrh\",\"providerIncidentId\":\"wrevkhgnlnzon\",\"teamInformation\":{\"teamId\":\"piqywnc\",\"primaryChannelUrl\":\"tszcofizehtdhgb\",\"teamCreationTimeUtc\":\"2020-12-26T18:59:24Z\",\"name\":\"eljeamurvzmlovua\",\"description\":\"shcxlpmjerbdk\"}},\"etag\":\"vidizozsdb\",\"id\":\"xjmonf\",\"name\":\"gnwncypuuwwlt\",\"type\":\"uqj\"}") .toObject(IncidentInner.class); - Assertions.assertEquals("erfuwuttt", model.etag()); - Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.classification()); - Assertions.assertEquals("rywn", model.classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.INACCURATE_DATA, model.classificationReason()); - Assertions.assertEquals("iyqzrnk", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T03:15:34Z"), model.firstActivityTimeUtc()); - Assertions.assertEquals("vlryavwhheunmmq", model.labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T23:19:13Z"), model.lastActivityTimeUtc()); - Assertions.assertEquals("cukoklyaxuconu", model.owner().email()); - Assertions.assertEquals("zf", model.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("7669d900-4798-41a9-8c99-3dc89eac8fa5"), model.owner().objectId()); - Assertions.assertEquals("ypewrmjmwvvjekt", model.owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.USER, model.owner().ownerType()); + Assertions.assertEquals("vidizozsdb", model.etag()); + Assertions.assertEquals("pwbralllibphbqz", model.title()); + Assertions.assertEquals("zakakankjpdn", model.description()); Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.severity()); - Assertions.assertEquals(IncidentStatus.CLOSED, model.status()); - Assertions.assertEquals("ymuctqhjfbebrj", model.title()); + Assertions.assertEquals(IncidentStatus.ACTIVE, model.status()); + Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.classification()); + Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED, model.classificationReason()); + Assertions.assertEquals("hjlmu", model.classificationComment()); + Assertions.assertEquals("primr", model.owner().email()); + Assertions.assertEquals("pteecjme", model.owner().assignedTo()); + Assertions.assertEquals("ls", model.owner().objectId()); + Assertions.assertEquals("asylwx", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.UNKNOWN, model.owner().ownerType()); + Assertions.assertEquals("weoohguufuzboyj", model.labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-27T12:40:12Z"), model.firstActivityTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T11:43:19Z"), model.lastActivityTimeUtc()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentInner model = new IncidentInner().withEtag("erfuwuttt") - .withClassification(IncidentClassification.TRUE_POSITIVE) - .withClassificationComment("rywn") - .withClassificationReason(IncidentClassificationReason.INACCURATE_DATA) - .withDescription("iyqzrnk") - .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-04-18T03:15:34Z")) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("vlryavwhheunmmq"))) - .withLastActivityTimeUtc(OffsetDateTime.parse("2021-05-31T23:19:13Z")) - .withOwner(new IncidentOwnerInfo().withEmail("cukoklyaxuconu") - .withAssignedTo("zf") - .withObjectId(UUID.fromString("7669d900-4798-41a9-8c99-3dc89eac8fa5")) - .withUserPrincipalName("ypewrmjmwvvjekt") - .withOwnerType(OwnerType.USER)) + IncidentInner model = new IncidentInner().withEtag("vidizozsdb") + .withTitle("pwbralllibphbqz") + .withDescription("zakakankjpdn") .withSeverity(IncidentSeverity.INFORMATIONAL) - .withStatus(IncidentStatus.CLOSED) - .withTitle("ymuctqhjfbebrj"); + .withStatus(IncidentStatus.ACTIVE) + .withClassification(IncidentClassification.TRUE_POSITIVE) + .withClassificationReason(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED) + .withClassificationComment("hjlmu") + .withOwner(new IncidentOwnerInfo().withEmail("primr") + .withAssignedTo("pteecjme") + .withObjectId("ls") + .withUserPrincipalName("asylwx") + .withOwnerType(OwnerType.UNKNOWN)) + .withLabels(Arrays.asList(new IncidentLabel().withLabelName("weoohguufuzboyj"), + new IncidentLabel().withLabelName("wtzolbaemwmdxmeb"))) + .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-10-27T12:40:12Z")) + .withLastActivityTimeUtc(OffsetDateTime.parse("2021-02-25T11:43:19Z")) + .withTeamInformation(new TeamInformation()); model = BinaryData.fromObject(model).toObject(IncidentInner.class); - Assertions.assertEquals("erfuwuttt", model.etag()); - Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.classification()); - Assertions.assertEquals("rywn", model.classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.INACCURATE_DATA, model.classificationReason()); - Assertions.assertEquals("iyqzrnk", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T03:15:34Z"), model.firstActivityTimeUtc()); - Assertions.assertEquals("vlryavwhheunmmq", model.labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T23:19:13Z"), model.lastActivityTimeUtc()); - Assertions.assertEquals("cukoklyaxuconu", model.owner().email()); - Assertions.assertEquals("zf", model.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("7669d900-4798-41a9-8c99-3dc89eac8fa5"), model.owner().objectId()); - Assertions.assertEquals("ypewrmjmwvvjekt", model.owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.USER, model.owner().ownerType()); + Assertions.assertEquals("vidizozsdb", model.etag()); + Assertions.assertEquals("pwbralllibphbqz", model.title()); + Assertions.assertEquals("zakakankjpdn", model.description()); Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.severity()); - Assertions.assertEquals(IncidentStatus.CLOSED, model.status()); - Assertions.assertEquals("ymuctqhjfbebrj", model.title()); + Assertions.assertEquals(IncidentStatus.ACTIVE, model.status()); + Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.classification()); + Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED, model.classificationReason()); + Assertions.assertEquals("hjlmu", model.classificationComment()); + Assertions.assertEquals("primr", model.owner().email()); + Assertions.assertEquals("pteecjme", model.owner().assignedTo()); + Assertions.assertEquals("ls", model.owner().objectId()); + Assertions.assertEquals("asylwx", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.UNKNOWN, model.owner().ownerType()); + Assertions.assertEquals("weoohguufuzboyj", model.labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-27T12:40:12Z"), model.firstActivityTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-25T11:43:19Z"), model.lastActivityTimeUtc()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentLabelTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentLabelTests.java index 2ed9864b7c52..d570795a4850 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentLabelTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentLabelTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,15 +11,15 @@ public final class IncidentLabelTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - IncidentLabel model = BinaryData.fromString("{\"labelName\":\"ywbiexzfeyueax\",\"labelType\":\"AutoAssigned\"}") + IncidentLabel model = BinaryData.fromString("{\"labelName\":\"odhtnsirudhzm\",\"labelType\":\"User\"}") .toObject(IncidentLabel.class); - Assertions.assertEquals("ywbiexzfeyueax", model.labelName()); + Assertions.assertEquals("odhtnsirudhzm", model.labelName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentLabel model = new IncidentLabel().withLabelName("ywbiexzfeyueax"); + IncidentLabel model = new IncidentLabel().withLabelName("odhtnsirudhzm"); model = BinaryData.fromObject(model).toObject(IncidentLabel.class); - Assertions.assertEquals("ywbiexzfeyueax", model.labelName()); + Assertions.assertEquals("odhtnsirudhzm", model.labelName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentListTests.java index 822e76400fe6..a5a88303e531 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentListTests.java @@ -1,123 +1,43 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.IncidentInner; +import com.azure.resourcemanager.securityinsights.implementation.models.IncidentList; 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.IncidentList; -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.OwnerType; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class IncidentListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentList model = BinaryData.fromString( - "{\"nextLink\":\"wlbjnpgacftade\",\"value\":[{\"properties\":{\"additionalData\":{\"alertsCount\":1735591195,\"bookmarksCount\":632380018,\"commentsCount\":1715960277,\"alertProductNames\":[\"suesnzw\"],\"tactics\":[\"Discovery\",\"PreAttack\",\"Reconnaissance\"]},\"classification\":\"FalsePositive\",\"classificationComment\":\"zdmohctbqvu\",\"classificationReason\":\"SuspiciousActivity\",\"createdTimeUtc\":\"2021-10-27T15:38:07Z\",\"description\":\"nvowgujju\",\"firstActivityTimeUtc\":\"2021-04-30T19:52:02Z\",\"incidentUrl\":\"cglhslazjdyggdt\",\"incidentNumber\":1916189356,\"labels\":[{\"labelName\":\"kuofqweykhme\",\"labelType\":\"User\"}],\"lastActivityTimeUtc\":\"2021-09-26T05:32:17Z\",\"lastModifiedTimeUtc\":\"2021-10-31T01:47:04Z\",\"owner\":{\"email\":\"hybcibv\",\"assignedTo\":\"dcsi\",\"objectId\":\"d2fc2719-47b0-4e58-ab20-5bbeba5d446d\",\"userPrincipalName\":\"naamde\",\"ownerType\":\"Unknown\"},\"relatedAnalyticRuleIds\":[\"iqscjeypv\"],\"severity\":\"Informational\",\"status\":\"Closed\",\"title\":\"rkgqhcjrefo\"},\"etag\":\"mkqsleyyv\",\"id\":\"qjpkcattpngjcrc\",\"name\":\"zsqpjhvmdajvny\",\"type\":\"ounqecano\"},{\"properties\":{\"additionalData\":{\"alertsCount\":1901274446,\"bookmarksCount\":1111397810,\"commentsCount\":2101228547,\"alertProductNames\":[\"pmopjmc\",\"atuokthfuiu\"],\"tactics\":[\"PreAttack\",\"ResourceDevelopment\",\"ResourceDevelopment\",\"LateralMovement\"]},\"classification\":\"TruePositive\",\"classificationComment\":\"odpuozmyzydag\",\"classificationReason\":\"IncorrectAlertLogic\",\"createdTimeUtc\":\"2021-09-10T01:22:25Z\",\"description\":\"zyiuokk\",\"firstActivityTimeUtc\":\"2021-06-08T13:35Z\",\"incidentUrl\":\"dxwzywqsmbsurexi\",\"incidentNumber\":1115871957,\"labels\":[{\"labelName\":\"cfsf\",\"labelType\":\"User\"}],\"lastActivityTimeUtc\":\"2021-06-13T04:15:30Z\",\"lastModifiedTimeUtc\":\"2021-01-31T18:49:05Z\",\"owner\":{\"email\":\"kiiuxhqyudxor\",\"assignedTo\":\"nbpoczvyifqrvkdv\",\"objectId\":\"c324685a-e2ec-4755-b92c-abc7b59b2d2e\",\"userPrincipalName\":\"lrmv\",\"ownerType\":\"Group\"},\"relatedAnalyticRuleIds\":[\"t\",\"pnpulexxbczwtru\"],\"severity\":\"Medium\",\"status\":\"Active\",\"title\":\"zb\"},\"etag\":\"vsovmyokac\",\"id\":\"kwlhzdo\",\"name\":\"pxjmflbvvnchr\",\"type\":\"cciw\"},{\"properties\":{\"additionalData\":{\"alertsCount\":982290440,\"bookmarksCount\":1059865036,\"commentsCount\":330822059,\"alertProductNames\":[\"iwkuofos\",\"ghsauuimjmvxied\",\"ugidyjrr\",\"byao\"],\"tactics\":[\"PrivilegeEscalation\"]},\"classification\":\"BenignPositive\",\"classificationComment\":\"npc\",\"classificationReason\":\"IncorrectAlertLogic\",\"createdTimeUtc\":\"2021-11-02T21:31:56Z\",\"description\":\"slkevle\",\"firstActivityTimeUtc\":\"2021-02-17T22:26:44Z\",\"incidentUrl\":\"buhfmvfaxkffeiit\",\"incidentNumber\":1335902799,\"labels\":[{\"labelName\":\"zy\",\"labelType\":\"AutoAssigned\"}],\"lastActivityTimeUtc\":\"2021-11-07T07:40:57Z\",\"lastModifiedTimeUtc\":\"2021-04-24T05:01:37Z\",\"owner\":{\"email\":\"zoggigrxwburvjxx\",\"assignedTo\":\"spyd\",\"objectId\":\"b81dbd7e-5aab-4fbd-93ee-17847cfd42b0\",\"userPrincipalName\":\"oenkouknvudwti\",\"ownerType\":\"Unknown\"},\"relatedAnalyticRuleIds\":[\"ngkpocipazy\"],\"severity\":\"High\",\"status\":\"Closed\",\"title\":\"gukgjnpiucgygevq\"},\"etag\":\"typmrbpizcdrqjsd\",\"id\":\"dnfyhxdeoejzicwi\",\"name\":\"sjttgzfbish\",\"type\":\"bkh\"}]}") + "{\"value\":[{\"properties\":{\"title\":\"qltfaey\",\"description\":\"nm\",\"severity\":\"High\",\"status\":\"New\",\"classification\":\"FalsePositive\",\"classificationReason\":\"InaccurateData\",\"classificationComment\":\"hriypoqeyhlqhy\",\"owner\":{\"email\":\"lpyznuciqdsmexi\",\"assignedTo\":\"dfuxtya\",\"objectId\":\"ibmi\",\"userPrincipalName\":\"nnust\",\"ownerType\":\"Unknown\"},\"labels\":[{\"labelName\":\"nmgixh\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"vmqfoud\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"cgyypro\",\"labelType\":\"AutoAssigned\"}],\"firstActivityTimeUtc\":\"2021-04-22T00:39:17Z\",\"lastActivityTimeUtc\":\"2021-05-09T02:53:19Z\",\"lastModifiedTimeUtc\":\"2021-11-30T16:56:30Z\",\"createdTimeUtc\":\"2021-03-18T00:08:35Z\",\"incidentNumber\":2095603265,\"additionalData\":{\"alertsCount\":1106032172,\"bookmarksCount\":914185865,\"commentsCount\":1134791831,\"alertProductNames\":[\"rb\"],\"tactics\":[\"Impact\"],\"techniques\":[\"tzfjltf\",\"nzcyjtotp\",\"opv\",\"bdb\"],\"providerIncidentUrl\":\"gqqihedsvqwt\",\"mergedIncidentNumber\":\"ky\",\"mergedIncidentUrl\":\"cysihs\"},\"relatedAnalyticRuleIds\":[\"wdhohsdtmcdzsu\"],\"incidentUrl\":\"ohdxbzlmcmu\",\"providerName\":\"cvhd\",\"providerIncidentId\":\"v\",\"teamInformation\":{\"teamId\":\"xeyskonqzinkfkbg\",\"primaryChannelUrl\":\"bowxe\",\"teamCreationTimeUtc\":\"2021-07-23T05:42:50Z\",\"name\":\"jmygvk\",\"description\":\"kjjeokbz\"}},\"etag\":\"ezrxcczurtleipqx\",\"id\":\"wvz\",\"name\":\"nzvdfbzdixzmq\",\"type\":\"noda\"},{\"properties\":{\"title\":\"pqhe\",\"description\":\"ptmcgsbostzelnd\",\"severity\":\"Informational\",\"status\":\"New\",\"classification\":\"BenignPositive\",\"classificationReason\":\"InaccurateData\",\"classificationComment\":\"biojlvf\",\"owner\":{\"email\":\"bpneqvcwwyyurm\",\"assignedTo\":\"hppr\",\"objectId\":\"snmokayzej\",\"userPrincipalName\":\"lbkpb\",\"ownerType\":\"User\"},\"labels\":[{\"labelName\":\"ljhah\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"chndbnwie\",\"labelType\":\"AutoAssigned\"}],\"firstActivityTimeUtc\":\"2021-05-12T12:47:52Z\",\"lastActivityTimeUtc\":\"2021-08-19T12:42:57Z\",\"lastModifiedTimeUtc\":\"2021-09-27T19:14:16Z\",\"createdTimeUtc\":\"2021-09-07T09:09:14Z\",\"incidentNumber\":1943665433,\"additionalData\":{\"alertsCount\":863156641,\"bookmarksCount\":512301047,\"commentsCount\":1697750371,\"alertProductNames\":[\"ferr\"],\"tactics\":[\"InitialAccess\"],\"techniques\":[\"mfxapjwogqqno\"],\"providerIncidentUrl\":\"udcdabtqwpwyawb\",\"mergedIncidentNumber\":\"sqbuc\",\"mergedIncidentUrl\":\"gkyexaoguy\"},\"relatedAnalyticRuleIds\":[\"ids\"],\"incidentUrl\":\"ultxijjumfq\",\"providerName\":\"z\",\"providerIncidentId\":\"qnmcjngzqdqx\",\"teamInformation\":{\"teamId\":\"wgnyfusfzsvtui\",\"primaryChannelUrl\":\"hajqglcfh\",\"teamCreationTimeUtc\":\"2021-09-21T22:27:05Z\",\"name\":\"ryxynqnzrd\",\"description\":\"ovw\"}},\"etag\":\"nptgoeiybba\",\"id\":\"fhvfsl\",\"name\":\"vntjlrigjk\",\"type\":\"kyrioovzid\"},{\"properties\":{\"title\":\"waabzmifrygzn\",\"description\":\"axri\",\"severity\":\"Informational\",\"status\":\"Closed\",\"classification\":\"BenignPositive\",\"classificationReason\":\"InaccurateData\",\"classificationComment\":\"xlhslnel\",\"owner\":{\"email\":\"ixynllxecwcrojp\",\"assignedTo\":\"lhc\",\"objectId\":\"jutifdwfmvigorqj\",\"userPrincipalName\":\"tzh\",\"ownerType\":\"Group\"},\"labels\":[{\"labelName\":\"afhonqj\",\"labelType\":\"User\"},{\"labelName\":\"ickpz\",\"labelType\":\"User\"}],\"firstActivityTimeUtc\":\"2021-07-11T18:22:38Z\",\"lastActivityTimeUtc\":\"2021-01-08T03:31:12Z\",\"lastModifiedTimeUtc\":\"2021-06-08T11:40:30Z\",\"createdTimeUtc\":\"2021-11-11T18:51:25Z\",\"incidentNumber\":1537591049,\"additionalData\":{\"alertsCount\":128430456,\"bookmarksCount\":1889348640,\"commentsCount\":1429091024,\"alertProductNames\":[\"lfmk\",\"scazuawxtzxpu\"],\"tactics\":[\"CommandAndControl\",\"Exfiltration\",\"Discovery\",\"Persistence\"],\"techniques\":[\"xcushs\",\"haivm\",\"yasflvgsgzwy\",\"akoi\"],\"providerIncidentUrl\":\"nsmjbl\",\"mergedIncidentNumber\":\"jhlnymzotqyryu\",\"mergedIncidentUrl\":\"bmqqvxmvw\"},\"relatedAnalyticRuleIds\":[\"ayxonsupeujl\"],\"incidentUrl\":\"nh\",\"providerName\":\"sqltnzo\",\"providerIncidentId\":\"gsxgnxfyqon\",\"teamInformation\":{\"teamId\":\"ox\",\"primaryChannelUrl\":\"o\",\"teamCreationTimeUtc\":\"2021-11-26T14:45:43Z\",\"name\":\"iqxeiiqbimht\",\"description\":\"winhehfqpo\"}},\"etag\":\"wbcb\",\"id\":\"mbnkb\",\"name\":\"vqvxk\",\"type\":\"ivqiheb\"}],\"nextLink\":\"swbzuwfmdurage\"}") .toObject(IncidentList.class); - Assertions.assertEquals("mkqsleyyv", model.value().get(0).etag()); + Assertions.assertEquals("ezrxcczurtleipqx", model.value().get(0).etag()); + Assertions.assertEquals("qltfaey", model.value().get(0).title()); + Assertions.assertEquals("nm", model.value().get(0).description()); + Assertions.assertEquals(IncidentSeverity.HIGH, model.value().get(0).severity()); + Assertions.assertEquals(IncidentStatus.NEW, model.value().get(0).status()); Assertions.assertEquals(IncidentClassification.FALSE_POSITIVE, model.value().get(0).classification()); - Assertions.assertEquals("zdmohctbqvu", model.value().get(0).classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_ACTIVITY, + Assertions.assertEquals(IncidentClassificationReason.INACCURATE_DATA, model.value().get(0).classificationReason()); - Assertions.assertEquals("nvowgujju", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T19:52:02Z"), - model.value().get(0).firstActivityTimeUtc()); - Assertions.assertEquals("kuofqweykhme", model.value().get(0).labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T05:32:17Z"), - model.value().get(0).lastActivityTimeUtc()); - Assertions.assertEquals("hybcibv", model.value().get(0).owner().email()); - Assertions.assertEquals("dcsi", model.value().get(0).owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("d2fc2719-47b0-4e58-ab20-5bbeba5d446d"), - model.value().get(0).owner().objectId()); - Assertions.assertEquals("naamde", model.value().get(0).owner().userPrincipalName()); + Assertions.assertEquals("hriypoqeyhlqhy", model.value().get(0).classificationComment()); + Assertions.assertEquals("lpyznuciqdsmexi", model.value().get(0).owner().email()); + Assertions.assertEquals("dfuxtya", model.value().get(0).owner().assignedTo()); + Assertions.assertEquals("ibmi", model.value().get(0).owner().objectId()); + Assertions.assertEquals("nnust", model.value().get(0).owner().userPrincipalName()); Assertions.assertEquals(OwnerType.UNKNOWN, model.value().get(0).owner().ownerType()); - Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.value().get(0).severity()); - Assertions.assertEquals(IncidentStatus.CLOSED, model.value().get(0).status()); - Assertions.assertEquals("rkgqhcjrefo", model.value().get(0).title()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IncidentList model = new IncidentList().withValue(Arrays.asList( - new IncidentInner().withEtag("mkqsleyyv") - .withClassification(IncidentClassification.FALSE_POSITIVE) - .withClassificationComment("zdmohctbqvu") - .withClassificationReason(IncidentClassificationReason.SUSPICIOUS_ACTIVITY) - .withDescription("nvowgujju") - .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-04-30T19:52:02Z")) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("kuofqweykhme"))) - .withLastActivityTimeUtc(OffsetDateTime.parse("2021-09-26T05:32:17Z")) - .withOwner(new IncidentOwnerInfo().withEmail("hybcibv") - .withAssignedTo("dcsi") - .withObjectId(UUID.fromString("d2fc2719-47b0-4e58-ab20-5bbeba5d446d")) - .withUserPrincipalName("naamde") - .withOwnerType(OwnerType.UNKNOWN)) - .withSeverity(IncidentSeverity.INFORMATIONAL) - .withStatus(IncidentStatus.CLOSED) - .withTitle("rkgqhcjrefo"), - new IncidentInner().withEtag("vsovmyokac") - .withClassification(IncidentClassification.TRUE_POSITIVE) - .withClassificationComment("odpuozmyzydag") - .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) - .withDescription("zyiuokk") - .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-06-08T13:35Z")) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("cfsf"))) - .withLastActivityTimeUtc(OffsetDateTime.parse("2021-06-13T04:15:30Z")) - .withOwner(new IncidentOwnerInfo().withEmail("kiiuxhqyudxor") - .withAssignedTo("nbpoczvyifqrvkdv") - .withObjectId(UUID.fromString("c324685a-e2ec-4755-b92c-abc7b59b2d2e")) - .withUserPrincipalName("lrmv") - .withOwnerType(OwnerType.GROUP)) - .withSeverity(IncidentSeverity.MEDIUM) - .withStatus(IncidentStatus.ACTIVE) - .withTitle("zb"), - new IncidentInner().withEtag("typmrbpizcdrqjsd") - .withClassification(IncidentClassification.BENIGN_POSITIVE) - .withClassificationComment("npc") - .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) - .withDescription("slkevle") - .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-02-17T22:26:44Z")) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("zy"))) - .withLastActivityTimeUtc(OffsetDateTime.parse("2021-11-07T07:40:57Z")) - .withOwner(new IncidentOwnerInfo().withEmail("zoggigrxwburvjxx") - .withAssignedTo("spyd") - .withObjectId(UUID.fromString("b81dbd7e-5aab-4fbd-93ee-17847cfd42b0")) - .withUserPrincipalName("oenkouknvudwti") - .withOwnerType(OwnerType.UNKNOWN)) - .withSeverity(IncidentSeverity.HIGH) - .withStatus(IncidentStatus.CLOSED) - .withTitle("gukgjnpiucgygevq"))); - model = BinaryData.fromObject(model).toObject(IncidentList.class); - Assertions.assertEquals("mkqsleyyv", model.value().get(0).etag()); - Assertions.assertEquals(IncidentClassification.FALSE_POSITIVE, model.value().get(0).classification()); - Assertions.assertEquals("zdmohctbqvu", model.value().get(0).classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_ACTIVITY, - model.value().get(0).classificationReason()); - Assertions.assertEquals("nvowgujju", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-30T19:52:02Z"), + Assertions.assertEquals("nmgixh", model.value().get(0).labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-22T00:39:17Z"), model.value().get(0).firstActivityTimeUtc()); - Assertions.assertEquals("kuofqweykhme", model.value().get(0).labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T05:32:17Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T02:53:19Z"), model.value().get(0).lastActivityTimeUtc()); - Assertions.assertEquals("hybcibv", model.value().get(0).owner().email()); - Assertions.assertEquals("dcsi", model.value().get(0).owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("d2fc2719-47b0-4e58-ab20-5bbeba5d446d"), - model.value().get(0).owner().objectId()); - Assertions.assertEquals("naamde", model.value().get(0).owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.UNKNOWN, model.value().get(0).owner().ownerType()); - Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.value().get(0).severity()); - Assertions.assertEquals(IncidentStatus.CLOSED, model.value().get(0).status()); - Assertions.assertEquals("rkgqhcjrefo", model.value().get(0).title()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentOwnerInfoTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentOwnerInfoTests.java index 00a90b358ccb..5002fb79412f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentOwnerInfoTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentOwnerInfoTests.java @@ -1,40 +1,39 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.IncidentOwnerInfo; import com.azure.resourcemanager.securityinsights.models.OwnerType; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class IncidentOwnerInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentOwnerInfo model = BinaryData.fromString( - "{\"email\":\"jwbhqwalmuz\",\"assignedTo\":\"xaepdkzjancuxr\",\"objectId\":\"bc6041b3-3f8c-4431-ad35-c5a51cd3ae8a\",\"userPrincipalName\":\"bavxbniwdjswzt\",\"ownerType\":\"Unknown\"}") + "{\"email\":\"zeexavoxtfgle\",\"assignedTo\":\"m\",\"objectId\":\"bwpypqtgsfjacb\",\"userPrincipalName\":\"hhxud\",\"ownerType\":\"Group\"}") .toObject(IncidentOwnerInfo.class); - Assertions.assertEquals("jwbhqwalmuz", model.email()); - Assertions.assertEquals("xaepdkzjancuxr", model.assignedTo()); - Assertions.assertEquals(UUID.fromString("bc6041b3-3f8c-4431-ad35-c5a51cd3ae8a"), model.objectId()); - Assertions.assertEquals("bavxbniwdjswzt", model.userPrincipalName()); - Assertions.assertEquals(OwnerType.UNKNOWN, model.ownerType()); + Assertions.assertEquals("zeexavoxtfgle", model.email()); + Assertions.assertEquals("m", model.assignedTo()); + Assertions.assertEquals("bwpypqtgsfjacb", model.objectId()); + Assertions.assertEquals("hhxud", model.userPrincipalName()); + Assertions.assertEquals(OwnerType.GROUP, model.ownerType()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentOwnerInfo model = new IncidentOwnerInfo().withEmail("jwbhqwalmuz") - .withAssignedTo("xaepdkzjancuxr") - .withObjectId(UUID.fromString("bc6041b3-3f8c-4431-ad35-c5a51cd3ae8a")) - .withUserPrincipalName("bavxbniwdjswzt") - .withOwnerType(OwnerType.UNKNOWN); + IncidentOwnerInfo model = new IncidentOwnerInfo().withEmail("zeexavoxtfgle") + .withAssignedTo("m") + .withObjectId("bwpypqtgsfjacb") + .withUserPrincipalName("hhxud") + .withOwnerType(OwnerType.GROUP); model = BinaryData.fromObject(model).toObject(IncidentOwnerInfo.class); - Assertions.assertEquals("jwbhqwalmuz", model.email()); - Assertions.assertEquals("xaepdkzjancuxr", model.assignedTo()); - Assertions.assertEquals(UUID.fromString("bc6041b3-3f8c-4431-ad35-c5a51cd3ae8a"), model.objectId()); - Assertions.assertEquals("bavxbniwdjswzt", model.userPrincipalName()); - Assertions.assertEquals(OwnerType.UNKNOWN, model.ownerType()); + Assertions.assertEquals("zeexavoxtfgle", model.email()); + Assertions.assertEquals("m", model.assignedTo()); + Assertions.assertEquals("bwpypqtgsfjacb", model.objectId()); + Assertions.assertEquals("hhxud", model.userPrincipalName()); + Assertions.assertEquals(OwnerType.GROUP, model.ownerType()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesActionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesActionTests.java index 628c40663511..0e7cea236143 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesActionTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesActionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -14,52 +14,52 @@ import com.azure.resourcemanager.securityinsights.models.IncidentStatus; import com.azure.resourcemanager.securityinsights.models.OwnerType; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class IncidentPropertiesActionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentPropertiesAction model = BinaryData.fromString( - "{\"severity\":\"Low\",\"status\":\"Closed\",\"classification\":\"FalsePositive\",\"classificationReason\":\"SuspiciousButExpected\",\"classificationComment\":\"rddga\",\"owner\":{\"email\":\"hiosrsjuiv\",\"assignedTo\":\"disyirnxz\",\"objectId\":\"1947767a-4bde-49e4-bfcc-d92753ab77d6\",\"userPrincipalName\":\"exrxzbujrtrhq\",\"ownerType\":\"Group\"},\"labels\":[{\"labelName\":\"khgn\",\"labelType\":\"AutoAssigned\"}]}") + "{\"severity\":\"Informational\",\"status\":\"Closed\",\"classification\":\"Undetermined\",\"classificationReason\":\"IncorrectAlertLogic\",\"classificationComment\":\"iymerteeammxqi\",\"owner\":{\"email\":\"kzddrtkgdojbmxva\",\"assignedTo\":\"efdeesve\",\"objectId\":\"ijpxtx\",\"userPrincipalName\":\"wprtu\",\"ownerType\":\"User\"},\"labels\":[{\"labelName\":\"ddjib\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"vit\",\"labelType\":\"User\"}]}") .toObject(IncidentPropertiesAction.class); - Assertions.assertEquals(IncidentSeverity.LOW, model.severity()); + Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.severity()); Assertions.assertEquals(IncidentStatus.CLOSED, model.status()); - Assertions.assertEquals(IncidentClassification.FALSE_POSITIVE, model.classification()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED, model.classificationReason()); - Assertions.assertEquals("rddga", model.classificationComment()); - Assertions.assertEquals("hiosrsjuiv", model.owner().email()); - Assertions.assertEquals("disyirnxz", model.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("1947767a-4bde-49e4-bfcc-d92753ab77d6"), model.owner().objectId()); - Assertions.assertEquals("exrxzbujrtrhq", model.owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.GROUP, model.owner().ownerType()); - Assertions.assertEquals("khgn", model.labels().get(0).labelName()); + Assertions.assertEquals(IncidentClassification.UNDETERMINED, model.classification()); + Assertions.assertEquals(IncidentClassificationReason.INCORRECT_ALERT_LOGIC, model.classificationReason()); + Assertions.assertEquals("iymerteeammxqi", model.classificationComment()); + Assertions.assertEquals("kzddrtkgdojbmxva", model.owner().email()); + Assertions.assertEquals("efdeesve", model.owner().assignedTo()); + Assertions.assertEquals("ijpxtx", model.owner().objectId()); + Assertions.assertEquals("wprtu", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.owner().ownerType()); + Assertions.assertEquals("ddjib", model.labels().get(0).labelName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentPropertiesAction model = new IncidentPropertiesAction().withSeverity(IncidentSeverity.LOW) + IncidentPropertiesAction model = new IncidentPropertiesAction().withSeverity(IncidentSeverity.INFORMATIONAL) .withStatus(IncidentStatus.CLOSED) - .withClassification(IncidentClassification.FALSE_POSITIVE) - .withClassificationReason(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED) - .withClassificationComment("rddga") - .withOwner(new IncidentOwnerInfo().withEmail("hiosrsjuiv") - .withAssignedTo("disyirnxz") - .withObjectId(UUID.fromString("1947767a-4bde-49e4-bfcc-d92753ab77d6")) - .withUserPrincipalName("exrxzbujrtrhq") - .withOwnerType(OwnerType.GROUP)) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("khgn"))); + .withClassification(IncidentClassification.UNDETERMINED) + .withClassificationReason(IncidentClassificationReason.INCORRECT_ALERT_LOGIC) + .withClassificationComment("iymerteeammxqi") + .withOwner(new IncidentOwnerInfo().withEmail("kzddrtkgdojbmxva") + .withAssignedTo("efdeesve") + .withObjectId("ijpxtx") + .withUserPrincipalName("wprtu") + .withOwnerType(OwnerType.USER)) + .withLabels( + Arrays.asList(new IncidentLabel().withLabelName("ddjib"), new IncidentLabel().withLabelName("vit"))); model = BinaryData.fromObject(model).toObject(IncidentPropertiesAction.class); - Assertions.assertEquals(IncidentSeverity.LOW, model.severity()); + Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, model.severity()); Assertions.assertEquals(IncidentStatus.CLOSED, model.status()); - Assertions.assertEquals(IncidentClassification.FALSE_POSITIVE, model.classification()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED, model.classificationReason()); - Assertions.assertEquals("rddga", model.classificationComment()); - Assertions.assertEquals("hiosrsjuiv", model.owner().email()); - Assertions.assertEquals("disyirnxz", model.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("1947767a-4bde-49e4-bfcc-d92753ab77d6"), model.owner().objectId()); - Assertions.assertEquals("exrxzbujrtrhq", model.owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.GROUP, model.owner().ownerType()); - Assertions.assertEquals("khgn", model.labels().get(0).labelName()); + Assertions.assertEquals(IncidentClassification.UNDETERMINED, model.classification()); + Assertions.assertEquals(IncidentClassificationReason.INCORRECT_ALERT_LOGIC, model.classificationReason()); + Assertions.assertEquals("iymerteeammxqi", model.classificationComment()); + Assertions.assertEquals("kzddrtkgdojbmxva", model.owner().email()); + Assertions.assertEquals("efdeesve", model.owner().assignedTo()); + Assertions.assertEquals("ijpxtx", model.owner().objectId()); + Assertions.assertEquals("wprtu", model.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.USER, model.owner().ownerType()); + Assertions.assertEquals("ddjib", model.labels().get(0).labelName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesTests.java index bf9ce90e12e1..396854296695 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,68 +13,68 @@ import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import com.azure.resourcemanager.securityinsights.models.IncidentStatus; import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class IncidentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IncidentProperties model = BinaryData.fromString( - "{\"additionalData\":{\"alertsCount\":1108075171,\"bookmarksCount\":1125977089,\"commentsCount\":649555961,\"alertProductNames\":[\"tbgsncghkj\",\"szzhbijhtxfvgxbf\",\"mxnehmp\"],\"tactics\":[\"Exfiltration\",\"InhibitResponseFunction\"]},\"classification\":\"FalsePositive\",\"classificationComment\":\"bfqkkr\",\"classificationReason\":\"InaccurateData\",\"createdTimeUtc\":\"2021-12-04T19:14:26Z\",\"description\":\"riwflzlfb\",\"firstActivityTimeUtc\":\"2021-09-10T17:06:39Z\",\"incidentUrl\":\"zycispn\",\"incidentNumber\":2071345899,\"labels\":[{\"labelName\":\"gkbrpyyd\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"nuqqkpikadrgvt\",\"labelType\":\"User\"},{\"labelName\":\"n\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"nhijggmebfsi\",\"labelType\":\"User\"}],\"lastActivityTimeUtc\":\"2021-08-14T22:49:32Z\",\"lastModifiedTimeUtc\":\"2021-02-21T10:02:12Z\",\"owner\":{\"email\":\"azzmhjrunmpxt\",\"assignedTo\":\"bh\",\"objectId\":\"e3195add-7d60-43aa-a6de-88b3cdeb1276\",\"userPrincipalName\":\"l\",\"ownerType\":\"Group\"},\"relatedAnalyticRuleIds\":[\"yskpbhen\",\"tkcxywnytnrsy\",\"lqidyby\",\"czfc\"],\"severity\":\"Low\",\"status\":\"Active\",\"title\":\"axdbabph\"}") + "{\"title\":\"tzenk\",\"description\":\"fzzhmkdasv\",\"severity\":\"High\",\"status\":\"Closed\",\"classification\":\"TruePositive\",\"classificationReason\":\"SuspiciousActivity\",\"classificationComment\":\"dchxgsrboldfor\",\"owner\":{\"email\":\"jlvizbfhfovva\",\"assignedTo\":\"pbt\",\"objectId\":\"dxe\",\"userPrincipalName\":\"abbelawumuaslzk\",\"ownerType\":\"Group\"},\"labels\":[{\"labelName\":\"ycqucwyh\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"omd\",\"labelType\":\"AutoAssigned\"}],\"firstActivityTimeUtc\":\"2021-10-21T16:39:12Z\",\"lastActivityTimeUtc\":\"2021-01-06T20:17:19Z\",\"lastModifiedTimeUtc\":\"2021-09-25T08:53:52Z\",\"createdTimeUtc\":\"2021-10-12T03:57:45Z\",\"incidentNumber\":2057925756,\"additionalData\":{\"alertsCount\":1702145471,\"bookmarksCount\":1783251204,\"commentsCount\":1618607662,\"alertProductNames\":[\"alniexzsrzp\",\"epqtybb\"],\"tactics\":[\"Persistence\",\"Discovery\",\"PrivilegeEscalation\"],\"techniques\":[\"hzyvlixqnrkcx\",\"jibnxmysu\",\"swqrntvlwijp\"],\"providerIncidentUrl\":\"texoqqpwc\",\"mergedIncidentNumber\":\"ufmhrunc\",\"mergedIncidentUrl\":\"mqspkcdqzhlctdd\"},\"relatedAnalyticRuleIds\":[\"ndy\"],\"incidentUrl\":\"chrqb\",\"providerName\":\"jrcg\",\"providerIncidentId\":\"ydcwboxjumv\",\"teamInformation\":{\"teamId\":\"lihrraiouaubr\",\"primaryChannelUrl\":\"loqxfuojrngif\",\"teamCreationTimeUtc\":\"2021-02-08T21:27:43Z\",\"name\":\"asccbiui\",\"description\":\"dlyjdf\"}}") .toObject(IncidentProperties.class); - Assertions.assertEquals(IncidentClassification.FALSE_POSITIVE, model.classification()); - Assertions.assertEquals("bfqkkr", model.classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.INACCURATE_DATA, model.classificationReason()); - Assertions.assertEquals("riwflzlfb", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-10T17:06:39Z"), model.firstActivityTimeUtc()); - Assertions.assertEquals("gkbrpyyd", model.labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T22:49:32Z"), model.lastActivityTimeUtc()); - Assertions.assertEquals("azzmhjrunmpxt", model.owner().email()); - Assertions.assertEquals("bh", model.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("e3195add-7d60-43aa-a6de-88b3cdeb1276"), model.owner().objectId()); - Assertions.assertEquals("l", model.owner().userPrincipalName()); + Assertions.assertEquals("tzenk", model.title()); + Assertions.assertEquals("fzzhmkdasv", model.description()); + Assertions.assertEquals(IncidentSeverity.HIGH, model.severity()); + Assertions.assertEquals(IncidentStatus.CLOSED, model.status()); + Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.classification()); + Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_ACTIVITY, model.classificationReason()); + Assertions.assertEquals("dchxgsrboldfor", model.classificationComment()); + Assertions.assertEquals("jlvizbfhfovva", model.owner().email()); + Assertions.assertEquals("pbt", model.owner().assignedTo()); + Assertions.assertEquals("dxe", model.owner().objectId()); + Assertions.assertEquals("abbelawumuaslzk", model.owner().userPrincipalName()); Assertions.assertEquals(OwnerType.GROUP, model.owner().ownerType()); - Assertions.assertEquals(IncidentSeverity.LOW, model.severity()); - Assertions.assertEquals(IncidentStatus.ACTIVE, model.status()); - Assertions.assertEquals("axdbabph", model.title()); + Assertions.assertEquals("ycqucwyh", model.labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T16:39:12Z"), model.firstActivityTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T20:17:19Z"), model.lastActivityTimeUtc()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IncidentProperties model = new IncidentProperties().withClassification(IncidentClassification.FALSE_POSITIVE) - .withClassificationComment("bfqkkr") - .withClassificationReason(IncidentClassificationReason.INACCURATE_DATA) - .withDescription("riwflzlfb") - .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-09-10T17:06:39Z")) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("gkbrpyyd"), - new IncidentLabel().withLabelName("nuqqkpikadrgvt"), new IncidentLabel().withLabelName("n"), - new IncidentLabel().withLabelName("nhijggmebfsi"))) - .withLastActivityTimeUtc(OffsetDateTime.parse("2021-08-14T22:49:32Z")) - .withOwner(new IncidentOwnerInfo().withEmail("azzmhjrunmpxt") - .withAssignedTo("bh") - .withObjectId(UUID.fromString("e3195add-7d60-43aa-a6de-88b3cdeb1276")) - .withUserPrincipalName("l") + IncidentProperties model = new IncidentProperties().withTitle("tzenk") + .withDescription("fzzhmkdasv") + .withSeverity(IncidentSeverity.HIGH) + .withStatus(IncidentStatus.CLOSED) + .withClassification(IncidentClassification.TRUE_POSITIVE) + .withClassificationReason(IncidentClassificationReason.SUSPICIOUS_ACTIVITY) + .withClassificationComment("dchxgsrboldfor") + .withOwner(new IncidentOwnerInfo().withEmail("jlvizbfhfovva") + .withAssignedTo("pbt") + .withObjectId("dxe") + .withUserPrincipalName("abbelawumuaslzk") .withOwnerType(OwnerType.GROUP)) - .withSeverity(IncidentSeverity.LOW) - .withStatus(IncidentStatus.ACTIVE) - .withTitle("axdbabph"); + .withLabels( + Arrays.asList(new IncidentLabel().withLabelName("ycqucwyh"), new IncidentLabel().withLabelName("omd"))) + .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-10-21T16:39:12Z")) + .withLastActivityTimeUtc(OffsetDateTime.parse("2021-01-06T20:17:19Z")) + .withTeamInformation(new TeamInformation()); model = BinaryData.fromObject(model).toObject(IncidentProperties.class); - Assertions.assertEquals(IncidentClassification.FALSE_POSITIVE, model.classification()); - Assertions.assertEquals("bfqkkr", model.classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.INACCURATE_DATA, model.classificationReason()); - Assertions.assertEquals("riwflzlfb", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-10T17:06:39Z"), model.firstActivityTimeUtc()); - Assertions.assertEquals("gkbrpyyd", model.labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T22:49:32Z"), model.lastActivityTimeUtc()); - Assertions.assertEquals("azzmhjrunmpxt", model.owner().email()); - Assertions.assertEquals("bh", model.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("e3195add-7d60-43aa-a6de-88b3cdeb1276"), model.owner().objectId()); - Assertions.assertEquals("l", model.owner().userPrincipalName()); + Assertions.assertEquals("tzenk", model.title()); + Assertions.assertEquals("fzzhmkdasv", model.description()); + Assertions.assertEquals(IncidentSeverity.HIGH, model.severity()); + Assertions.assertEquals(IncidentStatus.CLOSED, model.status()); + Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, model.classification()); + Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_ACTIVITY, model.classificationReason()); + Assertions.assertEquals("dchxgsrboldfor", model.classificationComment()); + Assertions.assertEquals("jlvizbfhfovva", model.owner().email()); + Assertions.assertEquals("pbt", model.owner().assignedTo()); + Assertions.assertEquals("dxe", model.owner().objectId()); + Assertions.assertEquals("abbelawumuaslzk", model.owner().userPrincipalName()); Assertions.assertEquals(OwnerType.GROUP, model.owner().ownerType()); - Assertions.assertEquals(IncidentSeverity.LOW, model.severity()); - Assertions.assertEquals(IncidentStatus.ACTIVE, model.status()); - Assertions.assertEquals("axdbabph", model.title()); + Assertions.assertEquals("ycqucwyh", model.labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T16:39:12Z"), model.firstActivityTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-06T20:17:19Z"), model.lastActivityTimeUtc()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java index a8706841265d..96c7d3955934 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; import com.azure.resourcemanager.securityinsights.models.Relation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -21,23 +22,22 @@ public final class IncidentRelationsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"relatedResourceId\":\"vdyznf\",\"relatedResourceName\":\"svkskmqoz\",\"relatedResourceType\":\"ivyhjrliizjixlqf\",\"relatedResourceKind\":\"fkwa\"},\"etag\":\"olro\",\"id\":\"qlmgnlqxsjxt\",\"name\":\"lexhv\",\"type\":\"qbozoolzqoc\"}"; + = "{\"properties\":{\"relatedResourceId\":\"defmebpalzpy\",\"relatedResourceName\":\"gwmrzrhcf\",\"relatedResourceType\":\"vmptnrzilvc\",\"relatedResourceKind\":\"dazw\"},\"etag\":\"goravovqpn\",\"id\":\"ufvggv\",\"name\":\"gmezf\",\"type\":\"elfxlbkbhjdkqf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Relation response = manager.incidentRelations() - .define("ezxlhdjzqdca") - .withExistingIncident("t", "azyqbxyxoyfp", "qqi") - .withEtag("ibuyvpirf") - .withRelatedResourceId("vpsozjiihjri") - .create(); + .createOrUpdateWithResponse("askrgoo", "fhpyuegdynydd", "jlizlzxh", "cuglgmfznholaf", + new RelationInner().withEtag("elxrfnp").withRelatedResourceId("jwawlkqmznk"), + com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("olro", response.etag()); - Assertions.assertEquals("vdyznf", response.relatedResourceId()); + Assertions.assertEquals("goravovqpn", response.etag()); + Assertions.assertEquals("defmebpalzpy", response.relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java index 23c84cdc9e9e..47775de82b72 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,11 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.incidentRelations() - .deleteWithResponse("uww", "pphefsbzx", "bzxomeik", "clwzacnmwpfsu", com.azure.core.util.Context.NONE); + .deleteWithResponse("zgyzjtmakh", "atynkihbfixybtow", "zoopzaenlzjx", "tgduwun", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetWithResponseMockTests.java index e013626a2a0d..19b89e1cf488 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.Relation; @@ -21,20 +21,20 @@ public final class IncidentRelationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"relatedResourceId\":\"srziuct\",\"relatedResourceName\":\"gbdsuifrev\",\"relatedResourceType\":\"apezkiswqjmdghs\",\"relatedResourceKind\":\"arybjufptbjc\"},\"etag\":\"nciuiyqvldaswvpp\",\"id\":\"qqzlgcndhz\",\"name\":\"rr\",\"type\":\"cfsrhkhgsn\"}"; + = "{\"properties\":{\"relatedResourceId\":\"dyruo\",\"relatedResourceName\":\"dtx\",\"relatedResourceType\":\"nmjimgg\",\"relatedResourceKind\":\"qgpldrn\"},\"etag\":\"hdb\",\"id\":\"bmsbetzufkvx\",\"name\":\"rbddrtngdctmjz\",\"type\":\"zaeuujgvheqzlqe\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Relation response = manager.incidentRelations() - .getWithResponse("ri", "fohyk", "kxbbcbrwjiutgnj", "zbeewoiymrvzbju", com.azure.core.util.Context.NONE) + .getWithResponse("jrmk", "sxym", "bfduaw", "krhhjyahrmuw", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("nciuiyqvldaswvpp", response.etag()); - Assertions.assertEquals("srziuct", response.relatedResourceId()); + Assertions.assertEquals("hdb", response.etag()); + Assertions.assertEquals("dyruo", response.relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java index ac32017cb7e1..6804d82c9cb6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.Relation; @@ -22,20 +22,20 @@ public final class IncidentRelationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"wuhvaj\",\"relatedResourceName\":\"ilfemjj\",\"relatedResourceType\":\"kzwjiqullq\",\"relatedResourceKind\":\"dmvr\"},\"etag\":\"mqerndb\",\"id\":\"yeofltfnnxrkad\",\"name\":\"fynn\",\"type\":\"muii\"}]}"; + = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"wupciokdrjd\",\"relatedResourceName\":\"fnqanba\",\"relatedResourceType\":\"zpqctuplpkj\",\"relatedResourceKind\":\"qnrnzla\"},\"etag\":\"goeftrbxomaa\",\"id\":\"arf\",\"name\":\"verxelq\",\"type\":\"qze\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.incidentRelations() - .list("ke", "bgvopemt", "oqujlyegqavn", "gflqqbtnyjp", "lxdbfvabmvms", 1081151366, "aevwjcnkot", + .list("wva", "lfgvtczzvqzhtme", "iptudw", "h", "rpsjkq", 478857066, "bjuakt", com.azure.core.util.Context.NONE); - Assertions.assertEquals("mqerndb", response.iterator().next().etag()); - Assertions.assertEquals("wuhvaj", response.iterator().next().relatedResourceId()); + Assertions.assertEquals("goeftrbxomaa", response.iterator().next().etag()); + Assertions.assertEquals("wupciokdrjd", response.iterator().next().relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskInnerTests.java new file mode 100644 index 000000000000..60f839d19314 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskInnerTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskInner; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import org.junit.jupiter.api.Assertions; + +public final class IncidentTaskInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncidentTaskInner model = BinaryData.fromString( + "{\"properties\":{\"title\":\"sxxhdodp\",\"description\":\"yblvtbdmvsbyi\",\"status\":\"Completed\",\"createdTimeUtc\":\"2021-07-26T01:19:14Z\",\"lastModifiedTimeUtc\":\"2021-01-19T17:46:14Z\",\"createdBy\":{\"email\":\"kmkwjfbo\",\"name\":\"oggdusxursui\",\"objectId\":\"xcjkcoqwczsy\",\"userPrincipalName\":\"rizfwihvaang\"},\"lastModifiedBy\":{\"email\":\"hjrfdmfdvbbaex\",\"name\":\"fwtgdfkkauigvmua\",\"objectId\":\"czfedyuep\",\"userPrincipalName\":\"pl\"}},\"etag\":\"dajjvywe\",\"id\":\"fkumcfjxoky\",\"name\":\"lsyasv\",\"type\":\"nkwmygjj\"}") + .toObject(IncidentTaskInner.class); + Assertions.assertEquals("dajjvywe", model.etag()); + Assertions.assertEquals("sxxhdodp", model.title()); + Assertions.assertEquals("yblvtbdmvsbyi", model.description()); + Assertions.assertEquals(IncidentTaskStatus.COMPLETED, model.status()); + Assertions.assertEquals("kmkwjfbo", model.createdBy().email()); + Assertions.assertEquals("oggdusxursui", model.createdBy().name()); + Assertions.assertEquals("xcjkcoqwczsy", model.createdBy().objectId()); + Assertions.assertEquals("rizfwihvaang", model.createdBy().userPrincipalName()); + Assertions.assertEquals("hjrfdmfdvbbaex", model.lastModifiedBy().email()); + Assertions.assertEquals("fwtgdfkkauigvmua", model.lastModifiedBy().name()); + Assertions.assertEquals("czfedyuep", model.lastModifiedBy().objectId()); + Assertions.assertEquals("pl", model.lastModifiedBy().userPrincipalName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IncidentTaskInner model = new IncidentTaskInner().withEtag("dajjvywe") + .withTitle("sxxhdodp") + .withDescription("yblvtbdmvsbyi") + .withStatus(IncidentTaskStatus.COMPLETED) + .withCreatedBy(new ClientInfo().withEmail("kmkwjfbo") + .withName("oggdusxursui") + .withObjectId("xcjkcoqwczsy") + .withUserPrincipalName("rizfwihvaang")) + .withLastModifiedBy(new ClientInfo().withEmail("hjrfdmfdvbbaex") + .withName("fwtgdfkkauigvmua") + .withObjectId("czfedyuep") + .withUserPrincipalName("pl")); + model = BinaryData.fromObject(model).toObject(IncidentTaskInner.class); + Assertions.assertEquals("dajjvywe", model.etag()); + Assertions.assertEquals("sxxhdodp", model.title()); + Assertions.assertEquals("yblvtbdmvsbyi", model.description()); + Assertions.assertEquals(IncidentTaskStatus.COMPLETED, model.status()); + Assertions.assertEquals("kmkwjfbo", model.createdBy().email()); + Assertions.assertEquals("oggdusxursui", model.createdBy().name()); + Assertions.assertEquals("xcjkcoqwczsy", model.createdBy().objectId()); + Assertions.assertEquals("rizfwihvaang", model.createdBy().userPrincipalName()); + Assertions.assertEquals("hjrfdmfdvbbaex", model.lastModifiedBy().email()); + Assertions.assertEquals("fwtgdfkkauigvmua", model.lastModifiedBy().name()); + Assertions.assertEquals("czfedyuep", model.lastModifiedBy().objectId()); + Assertions.assertEquals("pl", model.lastModifiedBy().userPrincipalName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskListTests.java new file mode 100644 index 000000000000..747ab855ea26 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskListTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.IncidentTaskList; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import org.junit.jupiter.api.Assertions; + +public final class IncidentTaskListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncidentTaskList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"title\":\"zkca\",\"description\":\"wz\",\"status\":\"Completed\",\"createdTimeUtc\":\"2021-02-03T09:40:21Z\",\"lastModifiedTimeUtc\":\"2021-09-27T14:40:14Z\",\"createdBy\":{\"email\":\"wajnrtwzvaqkifm\",\"name\":\"wostfzkn\",\"objectId\":\"kmjqncfvdsc\",\"userPrincipalName\":\"emvwf\"},\"lastModifiedBy\":{\"email\":\"wypvndrwbgo\",\"name\":\"ggrssgwjfkain\",\"objectId\":\"uymvecvzts\",\"userPrincipalName\":\"gmusaictdscnkzzo\"}},\"etag\":\"rddclzeqozrehlb\",\"id\":\"ixbnj\",\"name\":\"qvzyuexozonyn\",\"type\":\"ameudpabcreu\"},{\"properties\":{\"title\":\"zosgyjxvcvasorm\",\"description\":\"xzv\",\"status\":\"Completed\",\"createdTimeUtc\":\"2021-11-21T10:52:11Z\",\"lastModifiedTimeUtc\":\"2021-07-25T18:14:02Z\",\"createdBy\":{\"email\":\"gbaduve\",\"name\":\"vsdqhzrtdbak\",\"objectId\":\"imzfvpp\",\"userPrincipalName\":\"qsifjmclng\"},\"lastModifiedBy\":{\"email\":\"hrkombcdta\",\"name\":\"opggorwjoqtrotp\",\"objectId\":\"lpofyrl\",\"userPrincipalName\":\"kptskwxjgvhxc\"}},\"etag\":\"mkakmkook\",\"id\":\"utmgvmuyak\",\"name\":\"lwk\",\"type\":\"fowzkroyr\"},{\"properties\":{\"title\":\"urxf\",\"description\":\"qjimejtgzjxxlfej\",\"status\":\"Completed\",\"createdTimeUtc\":\"2021-05-07T01:53:50Z\",\"lastModifiedTimeUtc\":\"2021-07-07T17:03:45Z\",\"createdBy\":{\"email\":\"yayyziv\",\"name\":\"itcdqlhchwhrk\",\"objectId\":\"l\",\"userPrincipalName\":\"fibfiplhx\"},\"lastModifiedBy\":{\"email\":\"mycjowlyey\",\"name\":\"udsqcmhnx\",\"objectId\":\"buwodmachbkv\",\"userPrincipalName\":\"pbjrmvgoqplehm\"}},\"etag\":\"kzdllczdprwnhkgq\",\"id\":\"oxsstc\",\"name\":\"vrak\",\"type\":\"rrynjcwmhly\"},{\"properties\":{\"title\":\"gnukxrkemjpe\",\"description\":\"lrlzaudgjt\",\"status\":\"New\",\"createdTimeUtc\":\"2021-03-14T20:28:06Z\",\"lastModifiedTimeUtc\":\"2021-12-07T19:55:10Z\",\"createdBy\":{\"email\":\"cddwnhczbutoucgj\",\"name\":\"rjwayhicqq\",\"objectId\":\"v\",\"userPrincipalName\":\"kslvlizedvb\"},\"lastModifiedBy\":{\"email\":\"v\",\"name\":\"rgekzyq\",\"objectId\":\"dyfhb\",\"userPrincipalName\":\"khojqttbspvk\"}},\"etag\":\"laqjsgyzstujrzx\",\"id\":\"nsfdrlduye\",\"name\":\"iiit\",\"type\":\"ugyuqwrldaxu\"}],\"nextLink\":\"qa\"}") + .toObject(IncidentTaskList.class); + Assertions.assertEquals("rddclzeqozrehlb", model.value().get(0).etag()); + Assertions.assertEquals("zkca", model.value().get(0).title()); + Assertions.assertEquals("wz", model.value().get(0).description()); + Assertions.assertEquals(IncidentTaskStatus.COMPLETED, model.value().get(0).status()); + Assertions.assertEquals("wajnrtwzvaqkifm", model.value().get(0).createdBy().email()); + Assertions.assertEquals("wostfzkn", model.value().get(0).createdBy().name()); + Assertions.assertEquals("kmjqncfvdsc", model.value().get(0).createdBy().objectId()); + Assertions.assertEquals("emvwf", model.value().get(0).createdBy().userPrincipalName()); + Assertions.assertEquals("wypvndrwbgo", model.value().get(0).lastModifiedBy().email()); + Assertions.assertEquals("ggrssgwjfkain", model.value().get(0).lastModifiedBy().name()); + Assertions.assertEquals("uymvecvzts", model.value().get(0).lastModifiedBy().objectId()); + Assertions.assertEquals("gmusaictdscnkzzo", model.value().get(0).lastModifiedBy().userPrincipalName()); + Assertions.assertEquals("qa", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskPropertiesTests.java new file mode 100644 index 000000000000..aea281f1bb0c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTaskPropertiesTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.IncidentTaskProperties; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import org.junit.jupiter.api.Assertions; + +public final class IncidentTaskPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncidentTaskProperties model = BinaryData.fromString( + "{\"title\":\"krknf\",\"description\":\"ugjqyckgtxkrdt\",\"status\":\"New\",\"createdTimeUtc\":\"2021-07-13T10:13:14Z\",\"lastModifiedTimeUtc\":\"2021-07-29T22:22:36Z\",\"createdBy\":{\"email\":\"lotcsubmzoonsv\",\"name\":\"chkxfpwhdysl\",\"objectId\":\"lglmnnkkwayqsh\",\"userPrincipalName\":\"qxridt\"},\"lastModifiedBy\":{\"email\":\"aqjmkgxqwque\",\"name\":\"ylztp\",\"objectId\":\"izevjyk\",\"userPrincipalName\":\"vezefkhkqtwqle\"}}") + .toObject(IncidentTaskProperties.class); + Assertions.assertEquals("krknf", model.title()); + Assertions.assertEquals("ugjqyckgtxkrdt", model.description()); + Assertions.assertEquals(IncidentTaskStatus.NEW, model.status()); + Assertions.assertEquals("lotcsubmzoonsv", model.createdBy().email()); + Assertions.assertEquals("chkxfpwhdysl", model.createdBy().name()); + Assertions.assertEquals("lglmnnkkwayqsh", model.createdBy().objectId()); + Assertions.assertEquals("qxridt", model.createdBy().userPrincipalName()); + Assertions.assertEquals("aqjmkgxqwque", model.lastModifiedBy().email()); + Assertions.assertEquals("ylztp", model.lastModifiedBy().name()); + Assertions.assertEquals("izevjyk", model.lastModifiedBy().objectId()); + Assertions.assertEquals("vezefkhkqtwqle", model.lastModifiedBy().userPrincipalName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IncidentTaskProperties model = new IncidentTaskProperties().withTitle("krknf") + .withDescription("ugjqyckgtxkrdt") + .withStatus(IncidentTaskStatus.NEW) + .withCreatedBy(new ClientInfo().withEmail("lotcsubmzoonsv") + .withName("chkxfpwhdysl") + .withObjectId("lglmnnkkwayqsh") + .withUserPrincipalName("qxridt")) + .withLastModifiedBy(new ClientInfo().withEmail("aqjmkgxqwque") + .withName("ylztp") + .withObjectId("izevjyk") + .withUserPrincipalName("vezefkhkqtwqle")); + model = BinaryData.fromObject(model).toObject(IncidentTaskProperties.class); + Assertions.assertEquals("krknf", model.title()); + Assertions.assertEquals("ugjqyckgtxkrdt", model.description()); + Assertions.assertEquals(IncidentTaskStatus.NEW, model.status()); + Assertions.assertEquals("lotcsubmzoonsv", model.createdBy().email()); + Assertions.assertEquals("chkxfpwhdysl", model.createdBy().name()); + Assertions.assertEquals("lglmnnkkwayqsh", model.createdBy().objectId()); + Assertions.assertEquals("qxridt", model.createdBy().userPrincipalName()); + Assertions.assertEquals("aqjmkgxqwque", model.lastModifiedBy().email()); + Assertions.assertEquals("ylztp", model.lastModifiedBy().name()); + Assertions.assertEquals("izevjyk", model.lastModifiedBy().objectId()); + Assertions.assertEquals("vezefkhkqtwqle", model.lastModifiedBy().userPrincipalName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..ed2ebe596143 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.ClientInfo; +import com.azure.resourcemanager.securityinsights.models.IncidentTask; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncidentTasksCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"title\":\"lqwkddgep\",\"description\":\"ambzfxgshaq\",\"status\":\"New\",\"createdTimeUtc\":\"2021-09-12T08:50:16Z\",\"lastModifiedTimeUtc\":\"2021-02-25T03:35:03Z\",\"createdBy\":{\"email\":\"gzmyxsoxqarjt\",\"name\":\"lllmtiyguuhylzbd\",\"objectId\":\"tdohjxfqyyu\",\"userPrincipalName\":\"ilxzn\"},\"lastModifiedBy\":{\"email\":\"ttkkicxjxueilixz\",\"name\":\"kqjrbbl\",\"objectId\":\"mxxxpnk\",\"userPrincipalName\":\"ljnkmsfsquxxqcim\"}},\"etag\":\"hvkjwriva\",\"id\":\"smrtepsybdg\",\"name\":\"foz\",\"type\":\"sfjdcokb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + IncidentTask response = manager.incidentTasks() + .define("hkpko") + .withExistingIncident("vmrnwgeajyifei", "riomjdnkn", "tlxrdepqtz") + .withTitle("o") + .withStatus(IncidentTaskStatus.COMPLETED) + .withEtag("qo") + .withDescription("nobuwhutvcdtgx") + .withCreatedBy(new ClientInfo().withEmail("zxpsrlbppjq") + .withName("cpdaoskgtalljsoa") + .withObjectId("jjklmpbgrosxfdx") + .withUserPrincipalName("b")) + .withLastModifiedBy(new ClientInfo().withEmail("bhluvdc") + .withName("uevnomzlre") + .withObjectId("dskie") + .withUserPrincipalName("aenalepta")) + .create(); + + Assertions.assertEquals("hvkjwriva", response.etag()); + Assertions.assertEquals("lqwkddgep", response.title()); + Assertions.assertEquals("ambzfxgshaq", response.description()); + Assertions.assertEquals(IncidentTaskStatus.NEW, response.status()); + Assertions.assertEquals("gzmyxsoxqarjt", response.createdBy().email()); + Assertions.assertEquals("lllmtiyguuhylzbd", response.createdBy().name()); + Assertions.assertEquals("tdohjxfqyyu", response.createdBy().objectId()); + Assertions.assertEquals("ilxzn", response.createdBy().userPrincipalName()); + Assertions.assertEquals("ttkkicxjxueilixz", response.lastModifiedBy().email()); + Assertions.assertEquals("kqjrbbl", response.lastModifiedBy().name()); + Assertions.assertEquals("mxxxpnk", response.lastModifiedBy().objectId()); + Assertions.assertEquals("ljnkmsfsquxxqcim", response.lastModifiedBy().userPrincipalName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..f7ae5091e9ba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncidentTasksDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.incidentTasks() + .deleteWithResponse("bpqghxdp", "ihfimlyxdmix", "udbiacuqouc", "fuvuslvbuj", + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java new file mode 100644 index 000000000000..6355581d0508 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.IncidentTask; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncidentTasksGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"title\":\"jckakikkkajmnvb\",\"description\":\"mnkrqdyc\",\"status\":\"New\",\"createdTimeUtc\":\"2021-03-27T03:11:33Z\",\"lastModifiedTimeUtc\":\"2021-02-07T05:27:50Z\",\"createdBy\":{\"email\":\"klqr\",\"name\":\"cg\",\"objectId\":\"adaypxeqedftkigm\",\"userPrincipalName\":\"kt\"},\"lastModifiedBy\":{\"email\":\"yvzixmusiidiv\",\"name\":\"rtzfli\",\"objectId\":\"tnoegxoqpuc\",\"userPrincipalName\":\"dytwdaiexisa\"}},\"etag\":\"giiouka\",\"id\":\"zzfgivfiy\",\"name\":\"fvwyzjsix\",\"type\":\"rvigrxmptufde\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + IncidentTask response = manager.incidentTasks() + .getWithResponse("fq", "ujtcpdtdz", "y", "gzba", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("giiouka", response.etag()); + Assertions.assertEquals("jckakikkkajmnvb", response.title()); + Assertions.assertEquals("mnkrqdyc", response.description()); + Assertions.assertEquals(IncidentTaskStatus.NEW, response.status()); + Assertions.assertEquals("klqr", response.createdBy().email()); + Assertions.assertEquals("cg", response.createdBy().name()); + Assertions.assertEquals("adaypxeqedftkigm", response.createdBy().objectId()); + Assertions.assertEquals("kt", response.createdBy().userPrincipalName()); + Assertions.assertEquals("yvzixmusiidiv", response.lastModifiedBy().email()); + Assertions.assertEquals("rtzfli", response.lastModifiedBy().name()); + Assertions.assertEquals("tnoegxoqpuc", response.lastModifiedBy().objectId()); + Assertions.assertEquals("dytwdaiexisa", response.lastModifiedBy().userPrincipalName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java new file mode 100644 index 000000000000..fb9ac8367a00 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.IncidentTask; +import com.azure.resourcemanager.securityinsights.models.IncidentTaskStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncidentTasksListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"title\":\"xw\",\"description\":\"thivapuaxosw\",\"status\":\"Completed\",\"createdTimeUtc\":\"2021-08-11T03:49:35Z\",\"lastModifiedTimeUtc\":\"2021-06-17T16:33:55Z\",\"createdBy\":{\"email\":\"gkcnpdkwerxfezl\",\"name\":\"sekvsuzyo\",\"objectId\":\"af\",\"userPrincipalName\":\"fr\"},\"lastModifiedBy\":{\"email\":\"v\",\"name\":\"pltnyyeyj\",\"objectId\":\"fpbxnretpg\",\"userPrincipalName\":\"tohruqtximrxeyz\"}},\"etag\":\"nxb\",\"id\":\"yglfyfcsbkjhoxtb\",\"name\":\"ybpefojpnix\",\"type\":\"gqjk\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.incidentTasks() + .list("pnzijpyyvecruhqy", "wdsthktsaljk", "lpgtpgxkkoy", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("nxb", response.iterator().next().etag()); + Assertions.assertEquals("xw", response.iterator().next().title()); + Assertions.assertEquals("thivapuaxosw", response.iterator().next().description()); + Assertions.assertEquals(IncidentTaskStatus.COMPLETED, response.iterator().next().status()); + Assertions.assertEquals("gkcnpdkwerxfezl", response.iterator().next().createdBy().email()); + Assertions.assertEquals("sekvsuzyo", response.iterator().next().createdBy().name()); + Assertions.assertEquals("af", response.iterator().next().createdBy().objectId()); + Assertions.assertEquals("fr", response.iterator().next().createdBy().userPrincipalName()); + Assertions.assertEquals("v", response.iterator().next().lastModifiedBy().email()); + Assertions.assertEquals("pltnyyeyj", response.iterator().next().lastModifiedBy().name()); + Assertions.assertEquals("fpbxnretpg", response.iterator().next().lastModifiedBy().objectId()); + Assertions.assertEquals("tohruqtximrxeyz", response.iterator().next().lastModifiedBy().userPrincipalName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateWithResponseMockTests.java index 3ca3d739a5e2..0565129cf0a1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.Incident; @@ -18,10 +18,10 @@ import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import com.azure.resourcemanager.securityinsights.models.IncidentStatus; import com.azure.resourcemanager.securityinsights.models.OwnerType; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.UUID; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -30,52 +30,53 @@ public final class IncidentsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"additionalData\":{\"alertsCount\":1602665053,\"bookmarksCount\":954240404,\"commentsCount\":962345519,\"alertProductNames\":[\"pgsn\",\"agnchjhgemuowaky\",\"a\"],\"tactics\":[\"PrivilegeEscalation\",\"InitialAccess\"]},\"classification\":\"TruePositive\",\"classificationComment\":\"qt\",\"classificationReason\":\"IncorrectAlertLogic\",\"createdTimeUtc\":\"2021-08-03T01:14:01Z\",\"description\":\"ssoljom\",\"firstActivityTimeUtc\":\"2021-10-11T02:19:13Z\",\"incidentUrl\":\"ycnlbvgjcodk\",\"incidentNumber\":353901873,\"labels\":[{\"labelName\":\"ytssikiz\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"fqb\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"nrgmqsorhce\",\"labelType\":\"User\"}],\"lastActivityTimeUtc\":\"2020-12-27T06:15:57Z\",\"lastModifiedTimeUtc\":\"2021-07-13T13:05:34Z\",\"owner\":{\"email\":\"cpwzv\",\"assignedTo\":\"oksqdt\",\"objectId\":\"cd02e2a2-fe01-4773-901e-98dad9b5d876\",\"userPrincipalName\":\"wxlboncqbazqicq\",\"ownerType\":\"User\"},\"relatedAnalyticRuleIds\":[\"v\"],\"severity\":\"Medium\",\"status\":\"New\",\"title\":\"janepubdpkx\"},\"etag\":\"vgxiaodetvo\",\"id\":\"xdxuwsaifmc\",\"name\":\"nosbz\",\"type\":\"ehgcvkbcknjo\"}"; + = "{\"properties\":{\"title\":\"xzqzjv\",\"description\":\"hyxlwqyou\",\"severity\":\"Low\",\"status\":\"New\",\"classification\":\"FalsePositive\",\"classificationReason\":\"SuspiciousActivity\",\"classificationComment\":\"plgmem\",\"owner\":{\"email\":\"u\",\"assignedTo\":\"jxhmkchj\",\"objectId\":\"rbbhuk\",\"userPrincipalName\":\"qhyrbeqpg\",\"ownerType\":\"Group\"},\"labels\":[{\"labelName\":\"esgnxdvgxtefvs\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"oqcezmzno\",\"labelType\":\"User\"},{\"labelName\":\"duyqb\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"za\",\"labelType\":\"User\"}],\"firstActivityTimeUtc\":\"2021-03-03T05:19:37Z\",\"lastActivityTimeUtc\":\"2021-03-29T14:21:59Z\",\"lastModifiedTimeUtc\":\"2021-04-10T19:17:37Z\",\"createdTimeUtc\":\"2021-08-24T03:39:45Z\",\"incidentNumber\":553117999,\"additionalData\":{\"alertsCount\":618900505,\"bookmarksCount\":1452202070,\"commentsCount\":1544157976,\"alertProductNames\":[\"hcxikhiihg\",\"zqheit\",\"ymip\"],\"tactics\":[\"Exfiltration\"],\"techniques\":[\"bzgugwhkw\"],\"providerIncidentUrl\":\"bqnxpohcrkmbajyu\",\"mergedIncidentNumber\":\"sbu\",\"mergedIncidentUrl\":\"pzhqeczzutxti\"},\"relatedAnalyticRuleIds\":[\"rexbarg\",\"memopypc\",\"omowucjznnowp\",\"xuuv\"],\"incidentUrl\":\"srmeg\",\"providerName\":\"wjyfkjdhlqtq\",\"providerIncidentId\":\"bwtkpjytvq\",\"teamInformation\":{\"teamId\":\"upsuyq\",\"primaryChannelUrl\":\"xnavxzpyaptex\",\"teamCreationTimeUtc\":\"2021-06-25T13:45:06Z\",\"name\":\"hew\",\"description\":\"c\"}},\"etag\":\"xczrmyniwggmi\",\"id\":\"wolfmfazxwcaic\",\"name\":\"pjttzfswohd\",\"type\":\"liikkosqpl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Incident response = manager.incidents() - .define("kzxuiz") - .withExistingWorkspace("ezax", "f") - .withEtag("bckyoikxk") - .withClassification(IncidentClassification.TRUE_POSITIVE) - .withClassificationComment("kb") - .withClassificationReason(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED) - .withDescription("bnldpvcbh") - .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-10-02T02:32:06Z")) - .withLabels(Arrays.asList(new IncidentLabel().withLabelName("brruyuuatv"), - new IncidentLabel().withLabelName("jwcolbm"))) - .withLastActivityTimeUtc(OffsetDateTime.parse("2021-01-27T11:36:33Z")) - .withOwner(new IncidentOwnerInfo().withEmail("ahprzrvxhmtfhocn") - .withAssignedTo("cmj") - .withObjectId(UUID.fromString("37c7565c-a8ce-4181-8c0b-483f7314abc3")) - .withUserPrincipalName("xnoqrxtdisn") - .withOwnerType(OwnerType.USER)) + .define("d") + .withExistingWorkspace("hrdldvxcjj", "jnpatazfyxegkly") + .withEtag("arb") + .withTitle("myoqmam") + .withDescription("cqqtqzwntnly") .withSeverity(IncidentSeverity.INFORMATIONAL) - .withStatus(IncidentStatus.NEW) - .withTitle("tjfdoesxxhmw") + .withStatus(IncidentStatus.CLOSED) + .withClassification(IncidentClassification.BENIGN_POSITIVE) + .withClassificationReason(IncidentClassificationReason.INACCURATE_DATA) + .withClassificationComment("xsucforgcufiphn") + .withOwner(new IncidentOwnerInfo().withEmail("zz") + .withAssignedTo("nybfsoayatqkdzux") + .withObjectId("dzkvbe") + .withUserPrincipalName("jsaoggd") + .withOwnerType(OwnerType.GROUP)) + .withLabels(Arrays.asList(new IncidentLabel().withLabelName("xlccjdooy"), + new IncidentLabel().withLabelName("zzogz"))) + .withFirstActivityTimeUtc(OffsetDateTime.parse("2021-06-11T09:48:52Z")) + .withLastActivityTimeUtc(OffsetDateTime.parse("2021-03-12T14:23:25Z")) + .withTeamInformation(new TeamInformation()) .create(); - Assertions.assertEquals("vgxiaodetvo", response.etag()); - Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, response.classification()); - Assertions.assertEquals("qt", response.classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.INCORRECT_ALERT_LOGIC, response.classificationReason()); - Assertions.assertEquals("ssoljom", response.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-11T02:19:13Z"), response.firstActivityTimeUtc()); - Assertions.assertEquals("ytssikiz", response.labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T06:15:57Z"), response.lastActivityTimeUtc()); - Assertions.assertEquals("cpwzv", response.owner().email()); - Assertions.assertEquals("oksqdt", response.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("cd02e2a2-fe01-4773-901e-98dad9b5d876"), response.owner().objectId()); - Assertions.assertEquals("wxlboncqbazqicq", response.owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.USER, response.owner().ownerType()); - Assertions.assertEquals(IncidentSeverity.MEDIUM, response.severity()); + Assertions.assertEquals("xczrmyniwggmi", response.etag()); + Assertions.assertEquals("xzqzjv", response.title()); + Assertions.assertEquals("hyxlwqyou", response.description()); + Assertions.assertEquals(IncidentSeverity.LOW, response.severity()); Assertions.assertEquals(IncidentStatus.NEW, response.status()); - Assertions.assertEquals("janepubdpkx", response.title()); + Assertions.assertEquals(IncidentClassification.FALSE_POSITIVE, response.classification()); + Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_ACTIVITY, response.classificationReason()); + Assertions.assertEquals("plgmem", response.classificationComment()); + Assertions.assertEquals("u", response.owner().email()); + Assertions.assertEquals("jxhmkchj", response.owner().assignedTo()); + Assertions.assertEquals("rbbhuk", response.owner().objectId()); + Assertions.assertEquals("qhyrbeqpg", response.owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.GROUP, response.owner().ownerType()); + Assertions.assertEquals("esgnxdvgxtefvs", response.labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T05:19:37Z"), response.firstActivityTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-29T14:21:59Z"), response.lastActivityTimeUtc()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteWithResponseMockTests.java index 71c138f4059e..8f49542ba20d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.incidents().deleteWithResponse("jeaoqaqbz", "yh", "w", com.azure.core.util.Context.NONE); + manager.incidents() + .deleteWithResponse("lcrzdweb", "vspknxraidjeddn", "mnzchrhc", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetWithResponseMockTests.java index 472728d9e984..b9241b98426a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.Incident; @@ -18,7 +18,6 @@ import com.azure.resourcemanager.securityinsights.models.OwnerType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import java.util.UUID; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -27,34 +26,34 @@ public final class IncidentsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"additionalData\":{\"alertsCount\":522442521,\"bookmarksCount\":1652198165,\"commentsCount\":2134025478,\"alertProductNames\":[\"i\"],\"tactics\":[\"Persistence\"]},\"classification\":\"Undetermined\",\"classificationComment\":\"gvxvatv\",\"classificationReason\":\"SuspiciousButExpected\",\"createdTimeUtc\":\"2021-01-29T22:04:49Z\",\"description\":\"nbqxvhcsyhzlwxae\",\"firstActivityTimeUtc\":\"2021-09-21T01:21:46Z\",\"incidentUrl\":\"rexdndsbd\",\"incidentNumber\":1772286524,\"labels\":[{\"labelName\":\"rzmwn\",\"labelType\":\"User\"}],\"lastActivityTimeUtc\":\"2021-06-07T19:00:04Z\",\"lastModifiedTimeUtc\":\"2021-07-05T10:58:17Z\",\"owner\":{\"email\":\"mmagoaqylkjzt\",\"assignedTo\":\"uazjcgmxitpfinz\",\"objectId\":\"7fcf1d94-b75e-4e89-8b1f-55ea51c2bba2\",\"userPrincipalName\":\"ltkrl\",\"ownerType\":\"Group\"},\"relatedAnalyticRuleIds\":[\"drvcqguef\"],\"severity\":\"Informational\",\"status\":\"New\",\"title\":\"mpheqdur\"},\"etag\":\"yujlfyoumpckyecl\",\"id\":\"igptajbrzmqxucyc\",\"name\":\"joclxiutgjcyzy\",\"type\":\"jdnrqjbt\"}"; + = "{\"properties\":{\"title\":\"ytoainignxhzqgba\",\"description\":\"qeylac\",\"severity\":\"Low\",\"status\":\"Active\",\"classification\":\"TruePositive\",\"classificationReason\":\"IncorrectAlertLogic\",\"classificationComment\":\"f\",\"owner\":{\"email\":\"wxlhyszhxoth\",\"assignedTo\":\"ifjufzlgu\",\"objectId\":\"mtghmnuzyy\",\"userPrincipalName\":\"sxyrywdezprycix\",\"ownerType\":\"Group\"},\"labels\":[{\"labelName\":\"ochpwwykfy\",\"labelType\":\"User\"},{\"labelName\":\"ztdckwqvckh\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"dm\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"cojfuvmjtxwa\",\"labelType\":\"User\"}],\"firstActivityTimeUtc\":\"2021-03-23T09:11:08Z\",\"lastActivityTimeUtc\":\"2021-07-26T01:37:21Z\",\"lastModifiedTimeUtc\":\"2021-02-05T05:47:38Z\",\"createdTimeUtc\":\"2021-04-18T21:03:13Z\",\"incidentNumber\":1997360633,\"additionalData\":{\"alertsCount\":1195023872,\"bookmarksCount\":424466126,\"commentsCount\":714142738,\"alertProductNames\":[\"aapzrkhptyhziqe\",\"ajna\",\"ta\"],\"tactics\":[\"Discovery\"],\"techniques\":[\"tdgdfecju\",\"cyrwvoohmcw\"],\"providerIncidentUrl\":\"aczypslf\",\"mergedIncidentNumber\":\"fwonbtgpeizu\",\"mergedIncidentUrl\":\"oeo\"},\"relatedAnalyticRuleIds\":[\"cjwgfhdfomsc\",\"lcfcpzajgq\",\"bfgmeqhtngrxfqwo\"],\"incidentUrl\":\"wfbllegezv\",\"providerName\":\"wii\",\"providerIncidentId\":\"sggjacmazilqgv\",\"teamInformation\":{\"teamId\":\"roqpybzykm\",\"primaryChannelUrl\":\"lwbqkmtwuaqqqtm\",\"teamCreationTimeUtc\":\"2021-02-23T12:51:42Z\",\"name\":\"c\",\"description\":\"twedllpnoeb\"}},\"etag\":\"hyiohcj\",\"id\":\"duoggx\",\"name\":\"zmy\",\"type\":\"guykrpzpmwz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Incident response = manager.incidents() - .getWithResponse("fa", "sgftipwc", "byubhiqdxyurnpn", com.azure.core.util.Context.NONE) + .getWithResponse("bebafiqxomevke", "amdvnc", "tnb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("yujlfyoumpckyecl", response.etag()); - Assertions.assertEquals(IncidentClassification.UNDETERMINED, response.classification()); - Assertions.assertEquals("gvxvatv", response.classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED, response.classificationReason()); - Assertions.assertEquals("nbqxvhcsyhzlwxae", response.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T01:21:46Z"), response.firstActivityTimeUtc()); - Assertions.assertEquals("rzmwn", response.labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T19:00:04Z"), response.lastActivityTimeUtc()); - Assertions.assertEquals("mmagoaqylkjzt", response.owner().email()); - Assertions.assertEquals("uazjcgmxitpfinz", response.owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("7fcf1d94-b75e-4e89-8b1f-55ea51c2bba2"), response.owner().objectId()); - Assertions.assertEquals("ltkrl", response.owner().userPrincipalName()); + Assertions.assertEquals("hyiohcj", response.etag()); + Assertions.assertEquals("ytoainignxhzqgba", response.title()); + Assertions.assertEquals("qeylac", response.description()); + Assertions.assertEquals(IncidentSeverity.LOW, response.severity()); + Assertions.assertEquals(IncidentStatus.ACTIVE, response.status()); + Assertions.assertEquals(IncidentClassification.TRUE_POSITIVE, response.classification()); + Assertions.assertEquals(IncidentClassificationReason.INCORRECT_ALERT_LOGIC, response.classificationReason()); + Assertions.assertEquals("f", response.classificationComment()); + Assertions.assertEquals("wxlhyszhxoth", response.owner().email()); + Assertions.assertEquals("ifjufzlgu", response.owner().assignedTo()); + Assertions.assertEquals("mtghmnuzyy", response.owner().objectId()); + Assertions.assertEquals("sxyrywdezprycix", response.owner().userPrincipalName()); Assertions.assertEquals(OwnerType.GROUP, response.owner().ownerType()); - Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, response.severity()); - Assertions.assertEquals(IncidentStatus.NEW, response.status()); - Assertions.assertEquals("mpheqdur", response.title()); + Assertions.assertEquals("ochpwwykfy", response.labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T09:11:08Z"), response.firstActivityTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-26T01:37:21Z"), response.lastActivityTimeUtc()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsWithResponseMockTests.java index 2fad1532ef5d..8716702570b1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListAlertsWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; @@ -22,19 +22,19 @@ public final class IncidentsListAlertsWithResponseMockTests { @Test public void testListAlertsWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"slpkcvmwfauxxep\",\"alertType\":\"wbormcqmi\",\"compromisedEntity\":\"ijqpkzfbojxjmcs\",\"confidenceLevel\":\"High\",\"confidenceReasons\":[{},{},{},{}],\"confidenceScore\":46.701227253553256,\"confidenceScoreStatus\":\"NotFinal\",\"description\":\"kwywzwofalic\",\"endTimeUtc\":\"2021-09-02T12:29:07Z\",\"intent\":\"PrivilegeEscalation\",\"providerAlertId\":\"tamtyv\",\"processingEndTime\":\"2021-02-15T11:04:24Z\",\"productComponentName\":\"rwzawnvs\",\"productName\":\"fhzag\",\"productVersion\":\"vhycvdimwrzregzg\",\"remediationSteps\":[\"utrwpweryekz\",\"dhme\",\"tta\",\"jyosxwwh\"],\"severity\":\"Informational\",\"startTimeUtc\":\"2021-06-06T09:18:05Z\",\"status\":\"Dismissed\",\"systemAlertId\":\"dpmiljpn\",\"tactics\":[\"Discovery\",\"ResourceDevelopment\"],\"timeGenerated\":\"2021-10-23T23:22:48Z\",\"vendorName\":\"zsauzp\",\"alertLink\":\"xee\",\"resourceIdentifiers\":[\"dataiqhzlr\",\"datayme\",\"dataxls\",\"dataihmxrfdsajredn\"],\"additionalData\":{\"vuafpwzyifr\":\"datashtuwgm\",\"gzdyimsfayorp\":\"datagwltxeqip\",\"sl\":\"dataavkjog\"},\"friendlyName\":\"nsmjkwynqxaekqs\"},\"id\":\"vwjtqpkevmyltjc\",\"name\":\"spxklu\",\"type\":\"cclfgxannn\"}]}"; + = "{\"value\":[{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"qeesginpixhul\",\"alertType\":\"lmw\",\"compromisedEntity\":\"jbkwrvt\",\"confidenceLevel\":\"High\",\"confidenceReasons\":[{},{},{}],\"confidenceScore\":39.80357753234428,\"confidenceScoreStatus\":\"NotFinal\",\"description\":\"ixlvnwznfx\",\"endTimeUtc\":\"2021-01-10T20:18:21Z\",\"intent\":\"Persistence\",\"providerAlertId\":\"lbdtrwkpelyg\",\"processingEndTime\":\"2021-03-16T07:37:37Z\",\"productComponentName\":\"ajllatbldhcfhwni\",\"productName\":\"xnainss\",\"productVersion\":\"kzslylioguwshrmc\",\"remediationSteps\":[\"yghqtthsbblwkqz\",\"qrnre\"],\"severity\":\"Low\",\"startTimeUtc\":\"2021-08-10T22:16:20Z\",\"status\":\"Resolved\",\"systemAlertId\":\"e\",\"tactics\":[\"Discovery\",\"Execution\"],\"timeGenerated\":\"2021-02-08T22:18:59Z\",\"vendorName\":\"ugvsjfpsyqvgaay\",\"alertLink\":\"kexhi\",\"resourceIdentifiers\":[\"\\\"dataljhkgxcewzgo\\\"\",\"\\\"datazkktcrcctt\\\"\"],\"additionalData\":{\"thsysefilncyqnkp\":\"\\\"datayzbvsj\\\"\",\"ckzxdlupgtp\":\"\\\"dataefmpzdwer\\\"\"},\"friendlyName\":\"ndzbfoi\"},\"id\":\"pglntnsiuxy\",\"name\":\"tjwsdxyzgrrllz\",\"type\":\"xgomhenqnovt\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IncidentAlertList response = manager.incidents() - .listAlertsWithResponse("v", "atbwbqam", "e", com.azure.core.util.Context.NONE) + .listAlertsWithResponse("mwfogjrhmtbpnhjo", "lvfzwt", "rmp", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, response.value().get(0).severity()); + Assertions.assertEquals(AlertSeverity.LOW, response.value().get(0).severity()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksWithResponseMockTests.java index bfe39201552b..8651ada52641 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListBookmarksWithResponseMockTests.java @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.IncidentBookmarkList; import com.azure.resourcemanager.securityinsights.models.IncidentSeverity; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import java.util.UUID; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -23,34 +22,32 @@ public final class IncidentsListBookmarksWithResponseMockTests { @Test public void testListBookmarksWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-10-06T15:52:18Z\",\"createdBy\":{\"email\":\"zyzeyuubeidsz\",\"name\":\"ytoithgygvfl\",\"objectId\":\"3c5742fb-fadf-417b-8855-66d81342861e\"},\"displayName\":\"vdihoynkrx\",\"eventTime\":\"2021-04-11T05:57:12Z\",\"labels\":[\"drcyrucpcun\",\"uzdqumoenod\",\"aienhqhsknd\"],\"notes\":\"lqkaadlknwf\",\"query\":\"anniyopetxivcnr\",\"queryResult\":\"xnucaephblkwqp\",\"updated\":\"2021-06-05T10:07:49Z\",\"updatedBy\":{\"email\":\"sdtcjbctvivuzqym\",\"name\":\"owog\",\"objectId\":\"0a637f55-80a1-436f-9f84-eba4772c58e8\"},\"incidentInfo\":{\"incidentId\":\"sqhzvbrzcdbanfz\",\"severity\":\"Medium\",\"title\":\"xmxeatkdb\",\"relationName\":\"nrd\"},\"additionalData\":{\"axljal\":\"databqbnaomhjrmkuh\",\"cjmobcanc\":\"datai\",\"xf\":\"dataexxqcwg\"},\"friendlyName\":\"aknokzwjjzrl\"},\"id\":\"xldzyyfytpqsix\",\"name\":\"mmpuj\",\"type\":\"vyqlkjuvsmbmslzo\"},{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-09-01T12:35:13Z\",\"createdBy\":{\"email\":\"bpqvybefg\",\"name\":\"x\",\"objectId\":\"84cbd346-159b-4c7a-8055-2fd1b19d4388\"},\"displayName\":\"kcvtl\",\"eventTime\":\"2021-01-01T17:46:17Z\",\"labels\":[\"kvcuartrhunl\",\"iryky\",\"ndzfqivjreuyk\",\"bmnwa\"],\"notes\":\"tbxoee\",\"query\":\"nqlnfwmyymvqd\",\"queryResult\":\"bhfckdvezcrcssb\",\"updated\":\"2021-09-25T14:44:33Z\",\"updatedBy\":{\"email\":\"b\",\"name\":\"qfblhkalehpa\",\"objectId\":\"0ee25afa-17c9-4dd8-b68c-7eedda40f5a5\"},\"incidentInfo\":{\"incidentId\":\"giqjtiogq\",\"severity\":\"Medium\",\"title\":\"nictteajo\",\"relationName\":\"ygspnbonhpczykm\"},\"additionalData\":{\"qcs\":\"datavw\"},\"friendlyName\":\"chkhufm\"},\"id\":\"umqy\",\"name\":\"gy\",\"type\":\"zulo\"},{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-07-13T13:52:02Z\",\"createdBy\":{\"email\":\"a\",\"name\":\"sfnhsenwphp\",\"objectId\":\"b7d57b0a-6502-4190-a501-71d95729c049\"},\"displayName\":\"ngqjclidf\",\"eventTime\":\"2021-10-18T07:20:26Z\",\"labels\":[\"jufwbeqrkuorhtss\"],\"notes\":\"qnmdvhazcvjy\",\"query\":\"iqswbqer\",\"queryResult\":\"xiytxtdgukvl\",\"updated\":\"2021-11-18T11:20:29Z\",\"updatedBy\":{\"email\":\"dstyouam\",\"name\":\"wreswmowegm\",\"objectId\":\"a2b3831b-8f8c-4d7d-a8c4-f7eb64046d12\"},\"incidentInfo\":{\"incidentId\":\"yxey\",\"severity\":\"Informational\",\"title\":\"gijiitnspxlzd\",\"relationName\":\"ygr\"},\"additionalData\":{\"n\":\"dataaiuf\",\"qfrojsydgrhyd\":\"dataaybfu\",\"skieca\":\"dataygywe\"},\"friendlyName\":\"gzmxieqv\"},\"id\":\"makli\",\"name\":\"qcahyhxal\",\"type\":\"bx\"},{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-11-30T21:00:42Z\",\"createdBy\":{\"email\":\"o\",\"name\":\"blxpkkwjdjodq\",\"objectId\":\"f85fa2da-3b13-4c84-8f7d-0990fcd881f2\"},\"displayName\":\"kincnremeh\",\"eventTime\":\"2021-03-18T11:25:17Z\",\"labels\":[\"ceum\",\"qodkadppyibngql\",\"d\"],\"notes\":\"rxwhydtlu\",\"query\":\"vadswzs\",\"queryResult\":\"yemlowuowhlxln\",\"updated\":\"2021-12-07T17:56:08Z\",\"updatedBy\":{\"email\":\"uvblg\",\"name\":\"kzkltrfowt\",\"objectId\":\"b015fb72-7905-471e-b014-0abf069ae86f\"},\"incidentInfo\":{\"incidentId\":\"mvlihcvjdrqcrjid\",\"severity\":\"High\",\"title\":\"kvhd\",\"relationName\":\"wyojbfqzdkfnjyi\"},\"additionalData\":{\"valqjrhuzgfxo\":\"datafratqxmbjroumzz\"},\"friendlyName\":\"tpusllywp\"},\"id\":\"iotzbpdbollgryfq\",\"name\":\"uasigr\",\"type\":\"wsocnequygdjbo\"}]}"; + = "{\"value\":[{\"kind\":\"Bookmark\",\"properties\":{\"created\":\"2021-10-02T03:15:10Z\",\"createdBy\":{\"email\":\"mxjdkvyzilrlfg\",\"name\":\"v\",\"objectId\":\"jqruskmbqyfec\"},\"displayName\":\"sqeewfuwgmkcay\",\"eventTime\":\"2021-08-03T17:52:37Z\",\"labels\":[\"wybwmebmxzwcfd\"],\"notes\":\"kurppwksixh\",\"query\":\"rnvydxjkdsqea\",\"queryResult\":\"dqttiqwixsdx\",\"updated\":\"2021-07-18T10:20:31Z\",\"updatedBy\":{\"email\":\"vahbwhrguqet\",\"name\":\"qhys\",\"objectId\":\"lzjzdciwxl\"},\"incidentInfo\":{\"incidentId\":\"tpayfklbgshbkdp\",\"severity\":\"Informational\",\"title\":\"qznvkhjtrashnf\",\"relationName\":\"iykloeqxccpqbo\"},\"additionalData\":{\"ipyiafsuu\":\"\\\"datah\\\"\",\"rnlgnwwjikg\":\"\\\"dataoqqseoinxkot\\\"\"},\"friendlyName\":\"dczzkz\"},\"id\":\"pjnhhiofcnyzqz\",\"name\":\"lddngqwmlleg\",\"type\":\"cemagsyljww\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IncidentBookmarkList response = manager.incidents() - .listBookmarksWithResponse("ytzpo", "ewxigpxvk", "maupxvpi", com.azure.core.util.Context.NONE) + .listBookmarksWithResponse("kobxvexusjfjuphj", "ueksvjtgpy", "atl", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T15:52:18Z"), response.value().get(0).created()); - Assertions.assertEquals(UUID.fromString("3c5742fb-fadf-417b-8855-66d81342861e"), - response.value().get(0).createdBy().objectId()); - Assertions.assertEquals("vdihoynkrx", response.value().get(0).displayName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-11T05:57:12Z"), response.value().get(0).eventTime()); - Assertions.assertEquals("drcyrucpcun", response.value().get(0).labels().get(0)); - Assertions.assertEquals("lqkaadlknwf", response.value().get(0).notes()); - Assertions.assertEquals("anniyopetxivcnr", response.value().get(0).query()); - Assertions.assertEquals("xnucaephblkwqp", response.value().get(0).queryResult()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-05T10:07:49Z"), response.value().get(0).updated()); - Assertions.assertEquals(UUID.fromString("0a637f55-80a1-436f-9f84-eba4772c58e8"), - response.value().get(0).updatedBy().objectId()); - Assertions.assertEquals("sqhzvbrzcdbanfz", response.value().get(0).incidentInfo().incidentId()); - Assertions.assertEquals(IncidentSeverity.MEDIUM, response.value().get(0).incidentInfo().severity()); - Assertions.assertEquals("xmxeatkdb", response.value().get(0).incidentInfo().title()); - Assertions.assertEquals("nrd", response.value().get(0).incidentInfo().relationName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T03:15:10Z"), response.value().get(0).created()); + Assertions.assertEquals("jqruskmbqyfec", response.value().get(0).createdBy().objectId()); + Assertions.assertEquals("sqeewfuwgmkcay", response.value().get(0).displayName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-03T17:52:37Z"), response.value().get(0).eventTime()); + Assertions.assertEquals("wybwmebmxzwcfd", response.value().get(0).labels().get(0)); + Assertions.assertEquals("kurppwksixh", response.value().get(0).notes()); + Assertions.assertEquals("rnvydxjkdsqea", response.value().get(0).query()); + Assertions.assertEquals("dqttiqwixsdx", response.value().get(0).queryResult()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T10:20:31Z"), response.value().get(0).updated()); + Assertions.assertEquals("lzjzdciwxl", response.value().get(0).updatedBy().objectId()); + Assertions.assertEquals("tpayfklbgshbkdp", response.value().get(0).incidentInfo().incidentId()); + Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, response.value().get(0).incidentInfo().severity()); + Assertions.assertEquals("qznvkhjtrashnf", response.value().get(0).incidentInfo().title()); + Assertions.assertEquals("iykloeqxccpqbo", response.value().get(0).incidentInfo().relationName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesWithResponseMockTests.java index ccd39ad76327..af3ded3dd6e3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListEntitiesWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.EntityKindEnum; @@ -22,20 +22,20 @@ public final class IncidentsListEntitiesWithResponseMockTests { @Test public void testListEntitiesWithResponse() throws Exception { String responseStr - = "{\"entities\":[{\"kind\":\"Entity\",\"id\":\"idisczskosw\",\"name\":\"qiqazugamxzkr\",\"type\":\"coiisbamnppcce\"}],\"metaData\":[{\"count\":2123887167,\"entityKind\":\"Ip\"},{\"count\":1946574379,\"entityKind\":\"RegistryKey\"}]}"; + = "{\"entities\":[{\"kind\":\"Entity\",\"id\":\"o\",\"name\":\"b\",\"type\":\"tzrgyrldoalldgl\"},{\"kind\":\"Entity\",\"id\":\"k\",\"name\":\"ftjrederkvbdvl\",\"type\":\"zkxaujj\"},{\"kind\":\"Entity\",\"id\":\"ztghdwrvffjpw\",\"name\":\"zlfyftgae\",\"type\":\"cplxid\"},{\"kind\":\"Entity\",\"id\":\"xzzhldaxvir\",\"name\":\"uwacfqnwvrbb\",\"type\":\"gi\"}],\"metaData\":[{\"entityKind\":\"Process\",\"count\":1839933638},{\"entityKind\":\"RegistryValue\",\"count\":1561847384}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IncidentEntitiesResponse response = manager.incidents() - .listEntitiesWithResponse("grmtqjk", "evadrmmwiu", "wvcmj", com.azure.core.util.Context.NONE) + .listEntitiesWithResponse("zqhph", "a", "mikqvn", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(2123887167, response.metadata().get(0).count()); - Assertions.assertEquals(EntityKindEnum.IP, response.metadata().get(0).entityKind()); + Assertions.assertEquals(EntityKindEnum.PROCESS, response.metadata().get(0).entityKind()); + Assertions.assertEquals(1839933638, response.metadata().get(0).count()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListMockTests.java index bbdbcce8e88b..1b079559069a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.Incident; @@ -19,7 +19,6 @@ import com.azure.resourcemanager.securityinsights.models.OwnerType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import java.util.UUID; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -28,37 +27,36 @@ public final class IncidentsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"additionalData\":{\"alertsCount\":1963541859,\"bookmarksCount\":743054032,\"commentsCount\":1998617228,\"alertProductNames\":[\"dgglmepjpfs\",\"ykgsangpszng\",\"fpgylkve\"],\"tactics\":[\"Collection\",\"Execution\"]},\"classification\":\"BenignPositive\",\"classificationComment\":\"adyedmzrgjfok\",\"classificationReason\":\"SuspiciousButExpected\",\"createdTimeUtc\":\"2021-05-30T12:16:13Z\",\"description\":\"tp\",\"firstActivityTimeUtc\":\"2021-11-22T23:37:09Z\",\"incidentUrl\":\"rgdg\",\"incidentNumber\":1339773074,\"labels\":[{\"labelName\":\"raswugyxpqit\",\"labelType\":\"User\"},{\"labelName\":\"alwvskbu\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"caqt\",\"labelType\":\"User\"},{\"labelName\":\"co\",\"labelType\":\"AutoAssigned\"}],\"lastActivityTimeUtc\":\"2021-03-15T06:39:11Z\",\"lastModifiedTimeUtc\":\"2021-06-10T09:18:11Z\",\"owner\":{\"email\":\"akuejk\",\"assignedTo\":\"bizt\",\"objectId\":\"856fd1dd-2865-403f-94ab-ca27791198b8\",\"userPrincipalName\":\"qcvov\",\"ownerType\":\"Group\"},\"relatedAnalyticRuleIds\":[\"sj\",\"lbemyej\"],\"severity\":\"Informational\",\"status\":\"New\",\"title\":\"uxegthortudawlpj\"},\"etag\":\"lqerpptcbgqnzm\",\"id\":\"iilialwc\",\"name\":\"gckbb\",\"type\":\"ccgzpraoxnyu\"}]}"; + = "{\"value\":[{\"properties\":{\"title\":\"tihscptvkbcyknt\",\"description\":\"zee\",\"severity\":\"Informational\",\"status\":\"Closed\",\"classification\":\"Undetermined\",\"classificationReason\":\"InaccurateData\",\"classificationComment\":\"ydc\",\"owner\":{\"email\":\"eibhztl\",\"assignedTo\":\"wbyvjispkgkhvpv\",\"objectId\":\"myovhxst\",\"userPrincipalName\":\"fztlvsdmfshhc\",\"ownerType\":\"Unknown\"},\"labels\":[{\"labelName\":\"yhxwhdyf\",\"labelType\":\"AutoAssigned\"},{\"labelName\":\"xmjdbzfiacmwmce\",\"labelType\":\"User\"},{\"labelName\":\"hrfmcjjxxwzdwmju\",\"labelType\":\"AutoAssigned\"}],\"firstActivityTimeUtc\":\"2021-04-24T01:52:56Z\",\"lastActivityTimeUtc\":\"2021-04-14T05:30:13Z\",\"lastModifiedTimeUtc\":\"2020-12-28T14:46:02Z\",\"createdTimeUtc\":\"2021-01-27T09:34:43Z\",\"incidentNumber\":288194268,\"additionalData\":{\"alertsCount\":989791541,\"bookmarksCount\":1418393078,\"commentsCount\":1368118617,\"alertProductNames\":[\"pojenpsf\",\"pizefajgbleh\",\"p\",\"uahvxfnzcevfbi\"],\"tactics\":[\"PreAttack\"],\"techniques\":[\"dkzfkneck\",\"yrvdszrizpej\",\"yrzzxqtcgs\"],\"providerIncidentUrl\":\"hzcicitykzyi\",\"mergedIncidentNumber\":\"uingnfunhtz\",\"mergedIncidentUrl\":\"syiwm\"},\"relatedAnalyticRuleIds\":[\"udhjztbwzjb\",\"z\",\"wbhznhqzdbzlkd\",\"bekvprkwpvxieqc\"],\"incidentUrl\":\"gzshfa\",\"providerName\":\"e\",\"providerIncidentId\":\"aeiuex\",\"teamInformation\":{\"teamId\":\"rmwdwlra\",\"primaryChannelUrl\":\"lpfrecrizkabafd\",\"teamCreationTimeUtc\":\"2021-02-17T02:08:38Z\",\"name\":\"aobsgpdbhbdx\",\"description\":\"sox\"}},\"etag\":\"wuungdvvddr\",\"id\":\"quyin\",\"name\":\"gttvonwrpel\",\"type\":\"emitmtkcqixgqxsu\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.incidents() - .list("rftb", "ve", "reuquowtljvf", "hreagk", 1184787439, "xv", com.azure.core.util.Context.NONE); + .list("e", "jkacuxtnu", "kojqoxpwdhvfd", "sqv", 1381219926, "yqbpzxush", com.azure.core.util.Context.NONE); - Assertions.assertEquals("lqerpptcbgqnzm", response.iterator().next().etag()); - Assertions.assertEquals(IncidentClassification.BENIGN_POSITIVE, response.iterator().next().classification()); - Assertions.assertEquals("adyedmzrgjfok", response.iterator().next().classificationComment()); - Assertions.assertEquals(IncidentClassificationReason.SUSPICIOUS_BUT_EXPECTED, + Assertions.assertEquals("wuungdvvddr", response.iterator().next().etag()); + Assertions.assertEquals("tihscptvkbcyknt", response.iterator().next().title()); + Assertions.assertEquals("zee", response.iterator().next().description()); + Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, response.iterator().next().severity()); + Assertions.assertEquals(IncidentStatus.CLOSED, response.iterator().next().status()); + Assertions.assertEquals(IncidentClassification.UNDETERMINED, response.iterator().next().classification()); + Assertions.assertEquals(IncidentClassificationReason.INACCURATE_DATA, response.iterator().next().classificationReason()); - Assertions.assertEquals("tp", response.iterator().next().description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-22T23:37:09Z"), + Assertions.assertEquals("ydc", response.iterator().next().classificationComment()); + Assertions.assertEquals("eibhztl", response.iterator().next().owner().email()); + Assertions.assertEquals("wbyvjispkgkhvpv", response.iterator().next().owner().assignedTo()); + Assertions.assertEquals("myovhxst", response.iterator().next().owner().objectId()); + Assertions.assertEquals("fztlvsdmfshhc", response.iterator().next().owner().userPrincipalName()); + Assertions.assertEquals(OwnerType.UNKNOWN, response.iterator().next().owner().ownerType()); + Assertions.assertEquals("yhxwhdyf", response.iterator().next().labels().get(0).labelName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T01:52:56Z"), response.iterator().next().firstActivityTimeUtc()); - Assertions.assertEquals("raswugyxpqit", response.iterator().next().labels().get(0).labelName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T06:39:11Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-14T05:30:13Z"), response.iterator().next().lastActivityTimeUtc()); - Assertions.assertEquals("akuejk", response.iterator().next().owner().email()); - Assertions.assertEquals("bizt", response.iterator().next().owner().assignedTo()); - Assertions.assertEquals(UUID.fromString("856fd1dd-2865-403f-94ab-ca27791198b8"), - response.iterator().next().owner().objectId()); - Assertions.assertEquals("qcvov", response.iterator().next().owner().userPrincipalName()); - Assertions.assertEquals(OwnerType.GROUP, response.iterator().next().owner().ownerType()); - Assertions.assertEquals(IncidentSeverity.INFORMATIONAL, response.iterator().next().severity()); - Assertions.assertEquals(IncidentStatus.NEW, response.iterator().next().status()); - Assertions.assertEquals("uxegthortudawlpj", response.iterator().next().title()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookWithResponseMockTests.java new file mode 100644 index 000000000000..a57f1ee34666 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentsRunPlaybookWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncidentsRunPlaybookWithResponseMockTests { + @Test + public void testRunPlaybookWithResponse() throws Exception { + String responseStr = "\"\\\"datazc\\\"\""; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Object response = manager.incidents() + .runPlaybookWithResponse("ev", "huvupdsafqaghw", "umecqyia", + new ManualTriggerRequestBody().withTenantId("mvvkodkqffhu").withLogicAppsResourceId("oxqtgz"), + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorObservablesItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorObservablesItemTests.java new file mode 100644 index 000000000000..3531afa70b26 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorObservablesItemTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.IndicatorObservablesItem; +import org.junit.jupiter.api.Assertions; + +public final class IndicatorObservablesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IndicatorObservablesItem model = BinaryData.fromString("{\"type\":\"hzbcujd\",\"value\":\"gye\"}") + .toObject(IndicatorObservablesItem.class); + Assertions.assertEquals("hzbcujd", model.type()); + Assertions.assertEquals("gye", model.value()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorTests.java new file mode 100644 index 000000000000..5a6bb5ddb94a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IndicatorTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Indicator; +import org.junit.jupiter.api.Assertions; + +public final class IndicatorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Indicator model = BinaryData.fromString( + "{\"kind\":\"Indicator\",\"observables\":[{\"type\":\"biter\",\"value\":\"uterrcanlpfqddww\"},{\"type\":\"cqawupqkvmygueef\",\"value\":\"z\"},{\"type\":\"cvt\",\"value\":\"qdagwxjafbdvpcdz\"},{\"type\":\"jzxr\",\"value\":\"jiraupirvdon\"}],\"properties\":{\"data\":{\"wwuusjjhtcy\":\"\\\"datagvgjg\\\"\",\"highnxhgmfrnk\":\"\\\"datan\\\"\",\"arjteqlujmmknia\":\"\\\"datasvwq\\\"\",\"imeztas\":\"\\\"datakstt\\\"\"},\"createdBy\":{\"email\":\"mecweohlerpt\",\"name\":\"vzapybdeeagigbp\",\"objectId\":\"acp\"},\"source\":\"irj\",\"firstIngestedTimeUtc\":\"2021-08-20T06:01:28Z\",\"lastIngestedTimeUtc\":\"2021-09-10T04:55:50Z\",\"ingestionRulesVersion\":\"ndubmazlxlbdukid\",\"lastUpdateMethod\":\"eyq\",\"lastModifiedBy\":{\"email\":\"pkypbekpardoad\",\"name\":\"dxzgyhbzm\",\"objectId\":\"sytmpfsl\"},\"lastUpdatedDateTimeUtc\":\"2021-02-24T07:24:37Z\",\"relationshipHints\":[{\"fieldName\":\"bqrqbpiqfstkdlyj\",\"source\":\"jxefydc\"},{\"fieldName\":\"fkzlch\",\"source\":\"iwpadnhflxnn\"},{\"fieldName\":\"rugotfrdlfe\",\"source\":\"xbrvbdyriyr\"},{\"fieldName\":\"bigksnijclfdpre\",\"source\":\"xzxeigy\"}]},\"id\":\"pfnmbxe\",\"name\":\"zypcralwv\",\"type\":\"nmrbizxql\"}") + .toObject(Indicator.class); + Assertions.assertEquals("biter", model.observables().get(0).type()); + Assertions.assertEquals("uterrcanlpfqddww", model.observables().get(0).value()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesAdditionalQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesAdditionalQueryTests.java new file mode 100644 index 000000000000..a683df79225c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesAdditionalQueryTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesAdditionalQuery; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesAdditionalQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemPropertiesAdditionalQuery model = BinaryData.fromString("{\"query\":\"idhz\",\"text\":\"re\"}") + .toObject(InsightQueryItemPropertiesAdditionalQuery.class); + Assertions.assertEquals("idhz", model.query()); + Assertions.assertEquals("re", model.text()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesDefaultTimeRangeTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesDefaultTimeRangeTests.java new file mode 100644 index 000000000000..f8c751b47e23 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesDefaultTimeRangeTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesDefaultTimeRange; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesDefaultTimeRangeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemPropertiesDefaultTimeRange model + = BinaryData.fromString("{\"beforeRange\":\"zsdtm\",\"afterRange\":\"yorjplbchych\"}") + .toObject(InsightQueryItemPropertiesDefaultTimeRange.class); + Assertions.assertEquals("zsdtm", model.beforeRange()); + Assertions.assertEquals("yorjplbchych", model.afterRange()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesReferenceTimeRangeTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesReferenceTimeRangeTests.java new file mode 100644 index 000000000000..2c47285bb78e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesReferenceTimeRangeTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesReferenceTimeRange; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesReferenceTimeRangeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemPropertiesReferenceTimeRange model = BinaryData.fromString("{\"beforeRange\":\"vyrfbqvum\"}") + .toObject(InsightQueryItemPropertiesReferenceTimeRange.class); + Assertions.assertEquals("vyrfbqvum", model.beforeRange()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItemTests.java new file mode 100644 index 000000000000..e84be9da1d00 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItemTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem; +import com.azure.resourcemanager.securityinsights.models.OutputType; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesTableQueryColumnsDefinitionsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem model + = BinaryData.fromString("{\"header\":\"rlzh\",\"outputType\":\"String\",\"supportDeepLink\":false}") + .toObject(InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.class); + Assertions.assertEquals("rlzh", model.headerProperty()); + Assertions.assertEquals(OutputType.STRING, model.outputType()); + Assertions.assertFalse(model.supportDeepLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemTests.java new file mode 100644 index 000000000000..f37629886a40 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem model = BinaryData.fromString( + "{\"filter\":\"enqqzlxnqzu\",\"summarize\":\"onfdbgmkfwmjc\",\"project\":\"ewfhxwyrkbre\",\"linkColumnsDefinitions\":[{\"projectedName\":\"ynjpchamkaepl\",\"Query\":\"jub\"},{\"projectedName\":\"uywevtjrieikmwl\",\"Query\":\"klfnisyxgucbmt\"},{\"projectedName\":\"dscnns\",\"Query\":\"cyyuvtzrxzhclec\"}]}") + .toObject(InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.class); + Assertions.assertEquals("enqqzlxnqzu", model.filter()); + Assertions.assertEquals("onfdbgmkfwmjc", model.summarize()); + Assertions.assertEquals("ewfhxwyrkbre", model.project()); + Assertions.assertEquals("ynjpchamkaepl", model.linkColumnsDefinitions().get(0).projectedName()); + Assertions.assertEquals("jub", model.linkColumnsDefinitions().get(0).query()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItemTests.java new file mode 100644 index 000000000000..06413625d84e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItemTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem model + = BinaryData.fromString("{\"projectedName\":\"tzqzcloy\",\"Query\":\"u\"}") + .toObject(InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem.class); + Assertions.assertEquals("tzqzcloy", model.projectedName()); + Assertions.assertEquals("u", model.query()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryTests.java new file mode 100644 index 000000000000..9687e37d12d4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTableQueryTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemPropertiesTableQuery; +import com.azure.resourcemanager.securityinsights.models.OutputType; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesTableQueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemPropertiesTableQuery model = BinaryData.fromString( + "{\"columnsDefinitions\":[{\"header\":\"zmiyddeeqzq\",\"outputType\":\"Number\",\"supportDeepLink\":true},{\"header\":\"s\",\"outputType\":\"String\",\"supportDeepLink\":true},{\"header\":\"b\",\"outputType\":\"Number\",\"supportDeepLink\":true}],\"queriesDefinitions\":[{\"filter\":\"trlq\",\"summarize\":\"xyazkjpirgzx\",\"project\":\"czwhye\",\"linkColumnsDefinitions\":[{\"projectedName\":\"msritjbuiggr\",\"Query\":\"ozfvualjt\"},{\"projectedName\":\"ivsdw\",\"Query\":\"gkrfi\"},{\"projectedName\":\"cjvakmh\",\"Query\":\"hwahfbw\"}]},{\"filter\":\"bnnxem\",\"summarize\":\"nuqqkotauratnicp\",\"project\":\"zsclefyrletn\",\"linkColumnsDefinitions\":[{\"projectedName\":\"fdggnbbuyp\",\"Query\":\"vvv\"},{\"projectedName\":\"leev\",\"Query\":\"qayrehjuqwva\"}]}]}") + .toObject(InsightQueryItemPropertiesTableQuery.class); + Assertions.assertEquals("zmiyddeeqzq", model.columnsDefinitions().get(0).headerProperty()); + Assertions.assertEquals(OutputType.NUMBER, model.columnsDefinitions().get(0).outputType()); + Assertions.assertTrue(model.columnsDefinitions().get(0).supportDeepLink()); + Assertions.assertEquals("trlq", model.queriesDefinitions().get(0).filter()); + Assertions.assertEquals("xyazkjpirgzx", model.queriesDefinitions().get(0).summarize()); + Assertions.assertEquals("czwhye", model.queriesDefinitions().get(0).project()); + Assertions.assertEquals("msritjbuiggr", + model.queriesDefinitions().get(0).linkColumnsDefinitions().get(0).projectedName()); + Assertions.assertEquals("ozfvualjt", model.queriesDefinitions().get(0).linkColumnsDefinitions().get(0).query()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTests.java new file mode 100644 index 000000000000..a43d75d99776 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemPropertiesTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItemProperties; +import com.azure.resourcemanager.securityinsights.models.OutputType; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItemProperties model = BinaryData.fromString( + "{\"displayName\":\"th\",\"description\":\"at\",\"baseQuery\":\"jrnm\",\"tableQuery\":{\"columnsDefinitions\":[{\"header\":\"lgtkihoni\",\"outputType\":\"Date\",\"supportDeepLink\":true},{\"header\":\"ffjilzfbpnt\",\"outputType\":\"String\",\"supportDeepLink\":true},{\"header\":\"ck\",\"outputType\":\"String\",\"supportDeepLink\":false},{\"header\":\"moyfxx\",\"outputType\":\"String\",\"supportDeepLink\":true}],\"queriesDefinitions\":[{\"filter\":\"dxlykhkggapvdgt\",\"summarize\":\"eerscdxrnrnjrcu\",\"project\":\"bgacnr\",\"linkColumnsDefinitions\":[{\"projectedName\":\"ncmspsanma\",\"Query\":\"ubkqiq\"},{\"projectedName\":\"fv\",\"Query\":\"qcs\"}]}]},\"chartQuery\":\"\\\"dataqjmxpt\\\"\",\"additionalQuery\":{\"query\":\"puugkw\",\"text\":\"qmrpahuuonjk\"},\"defaultTimeRange\":{\"beforeRange\":\"kguehvvpxj\",\"afterRange\":\"gcjojlleui\"},\"referenceTimeRange\":{\"beforeRange\":\"tonvhgnhtmeplhb\"},\"dataTypes\":[{\"dataType\":\"pmummmkva\"}],\"inputEntityType\":\"FileHash\",\"requiredInputFieldsSets\":[[\"ua\",\"qpmnu\"],[\"hr\",\"hxwwuzdm\"],[\"wlvi\",\"jmxmlitqdsj\",\"pdviscotyxbrii\",\"efndslvrqoemwsi\"],[\"ailwdqmqfyd\",\"otmfxlkdlgwgna\",\"kuuyiuyuaf\"]],\"entitiesFilter\":\"\\\"datalxicwgpthdcf\\\"\"}") + .toObject(InsightQueryItemProperties.class); + Assertions.assertEquals("pmummmkva", model.dataTypes().get(0).dataType()); + Assertions.assertEquals(EntityType.FILE_HASH, model.inputEntityType()); + Assertions.assertEquals("ua", model.requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("th", model.displayName()); + Assertions.assertEquals("at", model.description()); + Assertions.assertEquals("jrnm", model.baseQuery()); + Assertions.assertEquals("lgtkihoni", model.tableQuery().columnsDefinitions().get(0).headerProperty()); + Assertions.assertEquals(OutputType.DATE, model.tableQuery().columnsDefinitions().get(0).outputType()); + Assertions.assertTrue(model.tableQuery().columnsDefinitions().get(0).supportDeepLink()); + Assertions.assertEquals("dxlykhkggapvdgt", model.tableQuery().queriesDefinitions().get(0).filter()); + Assertions.assertEquals("eerscdxrnrnjrcu", model.tableQuery().queriesDefinitions().get(0).summarize()); + Assertions.assertEquals("bgacnr", model.tableQuery().queriesDefinitions().get(0).project()); + Assertions.assertEquals("ncmspsanma", + model.tableQuery().queriesDefinitions().get(0).linkColumnsDefinitions().get(0).projectedName()); + Assertions.assertEquals("ubkqiq", + model.tableQuery().queriesDefinitions().get(0).linkColumnsDefinitions().get(0).query()); + Assertions.assertEquals("puugkw", model.additionalQuery().query()); + Assertions.assertEquals("qmrpahuuonjk", model.additionalQuery().text()); + Assertions.assertEquals("kguehvvpxj", model.defaultTimeRange().beforeRange()); + Assertions.assertEquals("gcjojlleui", model.defaultTimeRange().afterRange()); + Assertions.assertEquals("tonvhgnhtmeplhb", model.referenceTimeRange().beforeRange()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemTests.java new file mode 100644 index 000000000000..4c6b55d43b41 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightQueryItemTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityType; +import com.azure.resourcemanager.securityinsights.models.InsightQueryItem; +import com.azure.resourcemanager.securityinsights.models.OutputType; +import org.junit.jupiter.api.Assertions; + +public final class InsightQueryItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightQueryItem model = BinaryData.fromString( + "{\"kind\":\"Insight\",\"properties\":{\"displayName\":\"euiyxfwkztsms\",\"description\":\"evyllznfhkqyt\",\"baseQuery\":\"tadopgfzdg\",\"tableQuery\":{\"columnsDefinitions\":[{\"header\":\"rsvloy\",\"outputType\":\"Date\",\"supportDeepLink\":true}],\"queriesDefinitions\":[{\"filter\":\"uqw\",\"summarize\":\"jquzx\",\"project\":\"xhyoip\",\"linkColumnsDefinitions\":[{},{}]},{\"filter\":\"gsoscienezfvb\",\"summarize\":\"n\",\"project\":\"kbpjnrte\",\"linkColumnsDefinitions\":[{},{},{}]},{\"filter\":\"thr\",\"summarize\":\"mdudsy\",\"project\":\"rzt\",\"linkColumnsDefinitions\":[{},{},{}]},{\"filter\":\"hf\",\"summarize\":\"cqkoqyouerg\",\"project\":\"hpuzxkpye\",\"linkColumnsDefinitions\":[{},{},{}]}]},\"chartQuery\":\"\\\"datayldhgyed\\\"\",\"additionalQuery\":{\"query\":\"qiyu\",\"text\":\"tdereunokakzw\"},\"defaultTimeRange\":{\"beforeRange\":\"lwyxedznmxrfomck\",\"afterRange\":\"vmyifopxf\"},\"referenceTimeRange\":{\"beforeRange\":\"pdyzoutx\"},\"dataTypes\":[{\"dataType\":\"fhgnuywezygv\"},{\"dataType\":\"gaaqw\"},{\"dataType\":\"gjpytpmpvdnogehl\"}],\"inputEntityType\":\"URL\",\"requiredInputFieldsSets\":[[\"bnukkfax\",\"svbxxyjisskob\",\"ocl\"],[\"ioewyhxes\"]],\"entitiesFilter\":\"\\\"datavrkdpsqeq\\\"\"},\"id\":\"dxmdses\",\"name\":\"ujbjppp\",\"type\":\"lpdib\"}") + .toObject(InsightQueryItem.class); + Assertions.assertEquals("ujbjppp", model.name()); + Assertions.assertEquals("lpdib", model.type()); + Assertions.assertEquals("fhgnuywezygv", model.properties().dataTypes().get(0).dataType()); + Assertions.assertEquals(EntityType.URL, model.properties().inputEntityType()); + Assertions.assertEquals("bnukkfax", model.properties().requiredInputFieldsSets().get(0).get(0)); + Assertions.assertEquals("euiyxfwkztsms", model.properties().displayName()); + Assertions.assertEquals("evyllznfhkqyt", model.properties().description()); + Assertions.assertEquals("tadopgfzdg", model.properties().baseQuery()); + Assertions.assertEquals("rsvloy", model.properties().tableQuery().columnsDefinitions().get(0).headerProperty()); + Assertions.assertEquals(OutputType.DATE, + model.properties().tableQuery().columnsDefinitions().get(0).outputType()); + Assertions.assertTrue(model.properties().tableQuery().columnsDefinitions().get(0).supportDeepLink()); + Assertions.assertEquals("uqw", model.properties().tableQuery().queriesDefinitions().get(0).filter()); + Assertions.assertEquals("jquzx", model.properties().tableQuery().queriesDefinitions().get(0).summarize()); + Assertions.assertEquals("xhyoip", model.properties().tableQuery().queriesDefinitions().get(0).project()); + Assertions.assertEquals("qiyu", model.properties().additionalQuery().query()); + Assertions.assertEquals("tdereunokakzw", model.properties().additionalQuery().text()); + Assertions.assertEquals("lwyxedznmxrfomck", model.properties().defaultTimeRange().beforeRange()); + Assertions.assertEquals("vmyifopxf", model.properties().defaultTimeRange().afterRange()); + Assertions.assertEquals("pdyzoutx", model.properties().referenceTimeRange().beforeRange()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultColumnsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultColumnsItemTests.java new file mode 100644 index 000000000000..fa72109ec928 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultColumnsItemTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightsTableResultColumnsItem; +import org.junit.jupiter.api.Assertions; + +public final class InsightsTableResultColumnsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightsTableResultColumnsItem model + = BinaryData.fromString("{\"type\":\"kjbjolpyoklkvuz\",\"name\":\"dvhml\"}") + .toObject(InsightsTableResultColumnsItem.class); + Assertions.assertEquals("kjbjolpyoklkvuz", model.type()); + Assertions.assertEquals("dvhml", model.name()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultTests.java new file mode 100644 index 000000000000..6ab2ec3cdddd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InsightsTableResultTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InsightsTableResult; +import org.junit.jupiter.api.Assertions; + +public final class InsightsTableResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InsightsTableResult model = BinaryData.fromString( + "{\"columns\":[{\"type\":\"dluday\",\"name\":\"ldidwmtffb\"}],\"rows\":[[\"dzch\",\"bagwnlzu\",\"igvlghfrbzakpjtc\"],[\"aqpojpsucmximc\"],[\"xyn\",\"jgsatky\"],[\"cb\",\"ngcrusxhircpgcvs\"]]}") + .toObject(InsightsTableResult.class); + Assertions.assertEquals("dluday", model.columns().get(0).type()); + Assertions.assertEquals("ldidwmtffb", model.columns().get(0).name()); + Assertions.assertEquals("dzch", model.rows().get(0).get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepDetailsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepDetailsTests.java new file mode 100644 index 000000000000..8e3f45879425 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepDetailsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InstructionStepDetails; +import org.junit.jupiter.api.Assertions; + +public final class InstructionStepDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InstructionStepDetails model + = BinaryData.fromString("{\"parameters\":\"\\\"datam\\\"\",\"type\":\"zjotvmrxkhlo\"}") + .toObject(InstructionStepDetails.class); + Assertions.assertEquals("zjotvmrxkhlo", model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InstructionStepDetails model + = new InstructionStepDetails().withParameters("\"datam\"").withType("zjotvmrxkhlo"); + model = BinaryData.fromObject(model).toObject(InstructionStepDetails.class); + Assertions.assertEquals("zjotvmrxkhlo", model.type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepTests.java new file mode 100644 index 000000000000..f27e85374621 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepTests.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InstructionStep; +import com.azure.resourcemanager.securityinsights.models.InstructionStepDetails; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class InstructionStepTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InstructionStep model = BinaryData.fromString( + "{\"title\":\"irtneemmjau\",\"description\":\"gxef\",\"instructions\":[{\"parameters\":\"\\\"dataaitranizerw\\\"\",\"type\":\"udasmxubvfbng\"},{\"parameters\":\"\\\"datacoce\\\"\",\"type\":\"hpriylfm\"},{\"parameters\":\"\\\"dataztraud\\\"\",\"type\":\"vhl\"}],\"innerSteps\":[{\"title\":\"lregpq\",\"description\":\"ojhvrz\",\"instructions\":[{\"parameters\":\"\\\"datagyshqrdgrtwmewj\\\"\",\"type\":\"lp\"},{\"parameters\":\"\\\"datakcfazzw\\\"\",\"type\":\"cayer\"}],\"innerSteps\":[{\"title\":\"nsyby\",\"description\":\"ol\",\"instructions\":[{\"parameters\":\"\\\"dataghsrleinkfscjfn\\\"\",\"type\":\"jwvuag\"},{\"parameters\":\"\\\"dataqwtltngvmreupt\\\"\",\"type\":\"klzmijajw\"},{\"parameters\":\"\\\"datal\\\"\",\"type\":\"fsvagh\"},{\"parameters\":\"\\\"datapynwlslrcigtzjcv\\\"\",\"type\":\"xqlaps\"}],\"innerSteps\":[{},{},{},{}]},{\"title\":\"vyxpavidni\",\"description\":\"wffcvvye\",\"instructions\":[{\"parameters\":\"\\\"datapuxgcbdsvalpnpt\\\"\",\"type\":\"trkxgpazwu\"},{\"parameters\":\"\\\"datax\\\"\",\"type\":\"qvn\"},{\"parameters\":\"\\\"dataobfelhldiuhz\\\"\",\"type\":\"gqlmfaewzgi\"},{\"parameters\":\"\\\"datadjpxpqht\\\"\",\"type\":\"qhnmhk\"}],\"innerSteps\":[{},{},{},{}]}]},{\"title\":\"dsuxheqdgcrux\",\"description\":\"inymmqgwokmikp\",\"instructions\":[{\"parameters\":\"\\\"databmjxuvjipf\\\"\",\"type\":\"vhax\"},{\"parameters\":\"\\\"datavwzaehp\\\"\",\"type\":\"hthdklmvetatlakf\"},{\"parameters\":\"\\\"dataoixwgiksb\\\"\",\"type\":\"vtooxrpo\"}],\"innerSteps\":[{\"title\":\"chgjtnhtukfacih\",\"description\":\"fntumeezbxvqx\",\"instructions\":[{\"parameters\":\"\\\"datavwcga\\\"\",\"type\":\"gomtm\"}],\"innerSteps\":[{}]},{\"title\":\"uqgovsxpwwztjfm\",\"description\":\"htgfred\",\"instructions\":[{\"parameters\":\"\\\"datacgrllc\\\"\",\"type\":\"na\"},{\"parameters\":\"\\\"datavjowazhpabac\\\"\",\"type\":\"mlyotg\"},{\"parameters\":\"\\\"datawsxnsrqor\\\"\",\"type\":\"genmvceb\"}],\"innerSteps\":[{},{},{}]},{\"title\":\"qu\",\"description\":\"cxxqndc\",\"instructions\":[{\"parameters\":\"\\\"datae\\\"\",\"type\":\"wqurc\"},{\"parameters\":\"\\\"dataojmrvvxwjongzse\\\"\",\"type\":\"qqrsil\"},{\"parameters\":\"\\\"datachskxxka\\\"\",\"type\":\"sbvr\"},{\"parameters\":\"\\\"dataaqgvto\\\"\",\"type\":\"rulfuct\"}],\"innerSteps\":[{},{}]},{\"title\":\"hcfjzhxlyubqjro\",\"description\":\"vrjeqmtzzbeqrztr\",\"instructions\":[{\"parameters\":\"\\\"dataxrd\\\"\",\"type\":\"absr\"},{\"parameters\":\"\\\"datarsnrhp\\\"\",\"type\":\"a\"},{\"parameters\":\"\\\"dataiwkkvya\\\"\",\"type\":\"xkvvcs\"},{\"parameters\":\"\\\"datamsvuvdjkqxetq\\\"\",\"type\":\"mlivrjjxnwx\"}],\"innerSteps\":[{},{}]}]},{\"title\":\"ojxl\",\"description\":\"z\",\"instructions\":[{\"parameters\":\"\\\"datagfquwz\\\"\",\"type\":\"w\"},{\"parameters\":\"\\\"dataibelwcerwkw\\\"\",\"type\":\"pjxljtxb\"},{\"parameters\":\"\\\"datasqtbxxniu\\\"\",\"type\":\"sdzhgbdgzpagsec\"},{\"parameters\":\"\\\"dataadbuwqrgxfllmqiy\\\"\",\"type\":\"ezoell\"}],\"innerSteps\":[{\"title\":\"iwvmtumxpymdjfu\",\"description\":\"roqvqpilrgu\",\"instructions\":[{\"parameters\":\"\\\"datanlduwzorxsbm\\\"\",\"type\":\"aqklxy\"},{\"parameters\":\"\\\"datax\\\"\",\"type\":\"qvfqepdxc\"},{\"parameters\":\"\\\"datatuubwyvpjb\\\"\",\"type\":\"wcpjqduqgi\"}],\"innerSteps\":[{},{},{}]},{\"title\":\"ydfbwlj\",\"description\":\"huerkjddvrglie\",\"instructions\":[{\"parameters\":\"\\\"datacvbiiftksdw\\\"\",\"type\":\"dnkefgm\"},{\"parameters\":\"\\\"datadhcebuv\\\"\",\"type\":\"zldbglzoutbaaqg\"},{\"parameters\":\"\\\"dataekaj\\\"\",\"type\":\"lyzgsnor\"}],\"innerSteps\":[{},{},{}]}]}]}") + .toObject(InstructionStep.class); + Assertions.assertEquals("irtneemmjau", model.title()); + Assertions.assertEquals("gxef", model.description()); + Assertions.assertEquals("udasmxubvfbng", model.instructions().get(0).type()); + Assertions.assertEquals("lregpq", model.innerSteps().get(0).title()); + Assertions.assertEquals("ojhvrz", model.innerSteps().get(0).description()); + Assertions.assertEquals("lp", model.innerSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("nsyby", model.innerSteps().get(0).innerSteps().get(0).title()); + Assertions.assertEquals("ol", model.innerSteps().get(0).innerSteps().get(0).description()); + Assertions.assertEquals("jwvuag", model.innerSteps().get(0).innerSteps().get(0).instructions().get(0).type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InstructionStep model = new InstructionStep().withTitle("irtneemmjau") + .withDescription("gxef") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"dataaitranizerw\"").withType("udasmxubvfbng"), + new InstructionStepDetails().withParameters("\"datacoce\"").withType("hpriylfm"), + new InstructionStepDetails().withParameters("\"dataztraud\"").withType("vhl"))) + .withInnerSteps(Arrays.asList( + new InstructionStep().withTitle("lregpq") + .withDescription("ojhvrz") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datagyshqrdgrtwmewj\"").withType("lp"), + new InstructionStepDetails().withParameters("\"datakcfazzw\"").withType("cayer"))) + .withInnerSteps(Arrays.asList(new InstructionStep().withTitle("nsyby") + .withDescription("ol") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"dataghsrleinkfscjfn\"").withType("jwvuag"), + new InstructionStepDetails().withParameters("\"dataqwtltngvmreupt\"").withType("klzmijajw"), + new InstructionStepDetails().withParameters("\"datal\"").withType("fsvagh"), + new InstructionStepDetails().withParameters("\"datapynwlslrcigtzjcv\"").withType("xqlaps"))) + .withInnerSteps( + Arrays.asList(new InstructionStep(), new InstructionStep(), new InstructionStep(), + new InstructionStep())), + new InstructionStep().withTitle("vyxpavidni") + .withDescription("wffcvvye") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datapuxgcbdsvalpnpt\"") + .withType("trkxgpazwu"), + new InstructionStepDetails().withParameters("\"datax\"").withType("qvn"), + new InstructionStepDetails().withParameters("\"dataobfelhldiuhz\"") + .withType("gqlmfaewzgi"), + new InstructionStepDetails().withParameters("\"datadjpxpqht\"").withType("qhnmhk"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep(), + new InstructionStep(), new InstructionStep())))), + new InstructionStep().withTitle("dsuxheqdgcrux") + .withDescription("inymmqgwokmikp") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"databmjxuvjipf\"").withType("vhax"), + new InstructionStepDetails().withParameters("\"datavwzaehp\"").withType("hthdklmvetatlakf"), + new InstructionStepDetails().withParameters("\"dataoixwgiksb\"").withType("vtooxrpo"))) + .withInnerSteps(Arrays.asList( + new InstructionStep().withTitle("chgjtnhtukfacih") + .withDescription("fntumeezbxvqx") + .withInstructions(Arrays + .asList(new InstructionStepDetails().withParameters("\"datavwcga\"").withType("gomtm"))) + .withInnerSteps(Arrays.asList(new InstructionStep())), + new InstructionStep().withTitle("uqgovsxpwwztjfm") + .withDescription("htgfred") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datacgrllc\"").withType("na"), + new InstructionStepDetails().withParameters("\"datavjowazhpabac\"").withType("mlyotg"), + new InstructionStepDetails().withParameters("\"datawsxnsrqor\"").withType("genmvceb"))) + .withInnerSteps( + Arrays.asList(new InstructionStep(), new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("qu") + .withDescription("cxxqndc") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datae\"").withType("wqurc"), + new InstructionStepDetails().withParameters("\"dataojmrvvxwjongzse\"") + .withType("qqrsil"), + new InstructionStepDetails().withParameters("\"datachskxxka\"").withType("sbvr"), + new InstructionStepDetails().withParameters("\"dataaqgvto\"").withType("rulfuct"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("hcfjzhxlyubqjro") + .withDescription("vrjeqmtzzbeqrztr") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"dataxrd\"").withType("absr"), + new InstructionStepDetails().withParameters("\"datarsnrhp\"").withType("a"), + new InstructionStepDetails().withParameters("\"dataiwkkvya\"").withType("xkvvcs"), + new InstructionStepDetails().withParameters("\"datamsvuvdjkqxetq\"") + .withType("mlivrjjxnwx"))) + .withInnerSteps(Arrays.asList(new InstructionStep(), new InstructionStep())))), + new InstructionStep().withTitle("ojxl") + .withDescription("z") + .withInstructions( + Arrays.asList(new InstructionStepDetails().withParameters("\"datagfquwz\"").withType("w"), + new InstructionStepDetails().withParameters("\"dataibelwcerwkw\"").withType("pjxljtxb"), + new InstructionStepDetails().withParameters("\"datasqtbxxniu\"") + .withType("sdzhgbdgzpagsec"), + new InstructionStepDetails().withParameters("\"dataadbuwqrgxfllmqiy\"").withType("ezoell"))) + .withInnerSteps(Arrays.asList( + new InstructionStep().withTitle("iwvmtumxpymdjfu") + .withDescription("roqvqpilrgu") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datanlduwzorxsbm\"").withType("aqklxy"), + new InstructionStepDetails().withParameters("\"datax\"").withType("qvfqepdxc"), + new InstructionStepDetails().withParameters("\"datatuubwyvpjb\"") + .withType("wcpjqduqgi"))) + .withInnerSteps( + Arrays.asList(new InstructionStep(), new InstructionStep(), new InstructionStep())), + new InstructionStep().withTitle("ydfbwlj") + .withDescription("huerkjddvrglie") + .withInstructions(Arrays.asList( + new InstructionStepDetails().withParameters("\"datacvbiiftksdw\"").withType("dnkefgm"), + new InstructionStepDetails().withParameters("\"datadhcebuv\"") + .withType("zldbglzoutbaaqg"), + new InstructionStepDetails().withParameters("\"dataekaj\"").withType("lyzgsnor"))) + .withInnerSteps( + Arrays.asList(new InstructionStep(), new InstructionStep(), new InstructionStep())))))); + model = BinaryData.fromObject(model).toObject(InstructionStep.class); + Assertions.assertEquals("irtneemmjau", model.title()); + Assertions.assertEquals("gxef", model.description()); + Assertions.assertEquals("udasmxubvfbng", model.instructions().get(0).type()); + Assertions.assertEquals("lregpq", model.innerSteps().get(0).title()); + Assertions.assertEquals("ojhvrz", model.innerSteps().get(0).description()); + Assertions.assertEquals("lp", model.innerSteps().get(0).instructions().get(0).type()); + Assertions.assertEquals("nsyby", model.innerSteps().get(0).innerSteps().get(0).title()); + Assertions.assertEquals("ol", model.innerSteps().get(0).innerSteps().get(0).description()); + Assertions.assertEquals("jwvuag", model.innerSteps().get(0).innerSteps().get(0).instructions().get(0).type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsInstructionsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsInstructionsItemTests.java new file mode 100644 index 000000000000..e2e36891f86c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsInstructionsItemTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import org.junit.jupiter.api.Assertions; + +public final class InstructionStepsInstructionsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InstructionStepsInstructionsItem model + = BinaryData.fromString("{\"parameters\":\"\\\"dataqnguba\\\"\",\"type\":\"InstructionStepsGroup\"}") + .toObject(InstructionStepsInstructionsItem.class); + Assertions.assertEquals(SettingType.INSTRUCTION_STEPS_GROUP, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InstructionStepsInstructionsItem model = new InstructionStepsInstructionsItem().withParameters("\"dataqnguba\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP); + model = BinaryData.fromObject(model).toObject(InstructionStepsInstructionsItem.class); + Assertions.assertEquals(SettingType.INSTRUCTION_STEPS_GROUP, model.type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsTests.java new file mode 100644 index 000000000000..cfbb2e4560a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/InstructionStepsTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.InstructionSteps; +import com.azure.resourcemanager.securityinsights.models.InstructionStepsInstructionsItem; +import com.azure.resourcemanager.securityinsights.models.SettingType; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class InstructionStepsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InstructionSteps model = BinaryData.fromString( + "{\"title\":\"zuzhasup\",\"description\":\"p\",\"instructions\":[{\"parameters\":\"\\\"datazvzqazvbkark\\\"\",\"type\":\"CopyableLabel\"},{\"parameters\":\"\\\"dataongru\\\"\",\"type\":\"InstructionStepsGroup\"},{\"parameters\":\"\\\"datayiysjqheni\\\"\",\"type\":\"InstructionStepsGroup\"}]}") + .toObject(InstructionSteps.class); + Assertions.assertEquals("zuzhasup", model.title()); + Assertions.assertEquals("p", model.description()); + Assertions.assertEquals(SettingType.COPYABLE_LABEL, model.instructions().get(0).type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + InstructionSteps model = new InstructionSteps().withTitle("zuzhasup") + .withDescription("p") + .withInstructions(Arrays.asList( + new InstructionStepsInstructionsItem().withParameters("\"datazvzqazvbkark\"") + .withType(SettingType.COPYABLE_LABEL), + new InstructionStepsInstructionsItem().withParameters("\"dataongru\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP), + new InstructionStepsInstructionsItem().withParameters("\"datayiysjqheni\"") + .withType(SettingType.INSTRUCTION_STEPS_GROUP))); + model = BinaryData.fromObject(model).toObject(InstructionSteps.class); + Assertions.assertEquals("zuzhasup", model.title()); + Assertions.assertEquals("p", model.description()); + Assertions.assertEquals(SettingType.COPYABLE_LABEL, model.instructions().get(0).type()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..afadf1f63b2d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.IoTCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class IoTCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IoTCheckRequirementsProperties model = BinaryData.fromString("{\"subscriptionId\":\"jgrpquafxgjqq\"}") + .toObject(IoTCheckRequirementsProperties.class); + Assertions.assertEquals("jgrpquafxgjqq", model.subscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IoTCheckRequirementsProperties model = new IoTCheckRequirementsProperties().withSubscriptionId("jgrpquafxgjqq"); + model = BinaryData.fromObject(model).toObject(IoTCheckRequirementsProperties.class); + Assertions.assertEquals("jgrpquafxgjqq", model.subscriptionId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsTests.java new file mode 100644 index 000000000000..b776d07fa940 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.IoTCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class IoTCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IoTCheckRequirements model + = BinaryData.fromString("{\"kind\":\"IOT\",\"properties\":{\"subscriptionId\":\"hdxity\"}}") + .toObject(IoTCheckRequirements.class); + Assertions.assertEquals("hdxity", model.subscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IoTCheckRequirements model = new IoTCheckRequirements().withSubscriptionId("hdxity"); + model = BinaryData.fromObject(model).toObject(IoTCheckRequirements.class); + Assertions.assertEquals("hdxity", model.subscriptionId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..9ed680d303be --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.IoTDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import org.junit.jupiter.api.Assertions; + +public final class IoTDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IoTDataConnectorProperties model = BinaryData + .fromString("{\"subscriptionId\":\"dkmdzgsszx\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") + .toObject(IoTDataConnectorProperties.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("dkmdzgsszx", model.subscriptionId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IoTDataConnectorProperties model = new IoTDataConnectorProperties() + .withDataTypes(new AlertsDataTypeOfDataConnector() + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))) + .withSubscriptionId("dkmdzgsszx"); + model = BinaryData.fromObject(model).toObject(IoTDataConnectorProperties.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("dkmdzgsszx", model.subscriptionId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorTests.java new file mode 100644 index 000000000000..82ce71134420 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDataConnectorTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.IoTDataConnector; +import org.junit.jupiter.api.Assertions; + +public final class IoTDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IoTDataConnector model = BinaryData.fromString( + "{\"kind\":\"IOT\",\"properties\":{\"subscriptionId\":\"cqrq\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"jtdrhutf\",\"id\":\"a\",\"name\":\"txop\",\"type\":\"eh\"}") + .toObject(IoTDataConnector.class); + Assertions.assertEquals("jtdrhutf", model.etag()); + Assertions.assertEquals("cqrq", model.subscriptionId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IoTDataConnector model = new IoTDataConnector().withEtag("jtdrhutf") + .withSubscriptionId("cqrq") + .withDataTypes(new AlertsDataTypeOfDataConnector() + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(IoTDataConnector.class); + Assertions.assertEquals("jtdrhutf", model.etag()); + Assertions.assertEquals("cqrq", model.subscriptionId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityPropertiesTests.java index 9e3006ce7ab0..93ef1936de5d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityPropertiesTests.java @@ -1,23 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.IoTDeviceEntityProperties; +import com.azure.resourcemanager.securityinsights.models.DeviceImportance; +import org.junit.jupiter.api.Assertions; public final class IoTDeviceEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IoTDeviceEntityProperties model = BinaryData.fromString( - "{\"deviceId\":\"jxtxrdc\",\"deviceName\":\"jvidttge\",\"source\":\"slvyjtcvuwkasi\",\"iotSecurityAgentId\":\"ba3f9ce6-cacb-4c01-8778-a7a6e4bf0e08\",\"deviceType\":\"sfuughtuqfecjx\",\"vendor\":\"gtuhxuicbu\",\"edgeId\":\"mr\",\"macAddress\":\"njlx\",\"model\":\"rhwpus\",\"serialNumber\":\"baqehgpdoh\",\"firmwareVersion\":\"qatucoigebxnc\",\"operatingSystem\":\"fepbnwgfmxjgc\",\"iotHubEntityId\":\"jbgdlfgtdysnaquf\",\"hostEntityId\":\"bctqhamzjrwd\",\"ipAddressEntityId\":\"zeqyjleziun\",\"threatIntelligence\":[{\"confidence\":52.45288148920413,\"providerName\":\"tkw\",\"reportLink\":\"gyamlbnseqacjjv\",\"threatDescription\":\"lguooqjagmd\",\"threatName\":\"gueiookjbsahrtdt\",\"threatType\":\"elqacslmot\"},{\"confidence\":44.88763883209227,\"providerName\":\"xofvcjk\",\"reportLink\":\"irazftxejwabmd\",\"threatDescription\":\"tmvcop\",\"threatName\":\"c\",\"threatType\":\"urbuhhlkyqltq\"},{\"confidence\":20.089415326798854,\"providerName\":\"uwkffdjktsysid\",\"reportLink\":\"c\",\"threatDescription\":\"lxnfuijtkbusqogs\",\"threatName\":\"kayi\",\"threatType\":\"sharujtj\"}],\"protocols\":[\"fzyjqt\"],\"additionalData\":{\"qqekewvnqvcdlgu\":\"datakpqhjpenuygbq\",\"nlaxpunjqikcz\":\"dataucmfdj\",\"xmfcsserxhtv\":\"datavitac\",\"tsjgqrsx\":\"dataoxhlw\"},\"friendlyName\":\"ruuuybnch\"}") + "{\"deviceId\":\"wqagnepzwa\",\"deviceName\":\"sbs\",\"source\":\"qqagwwr\",\"iotSecurityAgentId\":\"omzisglrrcz\",\"deviceType\":\"k\",\"vendor\":\"ltn\",\"edgeId\":\"dhqoawj\",\"macAddress\":\"yueayfbpcmsp\",\"model\":\"yrrueqth\",\"serialNumber\":\"gnmbscbbxigdhx\",\"firmwareVersion\":\"d\",\"operatingSystem\":\"pedbwdpyqy\",\"iotHubEntityId\":\"xubmdnafcbqw\",\"hostEntityId\":\"mjel\",\"ipAddressEntityId\":\"acigel\",\"threatIntelligence\":[{\"confidence\":87.31091276669832,\"providerName\":\"vwzkj\",\"reportLink\":\"wbeonrlkwzdqy\",\"threatDescription\":\"ceakxc\",\"threatName\":\"soqfyiaseqchkrt\",\"threatType\":\"razisg\"},{\"confidence\":91.55731524796032,\"providerName\":\"mvanbwzo\",\"reportLink\":\"nrxxbsojklin\",\"threatDescription\":\"dptysprqs\",\"threatName\":\"zxojpslsv\",\"threatType\":\"pli\"},{\"confidence\":81.04205822269522,\"providerName\":\"oyxqvapcohhou\",\"reportLink\":\"pqojxcx\",\"threatDescription\":\"zdcgdzbenr\",\"threatName\":\"cawetzqddt\",\"threatType\":\"fljhznamtua\"}],\"protocols\":[\"wcjjncqt\",\"z\",\"izvg\"],\"owners\":[\"tzuuvb\",\"ngrebwg\"],\"nicEntityIds\":[\"ttzlswvajqfutlx\",\"oqza\",\"unwqr\",\"zfrgqhaohcm\"],\"site\":\"oc\",\"zone\":\"r\",\"sensor\":\"mbpyryxamebly\",\"deviceSubType\":\"vkfkmr\",\"importance\":\"Unknown\",\"purdueLayer\":\"e\",\"isAuthorized\":false,\"isProgramming\":false,\"isScanner\":false,\"additionalData\":{\"unssxlghieegjl\":\"\\\"datapyapucygvoav\\\"\",\"eksgbuxantuygd\":\"\\\"datavvpa\\\"\",\"irpiwrqofulopmj\":\"\\\"datagaqi\\\"\",\"bke\":\"\\\"datalexwhcbjp\\\"\"},\"friendlyName\":\"uuuercta\"}") .toObject(IoTDeviceEntityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTDeviceEntityProperties model = new IoTDeviceEntityProperties(); - model = BinaryData.fromObject(model).toObject(IoTDeviceEntityProperties.class); + Assertions.assertEquals(DeviceImportance.UNKNOWN, model.importance()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityTests.java index 8668e7140b36..baf948a009bd 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IoTDeviceEntityTests.java @@ -1,23 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DeviceImportance; import com.azure.resourcemanager.securityinsights.models.IoTDeviceEntity; +import org.junit.jupiter.api.Assertions; public final class IoTDeviceEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IoTDeviceEntity model = BinaryData.fromString( - "{\"kind\":\"IoTDevice\",\"properties\":{\"deviceId\":\"ebqinjipnw\",\"deviceName\":\"ujqlafcbahh\",\"source\":\"pofoi\",\"iotSecurityAgentId\":\"34cc2481-801e-491b-a659-2b18f00be92c\",\"deviceType\":\"p\",\"vendor\":\"lkmkkholvdndvi\",\"edgeId\":\"ogphuartvtiu\",\"macAddress\":\"efchn\",\"model\":\"ahmnxhkxjqirw\",\"serialNumber\":\"eooxffifh\",\"firmwareVersion\":\"rsnewmozqvbubqma\",\"operatingSystem\":\"sycxhxzgaz\",\"iotHubEntityId\":\"abo\",\"hostEntityId\":\"vmfqhppubo\",\"ipAddressEntityId\":\"epdfgkmtdherng\",\"threatIntelligence\":[{\"confidence\":33.38182566342388,\"providerName\":\"okqtobk\",\"reportLink\":\"xof\",\"threatDescription\":\"fphwpnu\",\"threatName\":\"iywzejy\",\"threatType\":\"slwkojpl\"}],\"protocols\":[\"npdwr\",\"qafgfugsnnfhyet\",\"fypococtfjgti\"],\"additionalData\":{\"wolba\":\"datavzuyturmlmu\",\"pngajin\":\"datairopionszon\"},\"friendlyName\":\"xjawrt\"},\"id\":\"fjmyccxlzhco\",\"name\":\"ovne\",\"type\":\"henlusfnr\"}") + "{\"kind\":\"IoTDevice\",\"properties\":{\"deviceId\":\"tymkmvguihywart\",\"deviceName\":\"phkixkykxdssjpe\",\"source\":\"ucfx\",\"iotSecurityAgentId\":\"kkflrmymyincqlhr\",\"deviceType\":\"wslmiiiovgqcg\",\"vendor\":\"ugqkctotiowlxteq\",\"edgeId\":\"tjgwdtguk\",\"macAddress\":\"nblwphqlkcc\",\"model\":\"gygqwah\",\"serialNumber\":\"ulwgniiprglvawuw\",\"firmwareVersion\":\"ufypiv\",\"operatingSystem\":\"bbjpmcubkmif\",\"iotHubEntityId\":\"xkubvphavpmhbrbq\",\"hostEntityId\":\"govpbbtte\",\"ipAddressEntityId\":\"oknssqyzqedikdf\",\"threatIntelligence\":[{\"confidence\":26.596158565768114,\"providerName\":\"jgeihfqlggwfi\",\"reportLink\":\"cxmjpbyephmg\",\"threatDescription\":\"ljvrcmyfqipgxhnp\",\"threatName\":\"yqwcabvnuil\",\"threatType\":\"yaswlpaugmr\"},{\"confidence\":78.18727376266862,\"providerName\":\"xwtoaukhfkvc\",\"reportLink\":\"izmoaeds\",\"threatDescription\":\"wuived\",\"threatName\":\"gyeewxeiq\",\"threatType\":\"smgomguaml\"},{\"confidence\":4.1694469822149856,\"providerName\":\"msplzgaufcshhvn\",\"reportLink\":\"gnxkympqan\",\"threatDescription\":\"jk\",\"threatName\":\"tw\",\"threatType\":\"aoypny\"}],\"protocols\":[\"hxcylhkgm\",\"sghpx\",\"cphdrwjjkhvyo\"],\"owners\":[\"luzvxnq\"],\"nicEntityIds\":[\"pqpdfwmkoisqc\",\"sffxui\"],\"site\":\"csypobkdqzrdzsyl\",\"zone\":\"lgtrczzy\",\"sensor\":\"xzji\",\"deviceSubType\":\"vuaurk\",\"importance\":\"Unknown\",\"purdueLayer\":\"rldefxrdcox\",\"isAuthorized\":true,\"isProgramming\":false,\"isScanner\":false,\"additionalData\":{\"zxqltgrdogypx\":\"\\\"datannqbnqbp\\\"\",\"bfihw\":\"\\\"datax\\\"\"},\"friendlyName\":\"vctafsrb\"},\"id\":\"blml\",\"name\":\"owxih\",\"type\":\"p\"}") .toObject(IoTDeviceEntity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTDeviceEntity model = new IoTDeviceEntity(); - model = BinaryData.fromObject(model).toObject(IoTDeviceEntity.class); + Assertions.assertEquals(DeviceImportance.UNKNOWN, model.importance()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobInnerTests.java new file mode 100644 index 000000000000..77e6865ca8e2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.JobInner; +import org.junit.jupiter.api.Assertions; + +public final class JobInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobInner model = BinaryData.fromString( + "{\"properties\":{\"endTime\":\"2021-11-04T06:50:07Z\",\"items\":[{\"resourceId\":\"rcppqvovsirtas\",\"status\":\"Active\",\"executionTime\":\"2021-12-06T02:44:49Z\",\"errors\":[{\"memberResourceName\":\"xhhjjatl\",\"errorMessage\":\"p\"},{\"memberResourceName\":\"biroxamnvrcq\",\"errorMessage\":\"pbainsihdzxeufjy\"},{\"memberResourceName\":\"tzmmxdmppibv\",\"errorMessage\":\"qjcphofyoqfvm\"},{\"memberResourceName\":\"wplx\",\"errorMessage\":\"uzltn\"}]}],\"provisioningState\":\"Canceled\",\"startTime\":\"2021-07-24T22:06:31Z\",\"errorMessage\":\"gtejtyx\"},\"etag\":\"ycckjrqdtykcaocj\",\"id\":\"xqnkicwmrwciyn\",\"name\":\"cvewlrjrna\",\"type\":\"tjopig\"}") + .toObject(JobInner.class); + Assertions.assertEquals("ycckjrqdtykcaocj", model.etag()); + Assertions.assertEquals("rcppqvovsirtas", model.items().get(0).resourceId()); + Assertions.assertEquals("xhhjjatl", model.items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("p", model.items().get(0).errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobItemTests.java new file mode 100644 index 000000000000..76402fc88a3d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobItemTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.JobItem; +import org.junit.jupiter.api.Assertions; + +public final class JobItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobItem model = BinaryData.fromString( + "{\"resourceId\":\"ucmiqsdsnu\",\"status\":\"New\",\"executionTime\":\"2021-11-07T00:10:32Z\",\"errors\":[{\"memberResourceName\":\"iuttkasxj\",\"errorMessage\":\"clzqpasri\"},{\"memberResourceName\":\"etbhlbhkijqgcvqe\",\"errorMessage\":\"xrqiwxeppuhkizoa\"},{\"memberResourceName\":\"zvj\",\"errorMessage\":\"vob\"},{\"memberResourceName\":\"vfbmxzobpg\",\"errorMessage\":\"s\"}]}") + .toObject(JobItem.class); + Assertions.assertEquals("ucmiqsdsnu", model.resourceId()); + Assertions.assertEquals("iuttkasxj", model.errors().get(0).memberResourceName()); + Assertions.assertEquals("clzqpasri", model.errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobListTests.java new file mode 100644 index 000000000000..12a39d491b7d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobListTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.JobList; +import org.junit.jupiter.api.Assertions; + +public final class JobListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"endTime\":\"2021-10-31T21:27:06Z\",\"items\":[{\"resourceId\":\"wubtegoachojit\",\"status\":\"New\",\"executionTime\":\"2021-07-31T14:19:28Z\",\"errors\":[{\"memberResourceName\":\"iplxrifbsb\",\"errorMessage\":\"vfkvdbb\"},{\"memberResourceName\":\"oijsxv\",\"errorMessage\":\"utjit\"}]},{\"resourceId\":\"fknarscxnktp\",\"status\":\"New\",\"executionTime\":\"2021-12-09T15:41:51Z\",\"errors\":[{\"memberResourceName\":\"rsm\",\"errorMessage\":\"nn\"},{\"memberResourceName\":\"wnwoxve\",\"errorMessage\":\"wwqchxowppvux\"}]},{\"resourceId\":\"cto\",\"status\":\"Succeeded\",\"executionTime\":\"2021-11-30T23:10:37Z\",\"errors\":[{\"memberResourceName\":\"rrgnvuolvptv\",\"errorMessage\":\"lbkize\"}]},{\"resourceId\":\"rw\",\"status\":\"New\",\"executionTime\":\"2021-02-25T13:15:52Z\",\"errors\":[{\"memberResourceName\":\"oiq\",\"errorMessage\":\"etzgwywyxbwuam\"},{\"memberResourceName\":\"aopqqiyjrehedche\",\"errorMessage\":\"gmx\"}]}],\"provisioningState\":\"InProgress\",\"startTime\":\"2021-07-10T22:02:16Z\",\"errorMessage\":\"ngromlxsqdzyyalr\"},\"etag\":\"gq\",\"id\":\"fwuplfjkbax\",\"name\":\"useimuipg\",\"type\":\"ta\"},{\"properties\":{\"endTime\":\"2021-11-05T23:43:53Z\",\"items\":[{\"resourceId\":\"pldzipheife\",\"status\":\"Active\",\"executionTime\":\"2021-08-14T15:55:41Z\",\"errors\":[{\"memberResourceName\":\"yamvr\",\"errorMessage\":\"tjjhqvypqgncgw\"}]},{\"resourceId\":\"btkafcnfit\",\"status\":\"New\",\"executionTime\":\"2021-05-19T14:24:22Z\",\"errors\":[{\"memberResourceName\":\"wyjdvyxxbawjgy\",\"errorMessage\":\"goudcl\"},{\"memberResourceName\":\"idqlynx\",\"errorMessage\":\"disjeovgc\"}]}],\"provisioningState\":\"Canceled\",\"startTime\":\"2021-03-30T08:48:43Z\",\"errorMessage\":\"onrhdibzvp\"},\"etag\":\"y\",\"id\":\"eouiuvkcnqonjbb\",\"name\":\"wsfllzykzp\",\"type\":\"jdslpbyejsgbpjjn\"},{\"properties\":{\"endTime\":\"2021-10-10T03:53:45Z\",\"items\":[{\"resourceId\":\"ivwbddnddctkjcq\",\"status\":\"Closed\",\"executionTime\":\"2020-12-22T03:09:04Z\",\"errors\":[{\"memberResourceName\":\"qilsbabqtjch\",\"errorMessage\":\"sfwey\"},{\"memberResourceName\":\"eiyem\",\"errorMessage\":\"ipszekdq\"},{\"memberResourceName\":\"wcspfhrndqymlos\",\"errorMessage\":\"qgs\"},{\"memberResourceName\":\"qnqqzqdvg\",\"errorMessage\":\"omtkgoynya\"}]},{\"resourceId\":\"wphbuzmvjil\",\"status\":\"Backlog\",\"executionTime\":\"2021-06-14T11:13:36Z\",\"errors\":[{\"memberResourceName\":\"t\",\"errorMessage\":\"ai\"},{\"memberResourceName\":\"hrjwyxduwimwnuvj\",\"errorMessage\":\"ywpfxiwjfkmnjtk\"},{\"memberResourceName\":\"wmyjdbcknsojtmpd\",\"errorMessage\":\"cbpkig\"}]},{\"resourceId\":\"va\",\"status\":\"Approved\",\"executionTime\":\"2021-06-13T02:20:06Z\",\"errors\":[{\"memberResourceName\":\"wg\",\"errorMessage\":\"ssctnppx\"},{\"memberResourceName\":\"eysqen\",\"errorMessage\":\"wugonysemunvzmvn\"},{\"memberResourceName\":\"cklssxuu\",\"errorMessage\":\"svfsuk\"},{\"memberResourceName\":\"ki\",\"errorMessage\":\"albckpn\"}]}],\"provisioningState\":\"InProgress\",\"startTime\":\"2021-08-01T21:27:11Z\",\"errorMessage\":\"ztorazwkcohjxoc\"},\"etag\":\"vuamorhkneuuu\",\"id\":\"wizznkrarjii\",\"name\":\"pbychcwhlhdzdcrl\",\"type\":\"cmeyxypxlzcr\"}],\"nextLink\":\"fvjzcvetpde\"}") + .toObject(JobList.class); + Assertions.assertEquals("gq", model.value().get(0).etag()); + Assertions.assertEquals("wubtegoachojit", model.value().get(0).items().get(0).resourceId()); + Assertions.assertEquals("iplxrifbsb", model.value().get(0).items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("vfkvdbb", model.value().get(0).items().get(0).errors().get(0).errorMessage()); + Assertions.assertEquals("fvjzcvetpde", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobPropertiesTests.java new file mode 100644 index 000000000000..2f6ba5a5185f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/JobPropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.JobProperties; +import org.junit.jupiter.api.Assertions; + +public final class JobPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobProperties model = BinaryData.fromString( + "{\"endTime\":\"2021-09-29T18:42:54Z\",\"items\":[{\"resourceId\":\"jchhrrxmcztrqnua\",\"status\":\"Backlog\",\"executionTime\":\"2021-03-01T07:51:14Z\",\"errors\":[{\"memberResourceName\":\"rbdujpshiszivr\",\"errorMessage\":\"cyulwzjorvsgmkk\"},{\"memberResourceName\":\"les\",\"errorMessage\":\"jckyocyb\"},{\"memberResourceName\":\"lwdmpsdfsla\",\"errorMessage\":\"ktnhyylipvqpqu\"}]},{\"resourceId\":\"xnpoaer\",\"status\":\"Active\",\"executionTime\":\"2021-03-09T08:05:15Z\",\"errors\":[{\"memberResourceName\":\"wlzlmpiprlcgqe\",\"errorMessage\":\"mnwyhqlybm\"},{\"memberResourceName\":\"mxu\",\"errorMessage\":\"mkpa\"},{\"memberResourceName\":\"e\",\"errorMessage\":\"wpbnjcko\"},{\"memberResourceName\":\"tun\",\"errorMessage\":\"umy\"}]},{\"resourceId\":\"n\",\"status\":\"Approved\",\"executionTime\":\"2021-12-01T07:41:01Z\",\"errors\":[{\"memberResourceName\":\"mvhbzypmmyrggs\",\"errorMessage\":\"ouzo\"},{\"memberResourceName\":\"ihqlwyqsxeqtltl\",\"errorMessage\":\"czcxouaneuepgq\"}]}],\"provisioningState\":\"Canceled\",\"startTime\":\"2021-02-07T07:32:30Z\",\"errorMessage\":\"slvwpvdmtfc\"}") + .toObject(JobProperties.class); + Assertions.assertEquals("jchhrrxmcztrqnua", model.items().get(0).resourceId()); + Assertions.assertEquals("rbdujpshiszivr", model.items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("cyulwzjorvsgmkk", model.items().get(0).errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/LastDataReceivedDataTypeTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/LastDataReceivedDataTypeTests.java new file mode 100644 index 000000000000..8ab435a95e65 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/LastDataReceivedDataTypeTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.LastDataReceivedDataType; +import org.junit.jupiter.api.Assertions; + +public final class LastDataReceivedDataTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LastDataReceivedDataType model + = BinaryData.fromString("{\"name\":\"toxjdzj\",\"lastDataReceivedQuery\":\"znvhxqqmq\"}") + .toObject(LastDataReceivedDataType.class); + Assertions.assertEquals("toxjdzj", model.name()); + Assertions.assertEquals("znvhxqqmq", model.lastDataReceivedQuery()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LastDataReceivedDataType model + = new LastDataReceivedDataType().withName("toxjdzj").withLastDataReceivedQuery("znvhxqqmq"); + model = BinaryData.fromObject(model).toObject(LastDataReceivedDataType.class); + Assertions.assertEquals("toxjdzj", model.name()); + Assertions.assertEquals("znvhxqqmq", model.lastDataReceivedQuery()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..ade6cd727000 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MCASCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class MCASCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MCASCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"cbcendidhue\"}").toObject(MCASCheckRequirementsProperties.class); + Assertions.assertEquals("cbcendidhue", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MCASCheckRequirementsProperties model = new MCASCheckRequirementsProperties().withTenantId("cbcendidhue"); + model = BinaryData.fromObject(model).toObject(MCASCheckRequirementsProperties.class); + Assertions.assertEquals("cbcendidhue", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsTests.java new file mode 100644 index 000000000000..48c101213020 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MCASCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class MCASCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MCASCheckRequirements model + = BinaryData.fromString("{\"kind\":\"MicrosoftCloudAppSecurity\",\"properties\":{\"tenantId\":\"td\"}}") + .toObject(MCASCheckRequirements.class); + Assertions.assertEquals("td", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MCASCheckRequirements model = new MCASCheckRequirements().withTenantId("td"); + model = BinaryData.fromObject(model).toObject(MCASCheckRequirements.class); + Assertions.assertEquals("td", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASDataConnectorPropertiesTests.java similarity index 67% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorPropertiesTests.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASDataConnectorPropertiesTests.java index 36d6666291a0..4b444ac851b8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MCASDataConnectorPropertiesTests.java @@ -1,35 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.McasDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.MCASDataConnectorProperties; import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; import com.azure.resourcemanager.securityinsights.models.DataTypeState; import com.azure.resourcemanager.securityinsights.models.McasDataConnectorDataTypes; import org.junit.jupiter.api.Assertions; -public final class McasDataConnectorPropertiesTests { +public final class MCASDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - McasDataConnectorProperties model = BinaryData.fromString( - "{\"tenantId\":\"q\",\"dataTypes\":{\"discoveryLogs\":{\"state\":\"Disabled\"},\"alerts\":{\"state\":\"Enabled\"}}}") - .toObject(McasDataConnectorProperties.class); - Assertions.assertEquals("q", model.tenantId()); + MCASDataConnectorProperties model = BinaryData.fromString( + "{\"dataTypes\":{\"discoveryLogs\":{\"state\":\"Disabled\"},\"alerts\":{\"state\":\"Enabled\"}},\"tenantId\":\"eqi\"}") + .toObject(MCASDataConnectorProperties.class); + Assertions.assertEquals("eqi", model.tenantId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().discoveryLogs().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - McasDataConnectorProperties model = new McasDataConnectorProperties().withTenantId("q") + MCASDataConnectorProperties model = new MCASDataConnectorProperties().withTenantId("eqi") .withDataTypes(new McasDataConnectorDataTypes() .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED)) .withDiscoveryLogs(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); - model = BinaryData.fromObject(model).toObject(McasDataConnectorProperties.class); - Assertions.assertEquals("q", model.tenantId()); + model = BinaryData.fromObject(model).toObject(MCASDataConnectorProperties.class); + Assertions.assertEquals("eqi", model.tenantId()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().discoveryLogs().state()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..90d22cd73f21 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MDATPCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class MDATPCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MDATPCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"asgukq\"}").toObject(MDATPCheckRequirementsProperties.class); + Assertions.assertEquals("asgukq", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MDATPCheckRequirementsProperties model = new MDATPCheckRequirementsProperties().withTenantId("asgukq"); + model = BinaryData.fromObject(model).toObject(MDATPCheckRequirementsProperties.class); + Assertions.assertEquals("asgukq", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsTests.java new file mode 100644 index 000000000000..a129c23059c7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPCheckRequirementsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MDATPCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class MDATPCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MDATPCheckRequirements model = BinaryData + .fromString( + "{\"kind\":\"MicrosoftDefenderAdvancedThreatProtection\",\"properties\":{\"tenantId\":\"kwcx\"}}") + .toObject(MDATPCheckRequirements.class); + Assertions.assertEquals("kwcx", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MDATPCheckRequirements model = new MDATPCheckRequirements().withTenantId("kwcx"); + model = BinaryData.fromObject(model).toObject(MDATPCheckRequirements.class); + Assertions.assertEquals("kwcx", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MdatpDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPDataConnectorPropertiesTests.java similarity index 62% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MdatpDataConnectorPropertiesTests.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPDataConnectorPropertiesTests.java index 08302f47ba11..e883687fdef2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MdatpDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MDATPDataConnectorPropertiesTests.java @@ -1,33 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.MdatpDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.MDATPDataConnectorProperties; import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; import com.azure.resourcemanager.securityinsights.models.DataTypeState; import org.junit.jupiter.api.Assertions; -public final class MdatpDataConnectorPropertiesTests { +public final class MDATPDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MdatpDataConnectorProperties model - = BinaryData.fromString("{\"tenantId\":\"h\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") - .toObject(MdatpDataConnectorProperties.class); - Assertions.assertEquals("h", model.tenantId()); + MDATPDataConnectorProperties model + = BinaryData.fromString("{\"tenantId\":\"mrkkhmwd\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") + .toObject(MDATPDataConnectorProperties.class); + Assertions.assertEquals("mrkkhmwd", model.tenantId()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MdatpDataConnectorProperties model = new MdatpDataConnectorProperties().withTenantId("h") + MDATPDataConnectorProperties model = new MDATPDataConnectorProperties().withTenantId("mrkkhmwd") .withDataTypes(new AlertsDataTypeOfDataConnector() .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); - model = BinaryData.fromObject(model).toObject(MdatpDataConnectorProperties.class); - Assertions.assertEquals("h", model.tenantId()); + model = BinaryData.fromObject(model).toObject(MDATPDataConnectorProperties.class); + Assertions.assertEquals("mrkkhmwd", model.tenantId()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRulePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRulePropertiesTests.java new file mode 100644 index 000000000000..5f7ac370082b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRulePropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class MLBehaviorAnalyticsAlertRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MLBehaviorAnalyticsAlertRuleProperties model = BinaryData.fromString( + "{\"alertRuleTemplateName\":\"zdobpxjmflbvvnch\",\"description\":\"cciw\",\"displayName\":\"juqk\",\"enabled\":false,\"lastModifiedUtc\":\"2021-01-03T21:23:18Z\",\"severity\":\"Medium\",\"tactics\":[\"InitialAccess\"],\"techniques\":[\"oskg\",\"sauuimj\",\"vxieduugidyj\",\"rfbyaosvexcso\"],\"subTechniques\":[\"lhocohslkev\",\"eggzfb\",\"hfmvfaxkffe\"]}") + .toObject(MLBehaviorAnalyticsAlertRuleProperties.class); + Assertions.assertEquals("zdobpxjmflbvvnch", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MLBehaviorAnalyticsAlertRuleProperties model + = new MLBehaviorAnalyticsAlertRuleProperties().withAlertRuleTemplateName("zdobpxjmflbvvnch") + .withEnabled(false); + model = BinaryData.fromObject(model).toObject(MLBehaviorAnalyticsAlertRuleProperties.class); + Assertions.assertEquals("zdobpxjmflbvvnch", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplatePropertiesTests.java new file mode 100644 index 000000000000..db82e9e55d07 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplatePropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MLBehaviorAnalyticsAlertRuleTemplateProperties; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import org.junit.jupiter.api.Assertions; + +public final class MLBehaviorAnalyticsAlertRuleTemplatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MLBehaviorAnalyticsAlertRuleTemplateProperties model = BinaryData.fromString( + "{\"severity\":\"High\",\"tactics\":[\"Execution\",\"DefenseEvasion\",\"CredentialAccess\"],\"techniques\":[\"navvwx\",\"ibyqunyowxwlmdj\"],\"alertRulesCreatedByTemplateCount\":1085300316,\"lastUpdatedDateUTC\":\"2021-03-04T04:22:45Z\",\"createdDateUTC\":\"2021-08-07T01:52:17Z\",\"description\":\"vpdbodaciz\",\"displayName\":\"q\",\"requiredDataConnectors\":[{\"connectorId\":\"r\",\"dataTypes\":[\"eibq\",\"p\"]},{\"connectorId\":\"ghvxndzwmkrefa\",\"dataTypes\":[\"orwkqnyh\",\"b\",\"j\",\"jivfxzsjabib\"]},{\"connectorId\":\"stawfsdjpvkv\",\"dataTypes\":[\"xbkzbzkdvncj\",\"budurgkakmo\",\"zhjjklffhmouwq\"]}],\"status\":\"Available\"}") + .toObject(MLBehaviorAnalyticsAlertRuleTemplateProperties.class); + Assertions.assertEquals(1085300316, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("vpdbodaciz", model.description()); + Assertions.assertEquals("q", model.displayName()); + Assertions.assertEquals("r", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("eibq", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.AVAILABLE, model.status()); + Assertions.assertEquals(AttackTactic.EXECUTION, model.tactics().get(0)); + Assertions.assertEquals("navvwx", model.techniques().get(0)); + Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplateTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplateTests.java new file mode 100644 index 000000000000..2d68626a67ea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTemplateTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import org.junit.jupiter.api.Assertions; + +public final class MLBehaviorAnalyticsAlertRuleTemplateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MLBehaviorAnalyticsAlertRuleTemplate model = BinaryData.fromString( + "{\"kind\":\"MLBehaviorAnalytics\",\"properties\":{\"severity\":\"Informational\",\"tactics\":[\"LateralMovement\",\"Exfiltration\",\"PreAttack\",\"Discovery\"],\"techniques\":[\"ae\",\"u\",\"ah\",\"icslfaoq\"],\"alertRulesCreatedByTemplateCount\":1792279483,\"lastUpdatedDateUTC\":\"2021-04-23T06:55:46Z\",\"createdDateUTC\":\"2021-05-31T05:00:15Z\",\"description\":\"lnswhcc\",\"displayName\":\"hka\",\"requiredDataConnectors\":[{\"connectorId\":\"tqscywug\",\"dataTypes\":[\"luhczbw\",\"mhairsbrgzdwmsw\",\"ypqwdxggiccc\"]},{\"connectorId\":\"qhuexm\",\"dataTypes\":[\"lstvlzywe\",\"hz\",\"ncsdtclusiyp\"]},{\"connectorId\":\"fgytguslfeadcyg\",\"dataTypes\":[\"yhejhzisxgfp\",\"lolp\",\"vk\"]},{\"connectorId\":\"pqvujzraehtwdwrf\",\"dataTypes\":[\"iby\"]}],\"status\":\"Available\"},\"id\":\"bhshfwpracstwity\",\"name\":\"hevxcced\",\"type\":\"pnmdyodnwzxltjcv\"}") + .toObject(MLBehaviorAnalyticsAlertRuleTemplate.class); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); + Assertions.assertEquals(AttackTactic.LATERAL_MOVEMENT, model.tactics().get(0)); + Assertions.assertEquals("ae", model.techniques().get(0)); + Assertions.assertEquals(1792279483, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("lnswhcc", model.description()); + Assertions.assertEquals("hka", model.displayName()); + Assertions.assertEquals("tqscywug", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("luhczbw", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.AVAILABLE, model.status()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTests.java new file mode 100644 index 000000000000..6c994691e110 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MLBehaviorAnalyticsAlertRuleTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MLBehaviorAnalyticsAlertRule; +import org.junit.jupiter.api.Assertions; + +public final class MLBehaviorAnalyticsAlertRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MLBehaviorAnalyticsAlertRule model = BinaryData.fromString( + "{\"kind\":\"MLBehaviorAnalytics\",\"properties\":{\"alertRuleTemplateName\":\"thfuiuaodsfcpkvx\",\"description\":\"puozmyzydag\",\"displayName\":\"axbezyiuo\",\"enabled\":false,\"lastModifiedUtc\":\"2021-04-30T01:33:41Z\",\"severity\":\"Low\",\"tactics\":[\"CredentialAccess\"],\"techniques\":[\"wqsmbsur\",\"xim\",\"ryocfsfksymdd\",\"stkiiuxhqyud\"],\"subTechniques\":[\"rq\",\"b\",\"oczvy\",\"fqrvkdvjsllrmvvd\"]},\"etag\":\"atkpnp\",\"id\":\"exxbczwtr\",\"name\":\"wiqzbqjvsovmyo\",\"type\":\"acspkwl\"}") + .toObject(MLBehaviorAnalyticsAlertRule.class); + Assertions.assertEquals("atkpnp", model.etag()); + Assertions.assertEquals("thfuiuaodsfcpkvx", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MLBehaviorAnalyticsAlertRule model = new MLBehaviorAnalyticsAlertRule().withEtag("atkpnp") + .withAlertRuleTemplateName("thfuiuaodsfcpkvx") + .withEnabled(false); + model = BinaryData.fromObject(model).toObject(MLBehaviorAnalyticsAlertRule.class); + Assertions.assertEquals("atkpnp", model.etag()); + Assertions.assertEquals("thfuiuaodsfcpkvx", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..87830020f405 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MSTICheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class MSTICheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MSTICheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"bfvkiwmqnwm\"}").toObject(MSTICheckRequirementsProperties.class); + Assertions.assertEquals("bfvkiwmqnwm", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MSTICheckRequirementsProperties model = new MSTICheckRequirementsProperties().withTenantId("bfvkiwmqnwm"); + model = BinaryData.fromObject(model).toObject(MSTICheckRequirementsProperties.class); + Assertions.assertEquals("bfvkiwmqnwm", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsTests.java new file mode 100644 index 000000000000..45b66385d3a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTICheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MSTICheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class MSTICheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MSTICheckRequirements model + = BinaryData.fromString("{\"kind\":\"MicrosoftThreatIntelligence\",\"properties\":{\"tenantId\":\"iy\"}}") + .toObject(MSTICheckRequirements.class); + Assertions.assertEquals("iy", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MSTICheckRequirements model = new MSTICheckRequirements().withTenantId("iy"); + model = BinaryData.fromObject(model).toObject(MSTICheckRequirements.class); + Assertions.assertEquals("iy", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorDataTypesTests.java new file mode 100644 index 000000000000..2534219a8aca --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorDataTypesTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MSTIDataConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MSTIDataConnectorDataTypes model = BinaryData.fromString( + "{\"microsoftEmergingThreatFeed\":{\"lookbackPeriod\":\"2021-01-29T07:11:41Z\",\"state\":\"Disabled\"}}") + .toObject(MSTIDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.microsoftEmergingThreatFeed().state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-29T07:11:41Z"), + model.microsoftEmergingThreatFeed().lookbackPeriod()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MSTIDataConnectorDataTypes model = new MSTIDataConnectorDataTypes().withMicrosoftEmergingThreatFeed( + new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed().withState(DataTypeState.DISABLED) + .withLookbackPeriod(OffsetDateTime.parse("2021-01-29T07:11:41Z"))); + model = BinaryData.fromObject(model).toObject(MSTIDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.microsoftEmergingThreatFeed().state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-29T07:11:41Z"), + model.microsoftEmergingThreatFeed().lookbackPeriod()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..cbba3a80b6fc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorPropertiesTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MSTIDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MSTIDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MSTIDataConnectorProperties model = BinaryData.fromString( + "{\"dataTypes\":{\"microsoftEmergingThreatFeed\":{\"lookbackPeriod\":\"2021-02-13T18:31:36Z\",\"state\":\"Enabled\"}},\"tenantId\":\"oqar\"}") + .toObject(MSTIDataConnectorProperties.class); + Assertions.assertEquals("oqar", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().microsoftEmergingThreatFeed().state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T18:31:36Z"), + model.dataTypes().microsoftEmergingThreatFeed().lookbackPeriod()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MSTIDataConnectorProperties model = new MSTIDataConnectorProperties().withTenantId("oqar") + .withDataTypes(new MSTIDataConnectorDataTypes().withMicrosoftEmergingThreatFeed( + new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed().withState(DataTypeState.ENABLED) + .withLookbackPeriod(OffsetDateTime.parse("2021-02-13T18:31:36Z")))); + model = BinaryData.fromObject(model).toObject(MSTIDataConnectorProperties.class); + Assertions.assertEquals("oqar", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().microsoftEmergingThreatFeed().state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T18:31:36Z"), + model.dataTypes().microsoftEmergingThreatFeed().lookbackPeriod()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorTests.java new file mode 100644 index 000000000000..86759a154ff6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MSTIDataConnectorTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnector; +import com.azure.resourcemanager.securityinsights.models.MSTIDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MSTIDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MSTIDataConnector model = BinaryData.fromString( + "{\"kind\":\"MicrosoftThreatIntelligence\",\"properties\":{\"dataTypes\":{\"microsoftEmergingThreatFeed\":{\"lookbackPeriod\":\"2021-08-16T07:55:17Z\",\"state\":\"Disabled\"}},\"tenantId\":\"wpiwxeiicrmpep\"},\"etag\":\"dm\",\"id\":\"xijvskwsdgkjgyac\",\"name\":\"rasek\",\"type\":\"efcvo\"}") + .toObject(MSTIDataConnector.class); + Assertions.assertEquals("dm", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().microsoftEmergingThreatFeed().state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T07:55:17Z"), + model.dataTypes().microsoftEmergingThreatFeed().lookbackPeriod()); + Assertions.assertEquals("wpiwxeiicrmpep", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MSTIDataConnector model = new MSTIDataConnector().withEtag("dm") + .withDataTypes(new MSTIDataConnectorDataTypes().withMicrosoftEmergingThreatFeed( + new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed().withState(DataTypeState.DISABLED) + .withLookbackPeriod(OffsetDateTime.parse("2021-08-16T07:55:17Z")))) + .withTenantId("wpiwxeiicrmpep"); + model = BinaryData.fromObject(model).toObject(MSTIDataConnector.class); + Assertions.assertEquals("dm", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().microsoftEmergingThreatFeed().state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T07:55:17Z"), + model.dataTypes().microsoftEmergingThreatFeed().lookbackPeriod()); + Assertions.assertEquals("wpiwxeiicrmpep", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..873e88915407 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MTPCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class MTPCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MTPCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"rgyutexnzhd\"}").toObject(MTPCheckRequirementsProperties.class); + Assertions.assertEquals("rgyutexnzhd", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MTPCheckRequirementsProperties model = new MTPCheckRequirementsProperties().withTenantId("rgyutexnzhd"); + model = BinaryData.fromObject(model).toObject(MTPCheckRequirementsProperties.class); + Assertions.assertEquals("rgyutexnzhd", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesAlertsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesAlertsTests.java new file mode 100644 index 000000000000..91d92b957cde --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesAlertsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesAlerts; +import org.junit.jupiter.api.Assertions; + +public final class MTPDataConnectorDataTypesAlertsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MTPDataConnectorDataTypesAlerts model + = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(MTPDataConnectorDataTypesAlerts.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MTPDataConnectorDataTypesAlerts model = new MTPDataConnectorDataTypesAlerts().withState(DataTypeState.ENABLED); + model = BinaryData.fromObject(model).toObject(MTPDataConnectorDataTypesAlerts.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesIncidentsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesIncidentsTests.java new file mode 100644 index 000000000000..83e609f02f29 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesIncidentsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesIncidents; +import org.junit.jupiter.api.Assertions; + +public final class MTPDataConnectorDataTypesIncidentsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MTPDataConnectorDataTypesIncidents model + = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(MTPDataConnectorDataTypesIncidents.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MTPDataConnectorDataTypesIncidents model + = new MTPDataConnectorDataTypesIncidents().withState(DataTypeState.ENABLED); + model = BinaryData.fromObject(model).toObject(MTPDataConnectorDataTypesIncidents.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesTests.java new file mode 100644 index 000000000000..7c642e7a38d6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorDataTypesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesAlerts; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesIncidents; +import org.junit.jupiter.api.Assertions; + +public final class MTPDataConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MTPDataConnectorDataTypes model + = BinaryData.fromString("{\"incidents\":{\"state\":\"Enabled\"},\"alerts\":{\"state\":\"Disabled\"}}") + .toObject(MTPDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.incidents().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.alerts().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MTPDataConnectorDataTypes model = new MTPDataConnectorDataTypes() + .withIncidents(new MTPDataConnectorDataTypesIncidents().withState(DataTypeState.ENABLED)) + .withAlerts(new MTPDataConnectorDataTypesAlerts().withState(DataTypeState.DISABLED)); + model = BinaryData.fromObject(model).toObject(MTPDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.incidents().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.alerts().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..7db7f852181b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorPropertiesTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MTPDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesAlerts; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesIncidents; +import com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders; +import com.azure.resourcemanager.securityinsights.models.MtpProvider; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MTPDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MTPDataConnectorProperties model = BinaryData.fromString( + "{\"dataTypes\":{\"incidents\":{\"state\":\"Enabled\"},\"alerts\":{\"state\":\"Disabled\"}},\"filteredProviders\":{\"alerts\":[\"microsoftDefenderForCloudApps\"]},\"tenantId\":\"ifkwdvbtbrekqhs\"}") + .toObject(MTPDataConnectorProperties.class); + Assertions.assertEquals("ifkwdvbtbrekqhs", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().incidents().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS, + model.filteredProviders().alerts().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MTPDataConnectorProperties model = new MTPDataConnectorProperties().withTenantId("ifkwdvbtbrekqhs") + .withDataTypes(new MTPDataConnectorDataTypes() + .withIncidents(new MTPDataConnectorDataTypesIncidents().withState(DataTypeState.ENABLED)) + .withAlerts(new MTPDataConnectorDataTypesAlerts().withState(DataTypeState.DISABLED))) + .withFilteredProviders( + new MtpFilteredProviders().withAlerts(Arrays.asList(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS))); + model = BinaryData.fromObject(model).toObject(MTPDataConnectorProperties.class); + Assertions.assertEquals("ifkwdvbtbrekqhs", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().incidents().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS, + model.filteredProviders().alerts().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorTests.java new file mode 100644 index 000000000000..6f9b43ef82ae --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MTPDataConnectorTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnector; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesAlerts; +import com.azure.resourcemanager.securityinsights.models.MTPDataConnectorDataTypesIncidents; +import com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders; +import com.azure.resourcemanager.securityinsights.models.MtpProvider; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MTPDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MTPDataConnector model = BinaryData.fromString( + "{\"kind\":\"MicrosoftThreatProtection\",\"properties\":{\"dataTypes\":{\"incidents\":{\"state\":\"Disabled\"},\"alerts\":{\"state\":\"Disabled\"}},\"filteredProviders\":{\"alerts\":[\"microsoftDefenderForIdentity\",\"microsoftDefenderForIdentity\"]},\"tenantId\":\"hautw\"},\"etag\":\"exzgpmnmabedd\",\"id\":\"lwgdfpfqfpcvs\",\"name\":\"clg\",\"type\":\"rvwerfwxbsmtb\"}") + .toObject(MTPDataConnector.class); + Assertions.assertEquals("exzgpmnmabedd", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().incidents().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals(MtpProvider.MICROSOFT_DEFENDER_FOR_IDENTITY, model.filteredProviders().alerts().get(0)); + Assertions.assertEquals("hautw", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MTPDataConnector model = new MTPDataConnector().withEtag("exzgpmnmabedd") + .withDataTypes(new MTPDataConnectorDataTypes() + .withIncidents(new MTPDataConnectorDataTypesIncidents().withState(DataTypeState.DISABLED)) + .withAlerts(new MTPDataConnectorDataTypesAlerts().withState(DataTypeState.DISABLED))) + .withFilteredProviders(new MtpFilteredProviders().withAlerts(Arrays + .asList(MtpProvider.MICROSOFT_DEFENDER_FOR_IDENTITY, MtpProvider.MICROSOFT_DEFENDER_FOR_IDENTITY))) + .withTenantId("hautw"); + model = BinaryData.fromObject(model).toObject(MTPDataConnector.class); + Assertions.assertEquals("exzgpmnmabedd", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().incidents().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals(MtpProvider.MICROSOFT_DEFENDER_FOR_IDENTITY, model.filteredProviders().alerts().get(0)); + Assertions.assertEquals("hautw", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityPropertiesTests.java index f94f3582cab4..e11a64ef49d3 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class MailClusterEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MailClusterEntityProperties model = BinaryData.fromString( - "{\"networkMessageIds\":[\"oafcluqvox\"],\"countByDeliveryStatus\":\"datacjimryvwgcwwpbmz\",\"countByThreatType\":\"dataesyds\",\"countByProtectionStatus\":\"dataefoh\",\"threats\":[\"vopwndyqleallk\",\"mtkhlowkxxpvbr\",\"fjmzsyzfho\"],\"query\":\"h\",\"queryTime\":\"2021-04-25T11:24:14Z\",\"mailCount\":2107805309,\"isVolumeAnomaly\":false,\"source\":\"nsjlpjrtws\",\"clusterSourceIdentifier\":\"vv\",\"clusterSourceType\":\"c\",\"clusterQueryStartTime\":\"2021-07-19T03:46:29Z\",\"clusterQueryEndTime\":\"2021-09-11T09:13:01Z\",\"clusterGroup\":\"mhwrb\",\"additionalData\":{\"yzlwh\":\"datayflubhvjglroc\"},\"friendlyName\":\"emhooclutnpq\"}") + "{\"networkMessageIds\":[\"tasfaymxbulpzeal\",\"mqkyojwyvfkmbts\",\"ahxsgxjcmm\"],\"countByDeliveryStatus\":\"\\\"datarsc\\\"\",\"countByThreatType\":\"\\\"datai\\\"\",\"countByProtectionStatus\":\"\\\"datadrnpxqwodiff\\\"\",\"threats\":[\"jrmmuabwib\",\"jogjonmc\"],\"query\":\"foyzbamwineof\",\"queryTime\":\"2021-03-27T12:18:11Z\",\"mailCount\":1060241392,\"isVolumeAnomaly\":true,\"source\":\"dt\",\"clusterSourceIdentifier\":\"vboclzhzjk\",\"clusterSourceType\":\"uxgvttxpnr\",\"clusterQueryStartTime\":\"2021-05-11T17:12:31Z\",\"clusterQueryEndTime\":\"2021-03-15T12:24:46Z\",\"clusterGroup\":\"dixtreki\",\"additionalData\":{\"l\":\"\\\"datayskbruff\\\"\",\"hrpqhv\":\"\\\"dataukkutvl\\\"\",\"yr\":\"\\\"datablcouqehbhbcdszi\\\"\"},\"friendlyName\":\"doypm\"}") .toObject(MailClusterEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MailClusterEntityProperties model = new MailClusterEntityProperties(); - model = BinaryData.fromObject(model).toObject(MailClusterEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityTests.java index 21766c329ac5..82d39934ab2a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailClusterEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class MailClusterEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MailClusterEntity model = BinaryData.fromString( - "{\"kind\":\"MailCluster\",\"properties\":{\"networkMessageIds\":[\"jhbzxliohrdddtf\"],\"countByDeliveryStatus\":\"dataqbawpcbbnzqcykn\",\"countByThreatType\":\"dataqofyuicdhzbdy\",\"countByProtectionStatus\":\"datawgbdvibidmhmwffp\",\"threats\":[\"u\",\"apckccrrvw\"],\"query\":\"oxoyyukp\",\"queryTime\":\"2021-02-08T12:14:50Z\",\"mailCount\":617111065,\"isVolumeAnomaly\":true,\"source\":\"qboshbra\",\"clusterSourceIdentifier\":\"pyyrmfs\",\"clusterSourceType\":\"pavbo\",\"clusterQueryStartTime\":\"2021-06-03T07:36:41Z\",\"clusterQueryEndTime\":\"2021-09-22T17:44:07Z\",\"clusterGroup\":\"wnupgahxku\",\"additionalData\":{\"hqepvufhbzehewh\":\"datajcaacfdmmcpugm\",\"eaclgschorimk\":\"dataqhnlbqnbld\",\"ucsofldpuviyf\":\"datasrrm\",\"bsxtkcudfbsfarfs\":\"dataaabeolhbhlvbmxuq\"},\"friendlyName\":\"wlkjxn\"},\"id\":\"vwgf\",\"name\":\"tmhqykiz\",\"type\":\"d\"}") + "{\"kind\":\"MailCluster\",\"properties\":{\"networkMessageIds\":[\"lyjxltbsjus\"],\"countByDeliveryStatus\":\"\\\"datasfxigctmgx\\\"\",\"countByThreatType\":\"\\\"datapbezqccydrtceu\\\"\",\"countByProtectionStatus\":\"\\\"dataqkkyihztgeqmg\\\"\",\"threats\":[\"wldoychi\",\"lcecfeh\"],\"query\":\"aoaguhicqlli\",\"queryTime\":\"2021-01-11T11:55:04Z\",\"mailCount\":93233429,\"isVolumeAnomaly\":false,\"source\":\"hrweftkw\",\"clusterSourceIdentifier\":\"jp\",\"clusterSourceType\":\"sse\",\"clusterQueryStartTime\":\"2021-11-21T02:25:20Z\",\"clusterQueryEndTime\":\"2021-09-28T12:46:13Z\",\"clusterGroup\":\"mcxtczhu\",\"additionalData\":{\"ydjfb\":\"\\\"dataknijduyyes\\\"\",\"v\":\"\\\"datac\\\"\",\"uflgbhgauacdixm\":\"\\\"datahulrtywikdmhla\\\"\"},\"friendlyName\":\"f\"},\"id\":\"ryjqgdkf\",\"name\":\"ozo\",\"type\":\"oqbvjhvefgwbmqj\"}") .toObject(MailClusterEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MailClusterEntity model = new MailClusterEntity(); - model = BinaryData.fromObject(model).toObject(MailClusterEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityPropertiesTests.java index 832735e2cddb..f7087e5241a2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,36 +15,15 @@ public final class MailMessageEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MailMessageEntityProperties model = BinaryData.fromString( - "{\"fileEntityIds\":[\"lanrupdwvnp\",\"cnzqtpjhmqr\",\"v\",\"hlaiwd\"],\"recipient\":\"smlzzhzdtxetlgy\",\"urls\":[\"qvlnnpxybafiqgea\",\"rbgjekglkl\",\"yulidwcwvm\",\"eg\"],\"threats\":[\"fhjirwgdnqzbrfk\",\"pzhz\",\"tk\",\"jcitdigsxcdglj\"],\"p1Sender\":\"keuachtomf\",\"p1SenderDisplayName\":\"ytswfp\",\"p1SenderDomain\":\"dgycxnmskwhqjjy\",\"senderIP\":\"urlpshh\",\"p2Sender\":\"pedwqsl\",\"p2SenderDisplayName\":\"hmpqvw\",\"p2SenderDomain\":\"kondcb\",\"receiveDate\":\"2021-03-14T03:56:56Z\",\"networkMessageId\":\"2f4e80f2-f3c5-4da4-aa46-c2ee2adf52ce\",\"internetMessageId\":\"vqejosovy\",\"subject\":\"leaesi\",\"language\":\"qtljqobbpihehc\",\"threatDetectionMethods\":[\"bmrqbrjbbmp\",\"dlvykfrex\",\"rseqwjksghudgz\"],\"bodyFingerprintBin1\":1903316554,\"bodyFingerprintBin2\":1557581128,\"bodyFingerprintBin3\":770792528,\"bodyFingerprintBin4\":1356644601,\"bodyFingerprintBin5\":210376116,\"antispamDirection\":\"Inbound\",\"deliveryAction\":\"Delivered\",\"deliveryLocation\":\"JunkFolder\",\"additionalData\":{\"y\":\"datahrkmdyomkxfbvfbh\",\"gddeimaw\":\"datarhpw\",\"gkkumuikjcj\":\"datao\"},\"friendlyName\":\"ztbws\"}") + "{\"fileEntityIds\":[\"niylyly\",\"wxzut\",\"qztw\"],\"recipient\":\"hmupgxyjtcdxabbu\",\"urls\":[\"abe\",\"bbklqpxzuca\"],\"threats\":[\"dwwnl\",\"a\",\"wxudgn\",\"gookrtalvnb\"],\"p1Sender\":\"pbeme\",\"p1SenderDisplayName\":\"clvdjjukyrdnqod\",\"p1SenderDomain\":\"hhxhq\",\"senderIP\":\"qnvzoqgyipemch\",\"p2Sender\":\"v\",\"p2SenderDisplayName\":\"zuejd\",\"p2SenderDomain\":\"ptlghwzhomewjjst\",\"receiveDate\":\"2021-10-27T14:41:54Z\",\"networkMessageId\":\"qawmoaianc\",\"internetMessageId\":\"vodrrslblxydkxr\",\"subject\":\"vbxiwkgfbqlj\",\"language\":\"khychocokulehur\",\"threatDetectionMethods\":[\"qffawey\",\"rkphyjdxr\",\"vjuqdbrxmrgchb\"],\"bodyFingerprintBin1\":326838230,\"bodyFingerprintBin2\":1439674285,\"bodyFingerprintBin3\":2033228649,\"bodyFingerprintBin4\":73723123,\"bodyFingerprintBin5\":1335279864,\"antispamDirection\":\"Inbound\",\"deliveryAction\":\"Blocked\",\"deliveryLocation\":\"Unknown\",\"additionalData\":{\"mclujyxkyxlzgs\":\"\\\"datauusioycblev\\\"\",\"taf\":\"\\\"datagkzz\\\"\",\"ovwmbjlzqsczpgvd\":\"\\\"databzf\\\"\",\"uwjtks\":\"\\\"datanapfdqwowftpt\\\"\"},\"friendlyName\":\"gcgqyhleseyqrhvy\"}") .toObject(MailMessageEntityProperties.class); - Assertions.assertEquals(1903316554, model.bodyFingerprintBin1()); - Assertions.assertEquals(1557581128, model.bodyFingerprintBin2()); - Assertions.assertEquals(770792528, model.bodyFingerprintBin3()); - Assertions.assertEquals(1356644601, model.bodyFingerprintBin4()); - Assertions.assertEquals(210376116, model.bodyFingerprintBin5()); + Assertions.assertEquals(326838230, model.bodyFingerprintBin1()); + Assertions.assertEquals(1439674285, model.bodyFingerprintBin2()); + Assertions.assertEquals(2033228649, model.bodyFingerprintBin3()); + Assertions.assertEquals(73723123, model.bodyFingerprintBin4()); + Assertions.assertEquals(1335279864, model.bodyFingerprintBin5()); Assertions.assertEquals(AntispamMailDirection.INBOUND, model.antispamDirection()); - Assertions.assertEquals(DeliveryAction.DELIVERED, model.deliveryAction()); - Assertions.assertEquals(DeliveryLocation.JUNK_FOLDER, model.deliveryLocation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MailMessageEntityProperties model = new MailMessageEntityProperties().withBodyFingerprintBin1(1903316554) - .withBodyFingerprintBin2(1557581128) - .withBodyFingerprintBin3(770792528) - .withBodyFingerprintBin4(1356644601) - .withBodyFingerprintBin5(210376116) - .withAntispamDirection(AntispamMailDirection.INBOUND) - .withDeliveryAction(DeliveryAction.DELIVERED) - .withDeliveryLocation(DeliveryLocation.JUNK_FOLDER); - model = BinaryData.fromObject(model).toObject(MailMessageEntityProperties.class); - Assertions.assertEquals(1903316554, model.bodyFingerprintBin1()); - Assertions.assertEquals(1557581128, model.bodyFingerprintBin2()); - Assertions.assertEquals(770792528, model.bodyFingerprintBin3()); - Assertions.assertEquals(1356644601, model.bodyFingerprintBin4()); - Assertions.assertEquals(210376116, model.bodyFingerprintBin5()); - Assertions.assertEquals(AntispamMailDirection.INBOUND, model.antispamDirection()); - Assertions.assertEquals(DeliveryAction.DELIVERED, model.deliveryAction()); - Assertions.assertEquals(DeliveryLocation.JUNK_FOLDER, model.deliveryLocation()); + Assertions.assertEquals(DeliveryAction.BLOCKED, model.deliveryAction()); + Assertions.assertEquals(DeliveryLocation.UNKNOWN, model.deliveryLocation()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityTests.java index 624abf3bf03a..87ed5862e2f8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailMessageEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,36 +15,15 @@ public final class MailMessageEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MailMessageEntity model = BinaryData.fromString( - "{\"kind\":\"MailMessage\",\"properties\":{\"fileEntityIds\":[\"zjkmmykyujxs\"],\"recipient\":\"hsrrryejylmbkz\",\"urls\":[\"igrfihotjewl\",\"xuzzjgnrefq\",\"hqo\",\"oihiqak\"],\"threats\":[\"wf\",\"rkwpzdqtvhcspod\",\"qaxsipietgbebjf\",\"lbmoichd\"],\"p1Sender\":\"nfpubntnbatz\",\"p1SenderDisplayName\":\"qs\",\"p1SenderDomain\":\"saaelca\",\"senderIP\":\"cjuhplrvkm\",\"p2Sender\":\"wmj\",\"p2SenderDisplayName\":\"gfggcvkyylizrzbj\",\"p2SenderDomain\":\"fxsfuztlvtmv\",\"receiveDate\":\"2021-03-12T08:06:56Z\",\"networkMessageId\":\"9d3ce6ba-4d46-4e09-b8b6-fa300a33f4e9\",\"internetMessageId\":\"dqlvhukoveof\",\"subject\":\"rvjfnmjmvlw\",\"language\":\"giblkujrllf\",\"threatDetectionMethods\":[\"idjpuuyju\",\"ejikzoeovvtzejet\",\"kl\",\"tikyj\"],\"bodyFingerprintBin1\":191041134,\"bodyFingerprintBin2\":1716135154,\"bodyFingerprintBin3\":1169828149,\"bodyFingerprintBin4\":762753424,\"bodyFingerprintBin5\":886631090,\"antispamDirection\":\"Outbound\",\"deliveryAction\":\"DeliveredAsSpam\",\"deliveryLocation\":\"Dropped\",\"additionalData\":{\"zpcrrkolawj\":\"datahtgv\",\"xfzzzwyjafitlhgu\":\"datajsmwrokc\",\"us\":\"datanuchlgmltxdwhmo\",\"pafolp\":\"datazvlnsnnjz\"},\"friendlyName\":\"wamxqzrag\"},\"id\":\"dphtv\",\"name\":\"ulajvlejchc\",\"type\":\"rlzk\"}") + "{\"kind\":\"MailMessage\",\"properties\":{\"fileEntityIds\":[\"ormkfqlwxldyk\",\"lsygaol\",\"jpnnbmjksibjgsj\",\"xxahmrnadzyqegxy\"],\"recipient\":\"pinbmhwbjijkgqxn\",\"urls\":[\"keznjaujvaa\",\"nggiycwkdtaa\"],\"threats\":[\"fe\",\"aumrrqmbzmqkrat\",\"nxwbjsidbirkfp\"],\"p1Sender\":\"okdgoge\",\"p1SenderDisplayName\":\"jymrhbg\",\"p1SenderDomain\":\"ozkyewnfnzh\",\"senderIP\":\"qo\",\"p2Sender\":\"ffjkutycyarnroo\",\"p2SenderDisplayName\":\"uabzoghkt\",\"p2SenderDomain\":\"yczhco\",\"receiveDate\":\"2021-02-03T14:26:42Z\",\"networkMessageId\":\"hzqrottj\",\"internetMessageId\":\"fyjzptwr\",\"subject\":\"h\",\"language\":\"qinfszpyglqd\",\"threatDetectionMethods\":[\"jzralc\",\"pjby\"],\"bodyFingerprintBin1\":1905073411,\"bodyFingerprintBin2\":13507798,\"bodyFingerprintBin3\":1715277105,\"bodyFingerprintBin4\":1054159255,\"bodyFingerprintBin5\":1219334379,\"antispamDirection\":\"Unknown\",\"deliveryAction\":\"Blocked\",\"deliveryLocation\":\"External\",\"additionalData\":{\"hhqxuwyvcacoyviv\":\"\\\"dataxfxjelgcmpzqj\\\"\"},\"friendlyName\":\"izus\"},\"id\":\"zlbscmnlziji\",\"name\":\"fehgmv\",\"type\":\"lnwyvqkxr\"}") .toObject(MailMessageEntity.class); - Assertions.assertEquals(191041134, model.bodyFingerprintBin1()); - Assertions.assertEquals(1716135154, model.bodyFingerprintBin2()); - Assertions.assertEquals(1169828149, model.bodyFingerprintBin3()); - Assertions.assertEquals(762753424, model.bodyFingerprintBin4()); - Assertions.assertEquals(886631090, model.bodyFingerprintBin5()); - Assertions.assertEquals(AntispamMailDirection.OUTBOUND, model.antispamDirection()); - Assertions.assertEquals(DeliveryAction.DELIVERED_AS_SPAM, model.deliveryAction()); - Assertions.assertEquals(DeliveryLocation.DROPPED, model.deliveryLocation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MailMessageEntity model = new MailMessageEntity().withBodyFingerprintBin1(191041134) - .withBodyFingerprintBin2(1716135154) - .withBodyFingerprintBin3(1169828149) - .withBodyFingerprintBin4(762753424) - .withBodyFingerprintBin5(886631090) - .withAntispamDirection(AntispamMailDirection.OUTBOUND) - .withDeliveryAction(DeliveryAction.DELIVERED_AS_SPAM) - .withDeliveryLocation(DeliveryLocation.DROPPED); - model = BinaryData.fromObject(model).toObject(MailMessageEntity.class); - Assertions.assertEquals(191041134, model.bodyFingerprintBin1()); - Assertions.assertEquals(1716135154, model.bodyFingerprintBin2()); - Assertions.assertEquals(1169828149, model.bodyFingerprintBin3()); - Assertions.assertEquals(762753424, model.bodyFingerprintBin4()); - Assertions.assertEquals(886631090, model.bodyFingerprintBin5()); - Assertions.assertEquals(AntispamMailDirection.OUTBOUND, model.antispamDirection()); - Assertions.assertEquals(DeliveryAction.DELIVERED_AS_SPAM, model.deliveryAction()); - Assertions.assertEquals(DeliveryLocation.DROPPED, model.deliveryLocation()); + Assertions.assertEquals(1905073411, model.bodyFingerprintBin1()); + Assertions.assertEquals(13507798, model.bodyFingerprintBin2()); + Assertions.assertEquals(1715277105, model.bodyFingerprintBin3()); + Assertions.assertEquals(1054159255, model.bodyFingerprintBin4()); + Assertions.assertEquals(1219334379, model.bodyFingerprintBin5()); + Assertions.assertEquals(AntispamMailDirection.UNKNOWN, model.antispamDirection()); + Assertions.assertEquals(DeliveryAction.BLOCKED, model.deliveryAction()); + Assertions.assertEquals(DeliveryLocation.EXTERNAL, model.deliveryLocation()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityPropertiesTests.java index 09b4fe1046a2..35c5fe03188b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class MailboxEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MailboxEntityProperties model = BinaryData.fromString( - "{\"mailboxPrimaryAddress\":\"inqcymczngnbdxxe\",\"displayName\":\"ninvudbchaqdt\",\"upn\":\"ec\",\"externalDirectoryObjectId\":\"dfbd8756-87da-44b5-a09a-a48aac91cf6f\",\"additionalData\":{\"ytxzvtznapxbanno\":\"datamxxdtddmflh\",\"nwvroevytlyokrr\":\"datavoxczytpr\",\"uxvnsasbcrymodi\":\"datao\",\"lmv\":\"datarxklobdxnazpmk\"},\"friendlyName\":\"f\"}") + "{\"mailboxPrimaryAddress\":\"wdogiyetesyp\",\"displayName\":\"dbztjhqtfbov\",\"upn\":\"nkbw\",\"externalDirectoryObjectId\":\"njuhpsprkzya\",\"additionalData\":{\"vmaonurjt\":\"\\\"dataaccxnafbwqroohtu\\\"\"},\"friendlyName\":\"ghihpvecms\"}") .toObject(MailboxEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MailboxEntityProperties model = new MailboxEntityProperties(); - model = BinaryData.fromObject(model).toObject(MailboxEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityTests.java index f4687c820b5d..af28e2584044 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MailboxEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class MailboxEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MailboxEntity model = BinaryData.fromString( - "{\"kind\":\"Mailbox\",\"properties\":{\"mailboxPrimaryAddress\":\"dlpukhpyrne\",\"displayName\":\"jcpeogkhnmg\",\"upn\":\"ouxddbhfhpfpazj\",\"externalDirectoryObjectId\":\"92562bc9-b4d6-4c40-8dfc-867973c0fa94\",\"additionalData\":{\"qwtehtuevr\":\"datajxhpdulontacn\",\"gwbsreurf\":\"datarljyoogwxhnsdu\",\"htkln\":\"datakfuarenlv\"},\"friendlyName\":\"afvvk\"},\"id\":\"edev\",\"name\":\"bo\",\"type\":\"lcqxypokk\"}") + "{\"kind\":\"Mailbox\",\"properties\":{\"mailboxPrimaryAddress\":\"fqawzfgbrttui\",\"displayName\":\"lkiexhajlfnthiq\",\"upn\":\"uttdiygbp\",\"externalDirectoryObjectId\":\"wswmt\",\"additionalData\":{\"jlmec\":\"\\\"datactwwgzw\\\"\",\"gzyvnee\":\"\\\"dataog\\\"\"},\"friendlyName\":\"ifgh\"},\"id\":\"oqqtl\",\"name\":\"fhzbkr\",\"type\":\"jjjavfqnvhnq\"}") .toObject(MailboxEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MailboxEntity model = new MailboxEntity(); - model = BinaryData.fromObject(model).toObject(MailboxEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityPropertiesTests.java index 4a4a778d9b2f..05aedfcbadd7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class MalwareEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MalwareEntityProperties model = BinaryData.fromString( - "{\"category\":\"wxvgpiudeugfsxze\",\"fileEntityIds\":[\"xw\"],\"malwareName\":\"fykhvuhxepmru\",\"processEntityIds\":[\"abaobnslujdjltym\",\"mvguihywart\",\"pphkixkykxds\"],\"additionalData\":{\"kkflrmymyincqlhr\":\"dataemmucfxh\",\"sl\":\"datas\",\"ctotiowlx\":\"dataiiiovgqcgxuugq\"},\"friendlyName\":\"qd\"}") + "{\"category\":\"wenaz\",\"fileEntityIds\":[\"hzr\",\"qalsxkd\",\"wqapfgsdp\"],\"malwareName\":\"essmzhhku\",\"processEntityIds\":[\"ldqqctekv\",\"lblhtjq\"],\"additionalData\":{\"emxhzzy\":\"\\\"datavweht\\\"\",\"sxivzrrryvei\":\"\\\"dataev\\\"\",\"yzatvfuzkaft\":\"\\\"dataipsk\\\"\"},\"friendlyName\":\"vru\"}") .toObject(MalwareEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MalwareEntityProperties model = new MalwareEntityProperties(); - model = BinaryData.fromObject(model).toObject(MalwareEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityTests.java index f67579007a4b..919ae9a256c6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MalwareEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class MalwareEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MalwareEntity model = BinaryData.fromString( - "{\"kind\":\"Malware\",\"properties\":{\"category\":\"owxwcomli\",\"fileEntityIds\":[\"wvczcswkacve\"],\"malwareName\":\"fdv\",\"processEntityIds\":[\"b\",\"rnfxtgddp\",\"th\",\"hn\"],\"additionalData\":{\"kcoeqswank\":\"dataoya\",\"tmhdroznnhdr\":\"datat\",\"sggux\":\"dataktgj\",\"ywaeeczgf\":\"dataeml\"},\"friendlyName\":\"kklelssxblycs\"},\"id\":\"ujksrlsmdesqplpv\",\"name\":\"jcdoewb\",\"type\":\"dyvt\"}") + "{\"kind\":\"Malware\",\"properties\":{\"category\":\"otjvdkwiswskukjt\",\"fileEntityIds\":[\"vwisp\",\"xkdtxfkndlqvtwkn\"],\"malwareName\":\"mmbugtywatmqaq\",\"processEntityIds\":[\"atgr\",\"eshoygzcb\",\"fqxkfaoyteh\"],\"additionalData\":{\"ejnndljdju\":\"\\\"datavjmvqmtdwckygr\\\"\",\"req\":\"\\\"datakb\\\"\"},\"friendlyName\":\"kceysfaqegplw\"},\"id\":\"shwddkvbxgk\",\"name\":\"usybwptdaca\",\"type\":\"vvlfntymtp\"}") .toObject(MalwareEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MalwareEntity model = new MalwareEntity(); - model = BinaryData.fromObject(model).toObject(MalwareEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ManualTriggerRequestBodyTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ManualTriggerRequestBodyTests.java new file mode 100644 index 000000000000..ae18c8c291cd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ManualTriggerRequestBodyTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ManualTriggerRequestBody; +import org.junit.jupiter.api.Assertions; + +public final class ManualTriggerRequestBodyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManualTriggerRequestBody model + = BinaryData.fromString("{\"tenantId\":\"zvcjfelisdjubggb\",\"logicAppsResourceId\":\"igkxkbsazga\"}") + .toObject(ManualTriggerRequestBody.class); + Assertions.assertEquals("zvcjfelisdjubggb", model.tenantId()); + Assertions.assertEquals("igkxkbsazga", model.logicAppsResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManualTriggerRequestBody model + = new ManualTriggerRequestBody().withTenantId("zvcjfelisdjubggb").withLogicAppsResourceId("igkxkbsazga"); + model = BinaryData.fromObject(model).toObject(ManualTriggerRequestBody.class); + Assertions.assertEquals("zvcjfelisdjubggb", model.tenantId()); + Assertions.assertEquals("igkxkbsazga", model.logicAppsResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorDataTypesTests.java index 59f9a5c77adc..38e1d1e03113 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorDataTypesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorDataTypesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorTests.java index 1bd968adb7c4..d5da19921d17 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/McasDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,25 +15,25 @@ public final class McasDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { McasDataConnector model = BinaryData.fromString( - "{\"kind\":\"MicrosoftCloudAppSecurity\",\"properties\":{\"tenantId\":\"fczbgom\",\"dataTypes\":{\"discoveryLogs\":{\"state\":\"Enabled\"},\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"eohibet\",\"id\":\"uankrrfxeeeb\",\"name\":\"ij\",\"type\":\"acvbmqz\"}") + "{\"kind\":\"MicrosoftCloudAppSecurity\",\"properties\":{\"dataTypes\":{\"discoveryLogs\":{\"state\":\"Enabled\"},\"alerts\":{\"state\":\"Enabled\"}},\"tenantId\":\"fh\"},\"etag\":\"vjaqu\",\"id\":\"yynvskpa\",\"name\":\"bmgeumexmjbxcbc\",\"type\":\"wkqm\"}") .toObject(McasDataConnector.class); - Assertions.assertEquals("eohibet", model.etag()); - Assertions.assertEquals("fczbgom", model.tenantId()); + Assertions.assertEquals("vjaqu", model.etag()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().discoveryLogs().state()); + Assertions.assertEquals("fh", model.tenantId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - McasDataConnector model = new McasDataConnector().withEtag("eohibet") - .withTenantId("fczbgom") + McasDataConnector model = new McasDataConnector().withEtag("vjaqu") .withDataTypes(new McasDataConnectorDataTypes() .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED)) - .withDiscoveryLogs(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + .withDiscoveryLogs(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))) + .withTenantId("fh"); model = BinaryData.fromObject(model).toObject(McasDataConnector.class); - Assertions.assertEquals("eohibet", model.etag()); - Assertions.assertEquals("fczbgom", model.tenantId()); + Assertions.assertEquals("vjaqu", model.etag()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().discoveryLogs().state()); + Assertions.assertEquals("fh", model.tenantId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MdatpDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MdatpDataConnectorTests.java index 6de9dd38eb44..d9f35fe9ddb7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MdatpDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MdatpDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,22 +15,22 @@ public final class MdatpDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MdatpDataConnector model = BinaryData.fromString( - "{\"kind\":\"MicrosoftDefenderAdvancedThreatProtection\",\"properties\":{\"tenantId\":\"uyxoaf\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"faey\",\"id\":\"nm\",\"name\":\"gv\",\"type\":\"irpghriypoqeyh\"}") + "{\"kind\":\"MicrosoftDefenderAdvancedThreatProtection\",\"properties\":{\"tenantId\":\"cjmlfuyfjb\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}},\"etag\":\"dhlrufzcqyjmq\",\"id\":\"uiocuselqkrsazr\",\"name\":\"xu\",\"type\":\"dqmdtffis\"}") .toObject(MdatpDataConnector.class); - Assertions.assertEquals("faey", model.etag()); - Assertions.assertEquals("uyxoaf", model.tenantId()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("dhlrufzcqyjmq", model.etag()); + Assertions.assertEquals("cjmlfuyfjb", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MdatpDataConnector model = new MdatpDataConnector().withEtag("faey") - .withTenantId("uyxoaf") + MdatpDataConnector model = new MdatpDataConnector().withEtag("dhlrufzcqyjmq") + .withTenantId("cjmlfuyfjb") .withDataTypes(new AlertsDataTypeOfDataConnector() - .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); model = BinaryData.fromObject(model).toObject(MdatpDataConnector.class); - Assertions.assertEquals("faey", model.etag()); - Assertions.assertEquals("uyxoaf", model.tenantId()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + Assertions.assertEquals("dhlrufzcqyjmq", model.etag()); + Assertions.assertEquals("cjmlfuyfjb", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataAuthorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataAuthorTests.java new file mode 100644 index 000000000000..5077bcdbbddf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataAuthorTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MetadataAuthor; +import org.junit.jupiter.api.Assertions; + +public final class MetadataAuthorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataAuthor model + = BinaryData.fromString("{\"name\":\"crzm\",\"email\":\"jyvdhdgdiwmlg\",\"link\":\"mfetqjisjmo\"}") + .toObject(MetadataAuthor.class); + Assertions.assertEquals("crzm", model.name()); + Assertions.assertEquals("jyvdhdgdiwmlg", model.email()); + Assertions.assertEquals("mfetqjisjmo", model.link()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataAuthor model = new MetadataAuthor().withName("crzm").withEmail("jyvdhdgdiwmlg").withLink("mfetqjisjmo"); + model = BinaryData.fromObject(model).toObject(MetadataAuthor.class); + Assertions.assertEquals("crzm", model.name()); + Assertions.assertEquals("jyvdhdgdiwmlg", model.email()); + Assertions.assertEquals("mfetqjisjmo", model.link()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataCategoriesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataCategoriesTests.java new file mode 100644 index 000000000000..bbd19b0c83bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataCategoriesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MetadataCategories; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetadataCategoriesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataCategories model = BinaryData.fromString( + "{\"domains\":[\"vjsbgmlamoaxc\",\"ytn\",\"kvbpbl\",\"cw\"],\"verticals\":[\"heeocnqoubve\",\"vlryszfh\",\"xyfhxohzbzhhavzf\"]}") + .toObject(MetadataCategories.class); + Assertions.assertEquals("vjsbgmlamoaxc", model.domains().get(0)); + Assertions.assertEquals("heeocnqoubve", model.verticals().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataCategories model + = new MetadataCategories().withDomains(Arrays.asList("vjsbgmlamoaxc", "ytn", "kvbpbl", "cw")) + .withVerticals(Arrays.asList("heeocnqoubve", "vlryszfh", "xyfhxohzbzhhavzf")); + model = BinaryData.fromObject(model).toObject(MetadataCategories.class); + Assertions.assertEquals("vjsbgmlamoaxc", model.domains().get(0)); + Assertions.assertEquals("heeocnqoubve", model.verticals().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataDependenciesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataDependenciesTests.java new file mode 100644 index 000000000000..6bbf648167ce --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataDependenciesTests.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencies; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetadataDependenciesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataDependencies model = BinaryData.fromString( + "{\"contentId\":\"bdy\",\"kind\":\"DataType\",\"version\":\"mh\",\"name\":\"ozvoort\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"cyuzlybqscibv\",\"kind\":\"DataType\",\"version\":\"ckcafnwqh\",\"name\":\"vcnviulbylmgjzr\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"umwhmxpuck\",\"kind\":\"WatchlistTemplate\",\"version\":\"tlps\",\"name\":\"omic\",\"operator\":\"AND\",\"criteria\":[{},{}]},{\"contentId\":\"vjmxokxxamq\",\"kind\":\"Workbook\",\"version\":\"zvlcivqxdemkl\",\"name\":\"xwwwlojkbgnf\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},{\"contentId\":\"sunhaevlah\",\"kind\":\"AutomationRule\",\"version\":\"wywuahwcorewcnna\",\"name\":\"qjfdajr\",\"operator\":\"OR\",\"criteria\":[{},{}]},{\"contentId\":\"gg\",\"kind\":\"AzureFunction\",\"version\":\"bxexf\",\"name\":\"nvussuqk\",\"operator\":\"AND\",\"criteria\":[{},{},{}]}]},{\"contentId\":\"ayzqbyeywpmohn\",\"kind\":\"DataType\",\"version\":\"kffydztkqrfbgy\",\"name\":\"fwvzdteqjm\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"kax\",\"kind\":\"Workbook\",\"version\":\"ijyoxxj\",\"name\":\"so\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"klyfpjms\",\"kind\":\"WatchlistTemplate\",\"version\":\"mqomxoalknuy\",\"name\":\"vibzicy\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"ptkhjxnrkbnv\",\"kind\":\"Notebook\",\"version\":\"lzhznfgvlxyx\",\"name\":\"ctigp\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"k\",\"kind\":\"Workbook\",\"version\":\"kdprtqj\",\"name\":\"dcfe\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]}]}]}") + .toObject(MetadataDependencies.class); + Assertions.assertEquals("bdy", model.contentId()); + Assertions.assertEquals(Kind.DATA_TYPE, model.kind()); + Assertions.assertEquals("mh", model.version()); + Assertions.assertEquals("ozvoort", model.name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.operator()); + Assertions.assertEquals("cyuzlybqscibv", model.criteria().get(0).contentId()); + Assertions.assertEquals(Kind.DATA_TYPE, model.criteria().get(0).kind()); + Assertions.assertEquals("ckcafnwqh", model.criteria().get(0).version()); + Assertions.assertEquals("vcnviulbylmgjzr", model.criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.criteria().get(0).operator()); + Assertions.assertEquals("umwhmxpuck", model.criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, model.criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("tlps", model.criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("omic", model.criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.criteria().get(0).criteria().get(0).operator()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataDependencies model = new MetadataDependencies().withContentId("bdy") + .withKind(Kind.DATA_TYPE) + .withVersion("mh") + .withName("ozvoort") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("cyuzlybqscibv") + .withKind(Kind.DATA_TYPE) + .withVersion("ckcafnwqh") + .withName("vcnviulbylmgjzr") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("umwhmxpuck") + .withKind(Kind.WATCHLIST_TEMPLATE) + .withVersion("tlps") + .withName("omic") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("vjmxokxxamq") + .withKind(Kind.WORKBOOK) + .withVersion("zvlcivqxdemkl") + .withName("xwwwlojkbgnf") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())), + new MetadataDependencies().withContentId("sunhaevlah") + .withKind(Kind.AUTOMATION_RULE) + .withVersion("wywuahwcorewcnna") + .withName("qjfdajr") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("gg") + .withKind(Kind.AZURE_FUNCTION) + .withVersion("bxexf") + .withName("nvussuqk") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())))), + new MetadataDependencies().withContentId("ayzqbyeywpmohn") + .withKind(Kind.DATA_TYPE) + .withVersion("kffydztkqrfbgy") + .withName("fwvzdteqjm") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("kax") + .withKind(Kind.WORKBOOK) + .withVersion("ijyoxxj") + .withName("so") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("klyfpjms") + .withKind(Kind.WATCHLIST_TEMPLATE) + .withVersion("mqomxoalknuy") + .withName("vibzicy") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("ptkhjxnrkbnv") + .withKind(Kind.NOTEBOOK) + .withVersion("lzhznfgvlxyx") + .withName("ctigp") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("k") + .withKind(Kind.WORKBOOK) + .withVersion("kdprtqj") + .withName("dcfe") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())))))); + model = BinaryData.fromObject(model).toObject(MetadataDependencies.class); + Assertions.assertEquals("bdy", model.contentId()); + Assertions.assertEquals(Kind.DATA_TYPE, model.kind()); + Assertions.assertEquals("mh", model.version()); + Assertions.assertEquals("ozvoort", model.name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.operator()); + Assertions.assertEquals("cyuzlybqscibv", model.criteria().get(0).contentId()); + Assertions.assertEquals(Kind.DATA_TYPE, model.criteria().get(0).kind()); + Assertions.assertEquals("ckcafnwqh", model.criteria().get(0).version()); + Assertions.assertEquals("vcnviulbylmgjzr", model.criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.criteria().get(0).operator()); + Assertions.assertEquals("umwhmxpuck", model.criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, model.criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("tlps", model.criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("omic", model.criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.criteria().get(0).criteria().get(0).operator()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataListTests.java new file mode 100644 index 000000000000..c9f1e636d5e8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataListTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.MetadataList; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class MetadataListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"contentId\":\"vvxdvphx\",\"parentId\":\"wwvx\",\"version\":\"icbicbogsfo\",\"kind\":\"k\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"y\",\"sourceId\":\"un\"},\"author\":{\"name\":\"cyy\",\"email\":\"lbkubzq\",\"link\":\"dlrkvitzk\"},\"support\":{\"tier\":\"Community\",\"name\":\"xmnnidotmpumzu\",\"email\":\"odttq\",\"link\":\"varu\"},\"dependencies\":{\"contentId\":\"w\",\"kind\":\"SummaryRule\",\"version\":\"qfpqqllavzlh\",\"name\":\"mro\",\"operator\":\"OR\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"cz\"],\"verticals\":[\"iwf\",\"ubwhx\"]},\"providers\":[\"bxkcegcttgxk\",\"tcxbbjbeyqo\"],\"customVersion\":\"wpjfkra\",\"contentSchemaVersion\":\"r\",\"icon\":\"gbvtpxo\",\"threatAnalysisTactics\":[\"wwdocjasu\"],\"threatAnalysisTechniques\":[\"gjkfiszhexumfavw\",\"sloblitxr\",\"s\",\"scosanjsoutrz\"],\"previewImages\":[\"ujgbnclxhwkz\"],\"previewImagesDark\":[\"s\"]},\"etag\":\"kvdantpzuiwa\",\"id\":\"abth\",\"name\":\"t\",\"type\":\"tcabcpwabzfihsz\"},{\"properties\":{\"contentId\":\"oidfzwegvuojuwgw\",\"parentId\":\"ccvufjqv\",\"version\":\"fsssmy\",\"kind\":\"emkrhbsdgktluifi\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"cpenobqysbees\",\"sourceId\":\"bvvaerszsufzsa\"},\"author\":{\"name\":\"ricv\",\"email\":\"fenintzunh\",\"link\":\"qx\"},\"support\":{\"tier\":\"Community\",\"name\":\"xjpisrdnowinc\",\"email\":\"sfvijnubxfiiy\",\"link\":\"xewjsyutezl\"},\"dependencies\":{\"contentId\":\"voxdporxkivbkut\",\"kind\":\"Workbook\",\"version\":\"yqoytwss\",\"name\":\"qnp\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},\"categories\":{\"domains\":[\"a\"],\"verticals\":[\"qpwxnb\",\"zrmiukothyfjbpnh\"]},\"providers\":[\"r\",\"sizfwgnpcjni\",\"ffwcgjjio\"],\"customVersion\":\"ogdkp\",\"contentSchemaVersion\":\"wrfuqjdeb\",\"icon\":\"q\",\"threatAnalysisTactics\":[\"bgibklsc\"],\"threatAnalysisTechniques\":[\"ouzyv\",\"h\"],\"previewImages\":[\"f\",\"xm\"],\"previewImagesDark\":[\"g\",\"retsny\",\"ceulbyz\"]},\"etag\":\"xsygaoymyckd\",\"id\":\"brxbmljrjyfjl\",\"name\":\"uxixkpsjldgnimqo\",\"type\":\"cfqzxjziqcso\"}],\"nextLink\":\"qtkpdcdefqoermg\"}") + .toObject(MetadataList.class); + Assertions.assertEquals("kvdantpzuiwa", model.value().get(0).etag()); + Assertions.assertEquals("vvxdvphx", model.value().get(0).contentId()); + Assertions.assertEquals("wwvx", model.value().get(0).parentId()); + Assertions.assertEquals("icbicbogsfo", model.value().get(0).version()); + Assertions.assertEquals("k", model.value().get(0).kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.value().get(0).source().kind()); + Assertions.assertEquals("y", model.value().get(0).source().name()); + Assertions.assertEquals("un", model.value().get(0).source().sourceId()); + Assertions.assertEquals("cyy", model.value().get(0).author().name()); + Assertions.assertEquals("lbkubzq", model.value().get(0).author().email()); + Assertions.assertEquals("dlrkvitzk", model.value().get(0).author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.value().get(0).support().tier()); + Assertions.assertEquals("xmnnidotmpumzu", model.value().get(0).support().name()); + Assertions.assertEquals("odttq", model.value().get(0).support().email()); + Assertions.assertEquals("varu", model.value().get(0).support().link()); + Assertions.assertEquals("w", model.value().get(0).dependencies().contentId()); + Assertions.assertEquals(Kind.SUMMARY_RULE, model.value().get(0).dependencies().kind()); + Assertions.assertEquals("qfpqqllavzlh", model.value().get(0).dependencies().version()); + Assertions.assertEquals("mro", model.value().get(0).dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.value().get(0).dependencies().operator()); + Assertions.assertEquals("cz", model.value().get(0).categories().domains().get(0)); + Assertions.assertEquals("iwf", model.value().get(0).categories().verticals().get(0)); + Assertions.assertEquals("bxkcegcttgxk", model.value().get(0).providers().get(0)); + Assertions.assertEquals("wpjfkra", model.value().get(0).customVersion()); + Assertions.assertEquals("r", model.value().get(0).contentSchemaVersion()); + Assertions.assertEquals("gbvtpxo", model.value().get(0).icon()); + Assertions.assertEquals("wwdocjasu", model.value().get(0).threatAnalysisTactics().get(0)); + Assertions.assertEquals("gjkfiszhexumfavw", model.value().get(0).threatAnalysisTechniques().get(0)); + Assertions.assertEquals("ujgbnclxhwkz", model.value().get(0).previewImages().get(0)); + Assertions.assertEquals("s", model.value().get(0).previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataModelInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataModelInnerTests.java new file mode 100644 index 000000000000..179ccb87dad9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataModelInnerTests.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetadataModelInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataModelInner model = BinaryData.fromString( + "{\"properties\":{\"contentId\":\"rcsksxqfh\",\"parentId\":\"rvuvdagvyjcdp\",\"version\":\"vfye\",\"kind\":\"yodiij\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"qhipa\",\"sourceId\":\"nivnmevljbcu\"},\"author\":{\"name\":\"gpjfvqwkseo\",\"email\":\"lmd\",\"link\":\"vcykzz\"},\"support\":{\"tier\":\"Partner\",\"name\":\"yg\",\"email\":\"mumljvvcrsmwojmx\",\"link\":\"vumnru\"},\"dependencies\":{\"contentId\":\"keqjftvltjop\",\"kind\":\"HuntingQuery\",\"version\":\"kbzltnowpajfhx\",\"name\":\"ubbzadzglmuuzps\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"muldhfr\",\"kind\":\"Watchlist\",\"version\":\"p\",\"name\":\"jxkbywsbu\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]}]},\"categories\":{\"domains\":[\"m\"],\"verticals\":[\"ggnowxhyvdbrdv\",\"vghbtycvl\"]},\"providers\":[\"giikhrct\",\"ype\"],\"customVersion\":\"mrdiscsdvkymkt\",\"contentSchemaVersion\":\"m\",\"icon\":\"oxg\",\"threatAnalysisTactics\":[\"nglafnfgazagh\"],\"threatAnalysisTechniques\":[\"o\",\"wxuxor\",\"utuhvemg\"],\"previewImages\":[\"solqy\",\"vwxlxo\"],\"previewImagesDark\":[\"kqvrv\",\"dojcvzfcmxmjpjak\"]},\"etag\":\"tuodocgquq\",\"id\":\"yxpmqd\",\"name\":\"qniiontqikdipk\",\"type\":\"sq\"}") + .toObject(MetadataModelInner.class); + Assertions.assertEquals("tuodocgquq", model.etag()); + Assertions.assertEquals("rcsksxqfh", model.contentId()); + Assertions.assertEquals("rvuvdagvyjcdp", model.parentId()); + Assertions.assertEquals("vfye", model.version()); + Assertions.assertEquals("yodiij", model.kind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("qhipa", model.source().name()); + Assertions.assertEquals("nivnmevljbcu", model.source().sourceId()); + Assertions.assertEquals("gpjfvqwkseo", model.author().name()); + Assertions.assertEquals("lmd", model.author().email()); + Assertions.assertEquals("vcykzz", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("yg", model.support().name()); + Assertions.assertEquals("mumljvvcrsmwojmx", model.support().email()); + Assertions.assertEquals("vumnru", model.support().link()); + Assertions.assertEquals("keqjftvltjop", model.dependencies().contentId()); + Assertions.assertEquals(Kind.HUNTING_QUERY, model.dependencies().kind()); + Assertions.assertEquals("kbzltnowpajfhx", model.dependencies().version()); + Assertions.assertEquals("ubbzadzglmuuzps", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("muldhfr", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WATCHLIST, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("p", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("jxkbywsbu", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("m", model.categories().domains().get(0)); + Assertions.assertEquals("ggnowxhyvdbrdv", model.categories().verticals().get(0)); + Assertions.assertEquals("giikhrct", model.providers().get(0)); + Assertions.assertEquals("mrdiscsdvkymkt", model.customVersion()); + Assertions.assertEquals("m", model.contentSchemaVersion()); + Assertions.assertEquals("oxg", model.icon()); + Assertions.assertEquals("nglafnfgazagh", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("o", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("solqy", model.previewImages().get(0)); + Assertions.assertEquals("kqvrv", model.previewImagesDark().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataModelInner model = new MetadataModelInner().withEtag("tuodocgquq") + .withContentId("rcsksxqfh") + .withParentId("rvuvdagvyjcdp") + .withVersion("vfye") + .withKind("yodiij") + .withSource(new MetadataSource().withKind(SourceKind.SOURCE_REPOSITORY) + .withName("qhipa") + .withSourceId("nivnmevljbcu")) + .withAuthor(new MetadataAuthor().withName("gpjfvqwkseo").withEmail("lmd").withLink("vcykzz")) + .withSupport(new MetadataSupport().withTier(SupportTier.PARTNER) + .withName("yg") + .withEmail("mumljvvcrsmwojmx") + .withLink("vumnru")) + .withDependencies(new MetadataDependencies().withContentId("keqjftvltjop") + .withKind(Kind.HUNTING_QUERY) + .withVersion("kbzltnowpajfhx") + .withName("ubbzadzglmuuzps") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("muldhfr") + .withKind(Kind.WATCHLIST) + .withVersion("p") + .withName("jxkbywsbu") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies()))))) + .withCategories(new MetadataCategories().withDomains(Arrays.asList("m")) + .withVerticals(Arrays.asList("ggnowxhyvdbrdv", "vghbtycvl"))) + .withProviders(Arrays.asList("giikhrct", "ype")) + .withCustomVersion("mrdiscsdvkymkt") + .withContentSchemaVersion("m") + .withIcon("oxg") + .withThreatAnalysisTactics(Arrays.asList("nglafnfgazagh")) + .withThreatAnalysisTechniques(Arrays.asList("o", "wxuxor", "utuhvemg")) + .withPreviewImages(Arrays.asList("solqy", "vwxlxo")) + .withPreviewImagesDark(Arrays.asList("kqvrv", "dojcvzfcmxmjpjak")); + model = BinaryData.fromObject(model).toObject(MetadataModelInner.class); + Assertions.assertEquals("tuodocgquq", model.etag()); + Assertions.assertEquals("rcsksxqfh", model.contentId()); + Assertions.assertEquals("rvuvdagvyjcdp", model.parentId()); + Assertions.assertEquals("vfye", model.version()); + Assertions.assertEquals("yodiij", model.kind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("qhipa", model.source().name()); + Assertions.assertEquals("nivnmevljbcu", model.source().sourceId()); + Assertions.assertEquals("gpjfvqwkseo", model.author().name()); + Assertions.assertEquals("lmd", model.author().email()); + Assertions.assertEquals("vcykzz", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("yg", model.support().name()); + Assertions.assertEquals("mumljvvcrsmwojmx", model.support().email()); + Assertions.assertEquals("vumnru", model.support().link()); + Assertions.assertEquals("keqjftvltjop", model.dependencies().contentId()); + Assertions.assertEquals(Kind.HUNTING_QUERY, model.dependencies().kind()); + Assertions.assertEquals("kbzltnowpajfhx", model.dependencies().version()); + Assertions.assertEquals("ubbzadzglmuuzps", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("muldhfr", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WATCHLIST, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("p", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("jxkbywsbu", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("m", model.categories().domains().get(0)); + Assertions.assertEquals("ggnowxhyvdbrdv", model.categories().verticals().get(0)); + Assertions.assertEquals("giikhrct", model.providers().get(0)); + Assertions.assertEquals("mrdiscsdvkymkt", model.customVersion()); + Assertions.assertEquals("m", model.contentSchemaVersion()); + Assertions.assertEquals("oxg", model.icon()); + Assertions.assertEquals("nglafnfgazagh", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("o", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("solqy", model.previewImages().get(0)); + Assertions.assertEquals("kqvrv", model.previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPatchTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPatchTests.java new file mode 100644 index 000000000000..b71c395e455f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPatchTests.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataPatch; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetadataPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataPatch model = BinaryData.fromString( + "{\"properties\":{\"contentId\":\"cok\",\"parentId\":\"uqzuscolbqve\",\"version\":\"ekxn\",\"kind\":\"dvcgowrdtddd\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"lbbcztamkyrkw\",\"sourceId\":\"hpi\"},\"author\":{\"name\":\"ffxhvnodq\",\"email\":\"jbfyroswnfqdfwv\",\"link\":\"frwv\"},\"support\":{\"tier\":\"Community\",\"name\":\"tusk\",\"email\":\"cdo\",\"link\":\"oepjzaqbodswazb\"},\"dependencies\":{\"contentId\":\"k\",\"kind\":\"ResourcesDataConnector\",\"version\":\"d\",\"name\":\"vunngjoasnzl\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"nixxwdqzur\",\"kind\":\"Workbook\",\"version\":\"zkmxbh\",\"name\":\"vvaeght\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"nmcy\",\"kind\":\"AzureFunction\",\"version\":\"vw\",\"name\":\"esswbrnbox\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"fvbksksmqmwowrm\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"hfutj\",\"name\":\"ntmgtg\",\"operator\":\"AND\",\"criteria\":[{},{}]},{\"contentId\":\"ygcaxjymdqrf\",\"kind\":\"SummaryRule\",\"version\":\"xtcll\",\"name\":\"nsydksvjf\",\"operator\":\"OR\",\"criteria\":[{},{}]}]},\"categories\":{\"domains\":[\"khcoscoljjhc\",\"gzooefzs\",\"ttbqka\",\"dvwojvx\"],\"verticals\":[\"hrqxrqghotingzi\",\"kgygawyhpwmdkyfg\",\"elvyhvvpuqy\"]},\"providers\":[\"bbkhc\"],\"customVersion\":\"wo\",\"contentSchemaVersion\":\"ku\",\"icon\":\"owgmmixfz\",\"threatAnalysisTactics\":[\"gblnagjnp\",\"hz\",\"pqscu\",\"ileqjzrijebmuio\"],\"threatAnalysisTechniques\":[\"ndw\",\"hoeashu\",\"fvbj\",\"mzwynsmmphvkyez\"],\"previewImages\":[\"yuoyj\",\"jwq\",\"slqreofzrkrzt\",\"yaymhx\"],\"previewImagesDark\":[\"wax\",\"ymnrtvq\",\"imavyotpcvpahh\"]},\"etag\":\"vyqpvzxxzndw\",\"id\":\"mi\",\"name\":\"r\",\"type\":\"f\"}") + .toObject(MetadataPatch.class); + Assertions.assertEquals("vyqpvzxxzndw", model.etag()); + Assertions.assertEquals("cok", model.contentId()); + Assertions.assertEquals("uqzuscolbqve", model.parentId()); + Assertions.assertEquals("ekxn", model.version()); + Assertions.assertEquals("dvcgowrdtddd", model.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.source().kind()); + Assertions.assertEquals("lbbcztamkyrkw", model.source().name()); + Assertions.assertEquals("hpi", model.source().sourceId()); + Assertions.assertEquals("ffxhvnodq", model.author().name()); + Assertions.assertEquals("jbfyroswnfqdfwv", model.author().email()); + Assertions.assertEquals("frwv", model.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.support().tier()); + Assertions.assertEquals("tusk", model.support().name()); + Assertions.assertEquals("cdo", model.support().email()); + Assertions.assertEquals("oepjzaqbodswazb", model.support().link()); + Assertions.assertEquals("k", model.dependencies().contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("d", model.dependencies().version()); + Assertions.assertEquals("vunngjoasnzl", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("nixxwdqzur", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WORKBOOK, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("zkmxbh", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("vvaeght", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("khcoscoljjhc", model.categories().domains().get(0)); + Assertions.assertEquals("hrqxrqghotingzi", model.categories().verticals().get(0)); + Assertions.assertEquals("bbkhc", model.providers().get(0)); + Assertions.assertEquals("wo", model.customVersion()); + Assertions.assertEquals("ku", model.contentSchemaVersion()); + Assertions.assertEquals("owgmmixfz", model.icon()); + Assertions.assertEquals("gblnagjnp", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("ndw", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("yuoyj", model.previewImages().get(0)); + Assertions.assertEquals("wax", model.previewImagesDark().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataPatch model = new MetadataPatch().withEtag("vyqpvzxxzndw") + .withContentId("cok") + .withParentId("uqzuscolbqve") + .withVersion("ekxn") + .withKind("dvcgowrdtddd") + .withSource( + new MetadataSource().withKind(SourceKind.LOCAL_WORKSPACE).withName("lbbcztamkyrkw").withSourceId("hpi")) + .withAuthor(new MetadataAuthor().withName("ffxhvnodq").withEmail("jbfyroswnfqdfwv").withLink("frwv")) + .withSupport(new MetadataSupport().withTier(SupportTier.COMMUNITY) + .withName("tusk") + .withEmail("cdo") + .withLink("oepjzaqbodswazb")) + .withDependencies(new MetadataDependencies().withContentId("k") + .withKind(Kind.RESOURCES_DATA_CONNECTOR) + .withVersion("d") + .withName("vunngjoasnzl") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("nixxwdqzur") + .withKind(Kind.WORKBOOK) + .withVersion("zkmxbh") + .withName("vvaeght") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("nmcy") + .withKind(Kind.AZURE_FUNCTION) + .withVersion("vw") + .withName("esswbrnbox") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("fvbksksmqmwowrm") + .withKind(Kind.ANALYTICS_RULE_TEMPLATE) + .withVersion("hfutj") + .withName("ntmgtg") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("ygcaxjymdqrf") + .withKind(Kind.SUMMARY_RULE) + .withVersion("xtcll") + .withName("nsydksvjf") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies()))))) + .withCategories( + new MetadataCategories().withDomains(Arrays.asList("khcoscoljjhc", "gzooefzs", "ttbqka", "dvwojvx")) + .withVerticals(Arrays.asList("hrqxrqghotingzi", "kgygawyhpwmdkyfg", "elvyhvvpuqy"))) + .withProviders(Arrays.asList("bbkhc")) + .withCustomVersion("wo") + .withContentSchemaVersion("ku") + .withIcon("owgmmixfz") + .withThreatAnalysisTactics(Arrays.asList("gblnagjnp", "hz", "pqscu", "ileqjzrijebmuio")) + .withThreatAnalysisTechniques(Arrays.asList("ndw", "hoeashu", "fvbj", "mzwynsmmphvkyez")) + .withPreviewImages(Arrays.asList("yuoyj", "jwq", "slqreofzrkrzt", "yaymhx")) + .withPreviewImagesDark(Arrays.asList("wax", "ymnrtvq", "imavyotpcvpahh")); + model = BinaryData.fromObject(model).toObject(MetadataPatch.class); + Assertions.assertEquals("vyqpvzxxzndw", model.etag()); + Assertions.assertEquals("cok", model.contentId()); + Assertions.assertEquals("uqzuscolbqve", model.parentId()); + Assertions.assertEquals("ekxn", model.version()); + Assertions.assertEquals("dvcgowrdtddd", model.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.source().kind()); + Assertions.assertEquals("lbbcztamkyrkw", model.source().name()); + Assertions.assertEquals("hpi", model.source().sourceId()); + Assertions.assertEquals("ffxhvnodq", model.author().name()); + Assertions.assertEquals("jbfyroswnfqdfwv", model.author().email()); + Assertions.assertEquals("frwv", model.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.support().tier()); + Assertions.assertEquals("tusk", model.support().name()); + Assertions.assertEquals("cdo", model.support().email()); + Assertions.assertEquals("oepjzaqbodswazb", model.support().link()); + Assertions.assertEquals("k", model.dependencies().contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("d", model.dependencies().version()); + Assertions.assertEquals("vunngjoasnzl", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("nixxwdqzur", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WORKBOOK, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("zkmxbh", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("vvaeght", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("khcoscoljjhc", model.categories().domains().get(0)); + Assertions.assertEquals("hrqxrqghotingzi", model.categories().verticals().get(0)); + Assertions.assertEquals("bbkhc", model.providers().get(0)); + Assertions.assertEquals("wo", model.customVersion()); + Assertions.assertEquals("ku", model.contentSchemaVersion()); + Assertions.assertEquals("owgmmixfz", model.icon()); + Assertions.assertEquals("gblnagjnp", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("ndw", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("yuoyj", model.previewImages().get(0)); + Assertions.assertEquals("wax", model.previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesPatchTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesPatchTests.java new file mode 100644 index 000000000000..7d35e301f328 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesPatchTests.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataPropertiesPatch; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetadataPropertiesPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataPropertiesPatch model = BinaryData.fromString( + "{\"contentId\":\"auygasfmhbxvew\",\"parentId\":\"natxvuzccaliry\",\"version\":\"tcaqpjo\",\"kind\":\"cbnrvxyyhhsi\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"frpan\",\"sourceId\":\"qiwduukaamimkjzc\"},\"author\":{\"name\":\"jdfxvksijrjgyin\",\"email\":\"xijovuyxuupzeadd\",\"link\":\"opdtph\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"jzykngqy\",\"email\":\"jxzxbth\",\"link\":\"yzpuonrmdlkoab\"},\"dependencies\":{\"contentId\":\"efbwxpmg\",\"kind\":\"Workbook\",\"version\":\"sasmryuyut\",\"name\":\"xrgrztkyqgu\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"ybgk\",\"kind\":\"CustomDetection\",\"version\":\"zjndfeemx\",\"name\":\"rpfivypm\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"cr\",\"kind\":\"AnalyticsRule\",\"version\":\"o\",\"name\":\"myhxnpdggllyduyu\",\"operator\":\"AND\",\"criteria\":[{},{}]},{\"contentId\":\"xvzvwlxd\",\"kind\":\"WorkbookTemplate\",\"version\":\"zeurdoxkl\",\"name\":\"atsiznymwz\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]}]},{\"contentId\":\"qhnf\",\"kind\":\"WorkbookTemplate\",\"version\":\"wadxcezxevltfeb\",\"name\":\"qiaklqakps\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"wrphmriipz\",\"kind\":\"Watchlist\",\"version\":\"u\",\"name\":\"cjqnea\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"arg\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"qlsnr\",\"name\":\"xoyvg\",\"operator\":\"OR\",\"criteria\":[{},{}]}]},{\"contentId\":\"hsppvjsduouoqte\",\"kind\":\"Workbook\",\"version\":\"muogeq\",\"name\":\"paseqcp\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"uwvzh\",\"kind\":\"PlaybookTemplate\",\"version\":\"toiqofzttq\",\"name\":\"llwyoxzuhellitp\",\"operator\":\"OR\",\"criteria\":[{},{}]},{\"contentId\":\"sgqbmolxeomebzv\",\"kind\":\"PlaybookTemplate\",\"version\":\"fsfoy\",\"name\":\"gihnalpc\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]}]}]},\"categories\":{\"domains\":[\"dwbmivzika\",\"ywedbpirbzpauzbb\",\"xncszdwpaveux\",\"migs\"],\"verticals\":[\"dltniuii\",\"erffhgvcym\",\"doeilhggaj\"]},\"providers\":[\"dbobmolj\",\"rchhwlzi\",\"vccquajpoipdjxyo\",\"gvraxhntoiw\"],\"customVersion\":\"rlkosjwr\",\"contentSchemaVersion\":\"tsluqfgksdi\",\"icon\":\"ioixviobuwbng\",\"threatAnalysisTactics\":[\"h\"],\"threatAnalysisTechniques\":[\"gqamhbmggnqxnex\",\"zaffzqodokst\"],\"previewImages\":[\"mdqxnoyzqipapifc\"],\"previewImagesDark\":[\"bjghunqnttrw\"]}") + .toObject(MetadataPropertiesPatch.class); + Assertions.assertEquals("auygasfmhbxvew", model.contentId()); + Assertions.assertEquals("natxvuzccaliry", model.parentId()); + Assertions.assertEquals("tcaqpjo", model.version()); + Assertions.assertEquals("cbnrvxyyhhsi", model.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.source().kind()); + Assertions.assertEquals("frpan", model.source().name()); + Assertions.assertEquals("qiwduukaamimkjzc", model.source().sourceId()); + Assertions.assertEquals("jdfxvksijrjgyin", model.author().name()); + Assertions.assertEquals("xijovuyxuupzeadd", model.author().email()); + Assertions.assertEquals("opdtph", model.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, model.support().tier()); + Assertions.assertEquals("jzykngqy", model.support().name()); + Assertions.assertEquals("jxzxbth", model.support().email()); + Assertions.assertEquals("yzpuonrmdlkoab", model.support().link()); + Assertions.assertEquals("efbwxpmg", model.dependencies().contentId()); + Assertions.assertEquals(Kind.WORKBOOK, model.dependencies().kind()); + Assertions.assertEquals("sasmryuyut", model.dependencies().version()); + Assertions.assertEquals("xrgrztkyqgu", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("ybgk", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.CUSTOM_DETECTION, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("zjndfeemx", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("rpfivypm", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("cr", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.ANALYTICS_RULE, model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("o", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("myhxnpdggllyduyu", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("dwbmivzika", model.categories().domains().get(0)); + Assertions.assertEquals("dltniuii", model.categories().verticals().get(0)); + Assertions.assertEquals("dbobmolj", model.providers().get(0)); + Assertions.assertEquals("rlkosjwr", model.customVersion()); + Assertions.assertEquals("tsluqfgksdi", model.contentSchemaVersion()); + Assertions.assertEquals("ioixviobuwbng", model.icon()); + Assertions.assertEquals("h", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("gqamhbmggnqxnex", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("mdqxnoyzqipapifc", model.previewImages().get(0)); + Assertions.assertEquals("bjghunqnttrw", model.previewImagesDark().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataPropertiesPatch model = new MetadataPropertiesPatch().withContentId("auygasfmhbxvew") + .withParentId("natxvuzccaliry") + .withVersion("tcaqpjo") + .withKind("cbnrvxyyhhsi") + .withSource(new MetadataSource().withKind(SourceKind.LOCAL_WORKSPACE) + .withName("frpan") + .withSourceId("qiwduukaamimkjzc")) + .withAuthor( + new MetadataAuthor().withName("jdfxvksijrjgyin").withEmail("xijovuyxuupzeadd").withLink("opdtph")) + .withSupport(new MetadataSupport().withTier(SupportTier.MICROSOFT) + .withName("jzykngqy") + .withEmail("jxzxbth") + .withLink("yzpuonrmdlkoab")) + .withDependencies(new MetadataDependencies().withContentId("efbwxpmg") + .withKind(Kind.WORKBOOK) + .withVersion("sasmryuyut") + .withName("xrgrztkyqgu") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays + .asList( + new MetadataDependencies() + .withContentId("ybgk") + .withKind(Kind.CUSTOM_DETECTION) + .withVersion("zjndfeemx") + .withName("rpfivypm") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("cr") + .withKind(Kind.ANALYTICS_RULE) + .withVersion("o") + .withName("myhxnpdggllyduyu") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies() + .withContentId("xvzvwlxd") + .withKind(Kind.WORKBOOK_TEMPLATE) + .withVersion("zeurdoxkl") + .withName("atsiznymwz") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria( + Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())))), + new MetadataDependencies() + .withContentId("qhnf") + .withKind(Kind.WORKBOOK_TEMPLATE) + .withVersion("wadxcezxevltfeb") + .withName("qiaklqakps") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria( + Arrays.asList( + new MetadataDependencies() + .withContentId("wrphmriipz") + .withKind(Kind.WATCHLIST) + .withVersion("u") + .withName("cjqnea") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria( + Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())), + new MetadataDependencies() + .withContentId("arg") + .withKind(Kind.ANALYTICS_RULE_TEMPLATE) + .withVersion("qlsnr") + .withName("xoyvg") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria( + Arrays.asList(new MetadataDependencies(), new MetadataDependencies())))), + new MetadataDependencies().withContentId("hsppvjsduouoqte") + .withKind(Kind.WORKBOOK) + .withVersion("muogeq") + .withName("paseqcp") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("uwvzh") + .withKind(Kind.PLAYBOOK_TEMPLATE) + .withVersion("toiqofzttq") + .withName("llwyoxzuhellitp") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("sgqbmolxeomebzv") + .withKind(Kind.PLAYBOOK_TEMPLATE) + .withVersion("fsfoy") + .withName("gihnalpc") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies()))))))) + .withCategories(new MetadataCategories() + .withDomains(Arrays.asList("dwbmivzika", "ywedbpirbzpauzbb", "xncszdwpaveux", "migs")) + .withVerticals(Arrays.asList("dltniuii", "erffhgvcym", "doeilhggaj"))) + .withProviders(Arrays.asList("dbobmolj", "rchhwlzi", "vccquajpoipdjxyo", "gvraxhntoiw")) + .withCustomVersion("rlkosjwr") + .withContentSchemaVersion("tsluqfgksdi") + .withIcon("ioixviobuwbng") + .withThreatAnalysisTactics(Arrays.asList("h")) + .withThreatAnalysisTechniques(Arrays.asList("gqamhbmggnqxnex", "zaffzqodokst")) + .withPreviewImages(Arrays.asList("mdqxnoyzqipapifc")) + .withPreviewImagesDark(Arrays.asList("bjghunqnttrw")); + model = BinaryData.fromObject(model).toObject(MetadataPropertiesPatch.class); + Assertions.assertEquals("auygasfmhbxvew", model.contentId()); + Assertions.assertEquals("natxvuzccaliry", model.parentId()); + Assertions.assertEquals("tcaqpjo", model.version()); + Assertions.assertEquals("cbnrvxyyhhsi", model.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.source().kind()); + Assertions.assertEquals("frpan", model.source().name()); + Assertions.assertEquals("qiwduukaamimkjzc", model.source().sourceId()); + Assertions.assertEquals("jdfxvksijrjgyin", model.author().name()); + Assertions.assertEquals("xijovuyxuupzeadd", model.author().email()); + Assertions.assertEquals("opdtph", model.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, model.support().tier()); + Assertions.assertEquals("jzykngqy", model.support().name()); + Assertions.assertEquals("jxzxbth", model.support().email()); + Assertions.assertEquals("yzpuonrmdlkoab", model.support().link()); + Assertions.assertEquals("efbwxpmg", model.dependencies().contentId()); + Assertions.assertEquals(Kind.WORKBOOK, model.dependencies().kind()); + Assertions.assertEquals("sasmryuyut", model.dependencies().version()); + Assertions.assertEquals("xrgrztkyqgu", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("ybgk", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.CUSTOM_DETECTION, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("zjndfeemx", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("rpfivypm", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("cr", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.ANALYTICS_RULE, model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("o", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("myhxnpdggllyduyu", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("dwbmivzika", model.categories().domains().get(0)); + Assertions.assertEquals("dltniuii", model.categories().verticals().get(0)); + Assertions.assertEquals("dbobmolj", model.providers().get(0)); + Assertions.assertEquals("rlkosjwr", model.customVersion()); + Assertions.assertEquals("tsluqfgksdi", model.contentSchemaVersion()); + Assertions.assertEquals("ioixviobuwbng", model.icon()); + Assertions.assertEquals("h", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("gqamhbmggnqxnex", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("mdqxnoyzqipapifc", model.previewImages().get(0)); + Assertions.assertEquals("bjghunqnttrw", model.previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesTests.java new file mode 100644 index 000000000000..3c229ebeea1d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataPropertiesTests.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MetadataProperties; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MetadataPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataProperties model = BinaryData.fromString( + "{\"contentId\":\"zabrsoihatajdtac\",\"parentId\":\"synss\",\"version\":\"lsu\",\"kind\":\"oadoh\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"ehkxgfuzq\",\"sourceId\":\"zkwlxqdsxi\"},\"author\":{\"name\":\"lbyitfz\",\"email\":\"wgzeylzpiimxa\",\"link\":\"ktjoygynsixgzb\"},\"support\":{\"tier\":\"Partner\",\"name\":\"lquarbruvqb\",\"email\":\"xwrmupz\",\"link\":\"xzb\"},\"dependencies\":{\"contentId\":\"ajkvwkoc\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"zllvna\",\"name\":\"gvlpgfygenfakyb\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"qieoymppglxjsfgb\",\"kind\":\"Notebook\",\"version\":\"azlycx\",\"name\":\"brukhqbuoyr\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"mvvvjmfjjf\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"sveamsea\",\"name\":\"uvhxiohglmufzuuy\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]}]}]},\"categories\":{\"domains\":[\"yosdpxts\",\"ywfgefvw\",\"wphwxiavwm\"],\"verticals\":[\"qgfpu\",\"hzwrsjumlkjsvkbt\"]},\"providers\":[\"xalph\",\"gmin\",\"e\"],\"customVersion\":\"jdjmsngmluyrlkpi\",\"contentSchemaVersion\":\"mrmrjpjthizsa\",\"icon\":\"ylzzietumzen\",\"threatAnalysisTactics\":[\"ruesxe\"],\"threatAnalysisTechniques\":[\"xoibdctjwfeb\",\"qqeetsqac\",\"czfro\",\"yyraiaiidkewqwa\"],\"previewImages\":[\"ldddorzljhnxf\",\"ffngfpilloirm\",\"xdbktuqnbcjknrq\",\"znwwtkuytwii\"],\"previewImagesDark\":[\"liclmoyo\",\"oxdwff\",\"yzqke\",\"curr\"]}") + .toObject(MetadataProperties.class); + Assertions.assertEquals("zabrsoihatajdtac", model.contentId()); + Assertions.assertEquals("synss", model.parentId()); + Assertions.assertEquals("lsu", model.version()); + Assertions.assertEquals("oadoh", model.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.source().kind()); + Assertions.assertEquals("ehkxgfuzq", model.source().name()); + Assertions.assertEquals("zkwlxqdsxi", model.source().sourceId()); + Assertions.assertEquals("lbyitfz", model.author().name()); + Assertions.assertEquals("wgzeylzpiimxa", model.author().email()); + Assertions.assertEquals("ktjoygynsixgzb", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("lquarbruvqb", model.support().name()); + Assertions.assertEquals("xwrmupz", model.support().email()); + Assertions.assertEquals("xzb", model.support().link()); + Assertions.assertEquals("ajkvwkoc", model.dependencies().contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("zllvna", model.dependencies().version()); + Assertions.assertEquals("gvlpgfygenfakyb", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("qieoymppglxjsfgb", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.NOTEBOOK, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("azlycx", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("brukhqbuoyr", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("mvvvjmfjjf", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, + model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("sveamsea", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("uvhxiohglmufzuuy", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("yosdpxts", model.categories().domains().get(0)); + Assertions.assertEquals("qgfpu", model.categories().verticals().get(0)); + Assertions.assertEquals("xalph", model.providers().get(0)); + Assertions.assertEquals("jdjmsngmluyrlkpi", model.customVersion()); + Assertions.assertEquals("mrmrjpjthizsa", model.contentSchemaVersion()); + Assertions.assertEquals("ylzzietumzen", model.icon()); + Assertions.assertEquals("ruesxe", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("xoibdctjwfeb", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("ldddorzljhnxf", model.previewImages().get(0)); + Assertions.assertEquals("liclmoyo", model.previewImagesDark().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataProperties model = new MetadataProperties().withContentId("zabrsoihatajdtac") + .withParentId("synss") + .withVersion("lsu") + .withKind("oadoh") + .withSource(new MetadataSource().withKind(SourceKind.LOCAL_WORKSPACE) + .withName("ehkxgfuzq") + .withSourceId("zkwlxqdsxi")) + .withAuthor(new MetadataAuthor().withName("lbyitfz").withEmail("wgzeylzpiimxa").withLink("ktjoygynsixgzb")) + .withSupport(new MetadataSupport().withTier(SupportTier.PARTNER) + .withName("lquarbruvqb") + .withEmail("xwrmupz") + .withLink("xzb")) + .withDependencies(new MetadataDependencies().withContentId("ajkvwkoc") + .withKind(Kind.LOGIC_APPS_CUSTOM_CONNECTOR) + .withVersion("zllvna") + .withName("gvlpgfygenfakyb") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("qieoymppglxjsfgb") + .withKind(Kind.NOTEBOOK) + .withVersion("azlycx") + .withName("brukhqbuoyr") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("mvvvjmfjjf") + .withKind(Kind.LOGIC_APPS_CUSTOM_CONNECTOR) + .withVersion("sveamsea") + .withName("uvhxiohglmufzuuy") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies()))))))) + .withCategories(new MetadataCategories().withDomains(Arrays.asList("yosdpxts", "ywfgefvw", "wphwxiavwm")) + .withVerticals(Arrays.asList("qgfpu", "hzwrsjumlkjsvkbt"))) + .withProviders(Arrays.asList("xalph", "gmin", "e")) + .withCustomVersion("jdjmsngmluyrlkpi") + .withContentSchemaVersion("mrmrjpjthizsa") + .withIcon("ylzzietumzen") + .withThreatAnalysisTactics(Arrays.asList("ruesxe")) + .withThreatAnalysisTechniques(Arrays.asList("xoibdctjwfeb", "qqeetsqac", "czfro", "yyraiaiidkewqwa")) + .withPreviewImages(Arrays.asList("ldddorzljhnxf", "ffngfpilloirm", "xdbktuqnbcjknrq", "znwwtkuytwii")) + .withPreviewImagesDark(Arrays.asList("liclmoyo", "oxdwff", "yzqke", "curr")); + model = BinaryData.fromObject(model).toObject(MetadataProperties.class); + Assertions.assertEquals("zabrsoihatajdtac", model.contentId()); + Assertions.assertEquals("synss", model.parentId()); + Assertions.assertEquals("lsu", model.version()); + Assertions.assertEquals("oadoh", model.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.source().kind()); + Assertions.assertEquals("ehkxgfuzq", model.source().name()); + Assertions.assertEquals("zkwlxqdsxi", model.source().sourceId()); + Assertions.assertEquals("lbyitfz", model.author().name()); + Assertions.assertEquals("wgzeylzpiimxa", model.author().email()); + Assertions.assertEquals("ktjoygynsixgzb", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("lquarbruvqb", model.support().name()); + Assertions.assertEquals("xwrmupz", model.support().email()); + Assertions.assertEquals("xzb", model.support().link()); + Assertions.assertEquals("ajkvwkoc", model.dependencies().contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("zllvna", model.dependencies().version()); + Assertions.assertEquals("gvlpgfygenfakyb", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("qieoymppglxjsfgb", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.NOTEBOOK, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("azlycx", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("brukhqbuoyr", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("mvvvjmfjjf", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, + model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("sveamsea", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("uvhxiohglmufzuuy", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("yosdpxts", model.categories().domains().get(0)); + Assertions.assertEquals("qgfpu", model.categories().verticals().get(0)); + Assertions.assertEquals("xalph", model.providers().get(0)); + Assertions.assertEquals("jdjmsngmluyrlkpi", model.customVersion()); + Assertions.assertEquals("mrmrjpjthizsa", model.contentSchemaVersion()); + Assertions.assertEquals("ylzzietumzen", model.icon()); + Assertions.assertEquals("ruesxe", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("xoibdctjwfeb", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("ldddorzljhnxf", model.previewImages().get(0)); + Assertions.assertEquals("liclmoyo", model.previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSourceTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSourceTests.java new file mode 100644 index 000000000000..3656af975b85 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSourceTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import org.junit.jupiter.api.Assertions; + +public final class MetadataSourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataSource model + = BinaryData.fromString("{\"kind\":\"SourceRepository\",\"name\":\"bmtbsetko\",\"sourceId\":\"qvhedaak\"}") + .toObject(MetadataSource.class); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.kind()); + Assertions.assertEquals("bmtbsetko", model.name()); + Assertions.assertEquals("qvhedaak", model.sourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataSource model = new MetadataSource().withKind(SourceKind.SOURCE_REPOSITORY) + .withName("bmtbsetko") + .withSourceId("qvhedaak"); + model = BinaryData.fromObject(model).toObject(MetadataSource.class); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.kind()); + Assertions.assertEquals("bmtbsetko", model.name()); + Assertions.assertEquals("qvhedaak", model.sourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSupportTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSupportTests.java new file mode 100644 index 000000000000..1cc853713420 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadataSupportTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class MetadataSupportTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetadataSupport model = BinaryData + .fromString( + "{\"tier\":\"Microsoft\",\"name\":\"aqfkakhgkrvtyycv\",\"email\":\"v\",\"link\":\"jqawfusqpfzxk\"}") + .toObject(MetadataSupport.class); + Assertions.assertEquals(SupportTier.MICROSOFT, model.tier()); + Assertions.assertEquals("aqfkakhgkrvtyycv", model.name()); + Assertions.assertEquals("v", model.email()); + Assertions.assertEquals("jqawfusqpfzxk", model.link()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MetadataSupport model = new MetadataSupport().withTier(SupportTier.MICROSOFT) + .withName("aqfkakhgkrvtyycv") + .withEmail("v") + .withLink("jqawfusqpfzxk"); + model = BinaryData.fromObject(model).toObject(MetadataSupport.class); + Assertions.assertEquals(SupportTier.MICROSOFT, model.tier()); + Assertions.assertEquals("aqfkakhgkrvtyycv", model.name()); + Assertions.assertEquals("v", model.email()); + Assertions.assertEquals("jqawfusqpfzxk", model.link()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java new file mode 100644 index 000000000000..032e0655a14f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MetadatasCreateWithResponseMockTests { + @Test + public void testCreateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"plmytnhvyjz\",\"parentId\":\"erh\",\"version\":\"stiawywppq\",\"kind\":\"ujxbdyczplm\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"s\",\"sourceId\":\"wsftytpjmu\"},\"author\":{\"name\":\"nhqlzantahuykxs\",\"email\":\"mpsxmoadwiqnsm\",\"link\":\"eyjvlzqsyv\"},\"support\":{\"tier\":\"Community\",\"name\":\"eq\",\"email\":\"corkemobobxfh\",\"link\":\"tuvwzjyc\"},\"dependencies\":{\"contentId\":\"eagxikzvnghtknrw\",\"kind\":\"ResourcesDataConnector\",\"version\":\"nm\",\"name\":\"v\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"apxwt\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"elf\",\"name\":\"ehr\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"jcziytfwk\",\"kind\":\"Workbook\",\"version\":\"brdo\",\"name\":\"qahn\",\"operator\":\"AND\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"dzvuhw\"],\"verticals\":[\"azjv\",\"iiezdnezxtq\",\"dbrmyutzttroym\",\"vkkuzrvcegyz\"]},\"providers\":[\"cfuwmxezzum\",\"lro\"],\"customVersion\":\"h\",\"contentSchemaVersion\":\"spxblyokjwsszye\",\"icon\":\"oukdhnf\",\"threatAnalysisTactics\":[\"gg\",\"ihnzvoeh\",\"wgqgc\",\"kghg\"],\"threatAnalysisTechniques\":[\"xouxi\",\"dwpgmhqhvne\",\"nwxqwcxaqlymm\"],\"previewImages\":[\"netecfyusfkcwfpo\",\"flgkzgzx\",\"wvvfkqbgk\"],\"previewImagesDark\":[\"gdvllbbdfulvhpw\",\"sxygrniqnxpsebaz\",\"tyrj\",\"oqgnsfzrrapi\"]},\"etag\":\"u\",\"id\":\"qzgy\",\"name\":\"myywhfdkjykvez\",\"type\":\"o\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MetadataModel response = manager.metadatas() + .define("nc") + .withExistingWorkspace("vgyafttbetzydt", "p") + .withEtag("jplk") + .withContentId("oybjkuokajkyrh") + .withParentId("cbfkaql") + .withVersion("zpteron") + .withKind("qaktao") + .withSource(new MetadataSource().withKind(SourceKind.SOLUTION) + .withName("fobcqvzmywvsyns") + .withSourceId("mosqvojgolmkklz")) + .withAuthor(new MetadataAuthor().withName("uvnclntaoidjhoy").withEmail("tyvrn").withLink("kiree")) + .withSupport(new MetadataSupport().withTier(SupportTier.PARTNER) + .withName("izafdgjhnuvndg") + .withEmail("l") + .withLink("a")) + .withDependencies(new MetadataDependencies().withContentId("ipfwl") + .withKind(Kind.WATCHLIST_TEMPLATE) + .withVersion("jd") + .withName("mqteirrjjmvrzfpp") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("gzhnpxbuwauytqd") + .withKind(Kind.HUNTING_QUERY) + .withVersion("loafwsuaxqrok") + .withName("dipnd") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("hctbr") + .withKind(Kind.SUMMARY_RULE) + .withVersion("amoyvqfjpkezq") + .withName("zbyczm") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("vlnpjjbyr") + .withKind(Kind.SOLUTION) + .withVersion("uvdestarul") + .withName("b") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("xhcrffj") + .withKind(Kind.WORKBOOK) + .withVersion("pcuizvxjsvzh") + .withName("eotdscqkxzrfloqz") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies()))))) + .withCategories(new MetadataCategories().withDomains(Arrays.asList("dfqfnftrrhhgwaw", "zhanvcf", "dvkdnf")) + .withVerticals(Arrays.asList("xultxhqqvdhdyy", "dtxnep", "bs", "infauytmqvsdyqyj"))) + .withProviders(Arrays.asList("otwmxedlcxmyxt", "bapojkn", "xantlpspi", "pfgdnq")) + .withCustomVersion("rhoqy") + .withContentSchemaVersion("d") + .withIcon("ruoduexhskh") + .withThreatAnalysisTactics(Arrays.asList("vocrddqxhegco")) + .withThreatAnalysisTechniques(Arrays.asList("zcklqrunqw")) + .withPreviewImages(Arrays.asList("kabyxxyfnipywgjg", "bsfsvay", "ejypokk", "ptnwpwskck")) + .withPreviewImagesDark(Arrays.asList("mfyxpgvqioqrebwa")) + .create(); + + Assertions.assertEquals("u", response.etag()); + Assertions.assertEquals("plmytnhvyjz", response.contentId()); + Assertions.assertEquals("erh", response.parentId()); + Assertions.assertEquals("stiawywppq", response.version()); + Assertions.assertEquals("ujxbdyczplm", response.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, response.source().kind()); + Assertions.assertEquals("s", response.source().name()); + Assertions.assertEquals("wsftytpjmu", response.source().sourceId()); + Assertions.assertEquals("nhqlzantahuykxs", response.author().name()); + Assertions.assertEquals("mpsxmoadwiqnsm", response.author().email()); + Assertions.assertEquals("eyjvlzqsyv", response.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, response.support().tier()); + Assertions.assertEquals("eq", response.support().name()); + Assertions.assertEquals("corkemobobxfh", response.support().email()); + Assertions.assertEquals("tuvwzjyc", response.support().link()); + Assertions.assertEquals("eagxikzvnghtknrw", response.dependencies().contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, response.dependencies().kind()); + Assertions.assertEquals("nm", response.dependencies().version()); + Assertions.assertEquals("v", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().operator()); + Assertions.assertEquals("apxwt", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("elf", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("ehr", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("dzvuhw", response.categories().domains().get(0)); + Assertions.assertEquals("azjv", response.categories().verticals().get(0)); + Assertions.assertEquals("cfuwmxezzum", response.providers().get(0)); + Assertions.assertEquals("h", response.customVersion()); + Assertions.assertEquals("spxblyokjwsszye", response.contentSchemaVersion()); + Assertions.assertEquals("oukdhnf", response.icon()); + Assertions.assertEquals("gg", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("xouxi", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("netecfyusfkcwfpo", response.previewImages().get(0)); + Assertions.assertEquals("gdvllbbdfulvhpw", response.previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..08c7aec1e4d8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MetadatasDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.metadatas() + .deleteWithResponse("nimuaeokympwq", "utlzofuzthszjya", "hsliqeft", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java new file mode 100644 index 000000000000..1db3ae4a6bba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MetadatasGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"gmjjprdpvblon\",\"parentId\":\"h\",\"version\":\"exwjhicuzqa\",\"kind\":\"imxnhyl\",\"source\":{\"kind\":\"Community\",\"name\":\"vl\",\"sourceId\":\"gd\"},\"author\":{\"name\":\"nhdxlfntdc\",\"email\":\"mg\",\"link\":\"zlfyxaiafe\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"kfvycvhwduoa\",\"email\":\"pzzcxku\",\"link\":\"bahcassqe\"},\"dependencies\":{\"contentId\":\"nzeyakg\",\"kind\":\"Workbook\",\"version\":\"fqmxzkicx\",\"name\":\"mqi\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"arboxaluoadmcv\",\"kind\":\"SummaryRule\",\"version\":\"pe\",\"name\":\"wevlohuahl\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"gpmmz\",\"kind\":\"Watchlist\",\"version\":\"llxcmahzylspzc\",\"name\":\"hynlbtriaecvagu\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"yhqrasxeomjq\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"xiuhi\",\"name\":\"bhzdjvdyrzijggb\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]}]},\"categories\":{\"domains\":[\"znxzaliicrutyhm\",\"lvxilaytj\",\"wfqzwn\"],\"verticals\":[\"q\"]},\"providers\":[\"qwqng\"],\"customVersion\":\"buknvkutlszxuu\",\"contentSchemaVersion\":\"uvpbeswgkreozp\",\"icon\":\"kc\",\"threatAnalysisTactics\":[\"cbzgiklqpe\",\"cgdndpbsieymmcb\"],\"threatAnalysisTechniques\":[\"etzvqtcesvcsby\",\"mygswduzpdnb\",\"qweohmlkzhxadmau\",\"nxzr\"],\"previewImages\":[\"haerhxd\",\"hkbrkhjjbwelicrx\",\"bqmoguy\"],\"previewImagesDark\":[\"elwszqv\",\"akddxljjzdb\",\"k\"]},\"etag\":\"gw\",\"id\":\"ujshcsnk\",\"name\":\"ygpqxqevtfdvyyp\",\"type\":\"kjirvjogsalvjl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MetadataModel response = manager.metadatas() + .getWithResponse("msfqntakroxku", "fsuwcmzpwkca", "fq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("gw", response.etag()); + Assertions.assertEquals("gmjjprdpvblon", response.contentId()); + Assertions.assertEquals("h", response.parentId()); + Assertions.assertEquals("exwjhicuzqa", response.version()); + Assertions.assertEquals("imxnhyl", response.kind()); + Assertions.assertEquals(SourceKind.COMMUNITY, response.source().kind()); + Assertions.assertEquals("vl", response.source().name()); + Assertions.assertEquals("gd", response.source().sourceId()); + Assertions.assertEquals("nhdxlfntdc", response.author().name()); + Assertions.assertEquals("mg", response.author().email()); + Assertions.assertEquals("zlfyxaiafe", response.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, response.support().tier()); + Assertions.assertEquals("kfvycvhwduoa", response.support().name()); + Assertions.assertEquals("pzzcxku", response.support().email()); + Assertions.assertEquals("bahcassqe", response.support().link()); + Assertions.assertEquals("nzeyakg", response.dependencies().contentId()); + Assertions.assertEquals(Kind.WORKBOOK, response.dependencies().kind()); + Assertions.assertEquals("fqmxzkicx", response.dependencies().version()); + Assertions.assertEquals("mqi", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().operator()); + Assertions.assertEquals("arboxaluoadmcv", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.SUMMARY_RULE, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("pe", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("wevlohuahl", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("znxzaliicrutyhm", response.categories().domains().get(0)); + Assertions.assertEquals("q", response.categories().verticals().get(0)); + Assertions.assertEquals("qwqng", response.providers().get(0)); + Assertions.assertEquals("buknvkutlszxuu", response.customVersion()); + Assertions.assertEquals("uvpbeswgkreozp", response.contentSchemaVersion()); + Assertions.assertEquals("kc", response.icon()); + Assertions.assertEquals("cbzgiklqpe", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("etzvqtcesvcsby", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("haerhxd", response.previewImages().get(0)); + Assertions.assertEquals("elwszqv", response.previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java new file mode 100644 index 000000000000..01e20bd41317 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MetadatasListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"contentId\":\"glojupenoupcol\",\"parentId\":\"cwrszwades\",\"version\":\"dkcuhqtskybyue\",\"kind\":\"eucvv\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"rgelgodue\",\"sourceId\":\"f\"},\"author\":{\"name\":\"rzenvkqtvtqpwqz\",\"email\":\"tnozwphka\",\"link\":\"acvcbr\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"ohbzbbjxkamitgvq\",\"email\":\"dvdbyelrteunkwyp\",\"link\":\"qfm\"},\"dependencies\":{\"contentId\":\"tdfqlfd\",\"kind\":\"ResourcesDataConnector\",\"version\":\"zdbrw\",\"name\":\"wft\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"qjsfgkwrcb\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"rabpywec\",\"name\":\"izabjb\",\"operator\":\"OR\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"kktig\"],\"verticals\":[\"epl\",\"rerxydsompncea\",\"kjtm\",\"aczkjkfakgrwt\"]},\"providers\":[\"fanmj\",\"pceuwmfdy\",\"vpyhhgqy\"],\"customVersion\":\"ijzhv\",\"contentSchemaVersion\":\"qjekol\",\"icon\":\"lpykjpakaouyaan\",\"threatAnalysisTactics\":[\"ichey\"],\"threatAnalysisTechniques\":[\"konaydp\",\"wyha\",\"zyxaanhwuq\"],\"previewImages\":[\"n\"],\"previewImagesDark\":[\"sfbkxfkeeqofw\",\"ekpeerwssw\",\"mrpdjrylfpdudx\",\"igeurieh\"]},\"etag\":\"an\",\"id\":\"qfhatqssngeviyf\",\"name\":\"gohrhjspsyhda\",\"type\":\"yn\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.metadatas() + .list("unropd", "ufqsdt", "zxj", "xolmehquqi", 1304228238, 1142549709, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("an", response.iterator().next().etag()); + Assertions.assertEquals("glojupenoupcol", response.iterator().next().contentId()); + Assertions.assertEquals("cwrszwades", response.iterator().next().parentId()); + Assertions.assertEquals("dkcuhqtskybyue", response.iterator().next().version()); + Assertions.assertEquals("eucvv", response.iterator().next().kind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, response.iterator().next().source().kind()); + Assertions.assertEquals("rgelgodue", response.iterator().next().source().name()); + Assertions.assertEquals("f", response.iterator().next().source().sourceId()); + Assertions.assertEquals("rzenvkqtvtqpwqz", response.iterator().next().author().name()); + Assertions.assertEquals("tnozwphka", response.iterator().next().author().email()); + Assertions.assertEquals("acvcbr", response.iterator().next().author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, response.iterator().next().support().tier()); + Assertions.assertEquals("ohbzbbjxkamitgvq", response.iterator().next().support().name()); + Assertions.assertEquals("dvdbyelrteunkwyp", response.iterator().next().support().email()); + Assertions.assertEquals("qfm", response.iterator().next().support().link()); + Assertions.assertEquals("tdfqlfd", response.iterator().next().dependencies().contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, response.iterator().next().dependencies().kind()); + Assertions.assertEquals("zdbrw", response.iterator().next().dependencies().version()); + Assertions.assertEquals("wft", response.iterator().next().dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.iterator().next().dependencies().operator()); + Assertions.assertEquals("qjsfgkwrcb", response.iterator().next().dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, + response.iterator().next().dependencies().criteria().get(0).kind()); + Assertions.assertEquals("rabpywec", response.iterator().next().dependencies().criteria().get(0).version()); + Assertions.assertEquals("izabjb", response.iterator().next().dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + response.iterator().next().dependencies().criteria().get(0).operator()); + Assertions.assertEquals("kktig", response.iterator().next().categories().domains().get(0)); + Assertions.assertEquals("epl", response.iterator().next().categories().verticals().get(0)); + Assertions.assertEquals("fanmj", response.iterator().next().providers().get(0)); + Assertions.assertEquals("ijzhv", response.iterator().next().customVersion()); + Assertions.assertEquals("qjekol", response.iterator().next().contentSchemaVersion()); + Assertions.assertEquals("lpykjpakaouyaan", response.iterator().next().icon()); + Assertions.assertEquals("ichey", response.iterator().next().threatAnalysisTactics().get(0)); + Assertions.assertEquals("konaydp", response.iterator().next().threatAnalysisTechniques().get(0)); + Assertions.assertEquals("n", response.iterator().next().previewImages().get(0)); + Assertions.assertEquals("sfbkxfkeeqofw", response.iterator().next().previewImagesDark().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..1f94e3aea355 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class MicrosoftPurviewInformationProtectionCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MicrosoftPurviewInformationProtectionCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"niqw\"}") + .toObject(MicrosoftPurviewInformationProtectionCheckRequirementsProperties.class); + Assertions.assertEquals("niqw", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MicrosoftPurviewInformationProtectionCheckRequirementsProperties model + = new MicrosoftPurviewInformationProtectionCheckRequirementsProperties().withTenantId("niqw"); + model = BinaryData.fromObject(model) + .toObject(MicrosoftPurviewInformationProtectionCheckRequirementsProperties.class); + Assertions.assertEquals("niqw", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsTests.java new file mode 100644 index 000000000000..d0a5f11280db --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionCheckRequirementsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class MicrosoftPurviewInformationProtectionCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MicrosoftPurviewInformationProtectionCheckRequirements model = BinaryData + .fromString("{\"kind\":\"MicrosoftPurviewInformationProtection\",\"properties\":{\"tenantId\":\"gnm\"}}") + .toObject(MicrosoftPurviewInformationProtectionCheckRequirements.class); + Assertions.assertEquals("gnm", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MicrosoftPurviewInformationProtectionCheckRequirements model + = new MicrosoftPurviewInformationProtectionCheckRequirements().withTenantId("gnm"); + model = BinaryData.fromObject(model).toObject(MicrosoftPurviewInformationProtectionCheckRequirements.class); + Assertions.assertEquals("gnm", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesLogsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesLogsTests.java new file mode 100644 index 000000000000..5d70b0452c6b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesLogsTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class MicrosoftPurviewInformationProtectionConnectorDataTypesLogsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MicrosoftPurviewInformationProtectionConnectorDataTypesLogs model + = BinaryData.fromString("{\"state\":\"Enabled\"}") + .toObject(MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MicrosoftPurviewInformationProtectionConnectorDataTypesLogs model + = new MicrosoftPurviewInformationProtectionConnectorDataTypesLogs().withState(DataTypeState.ENABLED); + model + = BinaryData.fromObject(model).toObject(MicrosoftPurviewInformationProtectionConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesTests.java new file mode 100644 index 000000000000..a04d2d4bf74f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionConnectorDataTypesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class MicrosoftPurviewInformationProtectionConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MicrosoftPurviewInformationProtectionConnectorDataTypes model + = BinaryData.fromString("{\"logs\":{\"state\":\"Enabled\"}}") + .toObject(MicrosoftPurviewInformationProtectionConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MicrosoftPurviewInformationProtectionConnectorDataTypes model + = new MicrosoftPurviewInformationProtectionConnectorDataTypes().withLogs( + new MicrosoftPurviewInformationProtectionConnectorDataTypesLogs().withState(DataTypeState.ENABLED)); + model = BinaryData.fromObject(model).toObject(MicrosoftPurviewInformationProtectionConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..50fd95e3ddfe --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorPropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftPurviewInformationProtectionDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class MicrosoftPurviewInformationProtectionDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MicrosoftPurviewInformationProtectionDataConnectorProperties model + = BinaryData.fromString("{\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}},\"tenantId\":\"towlhlsycoyb\"}") + .toObject(MicrosoftPurviewInformationProtectionDataConnectorProperties.class); + Assertions.assertEquals("towlhlsycoyb", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MicrosoftPurviewInformationProtectionDataConnectorProperties model + = new MicrosoftPurviewInformationProtectionDataConnectorProperties().withTenantId("towlhlsycoyb") + .withDataTypes(new MicrosoftPurviewInformationProtectionConnectorDataTypes() + .withLogs(new MicrosoftPurviewInformationProtectionConnectorDataTypesLogs() + .withState(DataTypeState.ENABLED))); + model + = BinaryData.fromObject(model).toObject(MicrosoftPurviewInformationProtectionDataConnectorProperties.class); + Assertions.assertEquals("towlhlsycoyb", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorTests.java new file mode 100644 index 000000000000..98ddb1425faa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftPurviewInformationProtectionDataConnectorTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.MicrosoftPurviewInformationProtectionDataConnector; +import org.junit.jupiter.api.Assertions; + +public final class MicrosoftPurviewInformationProtectionDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MicrosoftPurviewInformationProtectionDataConnector model = BinaryData.fromString( + "{\"kind\":\"MicrosoftPurviewInformationProtection\",\"properties\":{\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}},\"tenantId\":\"ldfkcefeygzqpjoi\"},\"etag\":\"mnaybdjnxumentq\",\"id\":\"tw\",\"name\":\"ymxymu\",\"type\":\"wi\"}") + .toObject(MicrosoftPurviewInformationProtectionDataConnector.class); + Assertions.assertEquals("mnaybdjnxumentq", model.etag()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("ldfkcefeygzqpjoi", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MicrosoftPurviewInformationProtectionDataConnector model + = new MicrosoftPurviewInformationProtectionDataConnector().withEtag("mnaybdjnxumentq") + .withDataTypes(new MicrosoftPurviewInformationProtectionConnectorDataTypes().withLogs( + new MicrosoftPurviewInformationProtectionConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("ldfkcefeygzqpjoi"); + model = BinaryData.fromObject(model).toObject(MicrosoftPurviewInformationProtectionDataConnector.class); + Assertions.assertEquals("mnaybdjnxumentq", model.etag()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("ldfkcefeygzqpjoi", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleCommonPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleCommonPropertiesTests.java index 17d2fb4745ab..673df77807f4 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleCommonPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleCommonPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,29 +15,26 @@ public final class MicrosoftSecurityIncidentCreationAlertRuleCommonPropertiesTes @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRuleCommonProperties model = BinaryData.fromString( - "{\"displayNamesFilter\":[\"kvvjgslordilmyww\",\"kgkxn\",\"edabgyvudtjue\"],\"displayNamesExcludeFilter\":[\"ihxuuwh\",\"j\",\"xccybvpa\"],\"productFilter\":\"Azure Active Directory Identity Protection\",\"severitiesFilter\":[\"Informational\",\"Low\",\"High\"]}") + "{\"displayNamesFilter\":[\"rbpbewtghfgblcg\",\"xzvlvqhjkbegib\",\"nmxiebwwaloayqc\",\"wrtz\"],\"displayNamesExcludeFilter\":[\"gwyzm\"],\"productFilter\":\"Microsoft Cloud App Security\",\"severitiesFilter\":[\"Low\",\"Informational\"]}") .toObject(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.class); - Assertions.assertEquals("kvvjgslordilmyww", model.displayNamesFilter().get(0)); - Assertions.assertEquals("ihxuuwh", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION, - model.productFilter()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severitiesFilter().get(0)); + Assertions.assertEquals("rbpbewtghfgblcg", model.displayNamesFilter().get(0)); + Assertions.assertEquals("gwyzm", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY, model.productFilter()); + Assertions.assertEquals(AlertSeverity.LOW, model.severitiesFilter().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRuleCommonProperties model = new MicrosoftSecurityIncidentCreationAlertRuleCommonProperties() - .withDisplayNamesFilter(Arrays.asList("kvvjgslordilmyww", "kgkxn", "edabgyvudtjue")) - .withDisplayNamesExcludeFilter(Arrays.asList("ihxuuwh", "j", "xccybvpa")) - .withProductFilter(MicrosoftSecurityProductName.AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION) - .withSeveritiesFilter( - Arrays.asList(AlertSeverity.INFORMATIONAL, AlertSeverity.LOW, AlertSeverity.HIGH)); + .withDisplayNamesFilter(Arrays.asList("rbpbewtghfgblcg", "xzvlvqhjkbegib", "nmxiebwwaloayqc", "wrtz")) + .withDisplayNamesExcludeFilter(Arrays.asList("gwyzm")) + .withProductFilter(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY) + .withSeveritiesFilter(Arrays.asList(AlertSeverity.LOW, AlertSeverity.INFORMATIONAL)); model = BinaryData.fromObject(model).toObject(MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.class); - Assertions.assertEquals("kvvjgslordilmyww", model.displayNamesFilter().get(0)); - Assertions.assertEquals("ihxuuwh", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_ACTIVE_DIRECTORY_IDENTITY_PROTECTION, - model.productFilter()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severitiesFilter().get(0)); + Assertions.assertEquals("rbpbewtghfgblcg", model.displayNamesFilter().get(0)); + Assertions.assertEquals("gwyzm", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY, model.productFilter()); + Assertions.assertEquals(AlertSeverity.LOW, model.severitiesFilter().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRulePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRulePropertiesTests.java index f60184a18c02..1f7374f9fb01 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRulePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,38 +15,41 @@ public final class MicrosoftSecurityIncidentCreationAlertRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRuleProperties model = BinaryData.fromString( - "{\"alertRuleTemplateName\":\"zivj\",\"description\":\"rqttbajlkatnw\",\"displayName\":\"yiopi\",\"enabled\":false,\"lastModifiedUtc\":\"2021-07-26T10:21:10Z\",\"displayNamesFilter\":[\"uvscxkdmligov\",\"brxk\",\"mloazuru\"],\"displayNamesExcludeFilter\":[\"goorbteo\"],\"productFilter\":\"Azure Security Center for IoT\",\"severitiesFilter\":[\"Medium\"]}") + "{\"alertRuleTemplateName\":\"civyhzceuo\",\"description\":\"jrwjueiotwm\",\"displayName\":\"dytdxwitx\",\"enabled\":false,\"lastModifiedUtc\":\"2021-01-30T10:40:13Z\",\"displayNamesFilter\":[\"qwgxhniskx\",\"bkpyc\",\"klwndnhjdauwhv\",\"l\"],\"displayNamesExcludeFilter\":[\"tdhxujznbmpowuwp\",\"zqlveualupjmkhf\",\"obbc\"],\"productFilter\":\"Office 365 Advanced Threat Protection\",\"severitiesFilter\":[\"Medium\",\"Informational\",\"Low\",\"Informational\"]}") .toObject(MicrosoftSecurityIncidentCreationAlertRuleProperties.class); - Assertions.assertEquals("uvscxkdmligov", model.displayNamesFilter().get(0)); - Assertions.assertEquals("goorbteo", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_SECURITY_CENTER_FOR_IOT, model.productFilter()); + Assertions.assertEquals("qwgxhniskx", model.displayNamesFilter().get(0)); + Assertions.assertEquals("tdhxujznbmpowuwp", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals(MicrosoftSecurityProductName.OFFICE_365_ADVANCED_THREAT_PROTECTION, + model.productFilter()); Assertions.assertEquals(AlertSeverity.MEDIUM, model.severitiesFilter().get(0)); - Assertions.assertEquals("zivj", model.alertRuleTemplateName()); - Assertions.assertEquals("rqttbajlkatnw", model.description()); - Assertions.assertEquals("yiopi", model.displayName()); - Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals("civyhzceuo", model.alertRuleTemplateName()); + Assertions.assertEquals("jrwjueiotwm", model.description()); + Assertions.assertEquals("dytdxwitx", model.displayName()); + Assertions.assertFalse(model.enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRuleProperties model = new MicrosoftSecurityIncidentCreationAlertRuleProperties() - .withDisplayNamesFilter(Arrays.asList("uvscxkdmligov", "brxk", "mloazuru")) - .withDisplayNamesExcludeFilter(Arrays.asList("goorbteo")) - .withProductFilter(MicrosoftSecurityProductName.AZURE_SECURITY_CENTER_FOR_IOT) - .withSeveritiesFilter(Arrays.asList(AlertSeverity.MEDIUM)) - .withAlertRuleTemplateName("zivj") - .withDescription("rqttbajlkatnw") - .withDisplayName("yiopi") + .withDisplayNamesFilter(Arrays.asList("qwgxhniskx", "bkpyc", "klwndnhjdauwhv", "l")) + .withDisplayNamesExcludeFilter(Arrays.asList("tdhxujznbmpowuwp", "zqlveualupjmkhf", "obbc")) + .withProductFilter(MicrosoftSecurityProductName.OFFICE_365_ADVANCED_THREAT_PROTECTION) + .withSeveritiesFilter(Arrays.asList(AlertSeverity.MEDIUM, AlertSeverity.INFORMATIONAL, + AlertSeverity.LOW, AlertSeverity.INFORMATIONAL)) + .withAlertRuleTemplateName("civyhzceuo") + .withDescription("jrwjueiotwm") + .withDisplayName("dytdxwitx") .withEnabled(false); model = BinaryData.fromObject(model).toObject(MicrosoftSecurityIncidentCreationAlertRuleProperties.class); - Assertions.assertEquals("uvscxkdmligov", model.displayNamesFilter().get(0)); - Assertions.assertEquals("goorbteo", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_SECURITY_CENTER_FOR_IOT, model.productFilter()); + Assertions.assertEquals("qwgxhniskx", model.displayNamesFilter().get(0)); + Assertions.assertEquals("tdhxujznbmpowuwp", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals(MicrosoftSecurityProductName.OFFICE_365_ADVANCED_THREAT_PROTECTION, + model.productFilter()); Assertions.assertEquals(AlertSeverity.MEDIUM, model.severitiesFilter().get(0)); - Assertions.assertEquals("zivj", model.alertRuleTemplateName()); - Assertions.assertEquals("rqttbajlkatnw", model.description()); - Assertions.assertEquals("yiopi", model.displayName()); - Assertions.assertEquals(false, model.enabled()); + Assertions.assertEquals("civyhzceuo", model.alertRuleTemplateName()); + Assertions.assertEquals("jrwjueiotwm", model.description()); + Assertions.assertEquals("dytdxwitx", model.displayName()); + Assertions.assertFalse(model.enabled()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplatePropertiesTests.java index 3f69b1f77edb..2e14f69af32d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplatePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplatePropertiesTests.java @@ -1,63 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName; import com.azure.resourcemanager.securityinsights.models.TemplateStatus; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class MicrosoftSecurityIncidentCreationAlertRuleTemplatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties model = BinaryData.fromString( - "{\"alertRulesCreatedByTemplateCount\":595342906,\"createdDateUTC\":\"2021-11-02T17:47:35Z\",\"lastUpdatedDateUTC\":\"2021-04-11T00:27:16Z\",\"description\":\"xrkjpvdw\",\"displayName\":\"zwiivwzjbhyzs\",\"requiredDataConnectors\":[{\"connectorId\":\"ambtrnegvm\",\"dataTypes\":[\"q\",\"qvldspastjbkkd\"]},{\"connectorId\":\"lves\",\"dataTypes\":[\"lx\"]}],\"status\":\"Available\",\"displayNamesFilter\":[\"zapeewchpx\",\"ktwkuziyc\"],\"displayNamesExcludeFilter\":[\"vu\",\"uztcktyhjtqed\",\"gzulwmmrqzzr\"],\"productFilter\":\"Microsoft Cloud App Security\",\"severitiesFilter\":[\"High\",\"Medium\"]}") + "{\"displayNamesFilter\":[\"jyxgtczh\",\"ydbsd\",\"hmkxmaehvbb\"],\"displayNamesExcludeFilter\":[\"iplt\",\"n\"],\"productFilter\":\"Azure Security Center\",\"severitiesFilter\":[\"Medium\"],\"alertRulesCreatedByTemplateCount\":854940072,\"lastUpdatedDateUTC\":\"2021-09-02T05:21:08Z\",\"createdDateUTC\":\"2021-10-25T12:11:17Z\",\"description\":\"pyklyhpluodpvru\",\"displayName\":\"lgzi\",\"requiredDataConnectors\":[{\"connectorId\":\"stgktst\",\"dataTypes\":[\"eclze\",\"qbcvhzlhplod\",\"kdl\",\"wqfbumlkxtrqjfsm\"]},{\"connectorId\":\"btx\",\"dataTypes\":[\"fwsrtawcoezbrhu\",\"skh\"]},{\"connectorId\":\"ygo\",\"dataTypes\":[\"kqfqjbvl\",\"orfmluiqt\",\"zf\"]},{\"connectorId\":\"yvnqqybaryeuay\",\"dataTypes\":[\"abqgzslesjcbh\",\"rnntiewdjcv\",\"quwrbehwag\",\"hbuffkmrq\"]}],\"status\":\"Installed\"}") .toObject(MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.class); - Assertions.assertEquals(595342906, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("xrkjpvdw", model.description()); - Assertions.assertEquals("zwiivwzjbhyzs", model.displayName()); - Assertions.assertEquals("ambtrnegvm", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("q", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.AVAILABLE, model.status()); - Assertions.assertEquals("zapeewchpx", model.displayNamesFilter().get(0)); - Assertions.assertEquals("vu", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY, model.productFilter()); - Assertions.assertEquals(AlertSeverity.HIGH, model.severitiesFilter().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties model - = new MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties() - .withAlertRulesCreatedByTemplateCount(595342906) - .withDescription("xrkjpvdw") - .withDisplayName("zwiivwzjbhyzs") - .withRequiredDataConnectors(Arrays.asList( - new AlertRuleTemplateDataSource().withConnectorId("ambtrnegvm") - .withDataTypes(Arrays.asList("q", "qvldspastjbkkd")), - new AlertRuleTemplateDataSource().withConnectorId("lves").withDataTypes(Arrays.asList("lx")))) - .withStatus(TemplateStatus.AVAILABLE) - .withDisplayNamesFilter(Arrays.asList("zapeewchpx", "ktwkuziyc")) - .withDisplayNamesExcludeFilter(Arrays.asList("vu", "uztcktyhjtqed", "gzulwmmrqzzr")) - .withProductFilter(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY) - .withSeveritiesFilter(Arrays.asList(AlertSeverity.HIGH, AlertSeverity.MEDIUM)); - model - = BinaryData.fromObject(model).toObject(MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties.class); - Assertions.assertEquals(595342906, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("xrkjpvdw", model.description()); - Assertions.assertEquals("zwiivwzjbhyzs", model.displayName()); - Assertions.assertEquals("ambtrnegvm", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("q", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.AVAILABLE, model.status()); - Assertions.assertEquals("zapeewchpx", model.displayNamesFilter().get(0)); - Assertions.assertEquals("vu", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.MICROSOFT_CLOUD_APP_SECURITY, model.productFilter()); - Assertions.assertEquals(AlertSeverity.HIGH, model.severitiesFilter().get(0)); + Assertions.assertEquals(854940072, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("pyklyhpluodpvru", model.description()); + Assertions.assertEquals("lgzi", model.displayName()); + Assertions.assertEquals("stgktst", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("eclze", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); + Assertions.assertEquals("jyxgtczh", model.displayNamesFilter().get(0)); + Assertions.assertEquals("iplt", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_SECURITY_CENTER, model.productFilter()); + Assertions.assertEquals(AlertSeverity.MEDIUM, model.severitiesFilter().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplateTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplateTests.java index 376a240b9f17..a6ea77efaf5b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplateTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTemplateTests.java @@ -1,67 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityIncidentCreationAlertRuleTemplate; import com.azure.resourcemanager.securityinsights.models.MicrosoftSecurityProductName; import com.azure.resourcemanager.securityinsights.models.TemplateStatus; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class MicrosoftSecurityIncidentCreationAlertRuleTemplateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRuleTemplate model = BinaryData.fromString( - "{\"kind\":\"MicrosoftSecurityIncidentCreation\",\"properties\":{\"alertRulesCreatedByTemplateCount\":2015749730,\"createdDateUTC\":\"2021-11-14T05:13:38Z\",\"lastUpdatedDateUTC\":\"2021-07-01T17:47:57Z\",\"description\":\"agst\",\"displayName\":\"ohpfkyrkdbdgiog\",\"requiredDataConnectors\":[{\"connectorId\":\"nwqjnoba\",\"dataTypes\":[\"ddviacegfnmntfpm\"]},{\"connectorId\":\"emfnczdwvvbal\",\"dataTypes\":[\"lchpodbzevwrdn\"]},{\"connectorId\":\"ukuv\",\"dataTypes\":[\"swsmys\",\"uluqypfc\",\"lerchpq\"]},{\"connectorId\":\"f\",\"dataTypes\":[\"abwidfcxsspuun\",\"oxyhkxgqddrihpf\",\"oqcaaewdaomdj\"]}],\"status\":\"Installed\",\"displayNamesFilter\":[\"xkzb\"],\"displayNamesExcludeFilter\":[\"geivsiykzkdncj\",\"xonbzoggculapz\"],\"productFilter\":\"Azure Advanced Threat Protection\",\"severitiesFilter\":[\"Informational\",\"Low\",\"Medium\"]},\"id\":\"qxepnylbfuaj\",\"name\":\"yjt\",\"type\":\"vofqzhvfc\"}") + "{\"kind\":\"MicrosoftSecurityIncidentCreation\",\"properties\":{\"displayNamesFilter\":[\"tpwoqhihejq\",\"w\",\"pnfqntcyp\",\"xjvfoimwksl\"],\"displayNamesExcludeFilter\":[\"izjx\",\"ydfce\",\"cvlhv\",\"gdyftumrtwna\"],\"productFilter\":\"Azure Advanced Threat Protection\",\"severitiesFilter\":[\"High\",\"Informational\",\"Low\"],\"alertRulesCreatedByTemplateCount\":1263082708,\"lastUpdatedDateUTC\":\"2021-07-19T05:46:16Z\",\"createdDateUTC\":\"2021-09-14T02:22:36Z\",\"description\":\"sfmznbaeqphc\",\"displayName\":\"nrnrp\",\"requiredDataConnectors\":[{\"connectorId\":\"wrykqgai\",\"dataTypes\":[\"iklbydvkhb\",\"jdz\"]},{\"connectorId\":\"cvdsrhnj\",\"dataTypes\":[\"lvtno\",\"qfzgemjdftul\",\"ltducea\"]},{\"connectorId\":\"mczuo\",\"dataTypes\":[\"wcw\"]}],\"status\":\"Available\"},\"id\":\"knssxmojm\",\"name\":\"vpkjpr\",\"type\":\"kwcf\"}") .toObject(MicrosoftSecurityIncidentCreationAlertRuleTemplate.class); - Assertions.assertEquals(2015749730, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("agst", model.description()); - Assertions.assertEquals("ohpfkyrkdbdgiog", model.displayName()); - Assertions.assertEquals("nwqjnoba", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("ddviacegfnmntfpm", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); - Assertions.assertEquals("xkzb", model.displayNamesFilter().get(0)); - Assertions.assertEquals("geivsiykzkdncj", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals("tpwoqhihejq", model.displayNamesFilter().get(0)); + Assertions.assertEquals("izjx", model.displayNamesExcludeFilter().get(0)); Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_ADVANCED_THREAT_PROTECTION, model.productFilter()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severitiesFilter().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MicrosoftSecurityIncidentCreationAlertRuleTemplate model - = new MicrosoftSecurityIncidentCreationAlertRuleTemplate().withAlertRulesCreatedByTemplateCount(2015749730) - .withDescription("agst") - .withDisplayName("ohpfkyrkdbdgiog") - .withRequiredDataConnectors(Arrays.asList( - new AlertRuleTemplateDataSource().withConnectorId("nwqjnoba") - .withDataTypes(Arrays.asList("ddviacegfnmntfpm")), - new AlertRuleTemplateDataSource().withConnectorId("emfnczdwvvbal") - .withDataTypes(Arrays.asList("lchpodbzevwrdn")), - new AlertRuleTemplateDataSource().withConnectorId("ukuv") - .withDataTypes(Arrays.asList("swsmys", "uluqypfc", "lerchpq")), - new AlertRuleTemplateDataSource().withConnectorId("f") - .withDataTypes(Arrays.asList("abwidfcxsspuun", "oxyhkxgqddrihpf", "oqcaaewdaomdj")))) - .withStatus(TemplateStatus.INSTALLED) - .withDisplayNamesFilter(Arrays.asList("xkzb")) - .withDisplayNamesExcludeFilter(Arrays.asList("geivsiykzkdncj", "xonbzoggculapz")) - .withProductFilter(MicrosoftSecurityProductName.AZURE_ADVANCED_THREAT_PROTECTION) - .withSeveritiesFilter( - Arrays.asList(AlertSeverity.INFORMATIONAL, AlertSeverity.LOW, AlertSeverity.MEDIUM)); - model = BinaryData.fromObject(model).toObject(MicrosoftSecurityIncidentCreationAlertRuleTemplate.class); - Assertions.assertEquals(2015749730, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("agst", model.description()); - Assertions.assertEquals("ohpfkyrkdbdgiog", model.displayName()); - Assertions.assertEquals("nwqjnoba", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("ddviacegfnmntfpm", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); - Assertions.assertEquals("xkzb", model.displayNamesFilter().get(0)); - Assertions.assertEquals("geivsiykzkdncj", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_ADVANCED_THREAT_PROTECTION, model.productFilter()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severitiesFilter().get(0)); + Assertions.assertEquals(AlertSeverity.HIGH, model.severitiesFilter().get(0)); + Assertions.assertEquals(1263082708, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("sfmznbaeqphc", model.description()); + Assertions.assertEquals("nrnrp", model.displayName()); + Assertions.assertEquals("wrykqgai", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("iklbydvkhb", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.AVAILABLE, model.status()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTests.java index 254b46871b89..ea29146e5cd2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MicrosoftSecurityIncidentCreationAlertRuleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -15,40 +15,42 @@ public final class MicrosoftSecurityIncidentCreationAlertRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRule model = BinaryData.fromString( - "{\"kind\":\"MicrosoftSecurityIncidentCreation\",\"properties\":{\"alertRuleTemplateName\":\"mlqoljx\",\"description\":\"gxxlxsffgcvizq\",\"displayName\":\"dwl\",\"enabled\":false,\"lastModifiedUtc\":\"2021-04-26T05:35:21Z\",\"displayNamesFilter\":[\"pfgfbkjub\",\"yhgk\"],\"displayNamesExcludeFilter\":[\"nsgowzfttst\"],\"productFilter\":\"Azure Advanced Threat Protection\",\"severitiesFilter\":[\"Informational\"]},\"etag\":\"bqactxtgzukx\",\"id\":\"mmqtgqqqxhr\",\"name\":\"xrxc\",\"type\":\"juisavokqdzf\"}") + "{\"kind\":\"MicrosoftSecurityIncidentCreation\",\"properties\":{\"alertRuleTemplateName\":\"pkdeemaofmxagkvt\",\"description\":\"lmqkrhahvlj\",\"displayName\":\"ahaquh\",\"enabled\":false,\"lastModifiedUtc\":\"2021-02-17T13:46:53Z\",\"displayNamesFilter\":[\"alaexqpvfadmwsrc\",\"gvxp\",\"gomz\",\"fmisg\"],\"displayNamesExcludeFilter\":[\"b\",\"e\"],\"productFilter\":\"Office 365 Advanced Threat Protection\",\"severitiesFilter\":[\"High\"]},\"etag\":\"baliourqhakauha\",\"id\":\"sfwxosowzxc\",\"name\":\"gicjooxdjeb\",\"type\":\"pucwwfvovbvme\"}") .toObject(MicrosoftSecurityIncidentCreationAlertRule.class); - Assertions.assertEquals("bqactxtgzukx", model.etag()); - Assertions.assertEquals("mlqoljx", model.alertRuleTemplateName()); - Assertions.assertEquals("gxxlxsffgcvizq", model.description()); - Assertions.assertEquals("dwl", model.displayName()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("pfgfbkjub", model.displayNamesFilter().get(0)); - Assertions.assertEquals("nsgowzfttst", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_ADVANCED_THREAT_PROTECTION, model.productFilter()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severitiesFilter().get(0)); + Assertions.assertEquals("baliourqhakauha", model.etag()); + Assertions.assertEquals("pkdeemaofmxagkvt", model.alertRuleTemplateName()); + Assertions.assertEquals("lmqkrhahvlj", model.description()); + Assertions.assertEquals("ahaquh", model.displayName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("alaexqpvfadmwsrc", model.displayNamesFilter().get(0)); + Assertions.assertEquals("b", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals(MicrosoftSecurityProductName.OFFICE_365_ADVANCED_THREAT_PROTECTION, + model.productFilter()); + Assertions.assertEquals(AlertSeverity.HIGH, model.severitiesFilter().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MicrosoftSecurityIncidentCreationAlertRule model - = new MicrosoftSecurityIncidentCreationAlertRule().withEtag("bqactxtgzukx") - .withAlertRuleTemplateName("mlqoljx") - .withDescription("gxxlxsffgcvizq") - .withDisplayName("dwl") + = new MicrosoftSecurityIncidentCreationAlertRule().withEtag("baliourqhakauha") + .withAlertRuleTemplateName("pkdeemaofmxagkvt") + .withDescription("lmqkrhahvlj") + .withDisplayName("ahaquh") .withEnabled(false) - .withDisplayNamesFilter(Arrays.asList("pfgfbkjub", "yhgk")) - .withDisplayNamesExcludeFilter(Arrays.asList("nsgowzfttst")) - .withProductFilter(MicrosoftSecurityProductName.AZURE_ADVANCED_THREAT_PROTECTION) - .withSeveritiesFilter(Arrays.asList(AlertSeverity.INFORMATIONAL)); + .withDisplayNamesFilter(Arrays.asList("alaexqpvfadmwsrc", "gvxp", "gomz", "fmisg")) + .withDisplayNamesExcludeFilter(Arrays.asList("b", "e")) + .withProductFilter(MicrosoftSecurityProductName.OFFICE_365_ADVANCED_THREAT_PROTECTION) + .withSeveritiesFilter(Arrays.asList(AlertSeverity.HIGH)); model = BinaryData.fromObject(model).toObject(MicrosoftSecurityIncidentCreationAlertRule.class); - Assertions.assertEquals("bqactxtgzukx", model.etag()); - Assertions.assertEquals("mlqoljx", model.alertRuleTemplateName()); - Assertions.assertEquals("gxxlxsffgcvizq", model.description()); - Assertions.assertEquals("dwl", model.displayName()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("pfgfbkjub", model.displayNamesFilter().get(0)); - Assertions.assertEquals("nsgowzfttst", model.displayNamesExcludeFilter().get(0)); - Assertions.assertEquals(MicrosoftSecurityProductName.AZURE_ADVANCED_THREAT_PROTECTION, model.productFilter()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severitiesFilter().get(0)); + Assertions.assertEquals("baliourqhakauha", model.etag()); + Assertions.assertEquals("pkdeemaofmxagkvt", model.alertRuleTemplateName()); + Assertions.assertEquals("lmqkrhahvlj", model.description()); + Assertions.assertEquals("ahaquh", model.displayName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("alaexqpvfadmwsrc", model.displayNamesFilter().get(0)); + Assertions.assertEquals("b", model.displayNamesExcludeFilter().get(0)); + Assertions.assertEquals(MicrosoftSecurityProductName.OFFICE_365_ADVANCED_THREAT_PROTECTION, + model.productFilter()); + Assertions.assertEquals(AlertSeverity.HIGH, model.severitiesFilter().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeedTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeedTests.java new file mode 100644 index 000000000000..ab5e90c35e02 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MstiDataConnectorDataTypesMicrosoftEmergingThreatFeedTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class MstiDataConnectorDataTypesMicrosoftEmergingThreatFeedTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed model + = BinaryData.fromString("{\"lookbackPeriod\":\"2021-03-12T07:08:21Z\",\"state\":\"Disabled\"}") + .toObject(MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-12T07:08:21Z"), model.lookbackPeriod()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed model + = new MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed().withState(DataTypeState.DISABLED) + .withLookbackPeriod(OffsetDateTime.parse("2021-03-12T07:08:21Z")); + model = BinaryData.fromObject(model).toObject(MstiDataConnectorDataTypesMicrosoftEmergingThreatFeed.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-12T07:08:21Z"), model.lookbackPeriod()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpCheckRequirementsTests.java new file mode 100644 index 000000000000..ecb66a23e750 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MtpCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class MtpCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MtpCheckRequirements model + = BinaryData.fromString("{\"kind\":\"MicrosoftThreatProtection\",\"properties\":{\"tenantId\":\"cct\"}}") + .toObject(MtpCheckRequirements.class); + Assertions.assertEquals("cct", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MtpCheckRequirements model = new MtpCheckRequirements().withTenantId("cct"); + model = BinaryData.fromObject(model).toObject(MtpCheckRequirements.class); + Assertions.assertEquals("cct", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpFilteredProvidersTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpFilteredProvidersTests.java new file mode 100644 index 000000000000..aa7179806206 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MtpFilteredProvidersTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.MtpFilteredProviders; +import com.azure.resourcemanager.securityinsights.models.MtpProvider; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MtpFilteredProvidersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MtpFilteredProviders model + = BinaryData.fromString("{\"alerts\":[\"microsoftDefenderForCloudApps\",\"microsoftDefenderForIdentity\"]}") + .toObject(MtpFilteredProviders.class); + Assertions.assertEquals(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS, model.alerts().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MtpFilteredProviders model = new MtpFilteredProviders().withAlerts( + Arrays.asList(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS, MtpProvider.MICROSOFT_DEFENDER_FOR_IDENTITY)); + model = BinaryData.fromObject(model).toObject(MtpFilteredProviders.class); + Assertions.assertEquals(MtpProvider.MICROSOFT_DEFENDER_FOR_CLOUD_APPS, model.alerts().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityPropertiesTests.java new file mode 100644 index 000000000000..434cc0aff05a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.NicEntityProperties; + +public final class NicEntityPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NicEntityProperties model = BinaryData.fromString( + "{\"macAddress\":\"thor\",\"ipAddressEntityId\":\"dawlpjfelqerpp\",\"vlans\":[\"gqnzm\",\"h\"],\"additionalData\":{\"gckbb\":\"\\\"dataialwc\\\"\",\"fa\":\"\\\"dataccgzpraoxnyu\\\"\",\"byubhiqdxyurnpn\":\"\\\"datasgftipwc\\\"\",\"ccnuhiig\":\"\\\"datahza\\\"\"},\"friendlyName\":\"lbuigv\"}") + .toObject(NicEntityProperties.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityTests.java new file mode 100644 index 000000000000..8da88d25dfa4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NicEntityTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.NicEntity; + +public final class NicEntityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NicEntity model = BinaryData.fromString( + "{\"kind\":\"Nic\",\"properties\":{\"macAddress\":\"gjfoknubnoitpkpz\",\"ipAddressEntityId\":\"gdgxvcoqraswug\",\"vlans\":[\"qi\",\"we\"],\"additionalData\":{\"oqc\":\"\\\"datawvskbuhzacaqtylt\\\"\"},\"friendlyName\":\"pdsxzakuejkm\"},\"id\":\"iztjof\",\"name\":\"cvovjufyc\",\"type\":\"jmlbemyejiriux\"}") + .toObject(NicEntity.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NoneAuthModelTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NoneAuthModelTests.java new file mode 100644 index 000000000000..0cac428cd59d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NoneAuthModelTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.NoneAuthModel; + +public final class NoneAuthModelTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NoneAuthModel model = BinaryData.fromString("{\"type\":\"None\"}").toObject(NoneAuthModel.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NoneAuthModel model = new NoneAuthModel(); + model = BinaryData.fromObject(model).toObject(NoneAuthModel.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRulePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRulePropertiesTests.java new file mode 100644 index 000000000000..51aa1f0e41b1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRulePropertiesTests.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleProperties; +import com.azure.resourcemanager.securityinsights.models.AlertDetail; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; +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.GroupingConfiguration; +import com.azure.resourcemanager.securityinsights.models.IncidentConfiguration; +import com.azure.resourcemanager.securityinsights.models.MatchingMethod; +import com.azure.resourcemanager.securityinsights.models.SentinelEntityMapping; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class NrtAlertRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NrtAlertRuleProperties model = BinaryData.fromString( + "{\"alertRuleTemplateName\":\"hxx\",\"templateVersion\":\"yq\",\"description\":\"zfeqztppri\",\"query\":\"lxorjaltolmncws\",\"tactics\":[\"ResourceDevelopment\",\"Exfiltration\",\"Reconnaissance\",\"DefenseEvasion\"],\"techniques\":[\"wdcfhucqdpfuv\",\"lsbjjcanvxbv\"],\"subTechniques\":[\"dut\",\"cormr\"],\"displayName\":\"xqtvcofu\",\"enabled\":false,\"lastModifiedUtc\":\"2021-04-11T02:34:51Z\",\"suppressionDuration\":\"PT154H29M41S\",\"suppressionEnabled\":false,\"severity\":\"High\",\"incidentConfiguration\":{\"createIncident\":false,\"groupingConfiguration\":{\"enabled\":true,\"reopenClosedIncident\":true,\"lookbackDuration\":\"PT118H54M10S\",\"matchingMethod\":\"Selected\",\"groupByEntities\":[\"DNS\",\"File\",\"MailMessage\",\"DNS\"],\"groupByAlertDetails\":[\"DisplayName\"],\"groupByCustomDetails\":[\"udsgs\",\"hmk\"]}},\"customDetails\":{\"u\":\"rauwjuetaebu\",\"l\":\"dmovsm\",\"oefki\":\"wabm\",\"qujmqlgkf\":\"rvtp\"},\"entityMappings\":[{\"entityType\":\"SubmissionMail\",\"fieldMappings\":[{\"identifier\":\"gbjcntujitcjed\",\"columnName\":\"wwa\"},{\"identifier\":\"kojvd\",\"columnName\":\"zfoqouicybxar\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"zuf\",\"alertDescriptionFormat\":\"ciqopidoa\",\"alertTacticsColumnName\":\"iodhkhazxkhnz\",\"alertSeverityColumnName\":\"nlwntoe\",\"alertDynamicProperties\":[{\"alertProperty\":\"RemediationSteps\",\"value\":\"whkszzcmrvexztvb\"},{\"alertProperty\":\"ProductName\",\"value\":\"frao\"},{\"alertProperty\":\"ProviderName\",\"value\":\"owtlmnguxawqald\"}]},\"eventGroupingSettings\":{\"aggregationKind\":\"AlertPerResult\"},\"sentinelEntitiesMappings\":[{\"columnName\":\"erqf\"},{\"columnName\":\"wyznkbyku\"},{\"columnName\":\"pfhpagmhrskdsnfd\"},{\"columnName\":\"oakgtdlmkkzev\"}]}") + .toObject(NrtAlertRuleProperties.class); + Assertions.assertEquals("hxx", model.alertRuleTemplateName()); + Assertions.assertEquals("yq", model.templateVersion()); + Assertions.assertEquals("zfeqztppri", model.description()); + Assertions.assertEquals("lxorjaltolmncws", model.query()); + Assertions.assertEquals(AttackTactic.RESOURCE_DEVELOPMENT, model.tactics().get(0)); + Assertions.assertEquals("wdcfhucqdpfuv", model.techniques().get(0)); + Assertions.assertEquals("dut", model.subTechniques().get(0)); + Assertions.assertEquals("xqtvcofu", model.displayName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals(Duration.parse("PT154H29M41S"), model.suppressionDuration()); + Assertions.assertFalse(model.suppressionEnabled()); + Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT118H54M10S"), + model.incidentConfiguration().groupingConfiguration().lookbackDuration()); + Assertions.assertEquals(MatchingMethod.SELECTED, + model.incidentConfiguration().groupingConfiguration().matchingMethod()); + Assertions.assertEquals(EntityMappingType.DNS, + model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.DISPLAY_NAME, + model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); + Assertions.assertEquals("udsgs", + model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); + Assertions.assertEquals("rauwjuetaebu", model.customDetails().get("u")); + Assertions.assertEquals(EntityMappingType.SUBMISSION_MAIL, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("gbjcntujitcjed", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("wwa", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("zuf", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("ciqopidoa", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("iodhkhazxkhnz", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("nlwntoe", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.REMEDIATION_STEPS, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("whkszzcmrvexztvb", + model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, + model.eventGroupingSettings().aggregationKind()); + Assertions.assertEquals("erqf", model.sentinelEntitiesMappings().get(0).columnName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NrtAlertRuleProperties model = new NrtAlertRuleProperties().withAlertRuleTemplateName("hxx") + .withTemplateVersion("yq") + .withDescription("zfeqztppri") + .withQuery("lxorjaltolmncws") + .withTactics(Arrays.asList(AttackTactic.RESOURCE_DEVELOPMENT, AttackTactic.EXFILTRATION, + AttackTactic.RECONNAISSANCE, AttackTactic.DEFENSE_EVASION)) + .withTechniques(Arrays.asList("wdcfhucqdpfuv", "lsbjjcanvxbv")) + .withSubTechniques(Arrays.asList("dut", "cormr")) + .withDisplayName("xqtvcofu") + .withEnabled(false) + .withSuppressionDuration(Duration.parse("PT154H29M41S")) + .withSuppressionEnabled(false) + .withSeverity(AlertSeverity.HIGH) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(false) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) + .withReopenClosedIncident(true) + .withLookbackDuration(Duration.parse("PT118H54M10S")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.DNS, EntityMappingType.FILE, + EntityMappingType.MAIL_MESSAGE, EntityMappingType.DNS)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails(Arrays.asList("udsgs", "hmk")))) + .withCustomDetails(mapOf("u", "rauwjuetaebu", "l", "dmovsm", "oefki", "wabm", "qujmqlgkf", "rvtp")) + .withEntityMappings(Arrays.asList(new EntityMapping().withEntityType(EntityMappingType.SUBMISSION_MAIL) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("gbjcntujitcjed").withColumnName("wwa"), + new FieldMapping().withIdentifier("kojvd").withColumnName("zfoqouicybxar"))))) + .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("zuf") + .withAlertDescriptionFormat("ciqopidoa") + .withAlertTacticsColumnName("iodhkhazxkhnz") + .withAlertSeverityColumnName("nlwntoe") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.REMEDIATION_STEPS) + .withValue("whkszzcmrvexztvb"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_NAME).withValue("frao"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.PROVIDER_NAME) + .withValue("owtlmnguxawqald")))) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)) + .withSentinelEntitiesMappings(Arrays.asList(new SentinelEntityMapping().withColumnName("erqf"), + new SentinelEntityMapping().withColumnName("wyznkbyku"), + new SentinelEntityMapping().withColumnName("pfhpagmhrskdsnfd"), + new SentinelEntityMapping().withColumnName("oakgtdlmkkzev"))); + model = BinaryData.fromObject(model).toObject(NrtAlertRuleProperties.class); + Assertions.assertEquals("hxx", model.alertRuleTemplateName()); + Assertions.assertEquals("yq", model.templateVersion()); + Assertions.assertEquals("zfeqztppri", model.description()); + Assertions.assertEquals("lxorjaltolmncws", model.query()); + Assertions.assertEquals(AttackTactic.RESOURCE_DEVELOPMENT, model.tactics().get(0)); + Assertions.assertEquals("wdcfhucqdpfuv", model.techniques().get(0)); + Assertions.assertEquals("dut", model.subTechniques().get(0)); + Assertions.assertEquals("xqtvcofu", model.displayName()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals(Duration.parse("PT154H29M41S"), model.suppressionDuration()); + Assertions.assertFalse(model.suppressionEnabled()); + Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT118H54M10S"), + model.incidentConfiguration().groupingConfiguration().lookbackDuration()); + Assertions.assertEquals(MatchingMethod.SELECTED, + model.incidentConfiguration().groupingConfiguration().matchingMethod()); + Assertions.assertEquals(EntityMappingType.DNS, + model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.DISPLAY_NAME, + model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); + Assertions.assertEquals("udsgs", + model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); + Assertions.assertEquals("rauwjuetaebu", model.customDetails().get("u")); + Assertions.assertEquals(EntityMappingType.SUBMISSION_MAIL, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("gbjcntujitcjed", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("wwa", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("zuf", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("ciqopidoa", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("iodhkhazxkhnz", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("nlwntoe", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.REMEDIATION_STEPS, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("whkszzcmrvexztvb", + model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, + model.eventGroupingSettings().aggregationKind()); + Assertions.assertEquals("erqf", model.sentinelEntitiesMappings().get(0).columnName()); + } + + // Use "Map.of" if available + @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/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplatePropertiesTests.java new file mode 100644 index 000000000000..a1bc2aa2ed33 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplatePropertiesTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.NrtAlertRuleTemplateProperties; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMappingType; +import com.azure.resourcemanager.securityinsights.models.EventGroupingAggregationKind; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import org.junit.jupiter.api.Assertions; + +public final class NrtAlertRuleTemplatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NrtAlertRuleTemplateProperties model = BinaryData.fromString( + "{\"tactics\":[\"Persistence\",\"Collection\"],\"techniques\":[\"ee\",\"mieknlraria\",\"wiuagydwqf\"],\"alertRulesCreatedByTemplateCount\":803078065,\"lastUpdatedDateUTC\":\"2021-08-13T07:35:36Z\",\"createdDateUTC\":\"2021-11-07T20:33:57Z\",\"description\":\"agt\",\"displayName\":\"jocqwogfnzjvusf\",\"requiredDataConnectors\":[{\"connectorId\":\"ozuxylfsbtkadpys\",\"dataTypes\":[\"btgkbugrjqctoj\",\"mi\",\"of\",\"eypefojyqd\"]},{\"connectorId\":\"u\",\"dataTypes\":[\"plcwkhi\"]}],\"status\":\"Installed\",\"query\":\"hzdsqtzbsrgnow\",\"severity\":\"Low\",\"version\":\"gmvecactxmw\",\"customDetails\":{\"uqovekqvgqouwif\":\"yowc\"},\"entityMappings\":[{\"entityType\":\"MailCluster\",\"fieldMappings\":[{\"identifier\":\"qikfxcv\",\"columnName\":\"fsphuagrttikt\"},{\"identifier\":\"sqczkvyklxubyj\",\"columnName\":\"fmmfblcqcu\"},{\"identifier\":\"gqibrtalmetttw\",\"columnName\":\"slqxi\"}]},{\"entityType\":\"DNS\",\"fieldMappings\":[{\"identifier\":\"i\",\"columnName\":\"seypxiutcxapz\"},{\"identifier\":\"rpetogebjoxsl\",\"columnName\":\"nhl\"},{\"identifier\":\"rqnkkzjcjbtr\",\"columnName\":\"ehvvib\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"jsto\",\"alertDescriptionFormat\":\"eitpkxztmo\",\"alertTacticsColumnName\":\"klf\",\"alertSeverityColumnName\":\"dgfcwqmp\",\"alertDynamicProperties\":[{\"alertProperty\":\"ProductName\",\"value\":\"hemjy\"},{\"alertProperty\":\"ProductName\",\"value\":\"jswtwkozzwc\"},{\"alertProperty\":\"ProviderName\",\"value\":\"awpfajnjwltlwtjj\"}]},\"eventGroupingSettings\":{\"aggregationKind\":\"AlertPerResult\"},\"sentinelEntitiesMappings\":[{\"columnName\":\"snv\"},{\"columnName\":\"dmxzr\"},{\"columnName\":\"aimlnwiaaom\"}]}") + .toObject(NrtAlertRuleTemplateProperties.class); + Assertions.assertEquals(AttackTactic.PERSISTENCE, model.tactics().get(0)); + Assertions.assertEquals("ee", model.techniques().get(0)); + Assertions.assertEquals(803078065, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("agt", model.description()); + Assertions.assertEquals("jocqwogfnzjvusf", model.displayName()); + Assertions.assertEquals("ozuxylfsbtkadpys", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("btgkbugrjqctoj", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); + Assertions.assertEquals("hzdsqtzbsrgnow", model.query()); + Assertions.assertEquals(AlertSeverity.LOW, model.severity()); + Assertions.assertEquals("gmvecactxmw", model.version()); + Assertions.assertEquals("yowc", model.customDetails().get("uqovekqvgqouwif")); + Assertions.assertEquals(EntityMappingType.MAIL_CLUSTER, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("qikfxcv", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("fsphuagrttikt", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("jsto", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("eitpkxztmo", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("klf", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("dgfcwqmp", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.PRODUCT_NAME, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("hemjy", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, + model.eventGroupingSettings().aggregationKind()); + Assertions.assertEquals("snv", model.sentinelEntitiesMappings().get(0).columnName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplateTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplateTests.java new file mode 100644 index 000000000000..9a8c1fb88322 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTemplateTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.EntityMappingType; +import com.azure.resourcemanager.securityinsights.models.EventGroupingAggregationKind; +import com.azure.resourcemanager.securityinsights.models.NrtAlertRuleTemplate; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import org.junit.jupiter.api.Assertions; + +public final class NrtAlertRuleTemplateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NrtAlertRuleTemplate model = BinaryData.fromString( + "{\"kind\":\"NRT\",\"properties\":{\"tactics\":[\"CommandAndControl\",\"PreAttack\"],\"techniques\":[\"vzm\"],\"alertRulesCreatedByTemplateCount\":53911189,\"lastUpdatedDateUTC\":\"2021-08-29T10:44:42Z\",\"createdDateUTC\":\"2021-04-10T04:31:29Z\",\"description\":\"obfirclnpk\",\"displayName\":\"ayzri\",\"requiredDataConnectors\":[{\"connectorId\":\"awfvjlboxqvkjl\",\"dataTypes\":[\"omdynhdwdigum\"]}],\"status\":\"Installed\",\"query\":\"auzzptjazysd\",\"severity\":\"Medium\",\"version\":\"wwvaiqyuvvfonk\",\"customDetails\":{\"auy\":\"qyikvy\",\"y\":\"vluwmncsttij\"},\"entityMappings\":[{\"entityType\":\"SecurityGroup\",\"fieldMappings\":[{\"identifier\":\"gsgbdhuzq\",\"columnName\":\"j\"}]},{\"entityType\":\"RegistryKey\",\"fieldMappings\":[{\"identifier\":\"cli\",\"columnName\":\"zvhxnk\"},{\"identifier\":\"tkubotppn\",\"columnName\":\"xz\"},{\"identifier\":\"ihfrbbcevqa\",\"columnName\":\"ltd\"},{\"identifier\":\"fkqojpy\",\"columnName\":\"gtrd\"}]},{\"entityType\":\"SubmissionMail\",\"fieldMappings\":[{\"identifier\":\"zsdymbrnysuxmpra\",\"columnName\":\"g\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"ocxvdfffwafqr\",\"alertDescriptionFormat\":\"daspavehhrvk\",\"alertTacticsColumnName\":\"n\",\"alertSeverityColumnName\":\"zudhcxg\",\"alertDynamicProperties\":[{\"alertProperty\":\"ConfidenceScore\",\"value\":\"dyuib\"},{\"alertProperty\":\"Techniques\",\"value\":\"nbzydvfvfcj\"},{\"alertProperty\":\"ConfidenceScore\",\"value\":\"isrvhm\"}]},\"eventGroupingSettings\":{\"aggregationKind\":\"AlertPerResult\"},\"sentinelEntitiesMappings\":[{\"columnName\":\"is\"},{\"columnName\":\"w\"},{\"columnName\":\"hwplefaxvx\"}]},\"id\":\"cbtgnhnz\",\"name\":\"yqxtjjfzql\",\"type\":\"hycav\"}") + .toObject(NrtAlertRuleTemplate.class); + Assertions.assertEquals(AttackTactic.COMMAND_AND_CONTROL, model.tactics().get(0)); + Assertions.assertEquals("vzm", model.techniques().get(0)); + Assertions.assertEquals(53911189, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("obfirclnpk", model.description()); + Assertions.assertEquals("ayzri", model.displayName()); + Assertions.assertEquals("awfvjlboxqvkjl", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("omdynhdwdigum", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); + Assertions.assertEquals("auzzptjazysd", model.query()); + Assertions.assertEquals(AlertSeverity.MEDIUM, model.severity()); + Assertions.assertEquals("wwvaiqyuvvfonk", model.version()); + Assertions.assertEquals("qyikvy", model.customDetails().get("auy")); + Assertions.assertEquals(EntityMappingType.SECURITY_GROUP, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("gsgbdhuzq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("j", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("ocxvdfffwafqr", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("daspavehhrvk", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("n", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("zudhcxg", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.CONFIDENCE_SCORE, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("dyuib", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, + model.eventGroupingSettings().aggregationKind()); + Assertions.assertEquals("is", model.sentinelEntitiesMappings().get(0).columnName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTests.java new file mode 100644 index 000000000000..a13e74f44b53 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/NrtAlertRuleTests.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertDetail; +import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; +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.GroupingConfiguration; +import com.azure.resourcemanager.securityinsights.models.IncidentConfiguration; +import com.azure.resourcemanager.securityinsights.models.MatchingMethod; +import com.azure.resourcemanager.securityinsights.models.NrtAlertRule; +import com.azure.resourcemanager.securityinsights.models.SentinelEntityMapping; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class NrtAlertRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NrtAlertRule model = BinaryData.fromString( + "{\"kind\":\"NRT\",\"properties\":{\"alertRuleTemplateName\":\"ndrdvstkwq\",\"templateVersion\":\"chea\",\"description\":\"fmtdaaygdvwvgp\",\"query\":\"ohgwxrtfudxepxg\",\"tactics\":[\"Execution\",\"PreAttack\",\"Execution\"],\"techniques\":[\"npkukghimdblx\",\"wi\",\"fnjhfjxwmszkkfo\",\"rey\"],\"subTechniques\":[\"ikf\"],\"displayName\":\"aw\",\"enabled\":true,\"lastModifiedUtc\":\"2021-03-26T11:41:44Z\",\"suppressionDuration\":\"PT201H35M24S\",\"suppressionEnabled\":true,\"severity\":\"Medium\",\"incidentConfiguration\":{\"createIncident\":false,\"groupingConfiguration\":{\"enabled\":true,\"reopenClosedIncident\":true,\"lookbackDuration\":\"PT50H26M51S\",\"matchingMethod\":\"Selected\",\"groupByEntities\":[\"AzureResource\",\"DNS\"],\"groupByAlertDetails\":[\"DisplayName\"],\"groupByCustomDetails\":[\"wabfatkl\",\"dxbjhwuaanozj\",\"sphyoulpjrvxa\"]}},\"customDetails\":{\"tx\":\"vimjwos\",\"fcktqumiekke\":\"tcs\",\"fjhdg\":\"zikhl\",\"dunyg\":\"gge\"},\"entityMappings\":[{\"entityType\":\"IP\",\"fieldMappings\":[{\"identifier\":\"atpxl\",\"columnName\":\"xcyjmoadsuvarmy\"},{\"identifier\":\"mjsjqb\",\"columnName\":\"hyxxrwlycoduhpk\"},{\"identifier\":\"gymare\",\"columnName\":\"ajxq\"},{\"identifier\":\"jhkycub\",\"columnName\":\"dgssofwqmzqal\"}]},{\"entityType\":\"RegistryValue\",\"fieldMappings\":[{\"identifier\":\"jpxac\",\"columnName\":\"udfnbyxba\"},{\"identifier\":\"bjyvay\",\"columnName\":\"imrzrtuzqog\"}]},{\"entityType\":\"Mailbox\",\"fieldMappings\":[{\"identifier\":\"fdnw\",\"columnName\":\"mewzsyyc\"},{\"identifier\":\"zsoibjudpfrxtr\",\"columnName\":\"zvaytdwkqbr\"},{\"identifier\":\"bpaxhexiilivpdt\",\"columnName\":\"r\"}]},{\"entityType\":\"Malware\",\"fieldMappings\":[{\"identifier\":\"xoruzfgsquyfxrx\",\"columnName\":\"eptra\"},{\"identifier\":\"jezwlwnw\",\"columnName\":\"qlcvydy\"},{\"identifier\":\"tdooaoj\",\"columnName\":\"iodkooebwnujhem\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"vdkcrodtj\",\"alertDescriptionFormat\":\"fw\",\"alertTacticsColumnName\":\"fltkacjv\",\"alertSeverityColumnName\":\"kdlfoa\",\"alertDynamicProperties\":[{\"alertProperty\":\"ProductComponentName\",\"value\":\"agaowpulpqblylsy\"},{\"alertProperty\":\"Techniques\",\"value\":\"nsj\"}]},\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"sentinelEntitiesMappings\":[{\"columnName\":\"xsdszuempsb\"},{\"columnName\":\"f\"},{\"columnName\":\"eyvpnqicvinvkj\"}]},\"etag\":\"dxrbuukzcle\",\"id\":\"hmlwpaztzpo\",\"name\":\"ncckw\",\"type\":\"fz\"}") + .toObject(NrtAlertRule.class); + Assertions.assertEquals("dxrbuukzcle", model.etag()); + Assertions.assertEquals("ndrdvstkwq", model.alertRuleTemplateName()); + Assertions.assertEquals("chea", model.templateVersion()); + Assertions.assertEquals("fmtdaaygdvwvgp", model.description()); + Assertions.assertEquals("ohgwxrtfudxepxg", model.query()); + Assertions.assertEquals(AttackTactic.EXECUTION, model.tactics().get(0)); + Assertions.assertEquals("npkukghimdblx", model.techniques().get(0)); + Assertions.assertEquals("ikf", model.subTechniques().get(0)); + Assertions.assertEquals("aw", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(Duration.parse("PT201H35M24S"), model.suppressionDuration()); + Assertions.assertTrue(model.suppressionEnabled()); + Assertions.assertEquals(AlertSeverity.MEDIUM, model.severity()); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT50H26M51S"), + model.incidentConfiguration().groupingConfiguration().lookbackDuration()); + Assertions.assertEquals(MatchingMethod.SELECTED, + model.incidentConfiguration().groupingConfiguration().matchingMethod()); + Assertions.assertEquals(EntityMappingType.AZURE_RESOURCE, + model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.DISPLAY_NAME, + model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); + Assertions.assertEquals("wabfatkl", + model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); + Assertions.assertEquals("vimjwos", model.customDetails().get("tx")); + Assertions.assertEquals(EntityMappingType.IP, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("atpxl", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("xcyjmoadsuvarmy", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("vdkcrodtj", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("fw", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("fltkacjv", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("kdlfoa", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.PRODUCT_COMPONENT_NAME, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("agaowpulpqblylsy", + model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, + model.eventGroupingSettings().aggregationKind()); + Assertions.assertEquals("xsdszuempsb", model.sentinelEntitiesMappings().get(0).columnName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NrtAlertRule model + = new NrtAlertRule().withEtag("dxrbuukzcle") + .withAlertRuleTemplateName("ndrdvstkwq") + .withTemplateVersion("chea") + .withDescription("fmtdaaygdvwvgp") + .withQuery("ohgwxrtfudxepxg") + .withTactics(Arrays.asList(AttackTactic.EXECUTION, AttackTactic.PRE_ATTACK, AttackTactic.EXECUTION)) + .withTechniques(Arrays.asList("npkukghimdblx", "wi", "fnjhfjxwmszkkfo", "rey")) + .withSubTechniques(Arrays.asList("ikf")) + .withDisplayName("aw") + .withEnabled(true) + .withSuppressionDuration(Duration.parse("PT201H35M24S")) + .withSuppressionEnabled(true) + .withSeverity(AlertSeverity.MEDIUM) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(false) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) + .withReopenClosedIncident(true) + .withLookbackDuration(Duration.parse("PT50H26M51S")) + .withMatchingMethod(MatchingMethod.SELECTED) + .withGroupByEntities(Arrays.asList(EntityMappingType.AZURE_RESOURCE, EntityMappingType.DNS)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails(Arrays.asList("wabfatkl", "dxbjhwuaanozj", "sphyoulpjrvxa")))) + .withCustomDetails(mapOf("tx", "vimjwos", "fcktqumiekke", "tcs", "fjhdg", "zikhl", "dunyg", "gge")) + .withEntityMappings( + Arrays.asList( + new EntityMapping().withEntityType(EntityMappingType.IP) + .withFieldMappings(Arrays.asList( + new FieldMapping().withIdentifier("atpxl").withColumnName("xcyjmoadsuvarmy"), + new FieldMapping().withIdentifier("mjsjqb").withColumnName("hyxxrwlycoduhpk"), + new FieldMapping().withIdentifier("gymare").withColumnName("ajxq"), + new FieldMapping().withIdentifier("jhkycub").withColumnName("dgssofwqmzqal"))), + new EntityMapping().withEntityType(EntityMappingType.REGISTRY_VALUE) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("jpxac").withColumnName("udfnbyxba"), + new FieldMapping().withIdentifier("bjyvay").withColumnName("imrzrtuzqog"))), + new EntityMapping().withEntityType(EntityMappingType.MAILBOX) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("fdnw").withColumnName("mewzsyyc"), + new FieldMapping().withIdentifier("zsoibjudpfrxtr").withColumnName("zvaytdwkqbr"), + new FieldMapping().withIdentifier("bpaxhexiilivpdt").withColumnName("r"))), + new EntityMapping().withEntityType(EntityMappingType.MALWARE) + .withFieldMappings(Arrays.asList( + new FieldMapping().withIdentifier("xoruzfgsquyfxrx").withColumnName("eptra"), + new FieldMapping().withIdentifier("jezwlwnw").withColumnName("qlcvydy"), + new FieldMapping().withIdentifier("tdooaoj").withColumnName("iodkooebwnujhem"))))) + .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("vdkcrodtj") + .withAlertDescriptionFormat("fw") + .withAlertTacticsColumnName("fltkacjv") + .withAlertSeverityColumnName("kdlfoa") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_COMPONENT_NAME) + .withValue("agaowpulpqblylsy"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.TECHNIQUES).withValue("nsj")))) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.SINGLE_ALERT)) + .withSentinelEntitiesMappings(Arrays.asList(new SentinelEntityMapping().withColumnName("xsdszuempsb"), + new SentinelEntityMapping().withColumnName("f"), + new SentinelEntityMapping().withColumnName("eyvpnqicvinvkj"))); + model = BinaryData.fromObject(model).toObject(NrtAlertRule.class); + Assertions.assertEquals("dxrbuukzcle", model.etag()); + Assertions.assertEquals("ndrdvstkwq", model.alertRuleTemplateName()); + Assertions.assertEquals("chea", model.templateVersion()); + Assertions.assertEquals("fmtdaaygdvwvgp", model.description()); + Assertions.assertEquals("ohgwxrtfudxepxg", model.query()); + Assertions.assertEquals(AttackTactic.EXECUTION, model.tactics().get(0)); + Assertions.assertEquals("npkukghimdblx", model.techniques().get(0)); + Assertions.assertEquals("ikf", model.subTechniques().get(0)); + Assertions.assertEquals("aw", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(Duration.parse("PT201H35M24S"), model.suppressionDuration()); + Assertions.assertTrue(model.suppressionEnabled()); + Assertions.assertEquals(AlertSeverity.MEDIUM, model.severity()); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT50H26M51S"), + model.incidentConfiguration().groupingConfiguration().lookbackDuration()); + Assertions.assertEquals(MatchingMethod.SELECTED, + model.incidentConfiguration().groupingConfiguration().matchingMethod()); + Assertions.assertEquals(EntityMappingType.AZURE_RESOURCE, + model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); + Assertions.assertEquals(AlertDetail.DISPLAY_NAME, + model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); + Assertions.assertEquals("wabfatkl", + model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); + Assertions.assertEquals("vimjwos", model.customDetails().get("tx")); + Assertions.assertEquals(EntityMappingType.IP, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("atpxl", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("xcyjmoadsuvarmy", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("vdkcrodtj", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("fw", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("fltkacjv", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("kdlfoa", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.PRODUCT_COMPONENT_NAME, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("agaowpulpqblylsy", + model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, + model.eventGroupingSettings().aggregationKind()); + Assertions.assertEquals("xsdszuempsb", model.sentinelEntitiesMappings().get(0).columnName()); + } + + // Use "Map.of" if available + @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/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..a0495e619582 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class Office365ProjectCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Office365ProjectCheckRequirementsProperties model = BinaryData.fromString("{\"tenantId\":\"njq\"}") + .toObject(Office365ProjectCheckRequirementsProperties.class); + Assertions.assertEquals("njq", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Office365ProjectCheckRequirementsProperties model + = new Office365ProjectCheckRequirementsProperties().withTenantId("njq"); + model = BinaryData.fromObject(model).toObject(Office365ProjectCheckRequirementsProperties.class); + Assertions.assertEquals("njq", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsTests.java new file mode 100644 index 000000000000..3080d4beaa2f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class Office365ProjectCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Office365ProjectCheckRequirements model + = BinaryData.fromString("{\"kind\":\"Office365Project\",\"properties\":{\"tenantId\":\"xyxf\"}}") + .toObject(Office365ProjectCheckRequirements.class); + Assertions.assertEquals("xyxf", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Office365ProjectCheckRequirements model = new Office365ProjectCheckRequirements().withTenantId("xyxf"); + model = BinaryData.fromObject(model).toObject(Office365ProjectCheckRequirements.class); + Assertions.assertEquals("xyxf", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesLogsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesLogsTests.java new file mode 100644 index 000000000000..94f7072c4400 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesLogsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class Office365ProjectConnectorDataTypesLogsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Office365ProjectConnectorDataTypesLogs model + = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(Office365ProjectConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Office365ProjectConnectorDataTypesLogs model + = new Office365ProjectConnectorDataTypesLogs().withState(DataTypeState.ENABLED); + model = BinaryData.fromObject(model).toObject(Office365ProjectConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesTests.java new file mode 100644 index 000000000000..af7fdc3ebdc0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectConnectorDataTypesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class Office365ProjectConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Office365ProjectConnectorDataTypes model = BinaryData.fromString("{\"logs\":{\"state\":\"Disabled\"}}") + .toObject(Office365ProjectConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Office365ProjectConnectorDataTypes model = new Office365ProjectConnectorDataTypes() + .withLogs(new Office365ProjectConnectorDataTypesLogs().withState(DataTypeState.DISABLED)); + model = BinaryData.fromObject(model).toObject(Office365ProjectConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..7557a37b8d47 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorPropertiesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.Office365ProjectDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class Office365ProjectDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Office365ProjectDataConnectorProperties model + = BinaryData.fromString("{\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}},\"tenantId\":\"hq\"}") + .toObject(Office365ProjectDataConnectorProperties.class); + Assertions.assertEquals("hq", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Office365ProjectDataConnectorProperties model = new Office365ProjectDataConnectorProperties().withTenantId("hq") + .withDataTypes(new Office365ProjectConnectorDataTypes() + .withLogs(new Office365ProjectConnectorDataTypesLogs().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(Office365ProjectDataConnectorProperties.class); + Assertions.assertEquals("hq", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorTests.java new file mode 100644 index 000000000000..fca9b3e38492 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/Office365ProjectDataConnectorTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.Office365ProjectDataConnector; +import org.junit.jupiter.api.Assertions; + +public final class Office365ProjectDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Office365ProjectDataConnector model = BinaryData.fromString( + "{\"kind\":\"Office365Project\",\"properties\":{\"dataTypes\":{\"logs\":{\"state\":\"Disabled\"}},\"tenantId\":\"ubfajc\"},\"etag\":\"hjqwmchqoh\",\"id\":\"xcpup\",\"name\":\"kiymjzpwd\",\"type\":\"vwtiwsmosa\"}") + .toObject(Office365ProjectDataConnector.class); + Assertions.assertEquals("hjqwmchqoh", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("ubfajc", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Office365ProjectDataConnector model = new Office365ProjectDataConnector().withEtag("hjqwmchqoh") + .withDataTypes(new Office365ProjectConnectorDataTypes() + .withLogs(new Office365ProjectConnectorDataTypesLogs().withState(DataTypeState.DISABLED))) + .withTenantId("ubfajc"); + model = BinaryData.fromObject(model).toObject(Office365ProjectDataConnector.class); + Assertions.assertEquals("hjqwmchqoh", model.etag()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("ubfajc", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..e43aea13188e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeATPCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class OfficeATPCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeATPCheckRequirementsProperties model = BinaryData.fromString("{\"tenantId\":\"arkhkoqcud\"}") + .toObject(OfficeATPCheckRequirementsProperties.class); + Assertions.assertEquals("arkhkoqcud", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficeATPCheckRequirementsProperties model + = new OfficeATPCheckRequirementsProperties().withTenantId("arkhkoqcud"); + model = BinaryData.fromObject(model).toObject(OfficeATPCheckRequirementsProperties.class); + Assertions.assertEquals("arkhkoqcud", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsTests.java new file mode 100644 index 000000000000..33b3741e10f5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.OfficeATPCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class OfficeATPCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeATPCheckRequirements model + = BinaryData.fromString("{\"kind\":\"OfficeATP\",\"properties\":{\"tenantId\":\"gvjbryb\"}}") + .toObject(OfficeATPCheckRequirements.class); + Assertions.assertEquals("gvjbryb", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficeATPCheckRequirements model = new OfficeATPCheckRequirements().withTenantId("gvjbryb"); + model = BinaryData.fromObject(model).toObject(OfficeATPCheckRequirements.class); + Assertions.assertEquals("gvjbryb", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AatpDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPDataConnectorPropertiesTests.java similarity index 60% rename from sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AatpDataConnectorPropertiesTests.java rename to sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPDataConnectorPropertiesTests.java index 949cf241ab9e..fc18342f5f0e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/AatpDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPDataConnectorPropertiesTests.java @@ -1,33 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.AatpDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeATPDataConnectorProperties; import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; import com.azure.resourcemanager.securityinsights.models.DataTypeState; import org.junit.jupiter.api.Assertions; -public final class AatpDataConnectorPropertiesTests { +public final class OfficeATPDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AatpDataConnectorProperties model = BinaryData - .fromString("{\"tenantId\":\"unqndyfpchrqb\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") - .toObject(AatpDataConnectorProperties.class); - Assertions.assertEquals("unqndyfpchrqb", model.tenantId()); + OfficeATPDataConnectorProperties model + = BinaryData.fromString("{\"tenantId\":\"rdkdkgaw\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") + .toObject(OfficeATPDataConnectorProperties.class); + Assertions.assertEquals("rdkdkgaw", model.tenantId()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AatpDataConnectorProperties model = new AatpDataConnectorProperties().withTenantId("unqndyfpchrqb") + OfficeATPDataConnectorProperties model = new OfficeATPDataConnectorProperties().withTenantId("rdkdkgaw") .withDataTypes(new AlertsDataTypeOfDataConnector() .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); - model = BinaryData.fromObject(model).toObject(AatpDataConnectorProperties.class); - Assertions.assertEquals("unqndyfpchrqb", model.tenantId()); + model = BinaryData.fromObject(model).toObject(OfficeATPDataConnectorProperties.class); + Assertions.assertEquals("rdkdkgaw", model.tenantId()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPDataConnectorTests.java new file mode 100644 index 000000000000..094455d75871 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeATPDataConnectorTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.OfficeATPDataConnector; +import org.junit.jupiter.api.Assertions; + +public final class OfficeATPDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeATPDataConnector model = BinaryData.fromString( + "{\"kind\":\"OfficeATP\",\"properties\":{\"tenantId\":\"fjvmy\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"becuvlbefvwcl\",\"id\":\"xpyl\",\"name\":\"woxzgwpsyxji\",\"type\":\"eypdvrbk\"}") + .toObject(OfficeATPDataConnector.class); + Assertions.assertEquals("becuvlbefvwcl", model.etag()); + Assertions.assertEquals("fjvmy", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficeATPDataConnector model = new OfficeATPDataConnector().withEtag("becuvlbefvwcl") + .withTenantId("fjvmy") + .withDataTypes(new AlertsDataTypeOfDataConnector() + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(OfficeATPDataConnector.class); + Assertions.assertEquals("becuvlbefvwcl", model.etag()); + Assertions.assertEquals("fjvmy", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentInnerTests.java new file mode 100644 index 000000000000..adbb348ecb8d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentInner; +import org.junit.jupiter.api.Assertions; + +public final class OfficeConsentInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeConsentInner model = BinaryData.fromString( + "{\"properties\":{\"tenantId\":\"jvpmxnht\",\"consentId\":\"stqlfxolrwv\"},\"id\":\"gxyfjsweq\",\"name\":\"flzyyopoaytwwgwq\",\"type\":\"b\"}") + .toObject(OfficeConsentInner.class); + Assertions.assertEquals("jvpmxnht", model.tenantId()); + Assertions.assertEquals("stqlfxolrwv", model.consentId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentListTests.java new file mode 100644 index 000000000000..f438e7f5b59a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.OfficeConsentList; +import org.junit.jupiter.api.Assertions; + +public final class OfficeConsentListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeConsentList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"tenantId\":\"eeedddrftfquulp\",\"consentId\":\"hsiige\"},\"id\":\"wbrnqyxfedqnetdq\",\"name\":\"yn\",\"type\":\"oqgvbzpggp\"},{\"properties\":{\"tenantId\":\"y\",\"consentId\":\"qajejirvavrvkgp\"},\"id\":\"plbjuvlnhxnr\",\"name\":\"jhinaegesbx\",\"type\":\"epqmjmoplukfykk\"},{\"properties\":{\"tenantId\":\"ovadkrmjx\",\"consentId\":\"qpdkesjqbzkqmx\"},\"id\":\"o\",\"name\":\"iw\",\"type\":\"wggijtspzjnrrhik\"},{\"properties\":{\"tenantId\":\"zrhdugquht\",\"consentId\":\"zfrunjfhrjhiycba\"},\"id\":\"eqnczkvihvtuwy\",\"name\":\"sqwzszoszjgzu\",\"type\":\"kfnyskwwunqhc\"}],\"nextLink\":\"voj\"}") + .toObject(OfficeConsentList.class); + Assertions.assertEquals("eeedddrftfquulp", model.value().get(0).tenantId()); + Assertions.assertEquals("hsiige", model.value().get(0).consentId()); + Assertions.assertEquals("voj", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentPropertiesTests.java new file mode 100644 index 000000000000..548053a27f66 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentPropertiesTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeConsentProperties; +import org.junit.jupiter.api.Assertions; + +public final class OfficeConsentPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeConsentProperties model + = BinaryData.fromString("{\"tenantId\":\"bvufrkwjiemimdtn\",\"consentId\":\"wew\"}") + .toObject(OfficeConsentProperties.class); + Assertions.assertEquals("bvufrkwjiemimdtn", model.tenantId()); + Assertions.assertEquals("wew", model.consentId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..032d498385bc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsDeleteWithResponseMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OfficeConsentsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.officeConsents().deleteWithResponse("ljthm", "bqgldhttk", "lpqln", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetWithResponseMockTests.java new file mode 100644 index 000000000000..7635d70812d2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.OfficeConsent; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OfficeConsentsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"tenantId\":\"tr\",\"consentId\":\"vxqbxgqkawnri\"},\"id\":\"eki\",\"name\":\"vwqldil\",\"type\":\"xsvzwbktalobxl\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OfficeConsent response = manager.officeConsents() + .getWithResponse("oc", "aetctjhpgm", "azsjsuevf", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("tr", response.tenantId()); + Assertions.assertEquals("vxqbxgqkawnri", response.consentId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListMockTests.java new file mode 100644 index 000000000000..70823aa976f9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeConsentsListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.OfficeConsent; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OfficeConsentsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"tenantId\":\"owdqvqfldaqoao\",\"consentId\":\"qpfwnjdyoxformfe\"},\"id\":\"fq\",\"name\":\"neszx\",\"type\":\"esnhxphx\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.officeConsents().list("yevjealxlewlwb", "ufqfdkkvijilfqv", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("owdqvqfldaqoao", response.iterator().next().tenantId()); + Assertions.assertEquals("qpfwnjdyoxformfe", response.iterator().next().consentId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesExchangeTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesExchangeTests.java index eb813ee10797..a35382d39b19 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesExchangeTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesExchangeTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesSharePointTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesSharePointTests.java index deb9127be6b2..09aa0d92e999 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesSharePointTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesSharePointTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,15 +13,15 @@ public final class OfficeDataConnectorDataTypesSharePointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OfficeDataConnectorDataTypesSharePoint model - = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(OfficeDataConnectorDataTypesSharePoint.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + = BinaryData.fromString("{\"state\":\"Disabled\"}").toObject(OfficeDataConnectorDataTypesSharePoint.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { OfficeDataConnectorDataTypesSharePoint model - = new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED); + = new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.DISABLED); model = BinaryData.fromObject(model).toObject(OfficeDataConnectorDataTypesSharePoint.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTeamsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTeamsTests.java index fd205a62a1d4..92951d91e864 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTeamsTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTeamsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,15 +13,15 @@ public final class OfficeDataConnectorDataTypesTeamsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OfficeDataConnectorDataTypesTeams model - = BinaryData.fromString("{\"state\":\"Disabled\"}").toObject(OfficeDataConnectorDataTypesTeams.class); - Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + = BinaryData.fromString("{\"state\":\"Enabled\"}").toObject(OfficeDataConnectorDataTypesTeams.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { OfficeDataConnectorDataTypesTeams model - = new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.DISABLED); + = new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED); model = BinaryData.fromObject(model).toObject(OfficeDataConnectorDataTypesTeams.class); - Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTests.java index 65a77237bdac..f74a40333429 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorDataTypesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -16,11 +16,11 @@ public final class OfficeDataConnectorDataTypesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OfficeDataConnectorDataTypes model = BinaryData.fromString( - "{\"exchange\":{\"state\":\"Disabled\"},\"sharePoint\":{\"state\":\"Disabled\"},\"teams\":{\"state\":\"Disabled\"}}") + "{\"exchange\":{\"state\":\"Disabled\"},\"sharePoint\":{\"state\":\"Disabled\"},\"teams\":{\"state\":\"Enabled\"}}") .toObject(OfficeDataConnectorDataTypes.class); Assertions.assertEquals(DataTypeState.DISABLED, model.exchange().state()); Assertions.assertEquals(DataTypeState.DISABLED, model.sharePoint().state()); - Assertions.assertEquals(DataTypeState.DISABLED, model.teams().state()); + Assertions.assertEquals(DataTypeState.ENABLED, model.teams().state()); } @org.junit.jupiter.api.Test @@ -28,10 +28,10 @@ public void testSerialize() throws Exception { OfficeDataConnectorDataTypes model = new OfficeDataConnectorDataTypes() .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.DISABLED)) .withSharePoint(new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.DISABLED)) - .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.DISABLED)); + .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED)); model = BinaryData.fromObject(model).toObject(OfficeDataConnectorDataTypes.class); Assertions.assertEquals(DataTypeState.DISABLED, model.exchange().state()); Assertions.assertEquals(DataTypeState.DISABLED, model.sharePoint().state()); - Assertions.assertEquals(DataTypeState.DISABLED, model.teams().state()); + Assertions.assertEquals(DataTypeState.ENABLED, model.teams().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorPropertiesTests.java index 31105e91509f..0e4a27b225f4 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -17,25 +17,25 @@ public final class OfficeDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OfficeDataConnectorProperties model = BinaryData.fromString( - "{\"tenantId\":\"sufco\",\"dataTypes\":{\"exchange\":{\"state\":\"Disabled\"},\"sharePoint\":{\"state\":\"Disabled\"},\"teams\":{\"state\":\"Enabled\"}}}") + "{\"dataTypes\":{\"exchange\":{\"state\":\"Disabled\"},\"sharePoint\":{\"state\":\"Enabled\"},\"teams\":{\"state\":\"Disabled\"}},\"tenantId\":\"ymgobll\"}") .toObject(OfficeDataConnectorProperties.class); - Assertions.assertEquals("sufco", model.tenantId()); + Assertions.assertEquals("ymgobll", model.tenantId()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().exchange().state()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().sharePoint().state()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().teams().state()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().sharePoint().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().teams().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OfficeDataConnectorProperties model = new OfficeDataConnectorProperties().withTenantId("sufco") + OfficeDataConnectorProperties model = new OfficeDataConnectorProperties().withTenantId("ymgobll") .withDataTypes(new OfficeDataConnectorDataTypes() .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.DISABLED)) - .withSharePoint(new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.DISABLED)) - .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.ENABLED))); + .withSharePoint(new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) + .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.DISABLED))); model = BinaryData.fromObject(model).toObject(OfficeDataConnectorProperties.class); - Assertions.assertEquals("sufco", model.tenantId()); + Assertions.assertEquals("ymgobll", model.tenantId()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().exchange().state()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().sharePoint().state()); - Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().teams().state()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().sharePoint().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().teams().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorTests.java index d29a13610487..fa07e58f7355 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -17,28 +17,28 @@ public final class OfficeDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OfficeDataConnector model = BinaryData.fromString( - "{\"kind\":\"Office365\",\"properties\":{\"tenantId\":\"mdtzfjltfvnzc\",\"dataTypes\":{\"exchange\":{\"state\":\"Disabled\"},\"sharePoint\":{\"state\":\"Enabled\"},\"teams\":{\"state\":\"Disabled\"}}},\"etag\":\"dbzqgqqihed\",\"id\":\"qwthmky\",\"name\":\"bcysih\",\"type\":\"gqcwdhohsdtmc\"}") + "{\"kind\":\"Office365\",\"properties\":{\"dataTypes\":{\"exchange\":{\"state\":\"Disabled\"},\"sharePoint\":{\"state\":\"Enabled\"},\"teams\":{\"state\":\"Disabled\"}},\"tenantId\":\"xokwtjawhvagnqfq\"},\"etag\":\"lcvmyolcaymjch\",\"id\":\"snvlaqd\",\"name\":\"z\",\"type\":\"zawatuwqkokbc\"}") .toObject(OfficeDataConnector.class); - Assertions.assertEquals("dbzqgqqihed", model.etag()); - Assertions.assertEquals("mdtzfjltfvnzc", model.tenantId()); + Assertions.assertEquals("lcvmyolcaymjch", model.etag()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().exchange().state()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().sharePoint().state()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().teams().state()); + Assertions.assertEquals("xokwtjawhvagnqfq", model.tenantId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OfficeDataConnector model = new OfficeDataConnector().withEtag("dbzqgqqihed") - .withTenantId("mdtzfjltfvnzc") + OfficeDataConnector model = new OfficeDataConnector().withEtag("lcvmyolcaymjch") .withDataTypes(new OfficeDataConnectorDataTypes() .withExchange(new OfficeDataConnectorDataTypesExchange().withState(DataTypeState.DISABLED)) .withSharePoint(new OfficeDataConnectorDataTypesSharePoint().withState(DataTypeState.ENABLED)) - .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.DISABLED))); + .withTeams(new OfficeDataConnectorDataTypesTeams().withState(DataTypeState.DISABLED))) + .withTenantId("xokwtjawhvagnqfq"); model = BinaryData.fromObject(model).toObject(OfficeDataConnector.class); - Assertions.assertEquals("dbzqgqqihed", model.etag()); - Assertions.assertEquals("mdtzfjltfvnzc", model.tenantId()); + Assertions.assertEquals("lcvmyolcaymjch", model.etag()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().exchange().state()); Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().sharePoint().state()); Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().teams().state()); + Assertions.assertEquals("xokwtjawhvagnqfq", model.tenantId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..ee57c184827e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIRMCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class OfficeIRMCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeIRMCheckRequirementsProperties model = BinaryData.fromString("{\"tenantId\":\"yhdpjjhqnzcbjfpx\"}") + .toObject(OfficeIRMCheckRequirementsProperties.class); + Assertions.assertEquals("yhdpjjhqnzcbjfpx", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficeIRMCheckRequirementsProperties model + = new OfficeIRMCheckRequirementsProperties().withTenantId("yhdpjjhqnzcbjfpx"); + model = BinaryData.fromObject(model).toObject(OfficeIRMCheckRequirementsProperties.class); + Assertions.assertEquals("yhdpjjhqnzcbjfpx", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsTests.java new file mode 100644 index 000000000000..6d4fbdbd1c37 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.OfficeIRMCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class OfficeIRMCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeIRMCheckRequirements model + = BinaryData.fromString("{\"kind\":\"OfficeIRM\",\"properties\":{\"tenantId\":\"m\"}}") + .toObject(OfficeIRMCheckRequirements.class); + Assertions.assertEquals("m", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficeIRMCheckRequirements model = new OfficeIRMCheckRequirements().withTenantId("m"); + model = BinaryData.fromObject(model).toObject(OfficeIRMCheckRequirements.class); + Assertions.assertEquals("m", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..8e433c519920 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorPropertiesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficeIRMDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import org.junit.jupiter.api.Assertions; + +public final class OfficeIRMDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeIRMDataConnectorProperties model = BinaryData + .fromString("{\"tenantId\":\"kwdrnzkjthfc\",\"dataTypes\":{\"alerts\":{\"state\":\"Disabled\"}}}") + .toObject(OfficeIRMDataConnectorProperties.class); + Assertions.assertEquals("kwdrnzkjthfc", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficeIRMDataConnectorProperties model = new OfficeIRMDataConnectorProperties().withTenantId("kwdrnzkjthfc") + .withDataTypes(new AlertsDataTypeOfDataConnector() + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.DISABLED))); + model = BinaryData.fromObject(model).toObject(OfficeIRMDataConnectorProperties.class); + Assertions.assertEquals("kwdrnzkjthfc", model.tenantId()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().alerts().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorTests.java new file mode 100644 index 000000000000..ffc99e3f0b18 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficeIRMDataConnectorTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertsDataTypeOfDataConnector; +import com.azure.resourcemanager.securityinsights.models.DataConnectorDataTypeCommon; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.OfficeIRMDataConnector; +import org.junit.jupiter.api.Assertions; + +public final class OfficeIRMDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficeIRMDataConnector model = BinaryData.fromString( + "{\"kind\":\"OfficeIRM\",\"properties\":{\"tenantId\":\"alahf\",\"dataTypes\":{\"alerts\":{\"state\":\"Enabled\"}}},\"etag\":\"okdxkukmkcz\",\"id\":\"uhhoqeqshavlj\",\"name\":\"k\",\"type\":\"yrqolnthbbnkgz\"}") + .toObject(OfficeIRMDataConnector.class); + Assertions.assertEquals("okdxkukmkcz", model.etag()); + Assertions.assertEquals("alahf", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficeIRMDataConnector model = new OfficeIRMDataConnector().withEtag("okdxkukmkcz") + .withTenantId("alahf") + .withDataTypes(new AlertsDataTypeOfDataConnector() + .withAlerts(new DataConnectorDataTypeCommon().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(OfficeIRMDataConnector.class); + Assertions.assertEquals("okdxkukmkcz", model.etag()); + Assertions.assertEquals("alahf", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().alerts().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..386e6d14e14f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBICheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class OfficePowerBICheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficePowerBICheckRequirementsProperties model = BinaryData.fromString("{\"tenantId\":\"vklkwqisnlpa\"}") + .toObject(OfficePowerBICheckRequirementsProperties.class); + Assertions.assertEquals("vklkwqisnlpa", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficePowerBICheckRequirementsProperties model + = new OfficePowerBICheckRequirementsProperties().withTenantId("vklkwqisnlpa"); + model = BinaryData.fromObject(model).toObject(OfficePowerBICheckRequirementsProperties.class); + Assertions.assertEquals("vklkwqisnlpa", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsTests.java new file mode 100644 index 000000000000..de6116638e05 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBICheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBICheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class OfficePowerBICheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficePowerBICheckRequirements model + = BinaryData.fromString("{\"kind\":\"OfficePowerBI\",\"properties\":{\"tenantId\":\"tnwvravn\"}}") + .toObject(OfficePowerBICheckRequirements.class); + Assertions.assertEquals("tnwvravn", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficePowerBICheckRequirements model = new OfficePowerBICheckRequirements().withTenantId("tnwvravn"); + model = BinaryData.fromObject(model).toObject(OfficePowerBICheckRequirements.class); + Assertions.assertEquals("tnwvravn", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesLogsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesLogsTests.java new file mode 100644 index 000000000000..92ca86eee431 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesLogsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class OfficePowerBIConnectorDataTypesLogsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficePowerBIConnectorDataTypesLogs model + = BinaryData.fromString("{\"state\":\"Disabled\"}").toObject(OfficePowerBIConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficePowerBIConnectorDataTypesLogs model + = new OfficePowerBIConnectorDataTypesLogs().withState(DataTypeState.DISABLED); + model = BinaryData.fromObject(model).toObject(OfficePowerBIConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesTests.java new file mode 100644 index 000000000000..1cd93ceeb174 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIConnectorDataTypesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class OfficePowerBIConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficePowerBIConnectorDataTypes model = BinaryData.fromString("{\"logs\":{\"state\":\"Enabled\"}}") + .toObject(OfficePowerBIConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficePowerBIConnectorDataTypes model = new OfficePowerBIConnectorDataTypes() + .withLogs(new OfficePowerBIConnectorDataTypesLogs().withState(DataTypeState.ENABLED)); + model = BinaryData.fromObject(model).toObject(OfficePowerBIConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..7aa18c921214 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.OfficePowerBIDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class OfficePowerBIDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficePowerBIDataConnectorProperties model + = BinaryData.fromString("{\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}},\"tenantId\":\"lvgecpwgoljtz\"}") + .toObject(OfficePowerBIDataConnectorProperties.class); + Assertions.assertEquals("lvgecpwgoljtz", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficePowerBIDataConnectorProperties model + = new OfficePowerBIDataConnectorProperties().withTenantId("lvgecpwgoljtz") + .withDataTypes(new OfficePowerBIConnectorDataTypes() + .withLogs(new OfficePowerBIConnectorDataTypesLogs().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(OfficePowerBIDataConnectorProperties.class); + Assertions.assertEquals("lvgecpwgoljtz", model.tenantId()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorTests.java new file mode 100644 index 000000000000..449602ef8d4e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OfficePowerBIDataConnectorTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.OfficePowerBIDataConnector; +import org.junit.jupiter.api.Assertions; + +public final class OfficePowerBIDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OfficePowerBIDataConnector model = BinaryData.fromString( + "{\"kind\":\"OfficePowerBI\",\"properties\":{\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}},\"tenantId\":\"ultassae\"},\"etag\":\"wnaze\",\"id\":\"bkajlcyizy\",\"name\":\"dcvxodkrvfsxxby\",\"type\":\"e\"}") + .toObject(OfficePowerBIDataConnector.class); + Assertions.assertEquals("wnaze", model.etag()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("ultassae", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OfficePowerBIDataConnector model = new OfficePowerBIDataConnector().withEtag("wnaze") + .withDataTypes(new OfficePowerBIConnectorDataTypes() + .withLogs(new OfficePowerBIConnectorDataTypesLogs().withState(DataTypeState.ENABLED))) + .withTenantId("ultassae"); + model = BinaryData.fromObject(model).toObject(OfficePowerBIDataConnector.class); + Assertions.assertEquals("wnaze", model.etag()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("ultassae", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationDisplayTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationDisplayTests.java index 6bcfa53f8d29..158da80ba829 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationDisplayTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,24 +12,11 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"description\":\"ltfnhtbaxkgx\",\"operation\":\"rc\",\"provider\":\"yklyhpluodpvruud\",\"resource\":\"zibt\"}") + "{\"description\":\"efovgmk\",\"operation\":\"leyyvx\",\"provider\":\"jpkcattpng\",\"resource\":\"rcczsqpjhvmd\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("ltfnhtbaxkgx", model.description()); - Assertions.assertEquals("rc", model.operation()); - Assertions.assertEquals("yklyhpluodpvruud", model.provider()); - Assertions.assertEquals("zibt", model.resource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withDescription("ltfnhtbaxkgx") - .withOperation("rc") - .withProvider("yklyhpluodpvruud") - .withResource("zibt"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("ltfnhtbaxkgx", model.description()); - Assertions.assertEquals("rc", model.operation()); - Assertions.assertEquals("yklyhpluodpvruud", model.provider()); - Assertions.assertEquals("zibt", model.resource()); + Assertions.assertEquals("efovgmk", model.description()); + Assertions.assertEquals("leyyvx", model.operation()); + Assertions.assertEquals("jpkcattpng", model.provider()); + Assertions.assertEquals("rcczsqpjhvmd", model.resource()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationInnerTests.java index 5cfeb601aeb5..dfe0128af9d0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationInnerTests.java @@ -1,42 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; -import com.azure.resourcemanager.securityinsights.models.OperationDisplay; import org.junit.jupiter.api.Assertions; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"display\":{\"description\":\"nssxmojmsvpk\",\"operation\":\"rvkwc\",\"provider\":\"ql\",\"resource\":\"x\"},\"name\":\"czheyd\",\"origin\":\"dshmkxmaehvbbx\",\"isDataAction\":false}") + "{\"display\":{\"description\":\"b\",\"operation\":\"ofqweykhmenevfye\",\"provider\":\"whybcib\",\"resource\":\"vdcsitynn\"},\"name\":\"mdectehfiqscjey\",\"origin\":\"hezrkgq\",\"isDataAction\":true}") .toObject(OperationInner.class); - Assertions.assertEquals("nssxmojmsvpk", model.display().description()); - Assertions.assertEquals("rvkwc", model.display().operation()); - Assertions.assertEquals("ql", model.display().provider()); - Assertions.assertEquals("x", model.display().resource()); - Assertions.assertEquals("czheyd", model.name()); - Assertions.assertEquals("dshmkxmaehvbbx", model.origin()); - Assertions.assertEquals(false, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay().withDescription("nssxmojmsvpk") - .withOperation("rvkwc") - .withProvider("ql") - .withResource("x")).withName("czheyd").withOrigin("dshmkxmaehvbbx").withIsDataAction(false); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("nssxmojmsvpk", model.display().description()); - Assertions.assertEquals("rvkwc", model.display().operation()); - Assertions.assertEquals("ql", model.display().provider()); - Assertions.assertEquals("x", model.display().resource()); - Assertions.assertEquals("czheyd", model.name()); - Assertions.assertEquals("dshmkxmaehvbbx", model.origin()); - Assertions.assertEquals(false, model.isDataAction()); + Assertions.assertEquals("b", model.display().description()); + Assertions.assertEquals("ofqweykhmenevfye", model.display().operation()); + Assertions.assertEquals("whybcib", model.display().provider()); + Assertions.assertEquals("vdcsitynn", model.display().resource()); + Assertions.assertEquals("mdectehfiqscjey", model.name()); + Assertions.assertEquals("hezrkgq", model.origin()); + Assertions.assertTrue(model.isDataAction()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListMockTests.java index de2d8d90d1e1..0a68abd318f8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.Operation; @@ -22,23 +22,23 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"display\":{\"description\":\"xzajlnsjhwjuyxxb\",\"operation\":\"vmv\",\"provider\":\"ytuadxkxeqbwp\",\"resource\":\"ghyksarcdrnxs\"},\"name\":\"vlzladl\",\"origin\":\"kpbqhvfdqqjw\",\"isDataAction\":true}]}"; + = "{\"value\":[{\"display\":{\"description\":\"vvekpqi\",\"operation\":\"vm\",\"provider\":\"yafcvtosovxmio\",\"resource\":\"e\"},\"name\":\"xqrzsngltlbs\",\"origin\":\"fpl\",\"isDataAction\":false}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("xzajlnsjhwjuyxxb", response.iterator().next().display().description()); - Assertions.assertEquals("vmv", response.iterator().next().display().operation()); - Assertions.assertEquals("ytuadxkxeqbwp", response.iterator().next().display().provider()); - Assertions.assertEquals("ghyksarcdrnxs", response.iterator().next().display().resource()); - Assertions.assertEquals("vlzladl", response.iterator().next().name()); - Assertions.assertEquals("kpbqhvfdqqjw", response.iterator().next().origin()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); + Assertions.assertEquals("vvekpqi", response.iterator().next().display().description()); + Assertions.assertEquals("vm", response.iterator().next().display().operation()); + Assertions.assertEquals("yafcvtosovxmio", response.iterator().next().display().provider()); + Assertions.assertEquals("e", response.iterator().next().display().resource()); + Assertions.assertEquals("xqrzsngltlbs", response.iterator().next().name()); + Assertions.assertEquals("fpl", response.iterator().next().origin()); + Assertions.assertFalse(response.iterator().next().isDataAction()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListTests.java index 13a54a85bae1..66f3b9288ad0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OperationsListTests.java @@ -1,64 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.OperationInner; -import com.azure.resourcemanager.securityinsights.models.OperationDisplay; -import com.azure.resourcemanager.securityinsights.models.OperationsList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.OperationsList; import org.junit.jupiter.api.Assertions; public final class OperationsListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationsList model = BinaryData.fromString( - "{\"nextLink\":\"txifqj\",\"value\":[{\"display\":{\"description\":\"rhublwpcesutrg\",\"operation\":\"pauutpw\",\"provider\":\"hihejqgwzpnfqn\",\"resource\":\"ypsxjvfoim\"},\"name\":\"slirciz\",\"origin\":\"vydfceacvlhvygdy\",\"isDataAction\":true},{\"display\":{\"description\":\"twnawjslbiwkojgc\",\"operation\":\"tsf\",\"provider\":\"nbaeqphchqn\",\"resource\":\"rpxeh\"},\"name\":\"rykqgaifmvikl\",\"origin\":\"dvk\",\"isDataAction\":false},{\"display\":{\"description\":\"znxcvds\",\"operation\":\"njivolvtnovq\",\"provider\":\"gemjdftuljltdu\",\"resource\":\"amtmcz\"},\"name\":\"m\",\"origin\":\"wcw\",\"isDataAction\":true}]}") + "{\"nextLink\":\"suesnzw\",\"value\":[{\"display\":{\"description\":\"avo\",\"operation\":\"zdmohctbqvu\",\"provider\":\"xdn\",\"resource\":\"vo\"},\"name\":\"ujjugwdkcglh\",\"origin\":\"azjdyggd\",\"isDataAction\":true}]}") .toObject(OperationsList.class); - Assertions.assertEquals("rhublwpcesutrg", model.value().get(0).display().description()); - Assertions.assertEquals("pauutpw", model.value().get(0).display().operation()); - Assertions.assertEquals("hihejqgwzpnfqn", model.value().get(0).display().provider()); - Assertions.assertEquals("ypsxjvfoim", model.value().get(0).display().resource()); - Assertions.assertEquals("slirciz", model.value().get(0).name()); - Assertions.assertEquals("vydfceacvlhvygdy", model.value().get(0).origin()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsList model - = new OperationsList() - .withValue( - Arrays.asList( - new OperationInner() - .withDisplay(new OperationDisplay().withDescription("rhublwpcesutrg") - .withOperation("pauutpw") - .withProvider("hihejqgwzpnfqn") - .withResource("ypsxjvfoim")) - .withName("slirciz") - .withOrigin("vydfceacvlhvygdy") - .withIsDataAction(true), - new OperationInner() - .withDisplay(new OperationDisplay().withDescription("twnawjslbiwkojgc") - .withOperation("tsf") - .withProvider("nbaeqphchqn") - .withResource("rpxeh")) - .withName("rykqgaifmvikl") - .withOrigin("dvk") - .withIsDataAction(false), - new OperationInner().withDisplay(new OperationDisplay().withDescription("znxcvds") - .withOperation("njivolvtnovq") - .withProvider("gemjdftuljltdu") - .withResource("amtmcz")).withName("m").withOrigin("wcw").withIsDataAction(true))); - model = BinaryData.fromObject(model).toObject(OperationsList.class); - Assertions.assertEquals("rhublwpcesutrg", model.value().get(0).display().description()); - Assertions.assertEquals("pauutpw", model.value().get(0).display().operation()); - Assertions.assertEquals("hihejqgwzpnfqn", model.value().get(0).display().provider()); - Assertions.assertEquals("ypsxjvfoim", model.value().get(0).display().resource()); - Assertions.assertEquals("slirciz", model.value().get(0).name()); - Assertions.assertEquals("vydfceacvlhvygdy", model.value().get(0).origin()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); + Assertions.assertEquals("avo", model.value().get(0).display().description()); + Assertions.assertEquals("zdmohctbqvu", model.value().get(0).display().operation()); + Assertions.assertEquals("xdn", model.value().get(0).display().provider()); + Assertions.assertEquals("vo", model.value().get(0).display().resource()); + Assertions.assertEquals("ujjugwdkcglh", model.value().get(0).name()); + Assertions.assertEquals("azjdyggd", model.value().get(0).origin()); + Assertions.assertTrue(model.value().get(0).isDataAction()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OracleAuthModelTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OracleAuthModelTests.java new file mode 100644 index 000000000000..dfd2758198dc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/OracleAuthModelTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.OracleAuthModel; +import org.junit.jupiter.api.Assertions; + +public final class OracleAuthModelTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OracleAuthModel model = BinaryData.fromString( + "{\"type\":\"Oracle\",\"tenantId\":\"lfb\",\"userId\":\"rdcgu\",\"publicFingerprint\":\"srtmdylperpiltt\",\"pemFile\":\"zgczfcmfpfbode\"}") + .toObject(OracleAuthModel.class); + Assertions.assertEquals("lfb", model.tenantId()); + Assertions.assertEquals("rdcgu", model.userId()); + Assertions.assertEquals("srtmdylperpiltt", model.publicFingerprint()); + Assertions.assertEquals("zgczfcmfpfbode", model.pemFile()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OracleAuthModel model = new OracleAuthModel().withTenantId("lfb") + .withUserId("rdcgu") + .withPublicFingerprint("srtmdylperpiltt") + .withPemFile("zgczfcmfpfbode"); + model = BinaryData.fromObject(model).toObject(OracleAuthModel.class); + Assertions.assertEquals("lfb", model.tenantId()); + Assertions.assertEquals("rdcgu", model.userId()); + Assertions.assertEquals("srtmdylperpiltt", model.publicFingerprint()); + Assertions.assertEquals("zgczfcmfpfbode", model.pemFile()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageBasePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageBasePropertiesTests.java new file mode 100644 index 000000000000..8f16030601cb --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageBasePropertiesTests.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageBaseProperties; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PackageBasePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PackageBaseProperties model = BinaryData.fromString( + "{\"contentId\":\"ef\",\"contentProductId\":\"heywvfopkyllrey\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"w\",\"isNew\":\"false\",\"isPreview\":\"true\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"evcneqsw\",\"displayName\":\"qhgkhtbzvulqev\",\"description\":\"ncpmyh\",\"publisherDisplayName\":\"gdmvghcmixmlwkf\",\"source\":{\"kind\":\"Solution\",\"name\":\"yjrtalqeebu\",\"sourceId\":\"yimooaezkto\"},\"author\":{\"name\":\"oi\",\"email\":\"qwbywaazbaeee\",\"link\":\"ztvn\"},\"support\":{\"tier\":\"Partner\",\"name\":\"btownoljdkx\",\"email\":\"ewy\",\"link\":\"lclzxkrdpuy\"},\"dependencies\":{\"contentId\":\"pkrpkhqetpoe\",\"kind\":\"DataConnector\",\"version\":\"oaf\",\"name\":\"nrxiyrxow\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"uajwblxph\",\"kind\":\"HuntingQuery\",\"version\":\"rf\",\"name\":\"tnnsvrfajy\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"ufgzq\",\"kind\":\"ResourcesDataConnector\",\"version\":\"ctblfehb\",\"name\":\"gy\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"qljxdumhycxone\",\"kind\":\"Solution\",\"version\":\"a\",\"name\":\"d\",\"operator\":\"AND\",\"criteria\":[{}]}]}]},\"providers\":[\"wxjsjquv\"],\"categories\":{\"domains\":[\"tsrpjuvgzacr\"],\"verticals\":[\"sbylgmgbh\",\"qczouanbfulvcxgl\",\"oqwb\"]},\"threatAnalysisTactics\":[\"lqbzbwb\",\"wzhbhflj\",\"yodpiovnlhrwy\",\"kzu\"],\"threatAnalysisTechniques\":[\"pwxsvdeatjiobni\"],\"icon\":\"oextqdnwtgntimz\"}") + .toObject(PackageBaseProperties.class); + Assertions.assertEquals("ef", model.contentId()); + Assertions.assertEquals("heywvfopkyllrey", model.contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.contentKind()); + Assertions.assertEquals("w", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.isNew()); + Assertions.assertEquals(Flag.TRUE, model.isPreview()); + Assertions.assertEquals(Flag.TRUE, model.isFeatured()); + Assertions.assertEquals(Flag.TRUE, model.isDeprecated()); + Assertions.assertEquals("evcneqsw", model.version()); + Assertions.assertEquals("qhgkhtbzvulqev", model.displayName()); + Assertions.assertEquals("ncpmyh", model.description()); + Assertions.assertEquals("gdmvghcmixmlwkf", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOLUTION, model.source().kind()); + Assertions.assertEquals("yjrtalqeebu", model.source().name()); + Assertions.assertEquals("yimooaezkto", model.source().sourceId()); + Assertions.assertEquals("oi", model.author().name()); + Assertions.assertEquals("qwbywaazbaeee", model.author().email()); + Assertions.assertEquals("ztvn", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("btownoljdkx", model.support().name()); + Assertions.assertEquals("ewy", model.support().email()); + Assertions.assertEquals("lclzxkrdpuy", model.support().link()); + Assertions.assertEquals("pkrpkhqetpoe", model.dependencies().contentId()); + Assertions.assertEquals(Kind.DATA_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("oaf", model.dependencies().version()); + Assertions.assertEquals("nrxiyrxow", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("uajwblxph", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.HUNTING_QUERY, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("rf", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("tnnsvrfajy", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("ufgzq", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, + model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("ctblfehb", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("gy", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("wxjsjquv", model.providers().get(0)); + Assertions.assertEquals("tsrpjuvgzacr", model.categories().domains().get(0)); + Assertions.assertEquals("sbylgmgbh", model.categories().verticals().get(0)); + Assertions.assertEquals("lqbzbwb", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("pwxsvdeatjiobni", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("oextqdnwtgntimz", model.icon()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PackageBaseProperties model = new PackageBaseProperties().withContentId("ef") + .withContentProductId("heywvfopkyllrey") + .withContentKind(PackageKind.STANDALONE) + .withContentSchemaVersion("w") + .withIsNew(Flag.FALSE) + .withIsPreview(Flag.TRUE) + .withIsFeatured(Flag.TRUE) + .withIsDeprecated(Flag.TRUE) + .withVersion("evcneqsw") + .withDisplayName("qhgkhtbzvulqev") + .withDescription("ncpmyh") + .withPublisherDisplayName("gdmvghcmixmlwkf") + .withSource( + new MetadataSource().withKind(SourceKind.SOLUTION).withName("yjrtalqeebu").withSourceId("yimooaezkto")) + .withAuthor(new MetadataAuthor().withName("oi").withEmail("qwbywaazbaeee").withLink("ztvn")) + .withSupport(new MetadataSupport().withTier(SupportTier.PARTNER) + .withName("btownoljdkx") + .withEmail("ewy") + .withLink("lclzxkrdpuy")) + .withDependencies(new MetadataDependencies().withContentId("pkrpkhqetpoe") + .withKind(Kind.DATA_CONNECTOR) + .withVersion("oaf") + .withName("nrxiyrxow") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("uajwblxph") + .withKind(Kind.HUNTING_QUERY) + .withVersion("rf") + .withName("tnnsvrfajy") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("ufgzq") + .withKind(Kind.RESOURCES_DATA_CONNECTOR) + .withVersion("ctblfehb") + .withName("gy") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("qljxdumhycxone") + .withKind(Kind.SOLUTION) + .withVersion("a") + .withName("d") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies()))))))) + .withProviders(Arrays.asList("wxjsjquv")) + .withCategories(new MetadataCategories().withDomains(Arrays.asList("tsrpjuvgzacr")) + .withVerticals(Arrays.asList("sbylgmgbh", "qczouanbfulvcxgl", "oqwb"))) + .withThreatAnalysisTactics(Arrays.asList("lqbzbwb", "wzhbhflj", "yodpiovnlhrwy", "kzu")) + .withThreatAnalysisTechniques(Arrays.asList("pwxsvdeatjiobni")) + .withIcon("oextqdnwtgntimz"); + model = BinaryData.fromObject(model).toObject(PackageBaseProperties.class); + Assertions.assertEquals("ef", model.contentId()); + Assertions.assertEquals("heywvfopkyllrey", model.contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.contentKind()); + Assertions.assertEquals("w", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.isNew()); + Assertions.assertEquals(Flag.TRUE, model.isPreview()); + Assertions.assertEquals(Flag.TRUE, model.isFeatured()); + Assertions.assertEquals(Flag.TRUE, model.isDeprecated()); + Assertions.assertEquals("evcneqsw", model.version()); + Assertions.assertEquals("qhgkhtbzvulqev", model.displayName()); + Assertions.assertEquals("ncpmyh", model.description()); + Assertions.assertEquals("gdmvghcmixmlwkf", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOLUTION, model.source().kind()); + Assertions.assertEquals("yjrtalqeebu", model.source().name()); + Assertions.assertEquals("yimooaezkto", model.source().sourceId()); + Assertions.assertEquals("oi", model.author().name()); + Assertions.assertEquals("qwbywaazbaeee", model.author().email()); + Assertions.assertEquals("ztvn", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("btownoljdkx", model.support().name()); + Assertions.assertEquals("ewy", model.support().email()); + Assertions.assertEquals("lclzxkrdpuy", model.support().link()); + Assertions.assertEquals("pkrpkhqetpoe", model.dependencies().contentId()); + Assertions.assertEquals(Kind.DATA_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("oaf", model.dependencies().version()); + Assertions.assertEquals("nrxiyrxow", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("uajwblxph", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.HUNTING_QUERY, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("rf", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("tnnsvrfajy", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("ufgzq", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, + model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("ctblfehb", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("gy", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("wxjsjquv", model.providers().get(0)); + Assertions.assertEquals("tsrpjuvgzacr", model.categories().domains().get(0)); + Assertions.assertEquals("sbylgmgbh", model.categories().verticals().get(0)); + Assertions.assertEquals("lqbzbwb", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("pwxsvdeatjiobni", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("oextqdnwtgntimz", model.icon()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageListTests.java new file mode 100644 index 000000000000..9179d0710c8f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageListTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.PackageList; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class PackageListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PackageList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"contentId\":\"kdslcofuvtfu\",\"contentProductId\":\"ouisakl\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"dxqfussubzssp\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"false\",\"isDeprecated\":\"false\",\"version\":\"vxpqwlkqdgwbz\",\"displayName\":\"thldwvoglffjdhgs\",\"description\":\"rmhbtofcv\",\"publisherDisplayName\":\"yl\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"dylmnqun\",\"sourceId\":\"g\"},\"author\":{\"name\":\"msgkwedwlxtzhg\",\"email\":\"bh\",\"link\":\"hrpji\"},\"support\":{\"tier\":\"Partner\",\"name\":\"qfib\",\"email\":\"wmam\",\"link\":\"fizju\"},\"dependencies\":{\"contentId\":\"d\",\"kind\":\"PlaybookTemplate\",\"version\":\"ngy\",\"name\":\"lqy\",\"operator\":\"OR\",\"criteria\":[{}]},\"providers\":[\"dxwuuy\"],\"categories\":{\"domains\":[\"x\"],\"verticals\":[\"eargvfvkhbjh\",\"vpjxsdhweignybff\",\"cwwynepktvmw\"]},\"threatAnalysisTactics\":[\"onysebjijfhpxni\",\"ouoxfalo\"],\"threatAnalysisTechniques\":[\"kkyporsyn\"],\"icon\":\"unbydlgfap\"},\"etag\":\"uubwts\",\"id\":\"nrt\",\"name\":\"jfqreeo\",\"type\":\"vqjmrnblihs\"},{\"properties\":{\"contentId\":\"bmdivixzhpjgq\",\"contentProductId\":\"iaoaweacfxa\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"ruetcnx\",\"isNew\":\"false\",\"isPreview\":\"false\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"qdrrj\",\"displayName\":\"r\",\"description\":\"wobwxrxm\",\"publisherDisplayName\":\"kohlsfjfouqj\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"ahuvkqxqkvadmjh\",\"sourceId\":\"udjmaaj\"},\"author\":{\"name\":\"bhsermclyqwwu\",\"email\":\"qkaaptbssvkbcbpt\",\"link\":\"bloccu\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"zbns\",\"email\":\"vqnpszbeuybut\",\"link\":\"zjfjtvpey\"},\"dependencies\":{\"contentId\":\"uxurxrlt\",\"kind\":\"Playbook\",\"version\":\"jgpqfk\",\"name\":\"aeikczscy\",\"operator\":\"OR\",\"criteria\":[{},{}]},\"providers\":[\"pqnyumzapdok\"],\"categories\":{\"domains\":[\"knfzqnzbflbqmhb\"],\"verticals\":[\"xvwedhag\",\"bbsesea\",\"ufl\"]},\"threatAnalysisTactics\":[\"zzdcrolrz\",\"sb\",\"mphzkymunw\",\"ivt\"],\"threatAnalysisTechniques\":[\"zbdjrdfeujywdal\",\"sdeqngcaydzinlo\",\"ulpozmdahyc\"],\"icon\":\"rsi\"},\"etag\":\"ebldpo\",\"id\":\"ffjk\",\"name\":\"tnhrevimxmaxcj\",\"type\":\"pitygv\"},{\"properties\":{\"contentId\":\"soqtbfkvuozbzch\",\"contentProductId\":\"ekwanklp\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"ydjhtkjserwi\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"false\",\"isDeprecated\":\"true\",\"version\":\"o\",\"displayName\":\"blrdolenr\",\"description\":\"knpdrgnm\",\"publisherDisplayName\":\"o\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"fqckie\",\"sourceId\":\"rejyoyb\"},\"author\":{\"name\":\"tusdwmnrt\",\"email\":\"bucnnrov\",\"link\":\"epxwsicvwqzocsfs\"},\"support\":{\"tier\":\"Partner\",\"name\":\"msgpywdibu\",\"email\":\"nr\",\"link\":\"lvwrhryibrbk\"},\"dependencies\":{\"contentId\":\"bxcwojt\",\"kind\":\"CustomDetection\",\"version\":\"vnpyeevffifujgtd\",\"name\":\"lxmwefcbybpchrtc\",\"operator\":\"OR\",\"criteria\":[{},{}]},\"providers\":[\"znvyrjqdjlgkuir\",\"xeuwiiircvnfg\"],\"categories\":{\"domains\":[\"ohktxagfujdbqjny\",\"xbvxgx\",\"q\"],\"verticals\":[\"feoo\",\"ftpvevtarp\",\"klqlii\"]},\"threatAnalysisTactics\":[\"n\",\"wgjnofgij\",\"dgsebjuymtevae\"],\"threatAnalysisTechniques\":[\"wy\",\"hrjkejvaedogz\",\"ugxbxxgjogcph\"],\"icon\":\"fhrmtenfdvdoe\"},\"etag\":\"ywusrjzhdtr\",\"id\":\"fezfsmyljdzyyr\",\"name\":\"nmwtqiljkn\",\"type\":\"kyn\"},{\"properties\":{\"contentId\":\"dtfwhjfph\",\"contentProductId\":\"aqjyih\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"vao\",\"isNew\":\"false\",\"isPreview\":\"true\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"spwweifdyfa\",\"displayName\":\"xnguwn\",\"description\":\"pu\",\"publisherDisplayName\":\"a\",\"source\":{\"kind\":\"Community\",\"name\":\"jtggybs\",\"sourceId\":\"mijxejpd\"},\"author\":{\"name\":\"qwzutiye\",\"email\":\"nhhjtvhqszns\",\"link\":\"vqmq\"},\"support\":{\"tier\":\"Partner\",\"name\":\"toqwrnfc\",\"email\":\"thlokmxwawfu\",\"link\":\"ngejjxumowynjmoo\"},\"dependencies\":{\"contentId\":\"uktdrsjtmnkxjouw\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"dtstia\",\"name\":\"yrnuhcfhepisqb\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},\"providers\":[\"mmemsoqgblcye\",\"dobobaq\",\"abebckc\"],\"categories\":{\"domains\":[\"wnlpjcxbjg\",\"myqyyfrridzfps\",\"y\",\"kidfhmlxrqkeknu\"],\"verticals\":[\"afzvptriysjrg\"]},\"threatAnalysisTactics\":[\"wpuqpsrc\",\"kdvvoydwedggwg\",\"lvbwatzadrjbjn\",\"oarsrdr\"],\"threatAnalysisTechniques\":[\"mzc\",\"niapypi\",\"rxirq\",\"ipzesstu\"],\"icon\":\"ytkmlfupj\"},\"etag\":\"x\",\"id\":\"zj\",\"name\":\"yxjg\",\"type\":\"hxuerrd\"}],\"nextLink\":\"tnytkbcerfcvc\"}") + .toObject(PackageList.class); + Assertions.assertEquals("uubwts", model.value().get(0).etag()); + Assertions.assertEquals("kdslcofuvtfu", model.value().get(0).contentId()); + Assertions.assertEquals("ouisakl", model.value().get(0).contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.value().get(0).contentKind()); + Assertions.assertEquals("dxqfussubzssp", model.value().get(0).contentSchemaVersion()); + Assertions.assertEquals(Flag.TRUE, model.value().get(0).isNew()); + Assertions.assertEquals(Flag.FALSE, model.value().get(0).isPreview()); + Assertions.assertEquals(Flag.FALSE, model.value().get(0).isFeatured()); + Assertions.assertEquals(Flag.FALSE, model.value().get(0).isDeprecated()); + Assertions.assertEquals("vxpqwlkqdgwbz", model.value().get(0).version()); + Assertions.assertEquals("thldwvoglffjdhgs", model.value().get(0).displayName()); + Assertions.assertEquals("rmhbtofcv", model.value().get(0).description()); + Assertions.assertEquals("yl", model.value().get(0).publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.value().get(0).source().kind()); + Assertions.assertEquals("dylmnqun", model.value().get(0).source().name()); + Assertions.assertEquals("g", model.value().get(0).source().sourceId()); + Assertions.assertEquals("msgkwedwlxtzhg", model.value().get(0).author().name()); + Assertions.assertEquals("bh", model.value().get(0).author().email()); + Assertions.assertEquals("hrpji", model.value().get(0).author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.value().get(0).support().tier()); + Assertions.assertEquals("qfib", model.value().get(0).support().name()); + Assertions.assertEquals("wmam", model.value().get(0).support().email()); + Assertions.assertEquals("fizju", model.value().get(0).support().link()); + Assertions.assertEquals("d", model.value().get(0).dependencies().contentId()); + Assertions.assertEquals(Kind.PLAYBOOK_TEMPLATE, model.value().get(0).dependencies().kind()); + Assertions.assertEquals("ngy", model.value().get(0).dependencies().version()); + Assertions.assertEquals("lqy", model.value().get(0).dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.value().get(0).dependencies().operator()); + Assertions.assertEquals("dxwuuy", model.value().get(0).providers().get(0)); + Assertions.assertEquals("x", model.value().get(0).categories().domains().get(0)); + Assertions.assertEquals("eargvfvkhbjh", model.value().get(0).categories().verticals().get(0)); + Assertions.assertEquals("onysebjijfhpxni", model.value().get(0).threatAnalysisTactics().get(0)); + Assertions.assertEquals("kkyporsyn", model.value().get(0).threatAnalysisTechniques().get(0)); + Assertions.assertEquals("unbydlgfap", model.value().get(0).icon()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageModelInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageModelInnerTests.java new file mode 100644 index 000000000000..8dcd63bd7722 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackageModelInnerTests.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageModelInner; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PackageModelInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PackageModelInner model = BinaryData.fromString( + "{\"properties\":{\"contentId\":\"xcmmhipbvskcitly\",\"contentProductId\":\"wfsaa\",\"contentKind\":\"Solution\",\"contentSchemaVersion\":\"bm\",\"isNew\":\"false\",\"isPreview\":\"true\",\"isFeatured\":\"false\",\"isDeprecated\":\"false\",\"version\":\"ajklnac\",\"displayName\":\"nxq\",\"description\":\"nmzr\",\"publisherDisplayName\":\"aojpzngdrzi\",\"source\":{\"kind\":\"Solution\",\"name\":\"sadsqyuddkhwqdm\",\"sourceId\":\"heuyuunxmyevyi\"},\"author\":{\"name\":\"ipnfizejwl\",\"email\":\"acndjzwhaj\",\"link\":\"apqokhdyn\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"xsewbempfap\",\"email\":\"nme\",\"link\":\"ksy\"},\"dependencies\":{\"contentId\":\"iclm\",\"kind\":\"ResourcesDataConnector\",\"version\":\"n\",\"name\":\"vzl\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"exquawexizbf\",\"kind\":\"WatchlistTemplate\",\"version\":\"izwhpn\",\"name\":\"ajvvyxtvv\",\"operator\":\"AND\",\"criteria\":[{},{}]}]},\"providers\":[\"bkaybf\",\"l\",\"gfwhrmvlaknujmwx\"],\"categories\":{\"domains\":[\"nahhs\"],\"verticals\":[\"dcbsyhludzjk\",\"ovoh\"]},\"threatAnalysisTactics\":[\"rj\",\"dvt\",\"urmd\",\"a\"],\"threatAnalysisTechniques\":[\"jnaf\",\"hvqiiasbtwskkf\"],\"icon\":\"yikmxhhqsxjbjk\"},\"etag\":\"riglb\",\"id\":\"refeclflxcjf\",\"name\":\"zwncvdefxonz\",\"type\":\"pcjptnnt\"}") + .toObject(PackageModelInner.class); + Assertions.assertEquals("riglb", model.etag()); + Assertions.assertEquals("xcmmhipbvskcitly", model.contentId()); + Assertions.assertEquals("wfsaa", model.contentProductId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.contentKind()); + Assertions.assertEquals("bm", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.isNew()); + Assertions.assertEquals(Flag.TRUE, model.isPreview()); + Assertions.assertEquals(Flag.FALSE, model.isFeatured()); + Assertions.assertEquals(Flag.FALSE, model.isDeprecated()); + Assertions.assertEquals("ajklnac", model.version()); + Assertions.assertEquals("nxq", model.displayName()); + Assertions.assertEquals("nmzr", model.description()); + Assertions.assertEquals("aojpzngdrzi", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOLUTION, model.source().kind()); + Assertions.assertEquals("sadsqyuddkhwqdm", model.source().name()); + Assertions.assertEquals("heuyuunxmyevyi", model.source().sourceId()); + Assertions.assertEquals("ipnfizejwl", model.author().name()); + Assertions.assertEquals("acndjzwhaj", model.author().email()); + Assertions.assertEquals("apqokhdyn", model.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, model.support().tier()); + Assertions.assertEquals("xsewbempfap", model.support().name()); + Assertions.assertEquals("nme", model.support().email()); + Assertions.assertEquals("ksy", model.support().link()); + Assertions.assertEquals("iclm", model.dependencies().contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("n", model.dependencies().version()); + Assertions.assertEquals("vzl", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("exquawexizbf", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("izwhpn", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("ajvvyxtvv", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("bkaybf", model.providers().get(0)); + Assertions.assertEquals("nahhs", model.categories().domains().get(0)); + Assertions.assertEquals("dcbsyhludzjk", model.categories().verticals().get(0)); + Assertions.assertEquals("rj", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("jnaf", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("yikmxhhqsxjbjk", model.icon()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PackageModelInner model = new PackageModelInner().withEtag("riglb") + .withContentId("xcmmhipbvskcitly") + .withContentProductId("wfsaa") + .withContentKind(PackageKind.SOLUTION) + .withContentSchemaVersion("bm") + .withIsNew(Flag.FALSE) + .withIsPreview(Flag.TRUE) + .withIsFeatured(Flag.FALSE) + .withIsDeprecated(Flag.FALSE) + .withVersion("ajklnac") + .withDisplayName("nxq") + .withDescription("nmzr") + .withPublisherDisplayName("aojpzngdrzi") + .withSource(new MetadataSource().withKind(SourceKind.SOLUTION) + .withName("sadsqyuddkhwqdm") + .withSourceId("heuyuunxmyevyi")) + .withAuthor(new MetadataAuthor().withName("ipnfizejwl").withEmail("acndjzwhaj").withLink("apqokhdyn")) + .withSupport(new MetadataSupport().withTier(SupportTier.MICROSOFT) + .withName("xsewbempfap") + .withEmail("nme") + .withLink("ksy")) + .withDependencies(new MetadataDependencies().withContentId("iclm") + .withKind(Kind.RESOURCES_DATA_CONNECTOR) + .withVersion("n") + .withName("vzl") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("exquawexizbf") + .withKind(Kind.WATCHLIST_TEMPLATE) + .withVersion("izwhpn") + .withName("ajvvyxtvv") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies()))))) + .withProviders(Arrays.asList("bkaybf", "l", "gfwhrmvlaknujmwx")) + .withCategories(new MetadataCategories().withDomains(Arrays.asList("nahhs")) + .withVerticals(Arrays.asList("dcbsyhludzjk", "ovoh"))) + .withThreatAnalysisTactics(Arrays.asList("rj", "dvt", "urmd", "a")) + .withThreatAnalysisTechniques(Arrays.asList("jnaf", "hvqiiasbtwskkf")) + .withIcon("yikmxhhqsxjbjk"); + model = BinaryData.fromObject(model).toObject(PackageModelInner.class); + Assertions.assertEquals("riglb", model.etag()); + Assertions.assertEquals("xcmmhipbvskcitly", model.contentId()); + Assertions.assertEquals("wfsaa", model.contentProductId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.contentKind()); + Assertions.assertEquals("bm", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.isNew()); + Assertions.assertEquals(Flag.TRUE, model.isPreview()); + Assertions.assertEquals(Flag.FALSE, model.isFeatured()); + Assertions.assertEquals(Flag.FALSE, model.isDeprecated()); + Assertions.assertEquals("ajklnac", model.version()); + Assertions.assertEquals("nxq", model.displayName()); + Assertions.assertEquals("nmzr", model.description()); + Assertions.assertEquals("aojpzngdrzi", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOLUTION, model.source().kind()); + Assertions.assertEquals("sadsqyuddkhwqdm", model.source().name()); + Assertions.assertEquals("heuyuunxmyevyi", model.source().sourceId()); + Assertions.assertEquals("ipnfizejwl", model.author().name()); + Assertions.assertEquals("acndjzwhaj", model.author().email()); + Assertions.assertEquals("apqokhdyn", model.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, model.support().tier()); + Assertions.assertEquals("xsewbempfap", model.support().name()); + Assertions.assertEquals("nme", model.support().email()); + Assertions.assertEquals("ksy", model.support().link()); + Assertions.assertEquals("iclm", model.dependencies().contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("n", model.dependencies().version()); + Assertions.assertEquals("vzl", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("exquawexizbf", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("izwhpn", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("ajvvyxtvv", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("bkaybf", model.providers().get(0)); + Assertions.assertEquals("nahhs", model.categories().domains().get(0)); + Assertions.assertEquals("dcbsyhludzjk", model.categories().verticals().get(0)); + Assertions.assertEquals("rj", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("jnaf", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("yikmxhhqsxjbjk", model.icon()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackagePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackagePropertiesTests.java new file mode 100644 index 000000000000..42139eb2138d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PackagePropertiesTests.java @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.PackageProperties; +import com.azure.resourcemanager.securityinsights.models.Flag; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PackagePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PackageProperties model = BinaryData.fromString( + "{\"contentId\":\"cjqpzjvnpjr\",\"contentProductId\":\"pgsjbioagwviqehm\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"olidx\",\"isNew\":\"false\",\"isPreview\":\"true\",\"isFeatured\":\"false\",\"isDeprecated\":\"true\",\"version\":\"brsvxphtjnhp\",\"displayName\":\"lrkdcyzhimm\",\"description\":\"tdtftmizuzjd\",\"publisherDisplayName\":\"gyzcslazprkq\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"xpggkttea\",\"sourceId\":\"gacnqp\"},\"author\":{\"name\":\"tvudeylpbybki\",\"email\":\"oifm\",\"link\":\"lpwdjraurf\"},\"support\":{\"tier\":\"Community\",\"name\":\"urttuhaaaxxdcdj\",\"email\":\"kqtxfrm\",\"link\":\"cxstowageh\"},\"dependencies\":{\"contentId\":\"hwesrtja\",\"kind\":\"AutomationRule\",\"version\":\"kkncypmt\",\"name\":\"spsaneyvaerpiob\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"jokjwqdmraqnil\",\"kind\":\"WorkbookTemplate\",\"version\":\"aigazwf\",\"name\":\"rfd\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"odt\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"slzymqxserwycuhy\",\"name\":\"wgetfig\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"zizebjra\",\"kind\":\"Notebook\",\"version\":\"tubwggxzsshxli\",\"name\":\"sckwh\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"yobqzwjalwrsofxc\",\"kind\":\"HuntingQuery\",\"version\":\"vjf\",\"name\":\"suydldpr\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"zrztirjvqxvwkioc\",\"kind\":\"Workbook\",\"version\":\"jwbu\",\"name\":\"qflm\",\"operator\":\"OR\",\"criteria\":[{}]}]},{\"contentId\":\"bctatezyoz\",\"kind\":\"Solution\",\"version\":\"qnl\",\"name\":\"xc\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"dmra\",\"kind\":\"PlaybookTemplate\",\"version\":\"dodnvltcvmah\",\"name\":\"wkupbbnhic\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"cqdfwbifnnhlsfo\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"tfcq\",\"name\":\"ynb\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"ijte\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"peszamadlerz\",\"name\":\"f\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"tllxsw\",\"kind\":\"Solution\",\"version\":\"smirmnrijefmrtw\",\"name\":\"evdspthgffmwtbl\",\"operator\":\"AND\",\"criteria\":[{},{},{}]}]},{\"contentId\":\"oikxiefwln\",\"kind\":\"AnalyticsRule\",\"version\":\"fcnuestbsli\",\"name\":\"dnccotelik\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"hxtzxqdwbymuqln\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"dorctys\",\"name\":\"pek\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]}]},{\"contentId\":\"qtzcvimm\",\"kind\":\"AzureFunction\",\"version\":\"zvlfymtrts\",\"name\":\"upqtzckj\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"rfrjschjxncqzahg\",\"kind\":\"AnalyticsRule\",\"version\":\"do\",\"name\":\"morzolxosg\",\"operator\":\"OR\",\"criteria\":[{}]}]}]},\"providers\":[\"qbmxqf\",\"vznjqswshesgcsqo\"],\"categories\":{\"domains\":[\"goufpizpbmfx\",\"spfyvslazip\",\"lxgtdu\",\"jtyc\"],\"verticals\":[\"rznlaxo\",\"qthkwxfugfz\",\"zy\",\"duyjnqzbr\"]},\"threatAnalysisTactics\":[\"k\",\"fckviy\"],\"threatAnalysisTechniques\":[\"amnsbqoitwhmucj\",\"uhcxy\",\"ehyklelyqdvpqfbx\",\"ycudus\"],\"icon\":\"tx\"}") + .toObject(PackageProperties.class); + Assertions.assertEquals("cjqpzjvnpjr", model.contentId()); + Assertions.assertEquals("pgsjbioagwviqehm", model.contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.contentKind()); + Assertions.assertEquals("olidx", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.isNew()); + Assertions.assertEquals(Flag.TRUE, model.isPreview()); + Assertions.assertEquals(Flag.FALSE, model.isFeatured()); + Assertions.assertEquals(Flag.TRUE, model.isDeprecated()); + Assertions.assertEquals("brsvxphtjnhp", model.version()); + Assertions.assertEquals("lrkdcyzhimm", model.displayName()); + Assertions.assertEquals("tdtftmizuzjd", model.description()); + Assertions.assertEquals("gyzcslazprkq", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("xpggkttea", model.source().name()); + Assertions.assertEquals("gacnqp", model.source().sourceId()); + Assertions.assertEquals("tvudeylpbybki", model.author().name()); + Assertions.assertEquals("oifm", model.author().email()); + Assertions.assertEquals("lpwdjraurf", model.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.support().tier()); + Assertions.assertEquals("urttuhaaaxxdcdj", model.support().name()); + Assertions.assertEquals("kqtxfrm", model.support().email()); + Assertions.assertEquals("cxstowageh", model.support().link()); + Assertions.assertEquals("hwesrtja", model.dependencies().contentId()); + Assertions.assertEquals(Kind.AUTOMATION_RULE, model.dependencies().kind()); + Assertions.assertEquals("kkncypmt", model.dependencies().version()); + Assertions.assertEquals("spsaneyvaerpiob", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("jokjwqdmraqnil", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WORKBOOK_TEMPLATE, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("aigazwf", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("rfd", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("odt", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, + model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("slzymqxserwycuhy", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("wgetfig", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("qbmxqf", model.providers().get(0)); + Assertions.assertEquals("goufpizpbmfx", model.categories().domains().get(0)); + Assertions.assertEquals("rznlaxo", model.categories().verticals().get(0)); + Assertions.assertEquals("k", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("amnsbqoitwhmucj", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("tx", model.icon()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PackageProperties model = new PackageProperties().withContentId("cjqpzjvnpjr") + .withContentProductId("pgsjbioagwviqehm") + .withContentKind(PackageKind.STANDALONE) + .withContentSchemaVersion("olidx") + .withIsNew(Flag.FALSE) + .withIsPreview(Flag.TRUE) + .withIsFeatured(Flag.FALSE) + .withIsDeprecated(Flag.TRUE) + .withVersion("brsvxphtjnhp") + .withDisplayName("lrkdcyzhimm") + .withDescription("tdtftmizuzjd") + .withPublisherDisplayName("gyzcslazprkq") + .withSource(new MetadataSource().withKind(SourceKind.SOURCE_REPOSITORY) + .withName("xpggkttea") + .withSourceId("gacnqp")) + .withAuthor(new MetadataAuthor().withName("tvudeylpbybki").withEmail("oifm").withLink("lpwdjraurf")) + .withSupport(new MetadataSupport().withTier(SupportTier.COMMUNITY) + .withName("urttuhaaaxxdcdj") + .withEmail("kqtxfrm") + .withLink("cxstowageh")) + .withDependencies(new MetadataDependencies().withContentId("hwesrtja") + .withKind(Kind.AUTOMATION_RULE) + .withVersion("kkncypmt") + .withName("spsaneyvaerpiob") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("jokjwqdmraqnil") + .withKind(Kind.WORKBOOK_TEMPLATE) + .withVersion("aigazwf") + .withName("rfd") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("odt") + .withKind(Kind.LOGIC_APPS_CUSTOM_CONNECTOR) + .withVersion("slzymqxserwycuhy") + .withName("wgetfig") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("zizebjra") + .withKind(Kind.NOTEBOOK) + .withVersion("tubwggxzsshxli") + .withName("sckwh") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("yobqzwjalwrsofxc") + .withKind(Kind.HUNTING_QUERY) + .withVersion("vjf") + .withName("suydldpr") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("zrztirjvqxvwkioc") + .withKind(Kind.WORKBOOK) + .withVersion("jwbu") + .withName("qflm") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies())))), + new MetadataDependencies().withContentId("bctatezyoz") + .withKind(Kind.SOLUTION) + .withVersion("qnl") + .withName("xc") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("dmra") + .withKind(Kind.PLAYBOOK_TEMPLATE) + .withVersion("dodnvltcvmah") + .withName("wkupbbnhic") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("cqdfwbifnnhlsfo") + .withKind(Kind.ANALYTICS_RULE_TEMPLATE) + .withVersion("tfcq") + .withName("ynb") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())), + new MetadataDependencies().withContentId("ijte") + .withKind(Kind.ANALYTICS_RULE_TEMPLATE) + .withVersion("peszamadlerz") + .withName("f") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("tllxsw") + .withKind(Kind.SOLUTION) + .withVersion("smirmnrijefmrtw") + .withName("evdspthgffmwtbl") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())))), + new MetadataDependencies().withContentId("oikxiefwln") + .withKind(Kind.ANALYTICS_RULE) + .withVersion("fcnuestbsli") + .withName("dnccotelik") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("hxtzxqdwbymuqln") + .withKind(Kind.LOGIC_APPS_CUSTOM_CONNECTOR) + .withVersion("dorctys") + .withName("pek") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies(), new MetadataDependencies())))), + new MetadataDependencies().withContentId("qtzcvimm") + .withKind(Kind.AZURE_FUNCTION) + .withVersion("zvlfymtrts") + .withName("upqtzckj") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("rfrjschjxncqzahg") + .withKind(Kind.ANALYTICS_RULE) + .withVersion("do") + .withName("morzolxosg") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies()))))))) + .withProviders(Arrays.asList("qbmxqf", "vznjqswshesgcsqo")) + .withCategories( + new MetadataCategories().withDomains(Arrays.asList("goufpizpbmfx", "spfyvslazip", "lxgtdu", "jtyc")) + .withVerticals(Arrays.asList("rznlaxo", "qthkwxfugfz", "zy", "duyjnqzbr"))) + .withThreatAnalysisTactics(Arrays.asList("k", "fckviy")) + .withThreatAnalysisTechniques(Arrays.asList("amnsbqoitwhmucj", "uhcxy", "ehyklelyqdvpqfbx", "ycudus")) + .withIcon("tx"); + model = BinaryData.fromObject(model).toObject(PackageProperties.class); + Assertions.assertEquals("cjqpzjvnpjr", model.contentId()); + Assertions.assertEquals("pgsjbioagwviqehm", model.contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.contentKind()); + Assertions.assertEquals("olidx", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.isNew()); + Assertions.assertEquals(Flag.TRUE, model.isPreview()); + Assertions.assertEquals(Flag.FALSE, model.isFeatured()); + Assertions.assertEquals(Flag.TRUE, model.isDeprecated()); + Assertions.assertEquals("brsvxphtjnhp", model.version()); + Assertions.assertEquals("lrkdcyzhimm", model.displayName()); + Assertions.assertEquals("tdtftmizuzjd", model.description()); + Assertions.assertEquals("gyzcslazprkq", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("xpggkttea", model.source().name()); + Assertions.assertEquals("gacnqp", model.source().sourceId()); + Assertions.assertEquals("tvudeylpbybki", model.author().name()); + Assertions.assertEquals("oifm", model.author().email()); + Assertions.assertEquals("lpwdjraurf", model.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.support().tier()); + Assertions.assertEquals("urttuhaaaxxdcdj", model.support().name()); + Assertions.assertEquals("kqtxfrm", model.support().email()); + Assertions.assertEquals("cxstowageh", model.support().link()); + Assertions.assertEquals("hwesrtja", model.dependencies().contentId()); + Assertions.assertEquals(Kind.AUTOMATION_RULE, model.dependencies().kind()); + Assertions.assertEquals("kkncypmt", model.dependencies().version()); + Assertions.assertEquals("spsaneyvaerpiob", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("jokjwqdmraqnil", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WORKBOOK_TEMPLATE, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("aigazwf", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("rfd", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("odt", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, + model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("slzymqxserwycuhy", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("wgetfig", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("qbmxqf", model.providers().get(0)); + Assertions.assertEquals("goufpizpbmfx", model.categories().domains().get(0)); + Assertions.assertEquals("rznlaxo", model.categories().verticals().get(0)); + Assertions.assertEquals("k", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("amnsbqoitwhmucj", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("tx", model.icon()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsCustomsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsCustomsItemTests.java new file mode 100644 index 000000000000..1855596c7c69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsCustomsItemTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.PermissionsCustomsItem; +import org.junit.jupiter.api.Assertions; + +public final class PermissionsCustomsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PermissionsCustomsItem model = BinaryData.fromString("{\"name\":\"vjqterdq\",\"description\":\"gd\"}") + .toObject(PermissionsCustomsItem.class); + Assertions.assertEquals("vjqterdq", model.name()); + Assertions.assertEquals("gd", model.description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PermissionsCustomsItem model = new PermissionsCustomsItem().withName("vjqterdq").withDescription("gd"); + model = BinaryData.fromObject(model).toObject(PermissionsCustomsItem.class); + Assertions.assertEquals("vjqterdq", model.name()); + Assertions.assertEquals("gd", model.description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsResourceProviderItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsResourceProviderItemTests.java new file mode 100644 index 000000000000..5f2992889bd6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsResourceProviderItemTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.PermissionProviderScope; +import com.azure.resourcemanager.securityinsights.models.PermissionsResourceProviderItem; +import com.azure.resourcemanager.securityinsights.models.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import org.junit.jupiter.api.Assertions; + +public final class PermissionsResourceProviderItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PermissionsResourceProviderItem model = BinaryData.fromString( + "{\"provider\":\"microsoft.aadiam/diagnosticSettings\",\"permissionsDisplayText\":\"pglhzqp\",\"providerDisplayName\":\"bawkikcdg\",\"scope\":\"Workspace\",\"requiredPermissions\":{\"action\":true,\"write\":false,\"read\":true,\"delete\":false}}") + .toObject(PermissionsResourceProviderItem.class); + Assertions.assertEquals(ProviderName.MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS, model.provider()); + Assertions.assertEquals("pglhzqp", model.permissionsDisplayText()); + Assertions.assertEquals("bawkikcdg", model.providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.WORKSPACE, model.scope()); + Assertions.assertTrue(model.requiredPermissions().action()); + Assertions.assertFalse(model.requiredPermissions().write()); + Assertions.assertTrue(model.requiredPermissions().read()); + Assertions.assertFalse(model.requiredPermissions().delete()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PermissionsResourceProviderItem model + = new PermissionsResourceProviderItem().withProvider(ProviderName.MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS) + .withPermissionsDisplayText("pglhzqp") + .withProviderDisplayName("bawkikcdg") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions().withAction(true).withWrite(false).withRead(true).withDelete(false)); + model = BinaryData.fromObject(model).toObject(PermissionsResourceProviderItem.class); + Assertions.assertEquals(ProviderName.MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS, model.provider()); + Assertions.assertEquals("pglhzqp", model.permissionsDisplayText()); + Assertions.assertEquals("bawkikcdg", model.providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.WORKSPACE, model.scope()); + Assertions.assertTrue(model.requiredPermissions().action()); + Assertions.assertFalse(model.requiredPermissions().write()); + Assertions.assertTrue(model.requiredPermissions().read()); + Assertions.assertFalse(model.requiredPermissions().delete()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsTests.java new file mode 100644 index 000000000000..ffc74af78f12 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PermissionsTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +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.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PermissionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Permissions model = BinaryData.fromString( + "{\"resourceProvider\":[{\"provider\":\"Microsoft.OperationalInsights/solutions\",\"permissionsDisplayText\":\"uuzhw\",\"providerDisplayName\":\"adpcmhjhausy\",\"scope\":\"ResourceGroup\",\"requiredPermissions\":{\"action\":false,\"write\":false,\"read\":true,\"delete\":false}},{\"provider\":\"microsoft.aadiam/diagnosticSettings\",\"permissionsDisplayText\":\"v\",\"providerDisplayName\":\"yeiihfymkou\",\"scope\":\"Workspace\",\"requiredPermissions\":{\"action\":true,\"write\":false,\"read\":true,\"delete\":true}},{\"provider\":\"Microsoft.OperationalInsights/workspaces\",\"permissionsDisplayText\":\"gsmgb\",\"providerDisplayName\":\"tdwrqbebjnfve\",\"scope\":\"ResourceGroup\",\"requiredPermissions\":{\"action\":false,\"write\":true,\"read\":true,\"delete\":false}}],\"customs\":[{\"name\":\"gficud\",\"description\":\"izpacz\"},{\"name\":\"hbcakznhokhoit\",\"description\":\"rjsdmmazdnck\"}]}") + .toObject(Permissions.class); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS, + model.resourceProvider().get(0).provider()); + Assertions.assertEquals("uuzhw", model.resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("adpcmhjhausy", model.resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.RESOURCE_GROUP, model.resourceProvider().get(0).scope()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertTrue(model.resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertEquals("gficud", model.customs().get(0).name()); + Assertions.assertEquals("izpacz", model.customs().get(0).description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Permissions model = new Permissions().withResourceProvider(Arrays.asList( + new PermissionsResourceProviderItem().withProvider(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS) + .withPermissionsDisplayText("uuzhw") + .withProviderDisplayName("adpcmhjhausy") + .withScope(PermissionProviderScope.RESOURCE_GROUP) + .withRequiredPermissions( + new RequiredPermissions().withAction(false).withWrite(false).withRead(true).withDelete(false)), + new PermissionsResourceProviderItem().withProvider(ProviderName.MICROSOFT_AADIAM_DIAGNOSTIC_SETTINGS) + .withPermissionsDisplayText("v") + .withProviderDisplayName("yeiihfymkou") + .withScope(PermissionProviderScope.WORKSPACE) + .withRequiredPermissions( + new RequiredPermissions().withAction(true).withWrite(false).withRead(true).withDelete(true)), + new PermissionsResourceProviderItem().withProvider(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) + .withPermissionsDisplayText("gsmgb") + .withProviderDisplayName("tdwrqbebjnfve") + .withScope(PermissionProviderScope.RESOURCE_GROUP) + .withRequiredPermissions( + new RequiredPermissions().withAction(false).withWrite(true).withRead(true).withDelete(false)))) + .withCustoms(Arrays.asList(new PermissionsCustomsItem().withName("gficud").withDescription("izpacz"), + new PermissionsCustomsItem().withName("hbcakznhokhoit").withDescription("rjsdmmazdnck"))); + model = BinaryData.fromObject(model).toObject(Permissions.class); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_SOLUTIONS, + model.resourceProvider().get(0).provider()); + Assertions.assertEquals("uuzhw", model.resourceProvider().get(0).permissionsDisplayText()); + Assertions.assertEquals("adpcmhjhausy", model.resourceProvider().get(0).providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.RESOURCE_GROUP, model.resourceProvider().get(0).scope()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().action()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().write()); + Assertions.assertTrue(model.resourceProvider().get(0).requiredPermissions().read()); + Assertions.assertFalse(model.resourceProvider().get(0).requiredPermissions().delete()); + Assertions.assertEquals("gficud", model.customs().get(0).name()); + Assertions.assertEquals("izpacz", model.customs().get(0).description()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PlaybookActionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PlaybookActionPropertiesTests.java index 3e8a9e418ff2..9bb1fd82a082 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PlaybookActionPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PlaybookActionPropertiesTests.java @@ -1,30 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.PlaybookActionProperties; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class PlaybookActionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PlaybookActionProperties model = BinaryData - .fromString("{\"logicAppResourceId\":\"v\",\"tenantId\":\"47ec73ff-0a55-4f22-8db8-cbf311a170e2\"}") - .toObject(PlaybookActionProperties.class); - Assertions.assertEquals("v", model.logicAppResourceId()); - Assertions.assertEquals(UUID.fromString("47ec73ff-0a55-4f22-8db8-cbf311a170e2"), model.tenantId()); + PlaybookActionProperties model + = BinaryData.fromString("{\"logicAppResourceId\":\"dfgsftufqobrj\",\"tenantId\":\"acgcckknhx\"}") + .toObject(PlaybookActionProperties.class); + Assertions.assertEquals("dfgsftufqobrj", model.logicAppResourceId()); + Assertions.assertEquals("acgcckknhx", model.tenantId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PlaybookActionProperties model = new PlaybookActionProperties().withLogicAppResourceId("v") - .withTenantId(UUID.fromString("47ec73ff-0a55-4f22-8db8-cbf311a170e2")); + PlaybookActionProperties model + = new PlaybookActionProperties().withLogicAppResourceId("dfgsftufqobrj").withTenantId("acgcckknhx"); model = BinaryData.fromObject(model).toObject(PlaybookActionProperties.class); - Assertions.assertEquals("v", model.logicAppResourceId()); - Assertions.assertEquals(UUID.fromString("47ec73ff-0a55-4f22-8db8-cbf311a170e2"), model.tenantId()); + Assertions.assertEquals("dfgsftufqobrj", model.logicAppResourceId()); + Assertions.assertEquals("acgcckknhx", model.tenantId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesConnectorTests.java new file mode 100644 index 000000000000..7eb542c54fa6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesConnectorTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypesConnector; +import org.junit.jupiter.api.Assertions; + +public final class PremiumMdtiDataConnectorDataTypesConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PremiumMdtiDataConnectorDataTypesConnector model = BinaryData.fromString("{\"state\":\"Enabled\"}") + .toObject(PremiumMdtiDataConnectorDataTypesConnector.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PremiumMdtiDataConnectorDataTypesConnector model + = new PremiumMdtiDataConnectorDataTypesConnector().withState(DataTypeState.ENABLED); + model = BinaryData.fromObject(model).toObject(PremiumMdtiDataConnectorDataTypesConnector.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesTests.java new file mode 100644 index 000000000000..afe19cf5dd76 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorDataTypesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypesConnector; +import org.junit.jupiter.api.Assertions; + +public final class PremiumMdtiDataConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PremiumMdtiDataConnectorDataTypes model = BinaryData.fromString("{\"connector\":{\"state\":\"Disabled\"}}") + .toObject(PremiumMdtiDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.connector().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PremiumMdtiDataConnectorDataTypes model = new PremiumMdtiDataConnectorDataTypes() + .withConnector(new PremiumMdtiDataConnectorDataTypesConnector().withState(DataTypeState.DISABLED)); + model = BinaryData.fromObject(model).toObject(PremiumMdtiDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.connector().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..5e9e858f1e65 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMdtiDataConnectorPropertiesTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.PremiumMdtiDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypesConnector; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class PremiumMdtiDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PremiumMdtiDataConnectorProperties model = BinaryData.fromString( + "{\"lookbackPeriod\":\"2021-10-03T20:34:46Z\",\"requiredSKUsPresent\":false,\"dataTypes\":{\"connector\":{\"state\":\"Disabled\"}},\"tenantId\":\"iqwnnraclibbfq\"}") + .toObject(PremiumMdtiDataConnectorProperties.class); + Assertions.assertEquals("iqwnnraclibbfq", model.tenantId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T20:34:46Z"), model.lookbackPeriod()); + Assertions.assertFalse(model.requiredSKUsPresent()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().connector().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PremiumMdtiDataConnectorProperties model + = new PremiumMdtiDataConnectorProperties().withTenantId("iqwnnraclibbfq") + .withLookbackPeriod(OffsetDateTime.parse("2021-10-03T20:34:46Z")) + .withRequiredSKUsPresent(false) + .withDataTypes(new PremiumMdtiDataConnectorDataTypes() + .withConnector(new PremiumMdtiDataConnectorDataTypesConnector().withState(DataTypeState.DISABLED))); + model = BinaryData.fromObject(model).toObject(PremiumMdtiDataConnectorProperties.class); + Assertions.assertEquals("iqwnnraclibbfq", model.tenantId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T20:34:46Z"), model.lookbackPeriod()); + Assertions.assertFalse(model.requiredSKUsPresent()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().connector().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMicrosoftDefenderForThreatIntelligenceTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMicrosoftDefenderForThreatIntelligenceTests.java new file mode 100644 index 000000000000..25852f0c0df3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PremiumMicrosoftDefenderForThreatIntelligenceTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PremiumMdtiDataConnectorDataTypesConnector; +import com.azure.resourcemanager.securityinsights.models.PremiumMicrosoftDefenderForThreatIntelligence; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class PremiumMicrosoftDefenderForThreatIntelligenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PremiumMicrosoftDefenderForThreatIntelligence model = BinaryData.fromString( + "{\"kind\":\"PremiumMicrosoftDefenderForThreatIntelligence\",\"properties\":{\"lookbackPeriod\":\"2021-05-10T07:19:23Z\",\"requiredSKUsPresent\":true,\"dataTypes\":{\"connector\":{\"state\":\"Disabled\"}},\"tenantId\":\"bym\"},\"etag\":\"ob\",\"id\":\"quvjez\",\"name\":\"j\",\"type\":\"mvpsimioyo\"}") + .toObject(PremiumMicrosoftDefenderForThreatIntelligence.class); + Assertions.assertEquals("ob", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T07:19:23Z"), model.lookbackPeriod()); + Assertions.assertTrue(model.requiredSKUsPresent()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().connector().state()); + Assertions.assertEquals("bym", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PremiumMicrosoftDefenderForThreatIntelligence model + = new PremiumMicrosoftDefenderForThreatIntelligence().withEtag("ob") + .withLookbackPeriod(OffsetDateTime.parse("2021-05-10T07:19:23Z")) + .withRequiredSKUsPresent(true) + .withDataTypes(new PremiumMdtiDataConnectorDataTypes() + .withConnector(new PremiumMdtiDataConnectorDataTypesConnector().withState(DataTypeState.DISABLED))) + .withTenantId("bym"); + model = BinaryData.fromObject(model).toObject(PremiumMicrosoftDefenderForThreatIntelligence.class); + Assertions.assertEquals("ob", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T07:19:23Z"), model.lookbackPeriod()); + Assertions.assertTrue(model.requiredSKUsPresent()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().connector().state()); + Assertions.assertEquals("bym", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageListTests.java new file mode 100644 index 000000000000..f1e4ea04fedf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageListTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.ProductPackageList; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class ProductPackageListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProductPackageList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"contentId\":\"fswarmybw\",\"contentProductId\":\"otgeysyqnipe\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"cbfnxiajuv\",\"isNew\":\"false\",\"isPreview\":\"true\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"zlnra\",\"displayName\":\"fyzguaxf\",\"description\":\"jixgofqdqws\",\"publisherDisplayName\":\"ihuvrqpbxdoicqpk\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"dprpensbmzjrituk\",\"sourceId\":\"mh\"},\"author\":{\"name\":\"xmizzjxwjo\",\"email\":\"zwanduhduwdvolxt\",\"link\":\"ricdsflzbkiumj\"},\"support\":{\"tier\":\"Partner\",\"name\":\"edrm\",\"email\":\"zhvchvvoyiogb\",\"link\":\"nwzruzsoowx\"},\"dependencies\":{\"contentId\":\"xtlcappnvcebs\",\"kind\":\"Parser\",\"version\":\"yomhkdwuwedupb\",\"name\":\"zkwh\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},\"providers\":[\"efefvvkxdbnmcva\"],\"categories\":{\"domains\":[\"obuesdyvfx\",\"z\"],\"verticals\":[\"fupktw\"]},\"threatAnalysisTactics\":[\"segivytabvbbk\"],\"threatAnalysisTechniques\":[\"wgsltutbuve\"],\"icon\":\"uuqbm\",\"installedVersion\":\"xcqsxwclykcru\",\"metadataResourceId\":\"kk\",\"packagedContent\":\"\\\"datajrevmptedeuen\\\"\"},\"etag\":\"shnfiygpgpkkhp\",\"id\":\"glaqlmi\",\"name\":\"nmtrd\",\"type\":\"pxi\"},{\"properties\":{\"contentId\":\"ecpvfpnrzikvo\",\"contentProductId\":\"oeohyfivxdifb\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"jhpxukxgoyxontbw\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"false\",\"isDeprecated\":\"false\",\"version\":\"rldxfuaefew\",\"displayName\":\"tktwjrppifey\",\"description\":\"velrmdcizhvk\",\"publisherDisplayName\":\"ojklwjpzw\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"ksmpye\",\"sourceId\":\"olbf\"},\"author\":{\"name\":\"ytfxu\",\"email\":\"iqoomiswkqw\",\"link\":\"wsnliy\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"uqzgpdglkfv\",\"email\":\"rgavtfyzs\",\"link\":\"f\"},\"dependencies\":{\"contentId\":\"kryxpi\",\"kind\":\"ResourcesDataConnector\",\"version\":\"eakfdmcedlik\",\"name\":\"kyoddoqkanqtrkic\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},\"providers\":[\"mndkrwwmurhvif\",\"eqfsrnackitl\"],\"categories\":{\"domains\":[\"p\",\"jeldaqwju\",\"ilnijhw\",\"brdsypotnpkb\"],\"verticals\":[\"ko\"]},\"threatAnalysisTactics\":[\"vnqdj\"],\"threatAnalysisTechniques\":[\"twgnldxuczl\",\"vbqy\"],\"icon\":\"nrirpiiuvc\",\"installedVersion\":\"qkqwucqsdgb\",\"metadataResourceId\":\"wtvmijccpkkjl\",\"packagedContent\":\"\\\"datayvwpr\\\"\"},\"etag\":\"aih\",\"id\":\"nlbhxjppcbqetfz\",\"name\":\"ppvolzayjw\",\"type\":\"unj\"},{\"properties\":{\"contentId\":\"rklatwiuuj\",\"contentProductId\":\"ujk\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"eegxbnj\",\"isNew\":\"false\",\"isPreview\":\"false\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"g\",\"displayName\":\"mdquyyaescjxnavp\",\"description\":\"qbkxdtbfkihainz\",\"publisherDisplayName\":\"fkzlxvcozcgo\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"ibcbnunzuysaj\",\"sourceId\":\"qlho\"},\"author\":{\"name\":\"neli\",\"email\":\"tibtkqjqjcaj\",\"link\":\"fytkhhkemrv\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"jtdyulglhelwrukl\",\"email\":\"fxspxgog\",\"link\":\"bztgaex\"},\"dependencies\":{\"contentId\":\"kvctvuz\",\"kind\":\"AzureFunction\",\"version\":\"ttmhlvr\",\"name\":\"yxrnwukfajnpdwz\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},\"providers\":[\"p\",\"mz\"],\"categories\":{\"domains\":[\"ii\",\"xcor\",\"vudyhgtrttcuayi\",\"ylnkmmxzifbqg\"],\"verticals\":[\"o\",\"q\"]},\"threatAnalysisTactics\":[\"gqrqkkvfy\",\"kuobpw\",\"inpgobothxiew\",\"pnyjtu\"],\"threatAnalysisTechniques\":[\"yvextch\",\"lroldowuwhdlrif\",\"ozttcbiich\"],\"icon\":\"udsozodwjcfqoy\",\"installedVersion\":\"yqycymzrlcfgdwza\",\"metadataResourceId\":\"fd\",\"packagedContent\":\"\\\"dataadnyciwzki\\\"\"},\"etag\":\"kqadfgesvzohabb\",\"id\":\"zmadjrsbgail\",\"name\":\"qovqm\",\"type\":\"qsxofxqnkiuok\"}],\"nextLink\":\"tsxooiobh\"}") + .toObject(ProductPackageList.class); + Assertions.assertEquals("shnfiygpgpkkhp", model.value().get(0).etag()); + Assertions.assertEquals("fswarmybw", model.value().get(0).contentId()); + Assertions.assertEquals("otgeysyqnipe", model.value().get(0).contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.value().get(0).contentKind()); + Assertions.assertEquals("cbfnxiajuv", model.value().get(0).contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.value().get(0).isNew()); + Assertions.assertEquals(Flag.TRUE, model.value().get(0).isPreview()); + Assertions.assertEquals(Flag.TRUE, model.value().get(0).isFeatured()); + Assertions.assertEquals(Flag.TRUE, model.value().get(0).isDeprecated()); + Assertions.assertEquals("zlnra", model.value().get(0).version()); + Assertions.assertEquals("fyzguaxf", model.value().get(0).displayName()); + Assertions.assertEquals("jixgofqdqws", model.value().get(0).description()); + Assertions.assertEquals("ihuvrqpbxdoicqpk", model.value().get(0).publisherDisplayName()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.value().get(0).source().kind()); + Assertions.assertEquals("dprpensbmzjrituk", model.value().get(0).source().name()); + Assertions.assertEquals("mh", model.value().get(0).source().sourceId()); + Assertions.assertEquals("xmizzjxwjo", model.value().get(0).author().name()); + Assertions.assertEquals("zwanduhduwdvolxt", model.value().get(0).author().email()); + Assertions.assertEquals("ricdsflzbkiumj", model.value().get(0).author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.value().get(0).support().tier()); + Assertions.assertEquals("edrm", model.value().get(0).support().name()); + Assertions.assertEquals("zhvchvvoyiogb", model.value().get(0).support().email()); + Assertions.assertEquals("nwzruzsoowx", model.value().get(0).support().link()); + Assertions.assertEquals("xtlcappnvcebs", model.value().get(0).dependencies().contentId()); + Assertions.assertEquals(Kind.PARSER, model.value().get(0).dependencies().kind()); + Assertions.assertEquals("yomhkdwuwedupb", model.value().get(0).dependencies().version()); + Assertions.assertEquals("zkwh", model.value().get(0).dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.value().get(0).dependencies().operator()); + Assertions.assertEquals("efefvvkxdbnmcva", model.value().get(0).providers().get(0)); + Assertions.assertEquals("obuesdyvfx", model.value().get(0).categories().domains().get(0)); + Assertions.assertEquals("fupktw", model.value().get(0).categories().verticals().get(0)); + Assertions.assertEquals("segivytabvbbk", model.value().get(0).threatAnalysisTactics().get(0)); + Assertions.assertEquals("wgsltutbuve", model.value().get(0).threatAnalysisTechniques().get(0)); + Assertions.assertEquals("uuqbm", model.value().get(0).icon()); + Assertions.assertEquals("xcqsxwclykcru", model.value().get(0).installedVersion()); + Assertions.assertEquals("kk", model.value().get(0).metadataResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageModelInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageModelInnerTests.java new file mode 100644 index 000000000000..70d19417c59e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackageModelInnerTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageModelInner; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class ProductPackageModelInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProductPackageModelInner model = BinaryData.fromString( + "{\"properties\":{\"contentId\":\"qjc\",\"contentProductId\":\"pw\",\"contentKind\":\"Solution\",\"contentSchemaVersion\":\"nhhcikh\",\"isNew\":\"false\",\"isPreview\":\"true\",\"isFeatured\":\"false\",\"isDeprecated\":\"false\",\"version\":\"cagiflrcygot\",\"displayName\":\"zwtoidhbxi\",\"description\":\"ap\",\"publisherDisplayName\":\"hlutjs\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"sriemvupmeako\",\"sourceId\":\"sycvldee\"},\"author\":{\"name\":\"saipusuof\",\"email\":\"gbvbbdledfflzv\",\"link\":\"uazzxf\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"gpxzeem\",\"email\":\"pbscboxr\",\"link\":\"dczmrjgobekx\"},\"dependencies\":{\"contentId\":\"owsecaf\",\"kind\":\"Standalone\",\"version\":\"bskiwrj\",\"name\":\"db\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"cuicnvqiqsu\",\"kind\":\"DataType\",\"version\":\"faptndrm\",\"name\":\"lh\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"kekc\",\"kind\":\"Notebook\",\"version\":\"iebeqrfzavq\",\"name\":\"cwtsiucepl\",\"operator\":\"OR\",\"criteria\":[{},{}]},{\"contentId\":\"orwp\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"weobptscr\",\"name\":\"kkiela\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]}]},\"providers\":[\"flsmsbnlyoifg\",\"fzjqthy\",\"cvoevcwfz\"],\"categories\":{\"domains\":[\"wwooxgbsdzcg\",\"vypjhubdmgobxe\",\"ujcqgzwvxwiu\"],\"verticals\":[\"bmjklqrljd\",\"uky\"]},\"threatAnalysisTactics\":[\"rjiqoqovqhgphgxu\",\"ud\",\"cy\"],\"threatAnalysisTechniques\":[\"vumryd\"],\"icon\":\"qivah\",\"installedVersion\":\"qwnjzebpicciyo\",\"metadataResourceId\":\"oedkspw\",\"packagedContent\":\"\\\"databpybqeigxuyxsxte\\\"\"},\"etag\":\"khznfffnhcgna\",\"id\":\"rmrfqderkrgsdco\",\"name\":\"pmgqlwyqznb\",\"type\":\"yzposzfutgpbyg\"}") + .toObject(ProductPackageModelInner.class); + Assertions.assertEquals("khznfffnhcgna", model.etag()); + Assertions.assertEquals("qjc", model.contentId()); + Assertions.assertEquals("pw", model.contentProductId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.contentKind()); + Assertions.assertEquals("nhhcikh", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, model.isNew()); + Assertions.assertEquals(Flag.TRUE, model.isPreview()); + Assertions.assertEquals(Flag.FALSE, model.isFeatured()); + Assertions.assertEquals(Flag.FALSE, model.isDeprecated()); + Assertions.assertEquals("cagiflrcygot", model.version()); + Assertions.assertEquals("zwtoidhbxi", model.displayName()); + Assertions.assertEquals("ap", model.description()); + Assertions.assertEquals("hlutjs", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("sriemvupmeako", model.source().name()); + Assertions.assertEquals("sycvldee", model.source().sourceId()); + Assertions.assertEquals("saipusuof", model.author().name()); + Assertions.assertEquals("gbvbbdledfflzv", model.author().email()); + Assertions.assertEquals("uazzxf", model.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, model.support().tier()); + Assertions.assertEquals("gpxzeem", model.support().name()); + Assertions.assertEquals("pbscboxr", model.support().email()); + Assertions.assertEquals("dczmrjgobekx", model.support().link()); + Assertions.assertEquals("owsecaf", model.dependencies().contentId()); + Assertions.assertEquals(Kind.STANDALONE, model.dependencies().kind()); + Assertions.assertEquals("bskiwrj", model.dependencies().version()); + Assertions.assertEquals("db", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("cuicnvqiqsu", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.DATA_TYPE, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("faptndrm", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("lh", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("flsmsbnlyoifg", model.providers().get(0)); + Assertions.assertEquals("wwooxgbsdzcg", model.categories().domains().get(0)); + Assertions.assertEquals("bmjklqrljd", model.categories().verticals().get(0)); + Assertions.assertEquals("rjiqoqovqhgphgxu", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("vumryd", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("qivah", model.icon()); + Assertions.assertEquals("qwnjzebpicciyo", model.installedVersion()); + Assertions.assertEquals("oedkspw", model.metadataResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagePropertiesTests.java new file mode 100644 index 000000000000..886d736f11c3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagePropertiesTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductPackageProperties; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class ProductPackagePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProductPackageProperties model = BinaryData.fromString( + "{\"contentId\":\"bcmoiqgtzpvqewf\",\"contentProductId\":\"z\",\"contentKind\":\"Solution\",\"contentSchemaVersion\":\"xerx\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"false\",\"isDeprecated\":\"false\",\"version\":\"vdkfpfjdajd\",\"displayName\":\"ymxxyfrdjidce\",\"description\":\"vgwfwsldigwo\",\"publisherDisplayName\":\"pvydd\",\"source\":{\"kind\":\"Community\",\"name\":\"lrsnx\",\"sourceId\":\"p\"},\"author\":{\"name\":\"qclmd\",\"email\":\"fxxepzpxzxlcqzfx\",\"link\":\"tiqmcjbsmkirp\"},\"support\":{\"tier\":\"Community\",\"name\":\"udmhkcomeobwk\",\"email\":\"zltenlbfxl\",\"link\":\"ozesn\"},\"dependencies\":{\"contentId\":\"uomtxj\",\"kind\":\"AnalyticsRule\",\"version\":\"ymckik\",\"name\":\"yvurhwishy\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"fev\",\"kind\":\"DataConnector\",\"version\":\"kcktehog\",\"name\":\"d\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"desuazogfcn\",\"kind\":\"SummaryRule\",\"version\":\"xumtcqxmyvk\",\"name\":\"xypav\",\"operator\":\"AND\",\"criteria\":[{},{}]}]},{\"contentId\":\"ohvpsuw\",\"kind\":\"Parser\",\"version\":\"xczbyfkoc\",\"name\":\"zdct\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"rngtwgxr\",\"kind\":\"AnalyticsRule\",\"version\":\"plksdksutacucti\",\"name\":\"vis\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"vpmqququxlph\",\"kind\":\"Workbook\",\"version\":\"lexoweorocr\",\"name\":\"cgym\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"yrvhtv\",\"kind\":\"WorkbookTemplate\",\"version\":\"mrgcnzhrp\",\"name\":\"xfmbzqu\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]}]},{\"contentId\":\"btqyzycgcmbkygv\",\"kind\":\"DataType\",\"version\":\"osxzm\",\"name\":\"lybqfufkekzfkic\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"nk\",\"kind\":\"Parser\",\"version\":\"sryjokvl\",\"name\":\"bjsarxsvmfpa\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"fgqpud\",\"kind\":\"Notebook\",\"version\":\"ieabbfpxxavlo\",\"name\":\"kgsnuhwyxjsfm\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},{\"contentId\":\"b\",\"kind\":\"DataConnector\",\"version\":\"emqqerwqx\",\"name\":\"pvemdfkht\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"zmhytebjkjgee\",\"kind\":\"Notebook\",\"version\":\"mabvbmnhtwofxf\",\"name\":\"lvyqnslbqrm\",\"operator\":\"OR\",\"criteria\":[{},{}]}]},{\"contentId\":\"hj\",\"kind\":\"AutomationRule\",\"version\":\"ugwespscvsmsp\",\"name\":\"uwozfvz\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"qgxcvwio\",\"kind\":\"WorkbookTemplate\",\"version\":\"cgmlmpn\",\"name\":\"xuyi\",\"operator\":\"AND\",\"criteria\":[{},{}]}]}]},\"providers\":[\"seypd\",\"majpuyxoafrmzgcc\",\"nbuvms\"],\"categories\":{\"domains\":[\"m\",\"oneeyrxpa\",\"xtzayqwddig\"],\"verticals\":[\"spl\"]},\"threatAnalysisTactics\":[\"siwwv\",\"eozbj\"],\"threatAnalysisTechniques\":[\"p\",\"zdnuehxwltss\",\"dyw\"],\"icon\":\"klgerxactsawv\",\"installedVersion\":\"impthj\",\"metadataResourceId\":\"plzmslubnk\",\"packagedContent\":\"\\\"datafuysjhv\\\"\"}") + .toObject(ProductPackageProperties.class); + Assertions.assertEquals("bcmoiqgtzpvqewf", model.contentId()); + Assertions.assertEquals("z", model.contentProductId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.contentKind()); + Assertions.assertEquals("xerx", model.contentSchemaVersion()); + Assertions.assertEquals(Flag.TRUE, model.isNew()); + Assertions.assertEquals(Flag.FALSE, model.isPreview()); + Assertions.assertEquals(Flag.FALSE, model.isFeatured()); + Assertions.assertEquals(Flag.FALSE, model.isDeprecated()); + Assertions.assertEquals("vdkfpfjdajd", model.version()); + Assertions.assertEquals("ymxxyfrdjidce", model.displayName()); + Assertions.assertEquals("vgwfwsldigwo", model.description()); + Assertions.assertEquals("pvydd", model.publisherDisplayName()); + Assertions.assertEquals(SourceKind.COMMUNITY, model.source().kind()); + Assertions.assertEquals("lrsnx", model.source().name()); + Assertions.assertEquals("p", model.source().sourceId()); + Assertions.assertEquals("qclmd", model.author().name()); + Assertions.assertEquals("fxxepzpxzxlcqzfx", model.author().email()); + Assertions.assertEquals("tiqmcjbsmkirp", model.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.support().tier()); + Assertions.assertEquals("udmhkcomeobwk", model.support().name()); + Assertions.assertEquals("zltenlbfxl", model.support().email()); + Assertions.assertEquals("ozesn", model.support().link()); + Assertions.assertEquals("uomtxj", model.dependencies().contentId()); + Assertions.assertEquals(Kind.ANALYTICS_RULE, model.dependencies().kind()); + Assertions.assertEquals("ymckik", model.dependencies().version()); + Assertions.assertEquals("yvurhwishy", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("fev", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.DATA_CONNECTOR, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("kcktehog", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("d", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("desuazogfcn", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.SUMMARY_RULE, model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("xumtcqxmyvk", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("xypav", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("seypd", model.providers().get(0)); + Assertions.assertEquals("m", model.categories().domains().get(0)); + Assertions.assertEquals("spl", model.categories().verticals().get(0)); + Assertions.assertEquals("siwwv", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("p", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("klgerxactsawv", model.icon()); + Assertions.assertEquals("impthj", model.installedVersion()); + Assertions.assertEquals("plzmslubnk", model.metadataResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesGetWithResponseMockTests.java new file mode 100644 index 000000000000..dd8b0f48410e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesGetWithResponseMockTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.ProductPackageModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductPackagesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"lpy\",\"contentProductId\":\"bln\",\"contentKind\":\"Standalone\",\"contentSchemaVersion\":\"ubx\",\"isNew\":\"true\",\"isPreview\":\"false\",\"isFeatured\":\"true\",\"isDeprecated\":\"false\",\"version\":\"ltvkylwjopq\",\"displayName\":\"gkrjolba\",\"description\":\"haksscismr\",\"publisherDisplayName\":\"eklf\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"sfclxtf\",\"sourceId\":\"dwqzbiukzmfyfvy\"},\"author\":{\"name\":\"f\",\"email\":\"wlnfve\",\"link\":\"uuqafolseyxpgkml\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"aywgc\",\"email\":\"nf\",\"link\":\"pyglnfw\"},\"dependencies\":{\"contentId\":\"wv\",\"kind\":\"ResourcesDataConnector\",\"version\":\"ucpmqwkf\",\"name\":\"kpv\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"zhdwrc\",\"kind\":\"WorkbookTemplate\",\"version\":\"rs\",\"name\":\"xlkcw\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"k\",\"kind\":\"HuntingQuery\",\"version\":\"kdepqcybnhwsxp\",\"name\":\"motgmdygwwqev\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"tpmwjxlycel\",\"kind\":\"WatchlistTemplate\",\"version\":\"ywrau\",\"name\":\"ul\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"kirmiecfmq\",\"kind\":\"WorkbookTemplate\",\"version\":\"c\",\"name\":\"vcxoamhefuhnb\",\"operator\":\"OR\",\"criteria\":[{},{}]}]},\"providers\":[\"tzjjgv\",\"btq\",\"mpnkyvujhej\",\"trvlguysb\"],\"categories\":{\"domains\":[\"hmuqyzxkormrcj\",\"htcf\",\"bf\",\"d\"],\"verticals\":[\"yhxp\"]},\"threatAnalysisTactics\":[\"ehuboq\",\"zxnuxamxikhrxi\",\"glynbqpeo\"],\"threatAnalysisTechniques\":[\"boggw\",\"ihtnywgtso\"],\"icon\":\"xeirjtwji\",\"installedVersion\":\"frh\",\"metadataResourceId\":\"g\",\"packagedContent\":\"\\\"datavoaxqocalptf\\\"\"},\"etag\":\"zyqbggxcyram\",\"id\":\"uaxt\",\"name\":\"rqnyurxl\",\"type\":\"uwxslzq\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ProductPackageModel response = manager.productPackages() + .getWithResponse("yseyvagakfqpaexl", "tmekkaeigrhrdns", "vsrtqltawjkra", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zyqbggxcyram", response.etag()); + Assertions.assertEquals("lpy", response.contentId()); + Assertions.assertEquals("bln", response.contentProductId()); + Assertions.assertEquals(PackageKind.STANDALONE, response.contentKind()); + Assertions.assertEquals("ubx", response.contentSchemaVersion()); + Assertions.assertEquals(Flag.TRUE, response.isNew()); + Assertions.assertEquals(Flag.FALSE, response.isPreview()); + Assertions.assertEquals(Flag.TRUE, response.isFeatured()); + Assertions.assertEquals(Flag.FALSE, response.isDeprecated()); + Assertions.assertEquals("ltvkylwjopq", response.version()); + Assertions.assertEquals("gkrjolba", response.displayName()); + Assertions.assertEquals("haksscismr", response.description()); + Assertions.assertEquals("eklf", response.publisherDisplayName()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, response.source().kind()); + Assertions.assertEquals("sfclxtf", response.source().name()); + Assertions.assertEquals("dwqzbiukzmfyfvy", response.source().sourceId()); + Assertions.assertEquals("f", response.author().name()); + Assertions.assertEquals("wlnfve", response.author().email()); + Assertions.assertEquals("uuqafolseyxpgkml", response.author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, response.support().tier()); + Assertions.assertEquals("aywgc", response.support().name()); + Assertions.assertEquals("nf", response.support().email()); + Assertions.assertEquals("pyglnfw", response.support().link()); + Assertions.assertEquals("wv", response.dependencies().contentId()); + Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, response.dependencies().kind()); + Assertions.assertEquals("ucpmqwkf", response.dependencies().version()); + Assertions.assertEquals("kpv", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().operator()); + Assertions.assertEquals("zhdwrc", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.WORKBOOK_TEMPLATE, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("rs", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("xlkcw", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("tzjjgv", response.providers().get(0)); + Assertions.assertEquals("hmuqyzxkormrcj", response.categories().domains().get(0)); + Assertions.assertEquals("yhxp", response.categories().verticals().get(0)); + Assertions.assertEquals("ehuboq", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("boggw", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("xeirjtwji", response.icon()); + Assertions.assertEquals("frh", response.installedVersion()); + Assertions.assertEquals("g", response.metadataResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationsListMockTests.java new file mode 100644 index 000000000000..74ed180cf002 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductPackagesOperationsListMockTests.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Flag; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.ProductPackageModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductPackagesOperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"contentId\":\"cf\",\"contentProductId\":\"xyrtqegabsfjrj\",\"contentKind\":\"Solution\",\"contentSchemaVersion\":\"cgorvgdibep\",\"isNew\":\"false\",\"isPreview\":\"false\",\"isFeatured\":\"true\",\"isDeprecated\":\"true\",\"version\":\"qwwsgqziwooetwjs\",\"displayName\":\"azmmbu\",\"description\":\"to\",\"publisherDisplayName\":\"kxfkftqkbyru\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"ucmqfurb\",\"sourceId\":\"ogxlyvebvxjg\"},\"author\":{\"name\":\"sfijwiznbifzvixt\",\"email\":\"jrdx\",\"link\":\"im\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"jja\",\"email\":\"askullvtsauj\",\"link\":\"htz\"},\"dependencies\":{\"contentId\":\"qrpfhzxkjyg\",\"kind\":\"WatchlistTemplate\",\"version\":\"gwdhawjcoz\",\"name\":\"mt\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"dexnkpvoxcmsm\",\"kind\":\"Notebook\",\"version\":\"njg\",\"name\":\"mu\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"fmcnrgwgc\",\"kind\":\"DataType\",\"version\":\"rveehmvrv\",\"name\":\"rpzrysefdhchkk\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"rdlvbomhfqsjzlck\",\"kind\":\"Parser\",\"version\":\"xtee\",\"name\":\"hxgnlpjytle\",\"operator\":\"AND\",\"criteria\":[{},{}]}]},\"providers\":[\"jkrcohhuw\",\"unkzb\",\"eyhwebho\"],\"categories\":{\"domains\":[\"ajmmdmbylynd\"],\"verticals\":[\"jfzxsazu\",\"ohwwtlerh\",\"frar\"]},\"threatAnalysisTactics\":[\"ushs\",\"htvnqcmrrgmlwgo\"],\"threatAnalysisTechniques\":[\"csddlcnwbijxf\",\"ngeffrghwd\",\"rowh\"],\"icon\":\"guvdrggu\",\"installedVersion\":\"awlmsi\",\"metadataResourceId\":\"z\",\"packagedContent\":\"\\\"datadfcphg\\\"\"},\"etag\":\"ijzhrb\",\"id\":\"jvublou\",\"name\":\"lfyqfbgeblpdw\",\"type\":\"kmn\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.productPackagesOperations() + .list("gx", "bn", "urtnwbjjy", "upckhfbmdemohlsh", 656697652, "aoofltb", "ayvmwaejxzkqc", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ijzhrb", response.iterator().next().etag()); + Assertions.assertEquals("cf", response.iterator().next().contentId()); + Assertions.assertEquals("xyrtqegabsfjrj", response.iterator().next().contentProductId()); + Assertions.assertEquals(PackageKind.SOLUTION, response.iterator().next().contentKind()); + Assertions.assertEquals("cgorvgdibep", response.iterator().next().contentSchemaVersion()); + Assertions.assertEquals(Flag.FALSE, response.iterator().next().isNew()); + Assertions.assertEquals(Flag.FALSE, response.iterator().next().isPreview()); + Assertions.assertEquals(Flag.TRUE, response.iterator().next().isFeatured()); + Assertions.assertEquals(Flag.TRUE, response.iterator().next().isDeprecated()); + Assertions.assertEquals("qwwsgqziwooetwjs", response.iterator().next().version()); + Assertions.assertEquals("azmmbu", response.iterator().next().displayName()); + Assertions.assertEquals("to", response.iterator().next().description()); + Assertions.assertEquals("kxfkftqkbyru", response.iterator().next().publisherDisplayName()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, response.iterator().next().source().kind()); + Assertions.assertEquals("ucmqfurb", response.iterator().next().source().name()); + Assertions.assertEquals("ogxlyvebvxjg", response.iterator().next().source().sourceId()); + Assertions.assertEquals("sfijwiznbifzvixt", response.iterator().next().author().name()); + Assertions.assertEquals("jrdx", response.iterator().next().author().email()); + Assertions.assertEquals("im", response.iterator().next().author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, response.iterator().next().support().tier()); + Assertions.assertEquals("jja", response.iterator().next().support().name()); + Assertions.assertEquals("askullvtsauj", response.iterator().next().support().email()); + Assertions.assertEquals("htz", response.iterator().next().support().link()); + Assertions.assertEquals("qrpfhzxkjyg", response.iterator().next().dependencies().contentId()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, response.iterator().next().dependencies().kind()); + Assertions.assertEquals("gwdhawjcoz", response.iterator().next().dependencies().version()); + Assertions.assertEquals("mt", response.iterator().next().dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.iterator().next().dependencies().operator()); + Assertions.assertEquals("dexnkpvoxcmsm", + response.iterator().next().dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.NOTEBOOK, response.iterator().next().dependencies().criteria().get(0).kind()); + Assertions.assertEquals("njg", response.iterator().next().dependencies().criteria().get(0).version()); + Assertions.assertEquals("mu", response.iterator().next().dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + response.iterator().next().dependencies().criteria().get(0).operator()); + Assertions.assertEquals("jkrcohhuw", response.iterator().next().providers().get(0)); + Assertions.assertEquals("ajmmdmbylynd", response.iterator().next().categories().domains().get(0)); + Assertions.assertEquals("jfzxsazu", response.iterator().next().categories().verticals().get(0)); + Assertions.assertEquals("ushs", response.iterator().next().threatAnalysisTactics().get(0)); + Assertions.assertEquals("csddlcnwbijxf", response.iterator().next().threatAnalysisTechniques().get(0)); + Assertions.assertEquals("guvdrggu", response.iterator().next().icon()); + Assertions.assertEquals("awlmsi", response.iterator().next().installedVersion()); + Assertions.assertEquals("z", response.iterator().next().metadataResourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..03f042e1a991 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductSettingsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.productSettings() + .deleteWithResponse("itpbynetyxu", "opocleffgggg", "z", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetWithResponseMockTests.java new file mode 100644 index 000000000000..9c9dd994e6ad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Settings; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductSettingsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"Settings\",\"etag\":\"rxzcnwguezxl\",\"id\":\"mkwbwmgqzq\",\"name\":\"snycchpcjztziuu\",\"type\":\"yvpcfvi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Settings response = manager.productSettings() + .getWithResponse("k", "bvtpqttusuxxbzm", "vueijrnn", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("rxzcnwguezxl", response.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListMockTests.java new file mode 100644 index 000000000000..235cc5c35793 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsListMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Settings; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductSettingsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"Settings\",\"etag\":\"ouppgp\",\"id\":\"mg\",\"name\":\"utnlynplxx\",\"type\":\"bogxkidbcxbgfw\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.productSettings().list("bouhmngccnkgiu", "rvswcpspaoxigp", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ouppgp", response.iterator().next().etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..53dafc0c31ad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductSettingsUpdateWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import com.azure.resourcemanager.securityinsights.models.Settings; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductSettingsUpdateWithResponseMockTests { + @Test + public void testUpdateWithResponse() throws Exception { + String responseStr + = "{\"kind\":\"Settings\",\"etag\":\"yjm\",\"id\":\"nymbeeyskbql\",\"name\":\"aklesjgxdhgezy\",\"type\":\"phaokhbqmxgglk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Settings response = manager.productSettings() + .updateWithResponse("jxciu", "etcxgd", "qkle", new SettingsInner().withEtag("wa"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("yjm", response.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateListTests.java new file mode 100644 index 000000000000..59fa6b693bf0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateListTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.ProductTemplateList; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class ProductTemplateListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProductTemplateList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"contentId\":\"jwrvewojoqfxqetx\",\"contentProductId\":\"qiuspg\",\"packageVersion\":\"l\",\"version\":\"gjijzqjhljsazm\",\"displayName\":\"isfqqhcmecagsbf\",\"contentKind\":\"AzureFunction\",\"source\":{\"kind\":\"Community\",\"name\":\"jygllfkchhgsjuzz\",\"sourceId\":\"jlwmqc\"},\"author\":{\"name\":\"baamkkhdhpmk\",\"email\":\"ujkxpuqzdyoqyws\",\"link\":\"rpzhr\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"xizdsyxbfj\",\"email\":\"buazccouhw\",\"link\":\"kdf\"},\"dependencies\":{\"contentId\":\"knrbxzepi\",\"kind\":\"Watchlist\",\"version\":\"piqdqbvxqto\",\"name\":\"wbopvhcbtza\",\"operator\":\"OR\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"ick\",\"kithueoc\",\"gvuqzgbjwvrudmp\"],\"verticals\":[\"pmi\"]},\"providers\":[\"aj\",\"b\",\"sgyzwph\",\"jkscecmbaajdfw\"],\"customVersion\":\"lvzkfekde\",\"contentSchemaVersion\":\"pjqtllbhjjpduibs\",\"icon\":\"rqnneqryp\",\"threatAnalysisTactics\":[\"vshhovtuercpzhb\",\"cxybtdzy\",\"xhaoegjzgpljbnw\",\"zsrazcbybic\"],\"threatAnalysisTechniques\":[\"h\",\"pua\",\"asizzfmugykwuyc\",\"otennd\"],\"previewImages\":[\"hdzitjzffpherw\",\"qvswtwonadezmzx\",\"fybxmmrvn\"],\"previewImagesDark\":[\"krrs\",\"uogkcbrotpya\",\"ensjfl\"],\"packageId\":\"ftvvqtmvif\",\"packageKind\":\"Standalone\",\"packageName\":\"im\",\"isDeprecated\":\"false\",\"packagedContent\":\"\\\"datat\\\"\"},\"etag\":\"xgosnxa\",\"id\":\"tcdf\",\"name\":\"zxaoxlhmvjcnnls\",\"type\":\"nucqxhpaqo\"},{\"properties\":{\"contentId\":\"ejoysoxovlznk\",\"contentProductId\":\"ldkqdlqqhntqrykk\",\"packageVersion\":\"k\",\"version\":\"uptiicgvpzgyxcc\",\"displayName\":\"xiemacmztje\",\"contentKind\":\"DataType\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"rysgktfm\",\"sourceId\":\"nqbblrtbofzgh\"},\"author\":{\"name\":\"fwxud\",\"email\":\"ohocqxugjxugdcr\",\"link\":\"bplvhmhur\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"lzbdmddghq\",\"email\":\"y\",\"link\":\"rservpvesors\"},\"dependencies\":{\"contentId\":\"c\",\"kind\":\"Playbook\",\"version\":\"afjqzyhzy\",\"name\":\"vtuqvirl\",\"operator\":\"OR\",\"criteria\":[{},{}]},\"categories\":{\"domains\":[\"gtvjxsocsvje\",\"ejchxzjdcw\",\"zscyfyi\",\"ecmasjnfgngxaoje\"],\"verticals\":[\"fxbfckmo\"]},\"providers\":[\"axvwxtxuzh\",\"ojyffwflbkjc\",\"z\"],\"customVersion\":\"tcyzcj\",\"contentSchemaVersion\":\"pubaldjcgl\",\"icon\":\"yvlrlkbhz\",\"threatAnalysisTactics\":[\"xcaujbfomfbo\",\"pjy\",\"e\",\"ppqcwdnn\"],\"threatAnalysisTechniques\":[\"h\",\"snxeby\",\"ympohxubn\",\"pnse\"],\"previewImages\":[\"nous\",\"dyzssjlmykdygj\",\"gspjlf\"],\"previewImagesDark\":[\"ngwqxcrbcrgyoim\"],\"packageId\":\"szzcctvk\",\"packageKind\":\"Solution\",\"packageName\":\"tvagwnnw\",\"isDeprecated\":\"true\",\"packagedContent\":\"\\\"datanyldjdkjvd\\\"\"},\"etag\":\"knkxi\",\"id\":\"hnrjlqdoqejexfdl\",\"name\":\"uhdk\",\"type\":\"bgywadrklpdye\"}],\"nextLink\":\"rwcflvxbocayw\"}") + .toObject(ProductTemplateList.class); + Assertions.assertEquals("xgosnxa", model.value().get(0).etag()); + Assertions.assertEquals("jwrvewojoqfxqetx", model.value().get(0).contentId()); + Assertions.assertEquals("qiuspg", model.value().get(0).contentProductId()); + Assertions.assertEquals("l", model.value().get(0).packageVersion()); + Assertions.assertEquals("gjijzqjhljsazm", model.value().get(0).version()); + Assertions.assertEquals("isfqqhcmecagsbf", model.value().get(0).displayName()); + Assertions.assertEquals(Kind.AZURE_FUNCTION, model.value().get(0).contentKind()); + Assertions.assertEquals(SourceKind.COMMUNITY, model.value().get(0).source().kind()); + Assertions.assertEquals("jygllfkchhgsjuzz", model.value().get(0).source().name()); + Assertions.assertEquals("jlwmqc", model.value().get(0).source().sourceId()); + Assertions.assertEquals("baamkkhdhpmk", model.value().get(0).author().name()); + Assertions.assertEquals("ujkxpuqzdyoqyws", model.value().get(0).author().email()); + Assertions.assertEquals("rpzhr", model.value().get(0).author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, model.value().get(0).support().tier()); + Assertions.assertEquals("xizdsyxbfj", model.value().get(0).support().name()); + Assertions.assertEquals("buazccouhw", model.value().get(0).support().email()); + Assertions.assertEquals("kdf", model.value().get(0).support().link()); + Assertions.assertEquals("knrbxzepi", model.value().get(0).dependencies().contentId()); + Assertions.assertEquals(Kind.WATCHLIST, model.value().get(0).dependencies().kind()); + Assertions.assertEquals("piqdqbvxqto", model.value().get(0).dependencies().version()); + Assertions.assertEquals("wbopvhcbtza", model.value().get(0).dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.value().get(0).dependencies().operator()); + Assertions.assertEquals("ick", model.value().get(0).categories().domains().get(0)); + Assertions.assertEquals("pmi", model.value().get(0).categories().verticals().get(0)); + Assertions.assertEquals("aj", model.value().get(0).providers().get(0)); + Assertions.assertEquals("lvzkfekde", model.value().get(0).customVersion()); + Assertions.assertEquals("pjqtllbhjjpduibs", model.value().get(0).contentSchemaVersion()); + Assertions.assertEquals("rqnneqryp", model.value().get(0).icon()); + Assertions.assertEquals("vshhovtuercpzhb", model.value().get(0).threatAnalysisTactics().get(0)); + Assertions.assertEquals("h", model.value().get(0).threatAnalysisTechniques().get(0)); + Assertions.assertEquals("hdzitjzffpherw", model.value().get(0).previewImages().get(0)); + Assertions.assertEquals("krrs", model.value().get(0).previewImagesDark().get(0)); + Assertions.assertEquals("ftvvqtmvif", model.value().get(0).packageId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.value().get(0).packageKind()); + Assertions.assertEquals("im", model.value().get(0).packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateModelInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateModelInnerTests.java new file mode 100644 index 000000000000..d92adc31da96 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplateModelInnerTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateModelInner; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class ProductTemplateModelInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProductTemplateModelInner model = BinaryData.fromString( + "{\"properties\":{\"contentId\":\"ruptlsrvq\",\"contentProductId\":\"aqsos\",\"packageVersion\":\"j\",\"version\":\"grghn\",\"displayName\":\"oxrqhjninpeswv\",\"contentKind\":\"Standalone\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"bzq\",\"sourceId\":\"csviu\"},\"author\":{\"name\":\"zdvmsnao\",\"email\":\"sxoxvim\",\"link\":\"etqhdbitqsby\"},\"support\":{\"tier\":\"Partner\",\"name\":\"omr\",\"email\":\"u\",\"link\":\"rmsdbvqxgfyg\"},\"dependencies\":{\"contentId\":\"xbdpbcehwbd\",\"kind\":\"DataConnector\",\"version\":\"bo\",\"name\":\"pytporrvkxtfc\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"nq\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"pjnezjighduml\",\"name\":\"mrzwvwetqffux\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},{\"contentId\":\"ngqqxjb\",\"kind\":\"Notebook\",\"version\":\"clmr\",\"name\":\"u\",\"operator\":\"AND\",\"criteria\":[{},{}]}]},\"categories\":{\"domains\":[\"pxbxedhxbboceks\",\"amqchlugfnlvv\",\"swur\"],\"verticals\":[\"hvhauimnntfkqp\",\"qcnbnwivlqcwyzh\",\"dqkzstzpzecdl\"]},\"providers\":[\"r\",\"aht\"],\"customVersion\":\"m\",\"contentSchemaVersion\":\"au\",\"icon\":\"iud\",\"threatAnalysisTactics\":[\"jqrmlujmtunl\",\"fwuzebfq\",\"mpjbh\"],\"threatAnalysisTechniques\":[\"nfspetxeud\",\"khdlckd\",\"xocjcd\"],\"previewImages\":[\"pf\"],\"previewImagesDark\":[\"rtwwyjmgvrlhfxmr\",\"jnnhbcjywkdywks\"],\"packageId\":\"vuafanefictpt\",\"packageKind\":\"Standalone\",\"packageName\":\"ssjbzv\",\"isDeprecated\":\"true\",\"packagedContent\":\"\\\"datadqzu\\\"\"},\"etag\":\"gtiaczhfjdcc\",\"id\":\"yuvb\",\"name\":\"cuhjc\",\"type\":\"jt\"}") + .toObject(ProductTemplateModelInner.class); + Assertions.assertEquals("gtiaczhfjdcc", model.etag()); + Assertions.assertEquals("ruptlsrvq", model.contentId()); + Assertions.assertEquals("aqsos", model.contentProductId()); + Assertions.assertEquals("j", model.packageVersion()); + Assertions.assertEquals("grghn", model.version()); + Assertions.assertEquals("oxrqhjninpeswv", model.displayName()); + Assertions.assertEquals(Kind.STANDALONE, model.contentKind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("bzq", model.source().name()); + Assertions.assertEquals("csviu", model.source().sourceId()); + Assertions.assertEquals("zdvmsnao", model.author().name()); + Assertions.assertEquals("sxoxvim", model.author().email()); + Assertions.assertEquals("etqhdbitqsby", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("omr", model.support().name()); + Assertions.assertEquals("u", model.support().email()); + Assertions.assertEquals("rmsdbvqxgfyg", model.support().link()); + Assertions.assertEquals("xbdpbcehwbd", model.dependencies().contentId()); + Assertions.assertEquals(Kind.DATA_CONNECTOR, model.dependencies().kind()); + Assertions.assertEquals("bo", model.dependencies().version()); + Assertions.assertEquals("pytporrvkxtfc", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("nq", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("pjnezjighduml", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("mrzwvwetqffux", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("pxbxedhxbboceks", model.categories().domains().get(0)); + Assertions.assertEquals("hvhauimnntfkqp", model.categories().verticals().get(0)); + Assertions.assertEquals("r", model.providers().get(0)); + Assertions.assertEquals("m", model.customVersion()); + Assertions.assertEquals("au", model.contentSchemaVersion()); + Assertions.assertEquals("iud", model.icon()); + Assertions.assertEquals("jqrmlujmtunl", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("nfspetxeud", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("pf", model.previewImages().get(0)); + Assertions.assertEquals("rtwwyjmgvrlhfxmr", model.previewImagesDark().get(0)); + Assertions.assertEquals("vuafanefictpt", model.packageId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.packageKind()); + Assertions.assertEquals("ssjbzv", model.packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatePropertiesTests.java new file mode 100644 index 000000000000..3ad63f30e4d9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatePropertiesTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ProductTemplateProperties; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class ProductTemplatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProductTemplateProperties model = BinaryData.fromString( + "{\"contentId\":\"ntomnlzthcdbszsb\",\"contentProductId\":\"rxeyvidcowlrmb\",\"packageVersion\":\"tqxavejoez\",\"version\":\"kryzgavpl\",\"displayName\":\"mdfie\",\"contentKind\":\"AzureFunction\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"yyaeknf\",\"sourceId\":\"yshdawjlmlcufb\"},\"author\":{\"name\":\"utfofhoajjyl\",\"email\":\"qyjnu\",\"link\":\"vlqq\"},\"support\":{\"tier\":\"Partner\",\"name\":\"ceevogir\",\"email\":\"w\",\"link\":\"tvuxeu\"},\"dependencies\":{\"contentId\":\"ssijuaxxfd\",\"kind\":\"AutomationRule\",\"version\":\"cpwsrqnnmjundtl\",\"name\":\"ltjhb\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"kcsihxvta\",\"kind\":\"Parser\",\"version\":\"opxpryxnsbubwhz\",\"name\":\"gugwlux\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"kdhwqcqweba\",\"kind\":\"AzureFunction\",\"version\":\"kephujeucos\",\"name\":\"keer\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"pjpyillgnuee\",\"kind\":\"CustomDetection\",\"version\":\"fbuqxknvmcgmb\",\"name\":\"yojfchicpare\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"qhboojuxilozbl\",\"kind\":\"SummaryRule\",\"version\":\"l\",\"name\":\"ljwtkbpts\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"bmwgftshfgmuxu\",\"kind\":\"AutomationRule\",\"version\":\"sk\",\"name\":\"kuqirhskxpao\",\"operator\":\"OR\",\"criteria\":[{}]}]}]},\"categories\":{\"domains\":[\"eyxfzibrlrjugc\",\"ebpiu\",\"enbvrllldfknb\",\"zwi\"],\"verticals\":[\"ryiqjzlwrd\"]},\"providers\":[\"tpfxxgjahyxfwf\",\"t\",\"veyfbkqynlzxeme\",\"upjckiehdm\"],\"customVersion\":\"rx\",\"contentSchemaVersion\":\"ffgmcuanszeervg\",\"icon\":\"csapvbcqpfus\",\"threatAnalysisTactics\":[\"jh\",\"inenk\"],\"threatAnalysisTechniques\":[\"p\"],\"previewImages\":[\"vorlfqmljewyn\",\"fvvcwvurkmjufa\"],\"previewImagesDark\":[\"npbsotmynklnm\",\"znmtvrk\",\"fcwxizk\",\"txneykeip\"],\"packageId\":\"tc\",\"packageKind\":\"Standalone\",\"packageName\":\"uvnfazx\",\"isDeprecated\":\"false\",\"packagedContent\":\"\\\"datayyaeiivj\\\"\"}") + .toObject(ProductTemplateProperties.class); + Assertions.assertEquals("ntomnlzthcdbszsb", model.contentId()); + Assertions.assertEquals("rxeyvidcowlrmb", model.contentProductId()); + Assertions.assertEquals("tqxavejoez", model.packageVersion()); + Assertions.assertEquals("kryzgavpl", model.version()); + Assertions.assertEquals("mdfie", model.displayName()); + Assertions.assertEquals(Kind.AZURE_FUNCTION, model.contentKind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.source().kind()); + Assertions.assertEquals("yyaeknf", model.source().name()); + Assertions.assertEquals("yshdawjlmlcufb", model.source().sourceId()); + Assertions.assertEquals("utfofhoajjyl", model.author().name()); + Assertions.assertEquals("qyjnu", model.author().email()); + Assertions.assertEquals("vlqq", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("ceevogir", model.support().name()); + Assertions.assertEquals("w", model.support().email()); + Assertions.assertEquals("tvuxeu", model.support().link()); + Assertions.assertEquals("ssijuaxxfd", model.dependencies().contentId()); + Assertions.assertEquals(Kind.AUTOMATION_RULE, model.dependencies().kind()); + Assertions.assertEquals("cpwsrqnnmjundtl", model.dependencies().version()); + Assertions.assertEquals("ltjhb", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("kcsihxvta", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.PARSER, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("opxpryxnsbubwhz", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("gugwlux", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("kdhwqcqweba", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.AZURE_FUNCTION, model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("kephujeucos", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("keer", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("eyxfzibrlrjugc", model.categories().domains().get(0)); + Assertions.assertEquals("ryiqjzlwrd", model.categories().verticals().get(0)); + Assertions.assertEquals("tpfxxgjahyxfwf", model.providers().get(0)); + Assertions.assertEquals("rx", model.customVersion()); + Assertions.assertEquals("ffgmcuanszeervg", model.contentSchemaVersion()); + Assertions.assertEquals("csapvbcqpfus", model.icon()); + Assertions.assertEquals("jh", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("p", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("vorlfqmljewyn", model.previewImages().get(0)); + Assertions.assertEquals("npbsotmynklnm", model.previewImagesDark().get(0)); + Assertions.assertEquals("tc", model.packageId()); + Assertions.assertEquals(PackageKind.STANDALONE, model.packageKind()); + Assertions.assertEquals("uvnfazx", model.packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesGetWithResponseMockTests.java new file mode 100644 index 000000000000..cb68f04c8d96 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesGetWithResponseMockTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductTemplatesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"contentId\":\"pbshqzzlcfemnry\",\"contentProductId\":\"klfswzsyigxsyxhy\",\"packageVersion\":\"zabapeuqy\",\"version\":\"dsuopcdi\",\"displayName\":\"sspcutgkm\",\"contentKind\":\"Parser\",\"source\":{\"kind\":\"Solution\",\"name\":\"llnhgisiwzzkaeq\",\"sourceId\":\"g\"},\"author\":{\"name\":\"tu\",\"email\":\"fwdkpadktsyy\",\"link\":\"ojrfqtfk\"},\"support\":{\"tier\":\"Community\",\"name\":\"mdaj\",\"email\":\"dvvzb\",\"link\":\"xxokif\"},\"dependencies\":{\"contentId\":\"wdyzse\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"tqhnsoijucprkqyw\",\"name\":\"xga\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"zcxlisvqfblsizxp\",\"kind\":\"DataType\",\"version\":\"aploexhimv\",\"name\":\"cdxvhkob\",\"operator\":\"AND\",\"criteria\":[{}]},{\"contentId\":\"ntrdd\",\"kind\":\"Solution\",\"version\":\"anv\",\"name\":\"gmqscijlfulxgnza\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"ooqyp\",\"kind\":\"Solution\",\"version\":\"yzebvghhoyd\",\"name\":\"bvbexrbynnl\",\"operator\":\"AND\",\"criteria\":[{},{},{}]}]},\"categories\":{\"domains\":[\"zzsi\",\"bb\",\"sacrnpscfke\",\"eltxefamimg\"],\"verticals\":[\"jvtgecehennledho\",\"kfjwkctdnnqokqe\"]},\"providers\":[\"lnyjpuy\"],\"customVersion\":\"lpe\",\"contentSchemaVersion\":\"qbnmzkqydt\",\"icon\":\"c\",\"threatAnalysisTactics\":[\"mwvphrwufnfovyli\",\"qlekc\"],\"threatAnalysisTechniques\":[\"hlskeifwqtco\",\"n\",\"iwpptvbudbnuj\",\"mllyjelnhm\"],\"previewImages\":[\"xkofzx\",\"qsl\",\"okbamah\"],\"previewImagesDark\":[\"ccgblepamvlba\"],\"packageId\":\"aojahlqoxwqlnxv\",\"packageKind\":\"Standalone\",\"packageName\":\"jmjzyadafecwnu\",\"isDeprecated\":\"true\",\"packagedContent\":\"\\\"datajcpvhjbzpoh\\\"\"},\"etag\":\"jgpe\",\"id\":\"boxvwtlnv\",\"name\":\"shtujaqpkupnr\",\"type\":\"rje\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ProductTemplateModel response = manager.productTemplates() + .getWithResponse("z", "bzq", "swgfjrg", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("jgpe", response.etag()); + Assertions.assertEquals("pbshqzzlcfemnry", response.contentId()); + Assertions.assertEquals("klfswzsyigxsyxhy", response.contentProductId()); + Assertions.assertEquals("zabapeuqy", response.packageVersion()); + Assertions.assertEquals("dsuopcdi", response.version()); + Assertions.assertEquals("sspcutgkm", response.displayName()); + Assertions.assertEquals(Kind.PARSER, response.contentKind()); + Assertions.assertEquals(SourceKind.SOLUTION, response.source().kind()); + Assertions.assertEquals("llnhgisiwzzkaeq", response.source().name()); + Assertions.assertEquals("g", response.source().sourceId()); + Assertions.assertEquals("tu", response.author().name()); + Assertions.assertEquals("fwdkpadktsyy", response.author().email()); + Assertions.assertEquals("ojrfqtfk", response.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, response.support().tier()); + Assertions.assertEquals("mdaj", response.support().name()); + Assertions.assertEquals("dvvzb", response.support().email()); + Assertions.assertEquals("xxokif", response.support().link()); + Assertions.assertEquals("wdyzse", response.dependencies().contentId()); + Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, response.dependencies().kind()); + Assertions.assertEquals("tqhnsoijucprkqyw", response.dependencies().version()); + Assertions.assertEquals("xga", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().operator()); + Assertions.assertEquals("zcxlisvqfblsizxp", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.DATA_TYPE, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("aploexhimv", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("cdxvhkob", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("zzsi", response.categories().domains().get(0)); + Assertions.assertEquals("jvtgecehennledho", response.categories().verticals().get(0)); + Assertions.assertEquals("lnyjpuy", response.providers().get(0)); + Assertions.assertEquals("lpe", response.customVersion()); + Assertions.assertEquals("qbnmzkqydt", response.contentSchemaVersion()); + Assertions.assertEquals("c", response.icon()); + Assertions.assertEquals("mwvphrwufnfovyli", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("hlskeifwqtco", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("xkofzx", response.previewImages().get(0)); + Assertions.assertEquals("ccgblepamvlba", response.previewImagesDark().get(0)); + Assertions.assertEquals("aojahlqoxwqlnxv", response.packageId()); + Assertions.assertEquals(PackageKind.STANDALONE, response.packageKind()); + Assertions.assertEquals("jmjzyadafecwnu", response.packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationsListMockTests.java new file mode 100644 index 000000000000..07baecec031b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ProductTemplatesOperationsListMockTests.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.ProductTemplateModel; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProductTemplatesOperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"contentId\":\"snfaxtoboafp\",\"contentProductId\":\"lojwczar\",\"packageVersion\":\"tauskish\",\"version\":\"typgrkd\",\"displayName\":\"zaunbwcqti\",\"contentKind\":\"Notebook\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"nrjh\",\"sourceId\":\"ploaepplrd\"},\"author\":{\"name\":\"zujvhu\",\"email\":\"bsxhivncuela\",\"link\":\"xc\"},\"support\":{\"tier\":\"Community\",\"name\":\"lnzdk\",\"email\":\"feavz\",\"link\":\"mmzisljxphwy\"},\"dependencies\":{\"contentId\":\"cpfrakucgjre\",\"kind\":\"Playbook\",\"version\":\"oaboozxkdzmt\",\"name\":\"nyufdemrclsxg\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"tkhihixisd\",\"kind\":\"Playbook\",\"version\":\"keqg\",\"name\":\"jsbtosiwcve\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},{\"contentId\":\"lxocz\",\"kind\":\"Standalone\",\"version\":\"hhwdajfthxswuom\",\"name\":\"on\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"niob\",\"kind\":\"CustomDetection\",\"version\":\"bneiobubtp\",\"name\":\"mppwkryzrdqp\",\"operator\":\"OR\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"qqzbhmyhj\"],\"verticals\":[\"yernckggwiquka\",\"iokeolz\",\"zf\",\"unzm\"]},\"providers\":[\"ttmjomuwl\",\"vjwkpznsfbit\",\"fzgpvdlx\"],\"customVersion\":\"clcuxzl\",\"contentSchemaVersion\":\"wmgqcfggjequ\",\"icon\":\"mpgfspwhfhdguu\",\"threatAnalysisTactics\":[\"vvzvdfytqzx\",\"m\",\"nwpwrfetjg\"],\"threatAnalysisTechniques\":[\"eufhkoernrjm\"],\"previewImages\":[\"asaent\"],\"previewImagesDark\":[\"vddei\"],\"packageId\":\"rjhtpxydiuviu\",\"packageKind\":\"Standalone\",\"packageName\":\"nsyrrybdyqivk\",\"isDeprecated\":\"true\",\"packagedContent\":\"\\\"dataozihdkqdjwthwcpi\\\"\"},\"etag\":\"asnafdjinw\",\"id\":\"rnjgs\",\"name\":\"vzbdhrcepanhy\",\"type\":\"cah\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.productTemplatesOperations() + .list("pdkyscxzsyn", "d", "q", "rnihgothy", "bwge", true, 1607093725, 543533294, "vjxnsorsolarhlyh", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("asnafdjinw", response.iterator().next().etag()); + Assertions.assertEquals("snfaxtoboafp", response.iterator().next().contentId()); + Assertions.assertEquals("lojwczar", response.iterator().next().contentProductId()); + Assertions.assertEquals("tauskish", response.iterator().next().packageVersion()); + Assertions.assertEquals("typgrkd", response.iterator().next().version()); + Assertions.assertEquals("zaunbwcqti", response.iterator().next().displayName()); + Assertions.assertEquals(Kind.NOTEBOOK, response.iterator().next().contentKind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, response.iterator().next().source().kind()); + Assertions.assertEquals("nrjh", response.iterator().next().source().name()); + Assertions.assertEquals("ploaepplrd", response.iterator().next().source().sourceId()); + Assertions.assertEquals("zujvhu", response.iterator().next().author().name()); + Assertions.assertEquals("bsxhivncuela", response.iterator().next().author().email()); + Assertions.assertEquals("xc", response.iterator().next().author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, response.iterator().next().support().tier()); + Assertions.assertEquals("lnzdk", response.iterator().next().support().name()); + Assertions.assertEquals("feavz", response.iterator().next().support().email()); + Assertions.assertEquals("mmzisljxphwy", response.iterator().next().support().link()); + Assertions.assertEquals("cpfrakucgjre", response.iterator().next().dependencies().contentId()); + Assertions.assertEquals(Kind.PLAYBOOK, response.iterator().next().dependencies().kind()); + Assertions.assertEquals("oaboozxkdzmt", response.iterator().next().dependencies().version()); + Assertions.assertEquals("nyufdemrclsxg", response.iterator().next().dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.iterator().next().dependencies().operator()); + Assertions.assertEquals("tkhihixisd", response.iterator().next().dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.PLAYBOOK, response.iterator().next().dependencies().criteria().get(0).kind()); + Assertions.assertEquals("keqg", response.iterator().next().dependencies().criteria().get(0).version()); + Assertions.assertEquals("jsbtosiwcve", response.iterator().next().dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, + response.iterator().next().dependencies().criteria().get(0).operator()); + Assertions.assertEquals("qqzbhmyhj", response.iterator().next().categories().domains().get(0)); + Assertions.assertEquals("yernckggwiquka", response.iterator().next().categories().verticals().get(0)); + Assertions.assertEquals("ttmjomuwl", response.iterator().next().providers().get(0)); + Assertions.assertEquals("clcuxzl", response.iterator().next().customVersion()); + Assertions.assertEquals("wmgqcfggjequ", response.iterator().next().contentSchemaVersion()); + Assertions.assertEquals("mpgfspwhfhdguu", response.iterator().next().icon()); + Assertions.assertEquals("vvzvdfytqzx", response.iterator().next().threatAnalysisTactics().get(0)); + Assertions.assertEquals("eufhkoernrjm", response.iterator().next().threatAnalysisTechniques().get(0)); + Assertions.assertEquals("asaent", response.iterator().next().previewImages().get(0)); + Assertions.assertEquals("vddei", response.iterator().next().previewImagesDark().get(0)); + Assertions.assertEquals("rjhtpxydiuviu", response.iterator().next().packageId()); + Assertions.assertEquals(PackageKind.STANDALONE, response.iterator().next().packageKind()); + Assertions.assertEquals("nsyrrybdyqivk", response.iterator().next().packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayChangedConditionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayChangedConditionPropertiesTests.java index 5fda8d5445bb..ad990bd4682d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayChangedConditionPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayChangedConditionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayConditionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayConditionPropertiesTests.java new file mode 100644 index 000000000000..6c603b384e6a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyArrayConditionPropertiesTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AutomationRuleCondition; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayConditionType; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayConditionSupportedArrayType; +import com.azure.resourcemanager.securityinsights.models.AutomationRulePropertyArrayValuesCondition; +import com.azure.resourcemanager.securityinsights.models.PropertyArrayConditionProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PropertyArrayConditionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PropertyArrayConditionProperties model = BinaryData.fromString( + "{\"conditionType\":\"PropertyArray\",\"conditionProperties\":{\"arrayType\":\"IncidentLabels\",\"arrayConditionType\":\"AllItems\",\"itemConditions\":[{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"},{\"conditionType\":\"AutomationRuleCondition\"}]}}") + .toObject(PropertyArrayConditionProperties.class); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayType.INCIDENT_LABELS, + model.conditionProperties().arrayType()); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayConditionType.ALL_ITEMS, + model.conditionProperties().arrayConditionType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PropertyArrayConditionProperties model = new PropertyArrayConditionProperties() + .withConditionProperties(new AutomationRulePropertyArrayValuesCondition() + .withArrayType(AutomationRulePropertyArrayConditionSupportedArrayType.INCIDENT_LABELS) + .withArrayConditionType(AutomationRulePropertyArrayConditionSupportedArrayConditionType.ALL_ITEMS) + .withItemConditions(Arrays.asList(new AutomationRuleCondition(), new AutomationRuleCondition(), + new AutomationRuleCondition()))); + model = BinaryData.fromObject(model).toObject(PropertyArrayConditionProperties.class); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayType.INCIDENT_LABELS, + model.conditionProperties().arrayType()); + Assertions.assertEquals(AutomationRulePropertyArrayConditionSupportedArrayConditionType.ALL_ITEMS, + model.conditionProperties().arrayConditionType()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyChangedConditionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyChangedConditionPropertiesTests.java index 11b5c1055e10..0ef8560feec8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyChangedConditionPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyChangedConditionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -17,32 +17,32 @@ public final class PropertyChangedConditionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PropertyChangedConditionProperties model = BinaryData.fromString( - "{\"conditionType\":\"PropertyChanged\",\"conditionProperties\":{\"propertyName\":\"IncidentStatus\",\"changeType\":\"ChangedTo\",\"operator\":\"NotStartsWith\",\"propertyValues\":[\"kdasvflyhbxcudch\",\"gsrboldforobw\"]}}") + "{\"conditionType\":\"PropertyChanged\",\"conditionProperties\":{\"propertyName\":\"IncidentSeverity\",\"changeType\":\"ChangedFrom\",\"operator\":\"Contains\",\"propertyValues\":[\"nfhqlyvijouwivk\",\"oyzunbixxr\",\"ikvcpwp\",\"clrcivtsox\"]}}") .toObject(PropertyChangedConditionProperties.class); - Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_STATUS, + Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_SEVERITY, model.conditionProperties().propertyName()); - Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_TO, + Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_FROM, model.conditionProperties().changeType()); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_STARTS_WITH, + Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.CONTAINS, model.conditionProperties().operator()); - Assertions.assertEquals("kdasvflyhbxcudch", model.conditionProperties().propertyValues().get(0)); + Assertions.assertEquals("nfhqlyvijouwivk", model.conditionProperties().propertyValues().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PropertyChangedConditionProperties model = new PropertyChangedConditionProperties() .withConditionProperties(new AutomationRulePropertyValuesChangedCondition() - .withPropertyName(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_STATUS) - .withChangeType(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_TO) - .withOperator(AutomationRulePropertyConditionSupportedOperator.NOT_STARTS_WITH) - .withPropertyValues(Arrays.asList("kdasvflyhbxcudch", "gsrboldforobw"))); + .withPropertyName(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_SEVERITY) + .withChangeType(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_FROM) + .withOperator(AutomationRulePropertyConditionSupportedOperator.CONTAINS) + .withPropertyValues(Arrays.asList("nfhqlyvijouwivk", "oyzunbixxr", "ikvcpwp", "clrcivtsox"))); model = BinaryData.fromObject(model).toObject(PropertyChangedConditionProperties.class); - Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_STATUS, + Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedPropertyType.INCIDENT_SEVERITY, model.conditionProperties().propertyName()); - Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_TO, + Assertions.assertEquals(AutomationRulePropertyChangedConditionSupportedChangedType.CHANGED_FROM, model.conditionProperties().changeType()); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_STARTS_WITH, + Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.CONTAINS, model.conditionProperties().operator()); - Assertions.assertEquals("kdasvflyhbxcudch", model.conditionProperties().propertyValues().get(0)); + Assertions.assertEquals("nfhqlyvijouwivk", model.conditionProperties().propertyValues().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyConditionPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyConditionPropertiesTests.java index f06d0a73e90f..6b25eb4eea9d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyConditionPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PropertyConditionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -16,27 +16,27 @@ public final class PropertyConditionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PropertyConditionProperties model = BinaryData.fromString( - "{\"conditionType\":\"Property\",\"conditionProperties\":{\"propertyName\":\"HostAzureID\",\"operator\":\"NotStartsWith\",\"propertyValues\":[\"fovvacqpbtuodxes\",\"abbelawumuaslzk\",\"rrwoycqucwyhahn\"]}}") + "{\"conditionType\":\"Property\",\"conditionProperties\":{\"propertyName\":\"IncidentTactics\",\"operator\":\"NotStartsWith\",\"propertyValues\":[\"zyqdrfegcealzx\",\"hcans\"]}}") .toObject(PropertyConditionProperties.class); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.HOST_AZURE_ID, + Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.INCIDENT_TACTICS, model.conditionProperties().propertyName()); Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_STARTS_WITH, model.conditionProperties().operator()); - Assertions.assertEquals("fovvacqpbtuodxes", model.conditionProperties().propertyValues().get(0)); + Assertions.assertEquals("zyqdrfegcealzx", model.conditionProperties().propertyValues().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PropertyConditionProperties model = new PropertyConditionProperties().withConditionProperties(new AutomationRulePropertyValuesCondition() - .withPropertyName(AutomationRulePropertyConditionSupportedProperty.HOST_AZURE_ID) + .withPropertyName(AutomationRulePropertyConditionSupportedProperty.INCIDENT_TACTICS) .withOperator(AutomationRulePropertyConditionSupportedOperator.NOT_STARTS_WITH) - .withPropertyValues(Arrays.asList("fovvacqpbtuodxes", "abbelawumuaslzk", "rrwoycqucwyhahn"))); + .withPropertyValues(Arrays.asList("zyqdrfegcealzx", "hcans"))); model = BinaryData.fromObject(model).toObject(PropertyConditionProperties.class); - Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.HOST_AZURE_ID, + Assertions.assertEquals(AutomationRulePropertyConditionSupportedProperty.INCIDENT_TACTICS, model.conditionProperties().propertyName()); Assertions.assertEquals(AutomationRulePropertyConditionSupportedOperator.NOT_STARTS_WITH, model.conditionProperties().operator()); - Assertions.assertEquals("fovvacqpbtuodxes", model.conditionProperties().propertyValues().get(0)); + Assertions.assertEquals("zyqdrfegcealzx", model.conditionProperties().propertyValues().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PullRequestTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PullRequestTests.java new file mode 100644 index 000000000000..2ad1780ebf1a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PullRequestTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.PullRequest; + +public final class PullRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PullRequest model + = BinaryData.fromString("{\"url\":\"imwdcsklkqnqvki\",\"state\":\"Open\"}").toObject(PullRequest.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..be0e7ff5f6ed --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.PurviewAuditCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class PurviewAuditCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PurviewAuditCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"yz\"}").toObject(PurviewAuditCheckRequirementsProperties.class); + Assertions.assertEquals("yz", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PurviewAuditCheckRequirementsProperties model + = new PurviewAuditCheckRequirementsProperties().withTenantId("yz"); + model = BinaryData.fromObject(model).toObject(PurviewAuditCheckRequirementsProperties.class); + Assertions.assertEquals("yz", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsTests.java new file mode 100644 index 000000000000..f6c6c281282e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class PurviewAuditCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PurviewAuditCheckRequirements model + = BinaryData.fromString("{\"kind\":\"PurviewAudit\",\"properties\":{\"tenantId\":\"ketotktdmewwlk\"}}") + .toObject(PurviewAuditCheckRequirements.class); + Assertions.assertEquals("ketotktdmewwlk", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PurviewAuditCheckRequirements model = new PurviewAuditCheckRequirements().withTenantId("ketotktdmewwlk"); + model = BinaryData.fromObject(model).toObject(PurviewAuditCheckRequirements.class); + Assertions.assertEquals("ketotktdmewwlk", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesLogsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesLogsTests.java new file mode 100644 index 000000000000..6bcc20458190 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesLogsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class PurviewAuditConnectorDataTypesLogsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PurviewAuditConnectorDataTypesLogs model + = BinaryData.fromString("{\"state\":\"Disabled\"}").toObject(PurviewAuditConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PurviewAuditConnectorDataTypesLogs model + = new PurviewAuditConnectorDataTypesLogs().withState(DataTypeState.DISABLED); + model = BinaryData.fromObject(model).toObject(PurviewAuditConnectorDataTypesLogs.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesTests.java new file mode 100644 index 000000000000..0bee2f573540 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditConnectorDataTypesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class PurviewAuditConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PurviewAuditConnectorDataTypes model = BinaryData.fromString("{\"logs\":{\"state\":\"Enabled\"}}") + .toObject(PurviewAuditConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PurviewAuditConnectorDataTypes model = new PurviewAuditConnectorDataTypes() + .withLogs(new PurviewAuditConnectorDataTypesLogs().withState(DataTypeState.ENABLED)); + model = BinaryData.fromObject(model).toObject(PurviewAuditConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..54e1a7a8ac90 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorPropertiesTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.PurviewAuditDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypesLogs; +import org.junit.jupiter.api.Assertions; + +public final class PurviewAuditDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PurviewAuditDataConnectorProperties model = BinaryData.fromString( + "{\"connectorDefinitionName\":\"igaw\",\"sourceType\":\"zmxjqif\",\"dcrConfig\":{\"dataCollectionEndpoint\":\"jjsbcmlzaahzbhur\",\"dataCollectionRuleImmutableId\":\"olk\",\"streamName\":\"lirh\"},\"dataTypes\":{\"logs\":{\"state\":\"Enabled\"}},\"tenantId\":\"ojusuzgfjzcva\"}") + .toObject(PurviewAuditDataConnectorProperties.class); + Assertions.assertEquals("ojusuzgfjzcva", model.tenantId()); + Assertions.assertEquals("igaw", model.connectorDefinitionName()); + Assertions.assertEquals("zmxjqif", model.sourceType()); + Assertions.assertEquals("jjsbcmlzaahzbhur", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("olk", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("lirh", model.dcrConfig().streamName()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PurviewAuditDataConnectorProperties model + = new PurviewAuditDataConnectorProperties().withTenantId("ojusuzgfjzcva") + .withConnectorDefinitionName("igaw") + .withSourceType("zmxjqif") + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint("jjsbcmlzaahzbhur") + .withDataCollectionRuleImmutableId("olk") + .withStreamName("lirh")) + .withDataTypes(new PurviewAuditConnectorDataTypes() + .withLogs(new PurviewAuditConnectorDataTypesLogs().withState(DataTypeState.ENABLED))); + model = BinaryData.fromObject(model).toObject(PurviewAuditDataConnectorProperties.class); + Assertions.assertEquals("ojusuzgfjzcva", model.tenantId()); + Assertions.assertEquals("igaw", model.connectorDefinitionName()); + Assertions.assertEquals("zmxjqif", model.sourceType()); + Assertions.assertEquals("jjsbcmlzaahzbhur", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("olk", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("lirh", model.dcrConfig().streamName()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().logs().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorTests.java new file mode 100644 index 000000000000..49eedfc4b248 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/PurviewAuditDataConnectorTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditConnectorDataTypesLogs; +import com.azure.resourcemanager.securityinsights.models.PurviewAuditDataConnector; +import org.junit.jupiter.api.Assertions; + +public final class PurviewAuditDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PurviewAuditDataConnector model = BinaryData.fromString( + "{\"kind\":\"PurviewAudit\",\"properties\":{\"connectorDefinitionName\":\"dobygoogxqapj\",\"sourceType\":\"azyj\",\"dcrConfig\":{\"dataCollectionEndpoint\":\"csa\",\"dataCollectionRuleImmutableId\":\"djnosdkvibf\",\"streamName\":\"sgm\"},\"dataTypes\":{\"logs\":{\"state\":\"Disabled\"}},\"tenantId\":\"rnzpducdaak\"},\"etag\":\"jktzboimyfpq\",\"id\":\"wkppnwyytfvp\",\"name\":\"tfjikffffgkuh\",\"type\":\"nwhvuldbkkejj\"}") + .toObject(PurviewAuditDataConnector.class); + Assertions.assertEquals("jktzboimyfpq", model.etag()); + Assertions.assertEquals("dobygoogxqapj", model.connectorDefinitionName()); + Assertions.assertEquals("azyj", model.sourceType()); + Assertions.assertEquals("csa", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("djnosdkvibf", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("sgm", model.dcrConfig().streamName()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("rnzpducdaak", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PurviewAuditDataConnector model = new PurviewAuditDataConnector().withEtag("jktzboimyfpq") + .withConnectorDefinitionName("dobygoogxqapj") + .withSourceType("azyj") + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint("csa") + .withDataCollectionRuleImmutableId("djnosdkvibf") + .withStreamName("sgm")) + .withDataTypes(new PurviewAuditConnectorDataTypes() + .withLogs(new PurviewAuditConnectorDataTypesLogs().withState(DataTypeState.DISABLED))) + .withTenantId("rnzpducdaak"); + model = BinaryData.fromObject(model).toObject(PurviewAuditDataConnector.class); + Assertions.assertEquals("jktzboimyfpq", model.etag()); + Assertions.assertEquals("dobygoogxqapj", model.connectorDefinitionName()); + Assertions.assertEquals("azyj", model.sourceType()); + Assertions.assertEquals("csa", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("djnosdkvibf", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("sgm", model.dcrConfig().streamName()); + Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().logs().state()); + Assertions.assertEquals("rnzpducdaak", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryConditionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryConditionTests.java new file mode 100644 index 000000000000..548f3e849965 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryConditionTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.Connective; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.QueryCondition; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class QueryConditionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QueryCondition model = BinaryData.fromString( + "{\"stixObjectType\":\"yksfyzevcknglffn\",\"clauses\":[{\"clauseConnective\":\"Or\",\"field\":\"ysffrpjf\",\"operator\":\"AfterAbsolute\",\"values\":[\"xcdo\"]}],\"conditionConnective\":\"Or\"}") + .toObject(QueryCondition.class); + Assertions.assertEquals("yksfyzevcknglffn", model.stixObjectType()); + Assertions.assertEquals("ysffrpjf", model.clauses().get(0).field()); + Assertions.assertEquals(Operator.AFTER_ABSOLUTE, model.clauses().get(0).operator()); + Assertions.assertEquals("xcdo", model.clauses().get(0).values().get(0)); + Assertions.assertEquals(Connective.OR, model.conditionConnective()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + QueryCondition model = new QueryCondition().withStixObjectType("yksfyzevcknglffn") + .withClauses(Arrays.asList(new ConditionClause().withField("ysffrpjf") + .withOperator(Operator.AFTER_ABSOLUTE) + .withValues(Arrays.asList("xcdo")))) + .withConditionConnective(Connective.OR); + model = BinaryData.fromObject(model).toObject(QueryCondition.class); + Assertions.assertEquals("yksfyzevcknglffn", model.stixObjectType()); + Assertions.assertEquals("ysffrpjf", model.clauses().get(0).field()); + Assertions.assertEquals(Operator.AFTER_ABSOLUTE, model.clauses().get(0).operator()); + Assertions.assertEquals("xcdo", model.clauses().get(0).values().get(0)); + Assertions.assertEquals(Connective.OR, model.conditionConnective()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryPropertiesTests.java new file mode 100644 index 000000000000..15ab186191c1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.QueryProperties; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.ConditionProperties; +import com.azure.resourcemanager.securityinsights.models.Operator; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class QueryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QueryProperties model = BinaryData.fromString( + "{\"condition\":{\"stixObjectType\":\"lcfzfjdzkfthsyd\",\"clauses\":[{\"clauseConnective\":\"And\",\"field\":\"zzetfg\",\"operator\":\"StringEndsWith\",\"values\":[\"bvhvd\"]}],\"conditionConnective\":\"And\"}}") + .toObject(QueryProperties.class); + Assertions.assertEquals("zzetfg", model.condition().clauses().get(0).field()); + Assertions.assertEquals(Operator.STRING_ENDS_WITH, model.condition().clauses().get(0).operator()); + Assertions.assertEquals("bvhvd", model.condition().clauses().get(0).values().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + QueryProperties model = new QueryProperties() + .withCondition(new ConditionProperties().withClauses(Arrays.asList(new ConditionClause().withField("zzetfg") + .withOperator(Operator.STRING_ENDS_WITH) + .withValues(Arrays.asList("bvhvd"))))); + model = BinaryData.fromObject(model).toObject(QueryProperties.class); + Assertions.assertEquals("zzetfg", model.condition().clauses().get(0).field()); + Assertions.assertEquals(Operator.STRING_ENDS_WITH, model.condition().clauses().get(0).operator()); + Assertions.assertEquals("bvhvd", model.condition().clauses().get(0).values().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QuerySortByTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QuerySortByTests.java new file mode 100644 index 000000000000..c66715138e1e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QuerySortByTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.QuerySortBy; +import com.azure.resourcemanager.securityinsights.models.SortingDirection; +import org.junit.jupiter.api.Assertions; + +public final class QuerySortByTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuerySortBy model = BinaryData.fromString("{\"direction\":\"DESC\",\"field\":\"ufrspreyilqcskxk\"}") + .toObject(QuerySortBy.class); + Assertions.assertEquals(SortingDirection.DESC, model.direction()); + Assertions.assertEquals("ufrspreyilqcskxk", model.field()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + QuerySortBy model = new QuerySortBy().withDirection(SortingDirection.DESC).withField("ufrspreyilqcskxk"); + model = BinaryData.fromObject(model).toObject(QuerySortBy.class); + Assertions.assertEquals(SortingDirection.DESC, model.direction()); + Assertions.assertEquals("ufrspreyilqcskxk", model.field()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryTests.java new file mode 100644 index 000000000000..84ad298e9f41 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/QueryTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.Connective; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.QueryCondition; +import com.azure.resourcemanager.securityinsights.models.QuerySortBy; +import com.azure.resourcemanager.securityinsights.models.SortingDirection; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class QueryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Query model = BinaryData.fromString( + "{\"condition\":{\"stixObjectType\":\"wyfcenkbfxqcap\",\"clauses\":[{\"clauseConnective\":\"And\",\"field\":\"iradmxokbutbbz\",\"operator\":\"LessThan\",\"values\":[\"ayvcsejdh\"]},{\"clauseConnective\":\"And\",\"field\":\"yiitreddj\",\"operator\":\"AfterRelative\",\"values\":[\"ppybseckg\",\"xm\",\"aszji\",\"tfstdwqdvzc\"]},{\"clauseConnective\":\"And\",\"field\":\"vwrjtk\",\"operator\":\"ArrayNotContains\",\"values\":[\"soj\",\"uswmgrbkobmgwavz\"]},{\"clauseConnective\":\"Or\",\"field\":\"aalwid\",\"operator\":\"AfterRelative\",\"values\":[\"wedj\",\"ikzppgijncuba\",\"cxepgaxpydemccq\",\"ssbmgersd\"]}],\"conditionConnective\":\"Or\"},\"sortBy\":{\"direction\":\"DESC\",\"field\":\"nfgzmx\"},\"maxPageSize\":129637686,\"minPageSize\":138786533}") + .toObject(Query.class); + Assertions.assertEquals("wyfcenkbfxqcap", model.condition().stixObjectType()); + Assertions.assertEquals("iradmxokbutbbz", model.condition().clauses().get(0).field()); + Assertions.assertEquals(Operator.LESS_THAN, model.condition().clauses().get(0).operator()); + Assertions.assertEquals("ayvcsejdh", model.condition().clauses().get(0).values().get(0)); + Assertions.assertEquals(Connective.OR, model.condition().conditionConnective()); + Assertions.assertEquals(SortingDirection.DESC, model.sortBy().direction()); + Assertions.assertEquals("nfgzmx", model.sortBy().field()); + Assertions.assertEquals(129637686, model.maxPageSize()); + Assertions.assertEquals(138786533, model.minPageSize()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Query model = new Query() + .withCondition(new QueryCondition().withStixObjectType("wyfcenkbfxqcap") + .withClauses(Arrays.asList( + new ConditionClause().withField("iradmxokbutbbz") + .withOperator(Operator.LESS_THAN) + .withValues(Arrays.asList("ayvcsejdh")), + new ConditionClause().withField("yiitreddj") + .withOperator(Operator.AFTER_RELATIVE) + .withValues(Arrays.asList("ppybseckg", "xm", "aszji", "tfstdwqdvzc")), + new ConditionClause().withField("vwrjtk") + .withOperator(Operator.ARRAY_NOT_CONTAINS) + .withValues(Arrays.asList("soj", "uswmgrbkobmgwavz")), + new ConditionClause().withField("aalwid") + .withOperator(Operator.AFTER_RELATIVE) + .withValues(Arrays.asList("wedj", "ikzppgijncuba", "cxepgaxpydemccq", "ssbmgersd")))) + .withConditionConnective(Connective.OR)) + .withSortBy(new QuerySortBy().withDirection(SortingDirection.DESC).withField("nfgzmx")) + .withMaxPageSize(129637686) + .withMinPageSize(138786533); + model = BinaryData.fromObject(model).toObject(Query.class); + Assertions.assertEquals("wyfcenkbfxqcap", model.condition().stixObjectType()); + Assertions.assertEquals("iradmxokbutbbz", model.condition().clauses().get(0).field()); + Assertions.assertEquals(Operator.LESS_THAN, model.condition().clauses().get(0).operator()); + Assertions.assertEquals("ayvcsejdh", model.condition().clauses().get(0).values().get(0)); + Assertions.assertEquals(Connective.OR, model.condition().conditionConnective()); + Assertions.assertEquals(SortingDirection.DESC, model.sortBy().direction()); + Assertions.assertEquals("nfgzmx", model.sortBy().field()); + Assertions.assertEquals(129637686, model.maxPageSize()); + Assertions.assertEquals(138786533, model.minPageSize()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationInnerTests.java new file mode 100644 index 000000000000..ecdf181e9783 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationInnerTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationInner; +import com.azure.resourcemanager.securityinsights.models.State; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RecommendationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendationInner model = BinaryData.fromString( + "{\"properties\":{\"recommendationTypeId\":\"yuhdqhqgrksypoo\",\"state\":\"Active\",\"title\":\"xzobovsvhbtdgxg\",\"description\":\"lmdeoub\",\"creationTimeUtc\":\"2021-07-08T00:00:43Z\",\"lastEvaluatedTimeUtc\":\"2021-01-30T04:45:35Z\",\"lastModifiedTimeUtc\":\"2021-12-01T09:42:17Z\",\"suggestions\":[{\"suggestionTypeId\":\"wem\",\"title\":\"cjhmvvzeaicm\",\"description\":\"bsjtfqwlb\",\"action\":\"qczzscgrop\",\"additionalProperties\":{\"cgkociyikqlyoorm\":\"i\",\"bcpiadjslvxs\":\"wgglqijykckyhxuz\"}},{\"suggestionTypeId\":\"lcd\",\"title\":\"bibfviacghygmt\",\"description\":\"ivpzjnrw\",\"action\":\"fzzmxqyjy\",\"additionalProperties\":{\"ewvlkzmsyezxifj\":\"pyo\"}},{\"suggestionTypeId\":\"vhuovfotwv\",\"title\":\"uhtdxdcodzdhe\",\"description\":\"nmcvmxiundif\",\"action\":\"ahtkkccrusrz\",\"additionalProperties\":{\"lvtiploaws\":\"qodyafayx\",\"ynjtudfhpelza\":\"ctilbxn\"}},{\"suggestionTypeId\":\"ohvdbncdrchue\",\"title\":\"xliqcbonqjoekcjc\",\"description\":\"lvobctitexrbalv\",\"action\":\"fdqilprqhxfqk\",\"additionalProperties\":{\"jvdxhyfvqtdexfd\":\"yrqlazfjltck\",\"ww\":\"pxalkqlvbkzaiyr\",\"igbjbelnqalbso\":\"iviniyoizuwwzc\",\"qjb\":\"xajsiueai\"}}],\"resourceId\":\"bwxuypcuriwll\",\"additionalProperties\":{\"xrymiysghhcmq\":\"lveqdqtzshwlw\"}},\"etag\":\"kkw\",\"id\":\"e\",\"name\":\"bvdu\",\"type\":\"mkaadnxbs\"}") + .toObject(RecommendationInner.class); + Assertions.assertEquals("kkw", model.etag()); + Assertions.assertEquals("yuhdqhqgrksypoo", model.recommendationTypeId()); + Assertions.assertEquals(State.ACTIVE, model.state()); + Assertions.assertEquals("xzobovsvhbtdgxg", model.title()); + Assertions.assertEquals("lmdeoub", model.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-08T00:00:43Z"), model.creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-30T04:45:35Z"), model.lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T09:42:17Z"), model.lastModifiedTimeUtc()); + Assertions.assertEquals("wem", model.suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("cjhmvvzeaicm", model.suggestions().get(0).title()); + Assertions.assertEquals("bsjtfqwlb", model.suggestions().get(0).description()); + Assertions.assertEquals("qczzscgrop", model.suggestions().get(0).action()); + Assertions.assertEquals("i", model.suggestions().get(0).additionalProperties().get("cgkociyikqlyoorm")); + Assertions.assertEquals("bwxuypcuriwll", model.resourceId()); + Assertions.assertEquals("lveqdqtzshwlw", model.additionalProperties().get("xrymiysghhcmq")); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationListTests.java new file mode 100644 index 000000000000..1fcf11ab5faa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationListTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.RecommendationList; +import com.azure.resourcemanager.securityinsights.models.State; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RecommendationListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendationList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"recommendationTypeId\":\"gcvgebfeityantec\",\"state\":\"Active\",\"title\":\"tkgopdjqnsicucq\",\"description\":\"eciexsc\",\"creationTimeUtc\":\"2020-12-31T16:58:15Z\",\"lastEvaluatedTimeUtc\":\"2021-07-18T22:22:31Z\",\"lastModifiedTimeUtc\":\"2021-08-23T13:27:19Z\",\"suggestions\":[{\"suggestionTypeId\":\"jlypwgwbycfam\",\"title\":\"ikisppygothi\",\"description\":\"irhhbogxw\",\"action\":\"gpymyerpusozaou\",\"additionalProperties\":{\"nwdkgbzjoyypt\":\"iw\"}},{\"suggestionTypeId\":\"okd\",\"title\":\"qxkzeowizvj\",\"description\":\"jzxkflzqw\",\"action\":\"xxboauvkkc\",\"additionalProperties\":{\"tnwchuqm\":\"nwhld\",\"lcvlmrvhedrbzzb\":\"ynmt\",\"xwcndkdlxdlh\":\"yag\",\"j\":\"alz\"}},{\"suggestionTypeId\":\"wkyxowno\",\"title\":\"pqussxiajicr\",\"description\":\"dgtjxlopnccaxtpp\",\"action\":\"szehij\",\"additionalProperties\":{\"hjmg\":\"feabzjp\",\"xymfqmvnhsf\":\"ceqaklsfxlrx\",\"dptsp\":\"xtusbjxpuok\",\"asjwnwnj\":\"gtplonalpwaulkwu\"}},{\"suggestionTypeId\":\"rnfgtmupblhnxq\",\"title\":\"zzikxufuwcajy\",\"description\":\"zlku\",\"action\":\"veft\",\"additionalProperties\":{\"bpnrgnxwrfu\":\"wsvlfp\",\"xzyfqcjc\":\"zaysfzuvu\"}}],\"resourceId\":\"bqo\",\"additionalProperties\":{\"ubxlmqhedbqrlbyh\":\"ueytphnazpgvf\"}},\"etag\":\"fuupqkrzvd\",\"id\":\"cevbkk\",\"name\":\"qfjwgphhpw\",\"type\":\"g\"}],\"nextLink\":\"wfqzwysm\"}") + .toObject(RecommendationList.class); + Assertions.assertEquals("fuupqkrzvd", model.value().get(0).etag()); + Assertions.assertEquals("gcvgebfeityantec", model.value().get(0).recommendationTypeId()); + Assertions.assertEquals(State.ACTIVE, model.value().get(0).state()); + Assertions.assertEquals("tkgopdjqnsicucq", model.value().get(0).title()); + Assertions.assertEquals("eciexsc", model.value().get(0).description()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-31T16:58:15Z"), model.value().get(0).creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T22:22:31Z"), + model.value().get(0).lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-23T13:27:19Z"), + model.value().get(0).lastModifiedTimeUtc()); + Assertions.assertEquals("jlypwgwbycfam", model.value().get(0).suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("ikisppygothi", model.value().get(0).suggestions().get(0).title()); + Assertions.assertEquals("irhhbogxw", model.value().get(0).suggestions().get(0).description()); + Assertions.assertEquals("gpymyerpusozaou", model.value().get(0).suggestions().get(0).action()); + Assertions.assertEquals("iw", + model.value().get(0).suggestions().get(0).additionalProperties().get("nwdkgbzjoyypt")); + Assertions.assertEquals("bqo", model.value().get(0).resourceId()); + Assertions.assertEquals("ueytphnazpgvf", model.value().get(0).additionalProperties().get("ubxlmqhedbqrlbyh")); + Assertions.assertEquals("wfqzwysm", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchPropertiesTests.java new file mode 100644 index 000000000000..feb0d3dfb7c6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchPropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties; +import com.azure.resourcemanager.securityinsights.models.State; +import org.junit.jupiter.api.Assertions; + +public final class RecommendationPatchPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendationPatchProperties model + = BinaryData.fromString("{\"state\":\"CompletedBySystem\"}").toObject(RecommendationPatchProperties.class); + Assertions.assertEquals(State.COMPLETED_BY_SYSTEM, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecommendationPatchProperties model = new RecommendationPatchProperties().withState(State.COMPLETED_BY_SYSTEM); + model = BinaryData.fromObject(model).toObject(RecommendationPatchProperties.class); + Assertions.assertEquals(State.COMPLETED_BY_SYSTEM, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchTests.java new file mode 100644 index 000000000000..a81423da1ac9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPatchTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties; +import com.azure.resourcemanager.securityinsights.models.State; +import org.junit.jupiter.api.Assertions; + +public final class RecommendationPatchTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendationPatch model + = BinaryData.fromString("{\"properties\":{\"state\":\"Active\"}}").toObject(RecommendationPatch.class); + Assertions.assertEquals(State.ACTIVE, model.properties().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RecommendationPatch model + = new RecommendationPatch().withProperties(new RecommendationPatchProperties().withState(State.ACTIVE)); + model = BinaryData.fromObject(model).toObject(RecommendationPatch.class); + Assertions.assertEquals(State.ACTIVE, model.properties().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPropertiesTests.java new file mode 100644 index 000000000000..f3c2c1b61cab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendationPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.RecommendationProperties; +import com.azure.resourcemanager.securityinsights.models.State; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RecommendationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendationProperties model = BinaryData.fromString( + "{\"recommendationTypeId\":\"atpialrqhwcxxccf\",\"state\":\"Active\",\"title\":\"v\",\"description\":\"za\",\"creationTimeUtc\":\"2021-10-09T14:28:24Z\",\"lastEvaluatedTimeUtc\":\"2021-05-17T04:32:38Z\",\"lastModifiedTimeUtc\":\"2021-11-13T15:23:51Z\",\"suggestions\":[{\"suggestionTypeId\":\"xitpzriknosclujy\",\"title\":\"w\",\"description\":\"mbusnaw\",\"action\":\"ncljkh\",\"additionalProperties\":{\"iclrmmu\":\"buaho\",\"lizd\":\"vowtbscidkwznwt\",\"uybcp\":\"ysmzgbogdj\"}},{\"suggestionTypeId\":\"dvuotkvkbpmk\",\"title\":\"pbnkcwauylkbdsk\",\"description\":\"pyfrtlukafq\",\"action\":\"ylempahyuxxeik\",\"additionalProperties\":{\"vvysphjkxgfmesx\":\"pwrnhqaf\"}},{\"suggestionTypeId\":\"e\",\"title\":\"qfynvckx\",\"description\":\"anlvo\",\"action\":\"rvzhdn\",\"additionalProperties\":{\"vxp\":\"uwtpssgqlnols\",\"atptzkmfvdrkcw\":\"egxlzd\"}}],\"resourceId\":\"mnwsffiahfd\",\"additionalProperties\":{\"irxxkmozkdqzh\":\"z\",\"wm\":\"hkivvpyzn\"}}") + .toObject(RecommendationProperties.class); + Assertions.assertEquals("atpialrqhwcxxccf", model.recommendationTypeId()); + Assertions.assertEquals(State.ACTIVE, model.state()); + Assertions.assertEquals("v", model.title()); + Assertions.assertEquals("za", model.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T14:28:24Z"), model.creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-17T04:32:38Z"), model.lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-13T15:23:51Z"), model.lastModifiedTimeUtc()); + Assertions.assertEquals("xitpzriknosclujy", model.suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("w", model.suggestions().get(0).title()); + Assertions.assertEquals("mbusnaw", model.suggestions().get(0).description()); + Assertions.assertEquals("ncljkh", model.suggestions().get(0).action()); + Assertions.assertEquals("buaho", model.suggestions().get(0).additionalProperties().get("iclrmmu")); + Assertions.assertEquals("mnwsffiahfd", model.resourceId()); + Assertions.assertEquals("z", model.additionalProperties().get("irxxkmozkdqzh")); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendedSuggestionTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendedSuggestionTests.java new file mode 100644 index 000000000000..97d63279cf3f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RecommendedSuggestionTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.RecommendedSuggestion; +import org.junit.jupiter.api.Assertions; + +public final class RecommendedSuggestionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecommendedSuggestion model = BinaryData.fromString( + "{\"suggestionTypeId\":\"uuzny\",\"title\":\"bzzwsesqytktvof\",\"description\":\"xorhsxcsoaxcme\",\"action\":\"kpxt\",\"additionalProperties\":{\"hslnbyiowet\":\"nkubwkd\"}}") + .toObject(RecommendedSuggestion.class); + Assertions.assertEquals("uuzny", model.suggestionTypeId()); + Assertions.assertEquals("bzzwsesqytktvof", model.title()); + Assertions.assertEquals("xorhsxcsoaxcme", model.description()); + Assertions.assertEquals("kpxt", model.action()); + Assertions.assertEquals("nkubwkd", model.additionalProperties().get("hslnbyiowet")); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateResponseInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateResponseInnerTests.java new file mode 100644 index 000000000000..4431bc4453dd --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluateResponseInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ReevaluateResponseInner; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ReevaluateResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ReevaluateResponseInner model = BinaryData.fromString("{\"lastEvaluatedTimeUtc\":\"2021-04-15T09:30:50Z\"}") + .toObject(ReevaluateResponseInner.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T09:30:50Z"), model.lastEvaluatedTimeUtc()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java new file mode 100644 index 000000000000..f6cf77880f2b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.ReevaluateResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ReevaluatesRecommendationWithResponseMockTests { + @Test + public void testRecommendationWithResponse() throws Exception { + String responseStr = "{\"lastEvaluatedTimeUtc\":\"2021-09-19T02:20:01Z\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ReevaluateResponse response = manager.reevaluates() + .recommendationWithResponse("pmvppvgrigjegrl", "koqbzrc", "arrtfmfkuv", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T02:20:01Z"), response.lastEvaluatedTimeUtc()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationInnerTests.java index dbd4898197a0..b899bb3053fd 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,17 +12,17 @@ public final class RelationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RelationInner model = BinaryData.fromString( - "{\"properties\":{\"relatedResourceId\":\"wlycoduhpkxkg\",\"relatedResourceName\":\"areqna\",\"relatedResourceType\":\"qugjhkycube\",\"relatedResourceKind\":\"gssofwq\"},\"etag\":\"qal\",\"id\":\"mnjijpxacqqudf\",\"name\":\"byxbaaabjy\",\"type\":\"ayffim\"}") + "{\"properties\":{\"relatedResourceId\":\"vqdorbccqcd\",\"relatedResourceName\":\"hojvlirkn\",\"relatedResourceType\":\"osa\",\"relatedResourceKind\":\"dtnagzlgpyaix\"},\"etag\":\"zqjjt\",\"id\":\"uy\",\"name\":\"qfttkacybdueur\",\"type\":\"mcdcpkshl\"}") .toObject(RelationInner.class); - Assertions.assertEquals("qal", model.etag()); - Assertions.assertEquals("wlycoduhpkxkg", model.relatedResourceId()); + Assertions.assertEquals("zqjjt", model.etag()); + Assertions.assertEquals("vqdorbccqcd", model.relatedResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RelationInner model = new RelationInner().withEtag("qal").withRelatedResourceId("wlycoduhpkxkg"); + RelationInner model = new RelationInner().withEtag("zqjjt").withRelatedResourceId("vqdorbccqcd"); model = BinaryData.fromObject(model).toObject(RelationInner.class); - Assertions.assertEquals("qal", model.etag()); - Assertions.assertEquals("wlycoduhpkxkg", model.relatedResourceId()); + Assertions.assertEquals("zqjjt", model.etag()); + Assertions.assertEquals("vqdorbccqcd", model.relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationListTests.java index bd18da7a04bb..5eabcb06f574 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationListTests.java @@ -1,31 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; -import com.azure.resourcemanager.securityinsights.models.RelationList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.RelationList; import org.junit.jupiter.api.Assertions; public final class RelationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RelationList model = BinaryData.fromString( - "{\"nextLink\":\"tx\",\"value\":[{\"properties\":{\"relatedResourceId\":\"skfc\",\"relatedResourceName\":\"qumiek\",\"relatedResourceType\":\"zzikhlyfjhdg\",\"relatedResourceKind\":\"gebdunygaeq\"},\"etag\":\"bqfatpxllrxcyjmo\",\"id\":\"su\",\"name\":\"arm\",\"type\":\"wdmjsjqbjhhyx\"}]}") + "{\"value\":[{\"properties\":{\"relatedResourceId\":\"jnxkbylhyyxgffk\",\"relatedResourceName\":\"q\",\"relatedResourceType\":\"wtrdgs\",\"relatedResourceKind\":\"vq\"},\"etag\":\"nsgnwxlwmez\",\"id\":\"hxpthceop\",\"name\":\"kvtwfvesobpbo\",\"type\":\"hmmlc\"},{\"properties\":{\"relatedResourceId\":\"arnggcjfwblqh\",\"relatedResourceName\":\"asmcolmugpyvaos\",\"relatedResourceType\":\"l\",\"relatedResourceKind\":\"zxeygzvtye\"},\"etag\":\"hubnobgu\",\"id\":\"sqsqkpdmioyjpnml\",\"name\":\"iqcpszpmcvq\",\"type\":\"vrdmvxyrxdh\"},{\"properties\":{\"relatedResourceId\":\"qojbxao\",\"relatedResourceName\":\"gbzxmbtplefoioy\",\"relatedResourceType\":\"oxznvgvd\",\"relatedResourceKind\":\"uuvdawsx\"},\"etag\":\"szbknimxl\",\"id\":\"erxrzutylcurza\",\"name\":\"mnb\",\"type\":\"qaeht\"},{\"properties\":{\"relatedResourceId\":\"jmbnvynf\",\"relatedResourceName\":\"oeactedcglskakdd\",\"relatedResourceType\":\"ahzllrqmtlpb\",\"relatedResourceKind\":\"roid\"},\"etag\":\"qypffmnoiicsu\",\"id\":\"hbrj\",\"name\":\"talxrdsj\",\"type\":\"h\"}],\"nextLink\":\"uqwg\"}") .toObject(RelationList.class); - Assertions.assertEquals("bqfatpxllrxcyjmo", model.value().get(0).etag()); - Assertions.assertEquals("skfc", model.value().get(0).relatedResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RelationList model = new RelationList() - .withValue(Arrays.asList(new RelationInner().withEtag("bqfatpxllrxcyjmo").withRelatedResourceId("skfc"))); - model = BinaryData.fromObject(model).toObject(RelationList.class); - Assertions.assertEquals("bqfatpxllrxcyjmo", model.value().get(0).etag()); - Assertions.assertEquals("skfc", model.value().get(0).relatedResourceId()); + Assertions.assertEquals("nsgnwxlwmez", model.value().get(0).etag()); + Assertions.assertEquals("jnxkbylhyyxgffk", model.value().get(0).relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationPropertiesTests.java index 23a96004c2ad..90d6666f757c 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,15 +12,15 @@ public final class RelationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RelationProperties model = BinaryData.fromString( - "{\"relatedResourceId\":\"zrtuzq\",\"relatedResourceName\":\"sexnevfdnw\",\"relatedResourceType\":\"mewzsyyc\",\"relatedResourceKind\":\"zsoibjudpfrxtr\"}") + "{\"relatedResourceId\":\"jermhzic\",\"relatedResourceName\":\"fdjhyaaknyukibxi\",\"relatedResourceType\":\"hphzwxqt\",\"relatedResourceKind\":\"piilhvtozy\"}") .toObject(RelationProperties.class); - Assertions.assertEquals("zrtuzq", model.relatedResourceId()); + Assertions.assertEquals("jermhzic", model.relatedResourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RelationProperties model = new RelationProperties().withRelatedResourceId("zrtuzq"); + RelationProperties model = new RelationProperties().withRelatedResourceId("jermhzic"); model = BinaryData.fromObject(model).toObject(RelationProperties.class); - Assertions.assertEquals("zrtuzq", model.relatedResourceId()); + Assertions.assertEquals("jermhzic", model.relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipHintTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipHintTests.java new file mode 100644 index 000000000000..c7dc9ccd13ea --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipHintTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.RelationshipHint; +import org.junit.jupiter.api.Assertions; + +public final class RelationshipHintTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RelationshipHint model + = BinaryData.fromString("{\"fieldName\":\"hqnztukirdedijdh\",\"source\":\"wvueweivaje\"}") + .toObject(RelationshipHint.class); + Assertions.assertEquals("hqnztukirdedijdh", model.fieldName()); + Assertions.assertEquals("wvueweivaje", model.source()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipTests.java new file mode 100644 index 000000000000..653f071e2bc7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RelationshipTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Relationship; + +public final class RelationshipTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Relationship model = BinaryData.fromString( + "{\"kind\":\"Relationship\",\"properties\":{\"data\":{\"qvvyhgpgjd\":\"\\\"datasbecxuvkba\\\"\",\"kdje\":\"\\\"datan\\\"\",\"fzwiztvucyackgk\":\"\\\"datapuku\\\"\"},\"createdBy\":{\"email\":\"m\",\"name\":\"pcohfksixvwkp\",\"objectId\":\"smurjab\"},\"source\":\"xohagcojgmyzjd\",\"firstIngestedTimeUtc\":\"2021-04-21T17:12:22Z\",\"lastIngestedTimeUtc\":\"2021-06-15T21:24:24Z\",\"ingestionRulesVersion\":\"qtgdipbnj\",\"lastUpdateMethod\":\"eyuigyzsebkbfyk\",\"lastModifiedBy\":{\"email\":\"urcxxjyxyunypfkv\",\"name\":\"ovbbncjxrwaqgm\",\"objectId\":\"l\"},\"lastUpdatedDateTimeUtc\":\"2021-10-28T22:05:50Z\",\"relationshipHints\":[{\"fieldName\":\"ou\",\"source\":\"qffgjsqq\"},{\"fieldName\":\"irooglwujobdq\",\"source\":\"pp\"},{\"fieldName\":\"qovijpm\",\"source\":\"nk\"},{\"fieldName\":\"tfbibtrwglj\",\"source\":\"tezdxqh\"}]},\"id\":\"phgimyomje\",\"name\":\"lgnieeqjdfxxxnn\",\"type\":\"uxkepga\"}") + .toObject(Relationship.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoInnerTests.java new file mode 100644 index 000000000000..af823c69f3a6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.RepoInner; +import org.junit.jupiter.api.Assertions; + +public final class RepoInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RepoInner model = BinaryData.fromString( + "{\"url\":\"gwsfrlyvzl\",\"fullName\":\"ydgmdoqgruc\",\"installationId\":7548590744805441352,\"branches\":[\"dh\",\"wjqeglymn\",\"ruwsqpi\",\"xkmq\"]}") + .toObject(RepoInner.class); + Assertions.assertEquals("gwsfrlyvzl", model.url()); + Assertions.assertEquals("ydgmdoqgruc", model.fullName()); + Assertions.assertEquals(7548590744805441352L, model.installationId()); + Assertions.assertEquals("dh", model.branches().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoListTests.java new file mode 100644 index 000000000000..05cce43d2afc --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepoListTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.RepoList; +import org.junit.jupiter.api.Assertions; + +public final class RepoListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RepoList model = BinaryData.fromString( + "{\"value\":[{\"url\":\"fxdbis\",\"fullName\":\"umwafa\",\"installationId\":5971472515628859478,\"branches\":[\"opizqqihvbkuf\",\"iqddjynpgomzmkj\",\"ajlfpsvrljlhe\",\"cccpxbnwitaf\"]},{\"url\":\"evpt\",\"fullName\":\"tghzqwvk\",\"installationId\":5262477140128349471,\"branches\":[\"lqftqcx\",\"mbsudcykg\",\"lell\"]},{\"url\":\"rm\",\"fullName\":\"xyqbmq\",\"installationId\":3867919468899380278,\"branches\":[\"kdsnbqoymsd\"]},{\"url\":\"aduhgwaxz\",\"fullName\":\"ppoyvijribe\",\"installationId\":1174132529018763636,\"branches\":[\"ksribmbtmorik\"]}],\"nextLink\":\"erqti\"}") + .toObject(RepoList.class); + Assertions.assertEquals("fxdbis", model.value().get(0).url()); + Assertions.assertEquals("umwafa", model.value().get(0).fullName()); + Assertions.assertEquals(5971472515628859478L, model.value().get(0).installationId()); + Assertions.assertEquals("opizqqihvbkuf", model.value().get(0).branches().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepositoryTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepositoryTests.java new file mode 100644 index 000000000000..32ecc81ba91b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RepositoryTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Repository; +import org.junit.jupiter.api.Assertions; + +public final class RepositoryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Repository model = BinaryData.fromString( + "{\"url\":\"uck\",\"branch\":\"kdskswtiiqqc\",\"displayUrl\":\"kclsmalnssw\",\"deploymentLogsUrl\":\"kdnonaaxwmgzru\"}") + .toObject(Repository.class); + Assertions.assertEquals("uck", model.url()); + Assertions.assertEquals("kdskswtiiqqc", model.branch()); + Assertions.assertEquals("kclsmalnssw", model.displayUrl()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Repository model = new Repository().withUrl("uck").withBranch("kdskswtiiqqc").withDisplayUrl("kclsmalnssw"); + model = BinaryData.fromObject(model).toObject(Repository.class); + Assertions.assertEquals("uck", model.url()); + Assertions.assertEquals("kdskswtiiqqc", model.branch()); + Assertions.assertEquals("kclsmalnssw", model.displayUrl()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RequiredPermissionsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RequiredPermissionsTests.java new file mode 100644 index 000000000000..07be54517bb6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RequiredPermissionsTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import org.junit.jupiter.api.Assertions; + +public final class RequiredPermissionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RequiredPermissions model + = BinaryData.fromString("{\"action\":true,\"write\":false,\"read\":false,\"delete\":true}") + .toObject(RequiredPermissions.class); + Assertions.assertTrue(model.action()); + Assertions.assertFalse(model.write()); + Assertions.assertFalse(model.read()); + Assertions.assertTrue(model.delete()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RequiredPermissions model + = new RequiredPermissions().withAction(true).withWrite(false).withRead(false).withDelete(true); + model = BinaryData.fromObject(model).toObject(RequiredPermissions.class); + Assertions.assertTrue(model.action()); + Assertions.assertFalse(model.write()); + Assertions.assertFalse(model.read()); + Assertions.assertTrue(model.delete()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderRequiredPermissionsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderRequiredPermissionsTests.java new file mode 100644 index 000000000000..9c304efec022 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderRequiredPermissionsTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ResourceProviderRequiredPermissions; +import org.junit.jupiter.api.Assertions; + +public final class ResourceProviderRequiredPermissionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceProviderRequiredPermissions model + = BinaryData.fromString("{\"read\":true,\"write\":true,\"delete\":false,\"action\":false}") + .toObject(ResourceProviderRequiredPermissions.class); + Assertions.assertTrue(model.read()); + Assertions.assertTrue(model.write()); + Assertions.assertFalse(model.delete()); + Assertions.assertFalse(model.action()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceProviderRequiredPermissions model = new ResourceProviderRequiredPermissions().withRead(true) + .withWrite(true) + .withDelete(false) + .withAction(false); + model = BinaryData.fromObject(model).toObject(ResourceProviderRequiredPermissions.class); + Assertions.assertTrue(model.read()); + Assertions.assertTrue(model.write()); + Assertions.assertFalse(model.delete()); + Assertions.assertFalse(model.action()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderTests.java new file mode 100644 index 000000000000..2a277a8b1ae4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProviderTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.PermissionProviderScope; +import com.azure.resourcemanager.securityinsights.models.ProviderName; +import com.azure.resourcemanager.securityinsights.models.RequiredPermissions; +import com.azure.resourcemanager.securityinsights.models.ResourceProvider; +import org.junit.jupiter.api.Assertions; + +public final class ResourceProviderTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceProvider model = BinaryData.fromString( + "{\"provider\":\"Microsoft.OperationalInsights/workspaces\",\"permissionsDisplayText\":\"decfiwhagxsure\",\"providerDisplayName\":\"rshzzbgullcxiqqz\",\"scope\":\"ResourceGroup\",\"requiredPermissions\":{\"action\":true,\"write\":false,\"read\":true,\"delete\":true}}") + .toObject(ResourceProvider.class); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES, model.provider()); + Assertions.assertEquals("decfiwhagxsure", model.permissionsDisplayText()); + Assertions.assertEquals("rshzzbgullcxiqqz", model.providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.RESOURCE_GROUP, model.scope()); + Assertions.assertTrue(model.requiredPermissions().action()); + Assertions.assertFalse(model.requiredPermissions().write()); + Assertions.assertTrue(model.requiredPermissions().read()); + Assertions.assertTrue(model.requiredPermissions().delete()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceProvider model + = new ResourceProvider().withProvider(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES) + .withPermissionsDisplayText("decfiwhagxsure") + .withProviderDisplayName("rshzzbgullcxiqqz") + .withScope(PermissionProviderScope.RESOURCE_GROUP) + .withRequiredPermissions( + new RequiredPermissions().withAction(true).withWrite(false).withRead(true).withDelete(true)); + model = BinaryData.fromObject(model).toObject(ResourceProvider.class); + Assertions.assertEquals(ProviderName.MICROSOFT_OPERATIONAL_INSIGHTS_WORKSPACES, model.provider()); + Assertions.assertEquals("decfiwhagxsure", model.permissionsDisplayText()); + Assertions.assertEquals("rshzzbgullcxiqqz", model.providerDisplayName()); + Assertions.assertEquals(PermissionProviderScope.RESOURCE_GROUP, model.scope()); + Assertions.assertTrue(model.requiredPermissions().action()); + Assertions.assertFalse(model.requiredPermissions().write()); + Assertions.assertTrue(model.requiredPermissions().read()); + Assertions.assertTrue(model.requiredPermissions().delete()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProvidersListWhoisByDomainWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProvidersListWhoisByDomainWithResponseMockTests.java new file mode 100644 index 000000000000..0a41d174a95c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceProvidersListWhoisByDomainWithResponseMockTests.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainBody; +import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhois; +import com.azure.resourcemanager.securityinsights.models.EnrichmentType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ResourceProvidersListWhoisByDomainWithResponseMockTests { + @Test + public void testListWhoisByDomainWithResponse() throws Exception { + String responseStr + = "{\"domain\":\"mjckctybhsg\",\"server\":\"umkts\",\"created\":\"2021-07-18T16:50:36Z\",\"updated\":\"2021-10-21T00:29:12Z\",\"expires\":\"2021-08-14T03:42:45Z\",\"parsedWhois\":{\"registrar\":{\"name\":\"vmawxrgwt\",\"abuseContactEmail\":\"qbhhfhihwwk\",\"abuseContactPhone\":\"yub\",\"ianaId\":\"xzcvuttyi\",\"url\":\"srj\",\"whoisServer\":\"vojwjanzolqq\"},\"contacts\":{\"admin\":{\"name\":\"pz\",\"org\":\"jupqlu\",\"street\":[\"zdnot\",\"yowisqfifmit\",\"vypkiqlouezbce\"],\"city\":\"scotynaehllwqmr\",\"state\":\"hescjv\",\"postal\":\"gcliajq\",\"country\":\"vihy\",\"phone\":\"p\",\"fax\":\"xex\",\"email\":\"no\"},\"billing\":{\"name\":\"m\",\"org\":\"irfzvtzr\",\"street\":[\"lipmuufsek\",\"sp\"],\"city\":\"hwpkpejfszwrqms\",\"state\":\"rsm\",\"postal\":\"jcnzfajptjhwrnw\",\"country\":\"ka\",\"phone\":\"afjcdccqjaefrzq\",\"fax\":\"tgggidrx\",\"email\":\"k\"},\"registrant\":{\"name\":\"zczwcpqkpgbs\",\"org\":\"qjjtcvdzytsdlpbk\",\"street\":[\"u\",\"crppn\"],\"city\":\"buvmfsf\",\"state\":\"enqfnzwyppnular\",\"postal\":\"pprdjfeps\",\"country\":\"uzxoyanlhjeue\",\"phone\":\"auxkvruryyqytaqj\",\"fax\":\"khijghp\",\"email\":\"qpxkikd\"},\"tech\":{\"name\":\"wyarqthbj\",\"org\":\"h\",\"street\":[\"wirnxtpz\",\"gy\",\"lwuiklbjlnbx\"],\"city\":\"csddplg\",\"state\":\"hviahoke\",\"postal\":\"madyoctmdauoscc\",\"country\":\"bestntoeteufg\",\"phone\":\"bzftsbpefrfugthc\",\"fax\":\"zoxhoiogpbogpbw\",\"email\":\"oxlzrijpkbrvm\"}},\"nameServers\":[\"qkrq\"],\"statuses\":[\"tzawenrv\",\"itzdjixkepladoh\"]}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EnrichmentDomainWhois response = manager.resourceProviders() + .listWhoisByDomainWithResponse("wbbzcm", "b", EnrichmentType.MAIN, + new EnrichmentDomainBody().withDomain("gclksmrgjf"), com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("mjckctybhsg", response.domain()); + Assertions.assertEquals("umkts", response.server()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T16:50:36Z"), response.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T00:29:12Z"), response.updated()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-14T03:42:45Z"), response.expires()); + Assertions.assertEquals("vmawxrgwt", response.parsedWhois().registrar().name()); + Assertions.assertEquals("qbhhfhihwwk", response.parsedWhois().registrar().abuseContactEmail()); + Assertions.assertEquals("yub", response.parsedWhois().registrar().abuseContactPhone()); + Assertions.assertEquals("xzcvuttyi", response.parsedWhois().registrar().ianaId()); + Assertions.assertEquals("srj", response.parsedWhois().registrar().url()); + Assertions.assertEquals("vojwjanzolqq", response.parsedWhois().registrar().whoisServer()); + Assertions.assertEquals("pz", response.parsedWhois().contacts().admin().name()); + Assertions.assertEquals("jupqlu", response.parsedWhois().contacts().admin().org()); + Assertions.assertEquals("zdnot", response.parsedWhois().contacts().admin().street().get(0)); + Assertions.assertEquals("scotynaehllwqmr", response.parsedWhois().contacts().admin().city()); + Assertions.assertEquals("hescjv", response.parsedWhois().contacts().admin().state()); + Assertions.assertEquals("gcliajq", response.parsedWhois().contacts().admin().postal()); + Assertions.assertEquals("vihy", response.parsedWhois().contacts().admin().country()); + Assertions.assertEquals("p", response.parsedWhois().contacts().admin().phone()); + Assertions.assertEquals("xex", response.parsedWhois().contacts().admin().fax()); + Assertions.assertEquals("no", response.parsedWhois().contacts().admin().email()); + Assertions.assertEquals("m", response.parsedWhois().contacts().billing().name()); + Assertions.assertEquals("irfzvtzr", response.parsedWhois().contacts().billing().org()); + Assertions.assertEquals("lipmuufsek", response.parsedWhois().contacts().billing().street().get(0)); + Assertions.assertEquals("hwpkpejfszwrqms", response.parsedWhois().contacts().billing().city()); + Assertions.assertEquals("rsm", response.parsedWhois().contacts().billing().state()); + Assertions.assertEquals("jcnzfajptjhwrnw", response.parsedWhois().contacts().billing().postal()); + Assertions.assertEquals("ka", response.parsedWhois().contacts().billing().country()); + Assertions.assertEquals("afjcdccqjaefrzq", response.parsedWhois().contacts().billing().phone()); + Assertions.assertEquals("tgggidrx", response.parsedWhois().contacts().billing().fax()); + Assertions.assertEquals("k", response.parsedWhois().contacts().billing().email()); + Assertions.assertEquals("zczwcpqkpgbs", response.parsedWhois().contacts().registrant().name()); + Assertions.assertEquals("qjjtcvdzytsdlpbk", response.parsedWhois().contacts().registrant().org()); + Assertions.assertEquals("u", response.parsedWhois().contacts().registrant().street().get(0)); + Assertions.assertEquals("buvmfsf", response.parsedWhois().contacts().registrant().city()); + Assertions.assertEquals("enqfnzwyppnular", response.parsedWhois().contacts().registrant().state()); + Assertions.assertEquals("pprdjfeps", response.parsedWhois().contacts().registrant().postal()); + Assertions.assertEquals("uzxoyanlhjeue", response.parsedWhois().contacts().registrant().country()); + Assertions.assertEquals("auxkvruryyqytaqj", response.parsedWhois().contacts().registrant().phone()); + Assertions.assertEquals("khijghp", response.parsedWhois().contacts().registrant().fax()); + Assertions.assertEquals("qpxkikd", response.parsedWhois().contacts().registrant().email()); + Assertions.assertEquals("wyarqthbj", response.parsedWhois().contacts().tech().name()); + Assertions.assertEquals("h", response.parsedWhois().contacts().tech().org()); + Assertions.assertEquals("wirnxtpz", response.parsedWhois().contacts().tech().street().get(0)); + Assertions.assertEquals("csddplg", response.parsedWhois().contacts().tech().city()); + Assertions.assertEquals("hviahoke", response.parsedWhois().contacts().tech().state()); + Assertions.assertEquals("madyoctmdauoscc", response.parsedWhois().contacts().tech().postal()); + Assertions.assertEquals("bestntoeteufg", response.parsedWhois().contacts().tech().country()); + Assertions.assertEquals("bzftsbpefrfugthc", response.parsedWhois().contacts().tech().phone()); + Assertions.assertEquals("zoxhoiogpbogpbw", response.parsedWhois().contacts().tech().fax()); + Assertions.assertEquals("oxlzrijpkbrvm", response.parsedWhois().contacts().tech().email()); + Assertions.assertEquals("qkrq", response.parsedWhois().nameServers().get(0)); + Assertions.assertEquals("tzawenrv", response.parsedWhois().statuses().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceWithEtagTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceWithEtagTests.java index 6082918c7c19..572b7f8ce855 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceWithEtagTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ResourceWithEtagTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,16 +11,16 @@ public final class ResourceWithEtagTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceWithEtag model = BinaryData.fromString( - "{\"etag\":\"qjnqglhqgnufoooj\",\"id\":\"ifsqesaagdfmg\",\"name\":\"zlhjxrifkwmrvkt\",\"type\":\"izntocipao\"}") + ResourceWithEtag model = BinaryData + .fromString("{\"etag\":\"aypdtyzve\",\"id\":\"fohuriwhjdfr\",\"name\":\"psshr\",\"type\":\"nkcclpctuog\"}") .toObject(ResourceWithEtag.class); - Assertions.assertEquals("qjnqglhqgnufoooj", model.etag()); + Assertions.assertEquals("aypdtyzve", model.etag()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceWithEtag model = new ResourceWithEtag().withEtag("qjnqglhqgnufoooj"); + ResourceWithEtag model = new ResourceWithEtag().withEtag("aypdtyzve"); model = BinaryData.fromObject(model).toObject(ResourceWithEtag.class); - Assertions.assertEquals("qjnqglhqgnufoooj", model.etag()); + Assertions.assertEquals("aypdtyzve", model.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorPropertiesTests.java new file mode 100644 index 000000000000..b10b1ea5f9c2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorPropertiesTests.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.RestApiPollerDataConnectorProperties; +import com.azure.resourcemanager.securityinsights.models.CcpAuthConfig; +import com.azure.resourcemanager.securityinsights.models.CcpResponseConfig; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.HttpMethodVerb; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestConfig; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingConfig; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingKind; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RestApiPollerDataConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RestApiPollerDataConnectorProperties model = BinaryData.fromString( + "{\"connectorDefinitionName\":\"cjubkhjozfymcwm\",\"auth\":{\"type\":\"CcpAuthConfig\"},\"request\":{\"apiEndpoint\":\"upyvqyvliq\",\"rateLimitQPS\":1278727312,\"queryWindowInMin\":740633412,\"httpMethod\":\"GET\",\"queryTimeFormat\":\"vsi\",\"retryCount\":1281721808,\"timeoutInSeconds\":1734382480,\"isPostPayloadJson\":true,\"headers\":{\"ldpxott\":\"ydisnuepywyjl\",\"jihw\":\"iiaocqib\",\"ratjhdhzybspij\":\"ebiphryvcjwqwoq\"},\"queryParameters\":{\"hsusmmor\":\"\\\"datazgdkkagvwu\\\"\",\"mriprlk\":\"\\\"datamzhwilzzhni\\\"\",\"cxiv\":\"\\\"dataneyttl\\\"\"},\"queryParametersTemplate\":\"kutpu\",\"startTimeAttributeName\":\"twjfluxynbp\",\"endTimeAttributeName\":\"l\",\"queryTimeIntervalAttributeName\":\"wa\",\"queryTimeIntervalPrepend\":\"qnjckhmocg\",\"queryTimeIntervalDelimiter\":\"hgouarh\"},\"dcrConfig\":{\"dataCollectionEndpoint\":\"ixq\",\"dataCollectionRuleImmutableId\":\"ggljkybsjrclrv\",\"streamName\":\"z\"},\"isActive\":true,\"dataType\":\"ctbhpjhxpcvrd\",\"response\":{\"eventsJsonPaths\":[\"it\",\"n\",\"qady\",\"zjahwriuomz\"],\"successStatusJsonPath\":\"fki\",\"successStatusValue\":\"evsaa\",\"isGzipCompressed\":false,\"compressionAlgo\":\"caxikhfjqebgl\",\"format\":\"kxgzzromvygysem\",\"csvDelimiter\":\"esrfsvpinkzpatq\",\"hasCsvBoundary\":false,\"hasCsvHeader\":true,\"convertChildPropertiesToArray\":true,\"csvEscape\":\"vckojazbbgs\"},\"paging\":{\"pagingType\":\"NextPageUrl\",\"pageSize\":1098907429,\"pageSizeParameterName\":\"b\"},\"addOnAttributes\":{\"dylytcovq\":\"p\",\"rf\":\"eu\",\"swkjmdihdcyyyz\":\"bdxzfxnxmlbmu\",\"m\":\"whbwzjnufzrf\"}}") + .toObject(RestApiPollerDataConnectorProperties.class); + Assertions.assertEquals("cjubkhjozfymcwm", model.connectorDefinitionName()); + Assertions.assertEquals("upyvqyvliq", model.request().apiEndpoint()); + Assertions.assertEquals(1278727312, model.request().rateLimitQPS()); + Assertions.assertEquals(740633412, model.request().queryWindowInMin()); + Assertions.assertEquals(HttpMethodVerb.GET, model.request().httpMethod()); + Assertions.assertEquals("vsi", model.request().queryTimeFormat()); + Assertions.assertEquals(1281721808, model.request().retryCount()); + Assertions.assertEquals(1734382480, model.request().timeoutInSeconds()); + Assertions.assertTrue(model.request().isPostPayloadJson()); + Assertions.assertEquals("ydisnuepywyjl", model.request().headers().get("ldpxott")); + Assertions.assertEquals("kutpu", model.request().queryParametersTemplate()); + Assertions.assertEquals("twjfluxynbp", model.request().startTimeAttributeName()); + Assertions.assertEquals("l", model.request().endTimeAttributeName()); + Assertions.assertEquals("wa", model.request().queryTimeIntervalAttributeName()); + Assertions.assertEquals("qnjckhmocg", model.request().queryTimeIntervalPrepend()); + Assertions.assertEquals("hgouarh", model.request().queryTimeIntervalDelimiter()); + Assertions.assertEquals("ixq", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("ggljkybsjrclrv", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("z", model.dcrConfig().streamName()); + Assertions.assertTrue(model.isActive()); + Assertions.assertEquals("ctbhpjhxpcvrd", model.dataType()); + Assertions.assertEquals("it", model.response().eventsJsonPaths().get(0)); + Assertions.assertEquals("fki", model.response().successStatusJsonPath()); + Assertions.assertEquals("evsaa", model.response().successStatusValue()); + Assertions.assertFalse(model.response().isGzipCompressed()); + Assertions.assertEquals("caxikhfjqebgl", model.response().compressionAlgo()); + Assertions.assertEquals("kxgzzromvygysem", model.response().format()); + Assertions.assertEquals("esrfsvpinkzpatq", model.response().csvDelimiter()); + Assertions.assertFalse(model.response().hasCsvBoundary()); + Assertions.assertTrue(model.response().hasCsvHeader()); + Assertions.assertTrue(model.response().convertChildPropertiesToArray()); + Assertions.assertEquals("vckojazbbgs", model.response().csvEscape()); + Assertions.assertEquals(RestApiPollerRequestPagingKind.NEXT_PAGE_URL, model.paging().pagingType()); + Assertions.assertEquals(1098907429, model.paging().pageSize()); + Assertions.assertEquals("b", model.paging().pageSizeParameterName()); + Assertions.assertEquals("p", model.addOnAttributes().get("dylytcovq")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RestApiPollerDataConnectorProperties model = new RestApiPollerDataConnectorProperties() + .withConnectorDefinitionName("cjubkhjozfymcwm") + .withAuth(new CcpAuthConfig()) + .withRequest(new RestApiPollerRequestConfig().withApiEndpoint("upyvqyvliq") + .withRateLimitQPS(1278727312) + .withQueryWindowInMin(740633412) + .withHttpMethod(HttpMethodVerb.GET) + .withQueryTimeFormat("vsi") + .withRetryCount(1281721808) + .withTimeoutInSeconds(1734382480) + .withIsPostPayloadJson(true) + .withHeaders(mapOf("ldpxott", "ydisnuepywyjl", "jihw", "iiaocqib", "ratjhdhzybspij", "ebiphryvcjwqwoq")) + .withQueryParameters( + mapOf("hsusmmor", "\"datazgdkkagvwu\"", "mriprlk", "\"datamzhwilzzhni\"", "cxiv", "\"dataneyttl\"")) + .withQueryParametersTemplate("kutpu") + .withStartTimeAttributeName("twjfluxynbp") + .withEndTimeAttributeName("l") + .withQueryTimeIntervalAttributeName("wa") + .withQueryTimeIntervalPrepend("qnjckhmocg") + .withQueryTimeIntervalDelimiter("hgouarh")) + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint("ixq") + .withDataCollectionRuleImmutableId("ggljkybsjrclrv") + .withStreamName("z")) + .withIsActive(true) + .withDataType("ctbhpjhxpcvrd") + .withResponse(new CcpResponseConfig().withEventsJsonPaths(Arrays.asList("it", "n", "qady", "zjahwriuomz")) + .withSuccessStatusJsonPath("fki") + .withSuccessStatusValue("evsaa") + .withIsGzipCompressed(false) + .withCompressionAlgo("caxikhfjqebgl") + .withFormat("kxgzzromvygysem") + .withCsvDelimiter("esrfsvpinkzpatq") + .withHasCsvBoundary(false) + .withHasCsvHeader(true) + .withConvertChildPropertiesToArray(true) + .withCsvEscape("vckojazbbgs")) + .withPaging( + new RestApiPollerRequestPagingConfig().withPagingType(RestApiPollerRequestPagingKind.NEXT_PAGE_URL) + .withPageSize(1098907429) + .withPageSizeParameterName("b")) + .withAddOnAttributes( + mapOf("dylytcovq", "p", "rf", "eu", "swkjmdihdcyyyz", "bdxzfxnxmlbmu", "m", "whbwzjnufzrf")); + model = BinaryData.fromObject(model).toObject(RestApiPollerDataConnectorProperties.class); + Assertions.assertEquals("cjubkhjozfymcwm", model.connectorDefinitionName()); + Assertions.assertEquals("upyvqyvliq", model.request().apiEndpoint()); + Assertions.assertEquals(1278727312, model.request().rateLimitQPS()); + Assertions.assertEquals(740633412, model.request().queryWindowInMin()); + Assertions.assertEquals(HttpMethodVerb.GET, model.request().httpMethod()); + Assertions.assertEquals("vsi", model.request().queryTimeFormat()); + Assertions.assertEquals(1281721808, model.request().retryCount()); + Assertions.assertEquals(1734382480, model.request().timeoutInSeconds()); + Assertions.assertTrue(model.request().isPostPayloadJson()); + Assertions.assertEquals("ydisnuepywyjl", model.request().headers().get("ldpxott")); + Assertions.assertEquals("kutpu", model.request().queryParametersTemplate()); + Assertions.assertEquals("twjfluxynbp", model.request().startTimeAttributeName()); + Assertions.assertEquals("l", model.request().endTimeAttributeName()); + Assertions.assertEquals("wa", model.request().queryTimeIntervalAttributeName()); + Assertions.assertEquals("qnjckhmocg", model.request().queryTimeIntervalPrepend()); + Assertions.assertEquals("hgouarh", model.request().queryTimeIntervalDelimiter()); + Assertions.assertEquals("ixq", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("ggljkybsjrclrv", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("z", model.dcrConfig().streamName()); + Assertions.assertTrue(model.isActive()); + Assertions.assertEquals("ctbhpjhxpcvrd", model.dataType()); + Assertions.assertEquals("it", model.response().eventsJsonPaths().get(0)); + Assertions.assertEquals("fki", model.response().successStatusJsonPath()); + Assertions.assertEquals("evsaa", model.response().successStatusValue()); + Assertions.assertFalse(model.response().isGzipCompressed()); + Assertions.assertEquals("caxikhfjqebgl", model.response().compressionAlgo()); + Assertions.assertEquals("kxgzzromvygysem", model.response().format()); + Assertions.assertEquals("esrfsvpinkzpatq", model.response().csvDelimiter()); + Assertions.assertFalse(model.response().hasCsvBoundary()); + Assertions.assertTrue(model.response().hasCsvHeader()); + Assertions.assertTrue(model.response().convertChildPropertiesToArray()); + Assertions.assertEquals("vckojazbbgs", model.response().csvEscape()); + Assertions.assertEquals(RestApiPollerRequestPagingKind.NEXT_PAGE_URL, model.paging().pagingType()); + Assertions.assertEquals(1098907429, model.paging().pageSize()); + Assertions.assertEquals("b", model.paging().pageSizeParameterName()); + Assertions.assertEquals("p", model.addOnAttributes().get("dylytcovq")); + } + + // Use "Map.of" if available + @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/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorTests.java new file mode 100644 index 000000000000..45914a863359 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerDataConnectorTests.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.CcpAuthConfig; +import com.azure.resourcemanager.securityinsights.models.CcpResponseConfig; +import com.azure.resourcemanager.securityinsights.models.DCRConfiguration; +import com.azure.resourcemanager.securityinsights.models.HttpMethodVerb; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerDataConnector; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestConfig; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingConfig; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingKind; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RestApiPollerDataConnectorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RestApiPollerDataConnector model = BinaryData.fromString( + "{\"kind\":\"RestApiPoller\",\"properties\":{\"connectorDefinitionName\":\"kbfok\",\"auth\":{\"type\":\"CcpAuthConfig\"},\"request\":{\"apiEndpoint\":\"khup\",\"rateLimitQPS\":1940828329,\"queryWindowInMin\":1699514376,\"httpMethod\":\"DELETE\",\"queryTimeFormat\":\"l\",\"retryCount\":1647911155,\"timeoutInSeconds\":2135163704,\"isPostPayloadJson\":true,\"headers\":{\"kya\":\"ftzgy\",\"ttw\":\"ugekdfqn\"},\"queryParameters\":{\"kmhmnulwempdc\":\"\\\"datarczfjjnnuxxr\\\"\",\"lusnawmhhgzotfr\":\"\\\"datafrhjulrsulwzp\\\"\",\"wxxyxhighctx\":\"\\\"datayrgkoekv\\\"\",\"skiczd\":\"\\\"dataxmolpcqydeyk\\\"\"},\"queryParametersTemplate\":\"jei\",\"startTimeAttributeName\":\"kgqaboo\",\"endTimeAttributeName\":\"bmsgycqsxrmdv\",\"queryTimeIntervalAttributeName\":\"uyqaeohpj\",\"queryTimeIntervalPrepend\":\"ejkbvhhdaurgho\",\"queryTimeIntervalDelimiter\":\"aexbkhxjxjo\"},\"dcrConfig\":{\"dataCollectionEndpoint\":\"lqxr\",\"dataCollectionRuleImmutableId\":\"dknkobe\",\"streamName\":\"tmbozomtzamicbig\"},\"isActive\":false,\"dataType\":\"zseznuxkeuairaa\",\"response\":{\"eventsJsonPaths\":[\"lqjbedpfixlhupmo\",\"ihzbdnpxpk\",\"dpr\",\"yxelyicghflr\"],\"successStatusJsonPath\":\"ssjyghsfx\",\"successStatusValue\":\"bh\",\"isGzipCompressed\":false,\"compressionAlgo\":\"mqfmefgvqcpd\",\"format\":\"gquxweysland\",\"csvDelimiter\":\"cdjhunhg\",\"hasCsvBoundary\":true,\"hasCsvHeader\":true,\"convertChildPropertiesToArray\":false,\"csvEscape\":\"nquoxsotireimse\"},\"paging\":{\"pagingType\":\"LinkHeader\",\"pageSize\":709585513,\"pageSizeParameterName\":\"tcyilbvz\"},\"addOnAttributes\":{\"b\":\"cjzlquzexokjxebj\",\"v\":\"inzabwmvoglj\",\"ehaqidoyzltgio\":\"pgidnw\"}},\"etag\":\"oqpe\",\"id\":\"aeapfsergd\",\"name\":\"peqnacyheqwb\",\"type\":\"qq\"}") + .toObject(RestApiPollerDataConnector.class); + Assertions.assertEquals("oqpe", model.etag()); + Assertions.assertEquals("kbfok", model.connectorDefinitionName()); + Assertions.assertEquals("khup", model.request().apiEndpoint()); + Assertions.assertEquals(1940828329, model.request().rateLimitQPS()); + Assertions.assertEquals(1699514376, model.request().queryWindowInMin()); + Assertions.assertEquals(HttpMethodVerb.DELETE, model.request().httpMethod()); + Assertions.assertEquals("l", model.request().queryTimeFormat()); + Assertions.assertEquals(1647911155, model.request().retryCount()); + Assertions.assertEquals(2135163704, model.request().timeoutInSeconds()); + Assertions.assertTrue(model.request().isPostPayloadJson()); + Assertions.assertEquals("ftzgy", model.request().headers().get("kya")); + Assertions.assertEquals("jei", model.request().queryParametersTemplate()); + Assertions.assertEquals("kgqaboo", model.request().startTimeAttributeName()); + Assertions.assertEquals("bmsgycqsxrmdv", model.request().endTimeAttributeName()); + Assertions.assertEquals("uyqaeohpj", model.request().queryTimeIntervalAttributeName()); + Assertions.assertEquals("ejkbvhhdaurgho", model.request().queryTimeIntervalPrepend()); + Assertions.assertEquals("aexbkhxjxjo", model.request().queryTimeIntervalDelimiter()); + Assertions.assertEquals("lqxr", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("dknkobe", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("tmbozomtzamicbig", model.dcrConfig().streamName()); + Assertions.assertFalse(model.isActive()); + Assertions.assertEquals("zseznuxkeuairaa", model.dataType()); + Assertions.assertEquals("lqjbedpfixlhupmo", model.response().eventsJsonPaths().get(0)); + Assertions.assertEquals("ssjyghsfx", model.response().successStatusJsonPath()); + Assertions.assertEquals("bh", model.response().successStatusValue()); + Assertions.assertFalse(model.response().isGzipCompressed()); + Assertions.assertEquals("mqfmefgvqcpd", model.response().compressionAlgo()); + Assertions.assertEquals("gquxweysland", model.response().format()); + Assertions.assertEquals("cdjhunhg", model.response().csvDelimiter()); + Assertions.assertTrue(model.response().hasCsvBoundary()); + Assertions.assertTrue(model.response().hasCsvHeader()); + Assertions.assertFalse(model.response().convertChildPropertiesToArray()); + Assertions.assertEquals("nquoxsotireimse", model.response().csvEscape()); + Assertions.assertEquals(RestApiPollerRequestPagingKind.LINK_HEADER, model.paging().pagingType()); + Assertions.assertEquals(709585513, model.paging().pageSize()); + Assertions.assertEquals("tcyilbvz", model.paging().pageSizeParameterName()); + Assertions.assertEquals("cjzlquzexokjxebj", model.addOnAttributes().get("b")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RestApiPollerDataConnector model = new RestApiPollerDataConnector().withEtag("oqpe") + .withConnectorDefinitionName("kbfok") + .withAuth(new CcpAuthConfig()) + .withRequest(new RestApiPollerRequestConfig().withApiEndpoint("khup") + .withRateLimitQPS(1940828329) + .withQueryWindowInMin(1699514376) + .withHttpMethod(HttpMethodVerb.DELETE) + .withQueryTimeFormat("l") + .withRetryCount(1647911155) + .withTimeoutInSeconds(2135163704) + .withIsPostPayloadJson(true) + .withHeaders(mapOf("kya", "ftzgy", "ttw", "ugekdfqn")) + .withQueryParameters(mapOf("kmhmnulwempdc", "\"datarczfjjnnuxxr\"", "lusnawmhhgzotfr", + "\"datafrhjulrsulwzp\"", "wxxyxhighctx", "\"datayrgkoekv\"", "skiczd", "\"dataxmolpcqydeyk\"")) + .withQueryParametersTemplate("jei") + .withStartTimeAttributeName("kgqaboo") + .withEndTimeAttributeName("bmsgycqsxrmdv") + .withQueryTimeIntervalAttributeName("uyqaeohpj") + .withQueryTimeIntervalPrepend("ejkbvhhdaurgho") + .withQueryTimeIntervalDelimiter("aexbkhxjxjo")) + .withDcrConfig(new DCRConfiguration().withDataCollectionEndpoint("lqxr") + .withDataCollectionRuleImmutableId("dknkobe") + .withStreamName("tmbozomtzamicbig")) + .withIsActive(false) + .withDataType("zseznuxkeuairaa") + .withResponse(new CcpResponseConfig() + .withEventsJsonPaths(Arrays.asList("lqjbedpfixlhupmo", "ihzbdnpxpk", "dpr", "yxelyicghflr")) + .withSuccessStatusJsonPath("ssjyghsfx") + .withSuccessStatusValue("bh") + .withIsGzipCompressed(false) + .withCompressionAlgo("mqfmefgvqcpd") + .withFormat("gquxweysland") + .withCsvDelimiter("cdjhunhg") + .withHasCsvBoundary(true) + .withHasCsvHeader(true) + .withConvertChildPropertiesToArray(false) + .withCsvEscape("nquoxsotireimse")) + .withPaging( + new RestApiPollerRequestPagingConfig().withPagingType(RestApiPollerRequestPagingKind.LINK_HEADER) + .withPageSize(709585513) + .withPageSizeParameterName("tcyilbvz")) + .withAddOnAttributes(mapOf("b", "cjzlquzexokjxebj", "v", "inzabwmvoglj", "ehaqidoyzltgio", "pgidnw")); + model = BinaryData.fromObject(model).toObject(RestApiPollerDataConnector.class); + Assertions.assertEquals("oqpe", model.etag()); + Assertions.assertEquals("kbfok", model.connectorDefinitionName()); + Assertions.assertEquals("khup", model.request().apiEndpoint()); + Assertions.assertEquals(1940828329, model.request().rateLimitQPS()); + Assertions.assertEquals(1699514376, model.request().queryWindowInMin()); + Assertions.assertEquals(HttpMethodVerb.DELETE, model.request().httpMethod()); + Assertions.assertEquals("l", model.request().queryTimeFormat()); + Assertions.assertEquals(1647911155, model.request().retryCount()); + Assertions.assertEquals(2135163704, model.request().timeoutInSeconds()); + Assertions.assertTrue(model.request().isPostPayloadJson()); + Assertions.assertEquals("ftzgy", model.request().headers().get("kya")); + Assertions.assertEquals("jei", model.request().queryParametersTemplate()); + Assertions.assertEquals("kgqaboo", model.request().startTimeAttributeName()); + Assertions.assertEquals("bmsgycqsxrmdv", model.request().endTimeAttributeName()); + Assertions.assertEquals("uyqaeohpj", model.request().queryTimeIntervalAttributeName()); + Assertions.assertEquals("ejkbvhhdaurgho", model.request().queryTimeIntervalPrepend()); + Assertions.assertEquals("aexbkhxjxjo", model.request().queryTimeIntervalDelimiter()); + Assertions.assertEquals("lqxr", model.dcrConfig().dataCollectionEndpoint()); + Assertions.assertEquals("dknkobe", model.dcrConfig().dataCollectionRuleImmutableId()); + Assertions.assertEquals("tmbozomtzamicbig", model.dcrConfig().streamName()); + Assertions.assertFalse(model.isActive()); + Assertions.assertEquals("zseznuxkeuairaa", model.dataType()); + Assertions.assertEquals("lqjbedpfixlhupmo", model.response().eventsJsonPaths().get(0)); + Assertions.assertEquals("ssjyghsfx", model.response().successStatusJsonPath()); + Assertions.assertEquals("bh", model.response().successStatusValue()); + Assertions.assertFalse(model.response().isGzipCompressed()); + Assertions.assertEquals("mqfmefgvqcpd", model.response().compressionAlgo()); + Assertions.assertEquals("gquxweysland", model.response().format()); + Assertions.assertEquals("cdjhunhg", model.response().csvDelimiter()); + Assertions.assertTrue(model.response().hasCsvBoundary()); + Assertions.assertTrue(model.response().hasCsvHeader()); + Assertions.assertFalse(model.response().convertChildPropertiesToArray()); + Assertions.assertEquals("nquoxsotireimse", model.response().csvEscape()); + Assertions.assertEquals(RestApiPollerRequestPagingKind.LINK_HEADER, model.paging().pagingType()); + Assertions.assertEquals(709585513, model.paging().pageSize()); + Assertions.assertEquals("tcyilbvz", model.paging().pageSizeParameterName()); + Assertions.assertEquals("cjzlquzexokjxebj", model.addOnAttributes().get("b")); + } + + // Use "Map.of" if available + @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/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestConfigTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestConfigTests.java new file mode 100644 index 000000000000..31ff939f9fc8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestConfigTests.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.HttpMethodVerb; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestConfig; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RestApiPollerRequestConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RestApiPollerRequestConfig model = BinaryData.fromString( + "{\"apiEndpoint\":\"dsyenzsieuscpl\",\"rateLimitQPS\":1459036016,\"queryWindowInMin\":1817822327,\"httpMethod\":\"PUT\",\"queryTimeFormat\":\"zkxitd\",\"retryCount\":1316628135,\"timeoutInSeconds\":1663415726,\"isPostPayloadJson\":false,\"headers\":{\"wzlpzbtz\":\"rupjovmozsayebra\",\"sdyepfno\":\"ykykip\",\"zwyqejga\":\"mbezacfpztg\"},\"queryParameters\":{\"ngdyfcixrhlcq\":\"\\\"datactgkppgkqzkcyzmf\\\"\",\"goiutgw\":\"\\\"datahoe\\\"\"},\"queryParametersTemplate\":\"kahpqhazynta\",\"startTimeAttributeName\":\"hncogmipnml\",\"endTimeAttributeName\":\"mvlbhikeaqgrv\",\"queryTimeIntervalAttributeName\":\"omxp\",\"queryTimeIntervalPrepend\":\"dtsdfjy\",\"queryTimeIntervalDelimiter\":\"socwiqbuout\"}") + .toObject(RestApiPollerRequestConfig.class); + Assertions.assertEquals("dsyenzsieuscpl", model.apiEndpoint()); + Assertions.assertEquals(1459036016, model.rateLimitQPS()); + Assertions.assertEquals(1817822327, model.queryWindowInMin()); + Assertions.assertEquals(HttpMethodVerb.PUT, model.httpMethod()); + Assertions.assertEquals("zkxitd", model.queryTimeFormat()); + Assertions.assertEquals(1316628135, model.retryCount()); + Assertions.assertEquals(1663415726, model.timeoutInSeconds()); + Assertions.assertFalse(model.isPostPayloadJson()); + Assertions.assertEquals("rupjovmozsayebra", model.headers().get("wzlpzbtz")); + Assertions.assertEquals("kahpqhazynta", model.queryParametersTemplate()); + Assertions.assertEquals("hncogmipnml", model.startTimeAttributeName()); + Assertions.assertEquals("mvlbhikeaqgrv", model.endTimeAttributeName()); + Assertions.assertEquals("omxp", model.queryTimeIntervalAttributeName()); + Assertions.assertEquals("dtsdfjy", model.queryTimeIntervalPrepend()); + Assertions.assertEquals("socwiqbuout", model.queryTimeIntervalDelimiter()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RestApiPollerRequestConfig model = new RestApiPollerRequestConfig().withApiEndpoint("dsyenzsieuscpl") + .withRateLimitQPS(1459036016) + .withQueryWindowInMin(1817822327) + .withHttpMethod(HttpMethodVerb.PUT) + .withQueryTimeFormat("zkxitd") + .withRetryCount(1316628135) + .withTimeoutInSeconds(1663415726) + .withIsPostPayloadJson(false) + .withHeaders(mapOf("wzlpzbtz", "rupjovmozsayebra", "sdyepfno", "ykykip", "zwyqejga", "mbezacfpztg")) + .withQueryParameters(mapOf("ngdyfcixrhlcq", "\"datactgkppgkqzkcyzmf\"", "goiutgw", "\"datahoe\"")) + .withQueryParametersTemplate("kahpqhazynta") + .withStartTimeAttributeName("hncogmipnml") + .withEndTimeAttributeName("mvlbhikeaqgrv") + .withQueryTimeIntervalAttributeName("omxp") + .withQueryTimeIntervalPrepend("dtsdfjy") + .withQueryTimeIntervalDelimiter("socwiqbuout"); + model = BinaryData.fromObject(model).toObject(RestApiPollerRequestConfig.class); + Assertions.assertEquals("dsyenzsieuscpl", model.apiEndpoint()); + Assertions.assertEquals(1459036016, model.rateLimitQPS()); + Assertions.assertEquals(1817822327, model.queryWindowInMin()); + Assertions.assertEquals(HttpMethodVerb.PUT, model.httpMethod()); + Assertions.assertEquals("zkxitd", model.queryTimeFormat()); + Assertions.assertEquals(1316628135, model.retryCount()); + Assertions.assertEquals(1663415726, model.timeoutInSeconds()); + Assertions.assertFalse(model.isPostPayloadJson()); + Assertions.assertEquals("rupjovmozsayebra", model.headers().get("wzlpzbtz")); + Assertions.assertEquals("kahpqhazynta", model.queryParametersTemplate()); + Assertions.assertEquals("hncogmipnml", model.startTimeAttributeName()); + Assertions.assertEquals("mvlbhikeaqgrv", model.endTimeAttributeName()); + Assertions.assertEquals("omxp", model.queryTimeIntervalAttributeName()); + Assertions.assertEquals("dtsdfjy", model.queryTimeIntervalPrepend()); + Assertions.assertEquals("socwiqbuout", model.queryTimeIntervalDelimiter()); + } + + // Use "Map.of" if available + @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/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestPagingConfigTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestPagingConfigTests.java new file mode 100644 index 000000000000..39c8ab7ac090 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/RestApiPollerRequestPagingConfigTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingConfig; +import com.azure.resourcemanager.securityinsights.models.RestApiPollerRequestPagingKind; +import org.junit.jupiter.api.Assertions; + +public final class RestApiPollerRequestPagingConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RestApiPollerRequestPagingConfig model = BinaryData + .fromString("{\"pagingType\":\"NextPageToken\",\"pageSize\":1514762787,\"pageSizeParameterName\":\"ky\"}") + .toObject(RestApiPollerRequestPagingConfig.class); + Assertions.assertEquals(RestApiPollerRequestPagingKind.NEXT_PAGE_TOKEN, model.pagingType()); + Assertions.assertEquals(1514762787, model.pageSize()); + Assertions.assertEquals("ky", model.pageSizeParameterName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RestApiPollerRequestPagingConfig model + = new RestApiPollerRequestPagingConfig().withPagingType(RestApiPollerRequestPagingKind.NEXT_PAGE_TOKEN) + .withPageSize(1514762787) + .withPageSizeParameterName("ky"); + model = BinaryData.fromObject(model).toObject(RestApiPollerRequestPagingConfig.class); + Assertions.assertEquals(RestApiPollerRequestPagingKind.NEXT_PAGE_TOKEN, model.pagingType()); + Assertions.assertEquals(1514762787, model.pageSize()); + Assertions.assertEquals("ky", model.pageSizeParameterName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SampleQueriesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SampleQueriesTests.java new file mode 100644 index 000000000000..931fb15d5a49 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SampleQueriesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.SampleQueries; +import org.junit.jupiter.api.Assertions; + +public final class SampleQueriesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SampleQueries model = BinaryData.fromString("{\"description\":\"olntfx\",\"query\":\"rqmipfjwf\"}") + .toObject(SampleQueries.class); + Assertions.assertEquals("olntfx", model.description()); + Assertions.assertEquals("rqmipfjwf", model.query()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SampleQueries model = new SampleQueries().withDescription("olntfx").withQuery("rqmipfjwf"); + model = BinaryData.fromObject(model).toObject(SampleQueries.class); + Assertions.assertEquals("olntfx", model.description()); + Assertions.assertEquals("rqmipfjwf", model.query()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticPropertiesTests.java new file mode 100644 index 000000000000..5a6aeadffff0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.SapSolutionUsageStatisticProperties; + +public final class SapSolutionUsageStatisticPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SapSolutionUsageStatisticProperties model + = BinaryData.fromString("{\"activeSystemIdCount\":8324027567110316227}") + .toObject(SapSolutionUsageStatisticProperties.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticTests.java new file mode 100644 index 000000000000..a777195b448a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SapSolutionUsageStatisticTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.SapSolutionUsageStatistic; + +public final class SapSolutionUsageStatisticTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SapSolutionUsageStatistic model = BinaryData.fromString( + "{\"kind\":\"SapSolutionUsage\",\"properties\":{\"activeSystemIdCount\":5812372096912791391},\"etag\":\"znllaslk\",\"id\":\"hjqjpv\",\"name\":\"aihxjtgzgtaiywbq\",\"type\":\"roigbsfsgsaenwld\"}") + .toObject(SapSolutionUsageStatistic.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleCommonPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleCommonPropertiesTests.java index a05b8f5608b3..30b3b9ede64e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleCommonPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleCommonPropertiesTests.java @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.EntityMapping; import com.azure.resourcemanager.securityinsights.models.EntityMappingType; @@ -13,6 +15,7 @@ import com.azure.resourcemanager.securityinsights.models.EventGroupingSettings; import com.azure.resourcemanager.securityinsights.models.FieldMapping; import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRuleCommonProperties; +import com.azure.resourcemanager.securityinsights.models.SentinelEntityMapping; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.time.Duration; import java.util.Arrays; @@ -24,71 +27,93 @@ public final class ScheduledAlertRuleCommonPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledAlertRuleCommonProperties model = BinaryData.fromString( - "{\"query\":\"iwrxgkn\",\"queryFrequency\":\"PT12H25M8S\",\"queryPeriod\":\"PT154H27M34S\",\"severity\":\"Low\",\"triggerOperator\":\"GreaterThan\",\"triggerThreshold\":623780438,\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"customDetails\":{\"zflbqvg\":\"oxgsgbpfgzdjtx\",\"sdtutnwlduyc\":\"qvlgafcqusrdvetn\",\"kuqgsjjxundxgket\":\"uzhyrmewipmvekdx\"},\"entityMappings\":[{\"entityType\":\"Malware\",\"fieldMappings\":[{\"identifier\":\"jmhvvmuvgpmuneq\",\"columnName\":\"vmhfbuz\"},{\"identifier\":\"ihsasb\",\"columnName\":\"dyp\"}]},{\"entityType\":\"DNS\",\"fieldMappings\":[{\"identifier\":\"slynsqyrpfoo\",\"columnName\":\"lttymsjn\"},{\"identifier\":\"qdnfwqzdz\",\"columnName\":\"ilaxhn\"},{\"identifier\":\"qlyvijo\",\"columnName\":\"iv\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"yzunbixxrtikv\",\"alertDescriptionFormat\":\"wpgclrcivt\",\"alertTacticsColumnName\":\"xfrk\",\"alertSeverityColumnName\":\"xpmyyefrpmpdnq\"}}") + "{\"query\":\"vq\",\"queryFrequency\":\"PT115H24M17S\",\"queryPeriod\":\"PT104H11M46S\",\"severity\":\"Low\",\"triggerOperator\":\"Equal\",\"triggerThreshold\":1258366887,\"eventGroupingSettings\":{\"aggregationKind\":\"AlertPerResult\"},\"customDetails\":{\"vnhdldwmgxcxr\":\"otbobzdopcj\",\"niyqslui\":\"lpmutwuoegrpkhj\"},\"entityMappings\":[{\"entityType\":\"SecurityGroup\",\"fieldMappings\":[{\"identifier\":\"lvmbmpaxmodfvuef\",\"columnName\":\"sbpfvmwyhr\"},{\"identifier\":\"uyfta\",\"columnName\":\"cpwi\"},{\"identifier\":\"vqtmnub\",\"columnName\":\"kpzksmondjmq\"},{\"identifier\":\"vypomgkopkwho\",\"columnName\":\"pajqgxysm\"}]},{\"entityType\":\"Mailbox\",\"fieldMappings\":[{\"identifier\":\"qvmkcxo\",\"columnName\":\"pvhelxprg\"},{\"identifier\":\"atddc\",\"columnName\":\"bcuejrjxgci\"}]},{\"entityType\":\"RegistryKey\",\"fieldMappings\":[{\"identifier\":\"sxsdqrhzoymibm\",\"columnName\":\"yiba\"}]},{\"entityType\":\"AzureResource\",\"fieldMappings\":[{\"identifier\":\"zdtmhrkwofy\",\"columnName\":\"oqac\"},{\"identifier\":\"expbtg\",\"columnName\":\"bwoenwashrt\"},{\"identifier\":\"kcnqxwbpo\",\"columnName\":\"lpiujwaa\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"qiiobyuqer\",\"alertDescriptionFormat\":\"lp\",\"alertTacticsColumnName\":\"cciuqgbdbutau\",\"alertSeverityColumnName\":\"btkuwhh\",\"alertDynamicProperties\":[{\"alertProperty\":\"ProductComponentName\",\"value\":\"oxafn\"},{\"alertProperty\":\"ProviderName\",\"value\":\"ichkoymkcdyhb\"},{\"alertProperty\":\"AlertLink\",\"value\":\"wdreqnovvqfovl\"},{\"alertProperty\":\"ProviderName\",\"value\":\"suwsyrsnds\"}]},\"sentinelEntitiesMappings\":[{\"columnName\":\"dgvraeaeneq\"}]}") .toObject(ScheduledAlertRuleCommonProperties.class); - Assertions.assertEquals("iwrxgkn", model.query()); - Assertions.assertEquals(Duration.parse("PT12H25M8S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT154H27M34S"), model.queryPeriod()); + Assertions.assertEquals("vq", model.query()); + Assertions.assertEquals(Duration.parse("PT115H24M17S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT104H11M46S"), model.queryPeriod()); Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(TriggerOperator.GREATER_THAN, model.triggerOperator()); - Assertions.assertEquals(623780438, model.triggerThreshold()); - Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, + Assertions.assertEquals(TriggerOperator.EQUAL, model.triggerOperator()); + Assertions.assertEquals(1258366887, model.triggerThreshold()); + Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("oxgsgbpfgzdjtx", model.customDetails().get("zflbqvg")); - Assertions.assertEquals(EntityMappingType.MALWARE, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("jmhvvmuvgpmuneq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("vmhfbuz", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("yzunbixxrtikv", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("wpgclrcivt", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("xfrk", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("xpmyyefrpmpdnq", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals("otbobzdopcj", model.customDetails().get("vnhdldwmgxcxr")); + Assertions.assertEquals(EntityMappingType.SECURITY_GROUP, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("lvmbmpaxmodfvuef", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("sbpfvmwyhr", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("qiiobyuqer", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("lp", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("cciuqgbdbutau", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("btkuwhh", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.PRODUCT_COMPONENT_NAME, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("oxafn", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("dgvraeaeneq", model.sentinelEntitiesMappings().get(0).columnName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduledAlertRuleCommonProperties model - = new ScheduledAlertRuleCommonProperties().withQuery("iwrxgkn") - .withQueryFrequency(Duration.parse("PT12H25M8S")) - .withQueryPeriod(Duration.parse("PT154H27M34S")) - .withSeverity(AlertSeverity.LOW) - .withTriggerOperator(TriggerOperator.GREATER_THAN) - .withTriggerThreshold(623780438) - .withEventGroupingSettings( - new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.SINGLE_ALERT)) - .withCustomDetails(mapOf("zflbqvg", "oxgsgbpfgzdjtx", "sdtutnwlduyc", "qvlgafcqusrdvetn", - "kuqgsjjxundxgket", "uzhyrmewipmvekdx")) - .withEntityMappings( - Arrays.asList( - new EntityMapping().withEntityType(EntityMappingType.MALWARE) - .withFieldMappings(Arrays - .asList(new FieldMapping().withIdentifier("jmhvvmuvgpmuneq").withColumnName("vmhfbuz"), - new FieldMapping().withIdentifier("ihsasb").withColumnName("dyp"))), - new EntityMapping().withEntityType(EntityMappingType.DNS) - .withFieldMappings(Arrays.asList( - new FieldMapping().withIdentifier("slynsqyrpfoo").withColumnName("lttymsjn"), - new FieldMapping().withIdentifier("qdnfwqzdz").withColumnName("ilaxhn"), - new FieldMapping().withIdentifier("qlyvijo").withColumnName("iv"))))) - .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("yzunbixxrtikv") - .withAlertDescriptionFormat("wpgclrcivt") - .withAlertTacticsColumnName("xfrk") - .withAlertSeverityColumnName("xpmyyefrpmpdnq")); + ScheduledAlertRuleCommonProperties model = new ScheduledAlertRuleCommonProperties().withQuery("vq") + .withQueryFrequency(Duration.parse("PT115H24M17S")) + .withQueryPeriod(Duration.parse("PT104H11M46S")) + .withSeverity(AlertSeverity.LOW) + .withTriggerOperator(TriggerOperator.EQUAL) + .withTriggerThreshold(1258366887) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)) + .withCustomDetails(mapOf("vnhdldwmgxcxr", "otbobzdopcj", "niyqslui", "lpmutwuoegrpkhj")) + .withEntityMappings(Arrays.asList( + new EntityMapping().withEntityType(EntityMappingType.SECURITY_GROUP) + .withFieldMappings(Arrays.asList( + new FieldMapping().withIdentifier("lvmbmpaxmodfvuef").withColumnName("sbpfvmwyhr"), + new FieldMapping().withIdentifier("uyfta").withColumnName("cpwi"), + new FieldMapping().withIdentifier("vqtmnub").withColumnName("kpzksmondjmq"), + new FieldMapping().withIdentifier("vypomgkopkwho").withColumnName("pajqgxysm"))), + new EntityMapping().withEntityType(EntityMappingType.MAILBOX) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("qvmkcxo").withColumnName("pvhelxprg"), + new FieldMapping().withIdentifier("atddc").withColumnName("bcuejrjxgci"))), + new EntityMapping().withEntityType(EntityMappingType.REGISTRY_KEY) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("sxsdqrhzoymibm").withColumnName("yiba"))), + new EntityMapping().withEntityType(EntityMappingType.AZURE_RESOURCE) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("zdtmhrkwofy").withColumnName("oqac"), + new FieldMapping().withIdentifier("expbtg").withColumnName("bwoenwashrt"), + new FieldMapping().withIdentifier("kcnqxwbpo").withColumnName("lpiujwaa"))))) + .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("qiiobyuqer") + .withAlertDescriptionFormat("lp") + .withAlertTacticsColumnName("cciuqgbdbutau") + .withAlertSeverityColumnName("btkuwhh") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_COMPONENT_NAME) + .withValue("oxafn"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.PROVIDER_NAME) + .withValue("ichkoymkcdyhb"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.ALERT_LINK).withValue("wdreqnovvqfovl"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.PROVIDER_NAME).withValue("suwsyrsnds")))) + .withSentinelEntitiesMappings(Arrays.asList(new SentinelEntityMapping().withColumnName("dgvraeaeneq"))); model = BinaryData.fromObject(model).toObject(ScheduledAlertRuleCommonProperties.class); - Assertions.assertEquals("iwrxgkn", model.query()); - Assertions.assertEquals(Duration.parse("PT12H25M8S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT154H27M34S"), model.queryPeriod()); + Assertions.assertEquals("vq", model.query()); + Assertions.assertEquals(Duration.parse("PT115H24M17S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT104H11M46S"), model.queryPeriod()); Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(TriggerOperator.GREATER_THAN, model.triggerOperator()); - Assertions.assertEquals(623780438, model.triggerThreshold()); - Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, + Assertions.assertEquals(TriggerOperator.EQUAL, model.triggerOperator()); + Assertions.assertEquals(1258366887, model.triggerThreshold()); + Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("oxgsgbpfgzdjtx", model.customDetails().get("zflbqvg")); - Assertions.assertEquals(EntityMappingType.MALWARE, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("jmhvvmuvgpmuneq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("vmhfbuz", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("yzunbixxrtikv", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("wpgclrcivt", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("xfrk", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("xpmyyefrpmpdnq", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals("otbobzdopcj", model.customDetails().get("vnhdldwmgxcxr")); + Assertions.assertEquals(EntityMappingType.SECURITY_GROUP, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("lvmbmpaxmodfvuef", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("sbpfvmwyhr", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("qiiobyuqer", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("lp", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("cciuqgbdbutau", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("btkuwhh", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.PRODUCT_COMPONENT_NAME, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("oxafn", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("dgvraeaeneq", model.sentinelEntitiesMappings().get(0).columnName()); } // Use "Map.of" if available diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRulePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRulePropertiesTests.java index 4dc3cd927718..f3356c832892 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRulePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRulePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -8,6 +8,8 @@ import com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleProperties; import com.azure.resourcemanager.securityinsights.models.AlertDetail; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.EntityMapping; @@ -18,6 +20,7 @@ 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.SentinelEntityMapping; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.time.Duration; import java.util.Arrays; @@ -29,136 +32,153 @@ public final class ScheduledAlertRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledAlertRuleProperties model = BinaryData.fromString( - "{\"alertRuleTemplateName\":\"qfby\",\"templateVersion\":\"rfgi\",\"description\":\"tcojocqwo\",\"displayName\":\"fnzjvusfzldm\",\"enabled\":true,\"lastModifiedUtc\":\"2021-08-07T02:58:02Z\",\"suppressionDuration\":\"PT132H40M7S\",\"suppressionEnabled\":true,\"tactics\":[\"InitialAccess\",\"DefenseEvasion\",\"DefenseEvasion\",\"InhibitResponseFunction\"],\"techniques\":[\"ysownbtgkbug\",\"jqctojcmisofie\"],\"incidentConfiguration\":{\"createIncident\":true,\"groupingConfiguration\":{\"enabled\":true,\"reopenClosedIncident\":false,\"lookbackDuration\":\"PT66H50M3S\",\"matchingMethod\":\"Selected\",\"groupByEntities\":[\"Host\",\"IP\"],\"groupByAlertDetails\":[\"DisplayName\",\"DisplayName\"],\"groupByCustomDetails\":[\"wkhihihlhzdsqt\",\"bsrgnowc\"]}},\"query\":\"fgmvecactxmwo\",\"queryFrequency\":\"PT44H36M46S\",\"queryPeriod\":\"PT110H48M2S\",\"severity\":\"Low\",\"triggerOperator\":\"Equal\",\"triggerThreshold\":1896348924,\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"customDetails\":{\"wifzmp\":\"qo\",\"cvhrfsp\":\"wyivqikf\",\"kvyklxubyjaffmm\":\"uagrttikteusqc\"},\"entityMappings\":[{\"entityType\":\"Mailbox\",\"fieldMappings\":[{\"identifier\":\"bgq\",\"columnName\":\"rtalmet\"}]},{\"entityType\":\"Malware\",\"fieldMappings\":[{\"identifier\":\"lqxihhrmooiz\",\"columnName\":\"eypxiutcxapzhyr\"},{\"identifier\":\"togebjoxsl\",\"columnName\":\"nhl\"},{\"identifier\":\"rqnkkzjcjbtr\",\"columnName\":\"ehvvib\"},{\"identifier\":\"jj\",\"columnName\":\"oqbeitpkxzt\"}]},{\"entityType\":\"SecurityGroup\",\"fieldMappings\":[{\"identifier\":\"ft\",\"columnName\":\"gfcwqmpimaqxzhem\"}]},{\"entityType\":\"Account\",\"fieldMappings\":[{\"identifier\":\"jswtwkozzwc\",\"columnName\":\"kb\"},{\"identifier\":\"pfajnjwltlwtjj\",\"columnName\":\"ktalhsnvkcdmxz\"},{\"identifier\":\"oaimlnw\",\"columnName\":\"aomylwea\"},{\"identifier\":\"lcsethwwnpj\",\"columnName\":\"fz\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"ch\",\"alertDescriptionFormat\":\"hfbousnfepgfew\",\"alertTacticsColumnName\":\"wlyxgncxyk\",\"alertSeverityColumnName\":\"djhlimm\"}}") + "{\"alertRuleTemplateName\":\"bnw\",\"templateVersion\":\"wgdrjervnaenqp\",\"description\":\"indoygmifthnzd\",\"displayName\":\"dslgnayqigynduh\",\"enabled\":true,\"lastModifiedUtc\":\"2021-07-14T04:56:53Z\",\"suppressionDuration\":\"PT176H21M4S\",\"suppressionEnabled\":true,\"tactics\":[\"Impact\",\"PrivilegeEscalation\",\"Reconnaissance\"],\"techniques\":[\"lbg\",\"cdui\",\"r\",\"gccymvaolpssl\"],\"subTechniques\":[\"mmdnbbglzps\",\"iydmcwyhzdxs\"],\"incidentConfiguration\":{\"createIncident\":false,\"groupingConfiguration\":{\"enabled\":true,\"reopenClosedIncident\":false,\"lookbackDuration\":\"PT186H49M40S\",\"matchingMethod\":\"Selected\",\"groupByEntities\":[\"URL\",\"MailCluster\",\"MailCluster\"],\"groupByAlertDetails\":[\"DisplayName\"],\"groupByCustomDetails\":[\"xzb\",\"cblylpstdbhhxsr\"]}},\"query\":\"zucerscdntnev\",\"queryFrequency\":\"PT81H33M30S\",\"queryPeriod\":\"PT48H24M19S\",\"severity\":\"Low\",\"triggerOperator\":\"LessThan\",\"triggerThreshold\":1448354996,\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"customDetails\":{\"abnetshh\":\"weriofzpyqsem\",\"bmwmbesldnkw\":\"zhedplvwiw\",\"gaokonzmnsikv\":\"tppjflcx\"},\"entityMappings\":[{\"entityType\":\"Malware\",\"fieldMappings\":[{\"identifier\":\"dltfz\",\"columnName\":\"hhvh\"},{\"identifier\":\"r\",\"columnName\":\"dkwobdagx\"}]},{\"entityType\":\"SecurityGroup\",\"fieldMappings\":[{\"identifier\":\"bxwakbog\",\"columnName\":\"ndlkzgxhurip\"}]},{\"entityType\":\"Malware\",\"fieldMappings\":[{\"identifier\":\"unkbebx\",\"columnName\":\"byyntwlrbqt\"},{\"identifier\":\"ievseotgqrllt\",\"columnName\":\"wlauwzizxbmpg\"},{\"identifier\":\"efuzmuvpbttd\",\"columnName\":\"orppxebmnzbtb\"},{\"identifier\":\"pglkf\",\"columnName\":\"hdneuelfph\"}]},{\"entityType\":\"MailCluster\",\"fieldMappings\":[{\"identifier\":\"zfikd\",\"columnName\":\"wq\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"xzxcl\",\"alertDescriptionFormat\":\"thhqzonosggbh\",\"alertTacticsColumnName\":\"hfwdsjnkaljutiis\",\"alertSeverityColumnName\":\"cffgdkzzewk\",\"alertDynamicProperties\":[{\"alertProperty\":\"ProductComponentName\",\"value\":\"a\"},{\"alertProperty\":\"SubTechniques\",\"value\":\"n\"},{\"alertProperty\":\"ExtendedLinks\",\"value\":\"flrwd\"}]},\"sentinelEntitiesMappings\":[{\"columnName\":\"xyjrxsagafcnih\"},{\"columnName\":\"qapnedgfbcv\"}]}") .toObject(ScheduledAlertRuleProperties.class); - Assertions.assertEquals("fgmvecactxmwo", model.query()); - Assertions.assertEquals(Duration.parse("PT44H36M46S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT110H48M2S"), model.queryPeriod()); + Assertions.assertEquals("zucerscdntnev", model.query()); + Assertions.assertEquals(Duration.parse("PT81H33M30S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT48H24M19S"), model.queryPeriod()); Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(TriggerOperator.EQUAL, model.triggerOperator()); - Assertions.assertEquals(1896348924, model.triggerThreshold()); + Assertions.assertEquals(TriggerOperator.LESS_THAN, model.triggerOperator()); + Assertions.assertEquals(1448354996, model.triggerThreshold()); Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("qo", model.customDetails().get("wifzmp")); - Assertions.assertEquals(EntityMappingType.MAILBOX, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("bgq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("rtalmet", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("ch", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("hfbousnfepgfew", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("wlyxgncxyk", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("djhlimm", model.alertDetailsOverride().alertSeverityColumnName()); - Assertions.assertEquals("qfby", model.alertRuleTemplateName()); - Assertions.assertEquals("rfgi", model.templateVersion()); - Assertions.assertEquals("tcojocqwo", model.description()); - Assertions.assertEquals("fnzjvusfzldm", model.displayName()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(Duration.parse("PT132H40M7S"), model.suppressionDuration()); - Assertions.assertEquals(true, model.suppressionEnabled()); - Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.tactics().get(0)); - Assertions.assertEquals("ysownbtgkbug", model.techniques().get(0)); - Assertions.assertEquals(true, model.incidentConfiguration().createIncident()); - Assertions.assertEquals(true, model.incidentConfiguration().groupingConfiguration().enabled()); - Assertions.assertEquals(false, model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT66H50M3S"), + Assertions.assertEquals("weriofzpyqsem", model.customDetails().get("abnetshh")); + Assertions.assertEquals(EntityMappingType.MALWARE, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("dltfz", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("hhvh", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("xzxcl", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("thhqzonosggbh", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("hfwdsjnkaljutiis", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("cffgdkzzewk", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.PRODUCT_COMPONENT_NAME, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("a", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("xyjrxsagafcnih", model.sentinelEntitiesMappings().get(0).columnName()); + Assertions.assertEquals("bnw", model.alertRuleTemplateName()); + Assertions.assertEquals("wgdrjervnaenqp", model.templateVersion()); + Assertions.assertEquals("indoygmifthnzd", model.description()); + Assertions.assertEquals("dslgnayqigynduh", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(Duration.parse("PT176H21M4S"), model.suppressionDuration()); + Assertions.assertTrue(model.suppressionEnabled()); + Assertions.assertEquals(AttackTactic.IMPACT, model.tactics().get(0)); + Assertions.assertEquals("lbg", model.techniques().get(0)); + Assertions.assertEquals("mmdnbbglzps", model.subTechniques().get(0)); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertFalse(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT186H49M40S"), model.incidentConfiguration().groupingConfiguration().lookbackDuration()); Assertions.assertEquals(MatchingMethod.SELECTED, model.incidentConfiguration().groupingConfiguration().matchingMethod()); - Assertions.assertEquals(EntityMappingType.HOST, + Assertions.assertEquals(EntityMappingType.URL, model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); - Assertions.assertEquals("wkhihihlhzdsqt", + Assertions.assertEquals("xzb", model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduledAlertRuleProperties model = new ScheduledAlertRuleProperties().withQuery("fgmvecactxmwo") - .withQueryFrequency(Duration.parse("PT44H36M46S")) - .withQueryPeriod(Duration.parse("PT110H48M2S")) + ScheduledAlertRuleProperties model = new ScheduledAlertRuleProperties().withQuery("zucerscdntnev") + .withQueryFrequency(Duration.parse("PT81H33M30S")) + .withQueryPeriod(Duration.parse("PT48H24M19S")) .withSeverity(AlertSeverity.LOW) - .withTriggerOperator(TriggerOperator.EQUAL) - .withTriggerThreshold(1896348924) + .withTriggerOperator(TriggerOperator.LESS_THAN) + .withTriggerThreshold(1448354996) .withEventGroupingSettings( new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.SINGLE_ALERT)) - .withCustomDetails(mapOf("wifzmp", "qo", "cvhrfsp", "wyivqikf", "kvyklxubyjaffmm", "uagrttikteusqc")) - .withEntityMappings(Arrays.asList(new EntityMapping().withEntityType(EntityMappingType.MAILBOX) - .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("bgq").withColumnName("rtalmet"))), + .withCustomDetails( + mapOf("abnetshh", "weriofzpyqsem", "bmwmbesldnkw", "zhedplvwiw", "gaokonzmnsikv", "tppjflcx")) + .withEntityMappings(Arrays.asList( new EntityMapping().withEntityType(EntityMappingType.MALWARE) - .withFieldMappings(Arrays.asList( - new FieldMapping().withIdentifier("lqxihhrmooiz").withColumnName("eypxiutcxapzhyr"), - new FieldMapping().withIdentifier("togebjoxsl").withColumnName("nhl"), - new FieldMapping().withIdentifier("rqnkkzjcjbtr").withColumnName("ehvvib"), - new FieldMapping().withIdentifier("jj").withColumnName("oqbeitpkxzt"))), + .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("dltfz").withColumnName("hhvh"), + new FieldMapping().withIdentifier("r").withColumnName("dkwobdagx"))), new EntityMapping().withEntityType(EntityMappingType.SECURITY_GROUP) .withFieldMappings( - Arrays.asList(new FieldMapping().withIdentifier("ft").withColumnName("gfcwqmpimaqxzhem"))), - new EntityMapping().withEntityType(EntityMappingType.ACCOUNT) + Arrays.asList(new FieldMapping().withIdentifier("bxwakbog").withColumnName("ndlkzgxhurip"))), + new EntityMapping().withEntityType(EntityMappingType.MALWARE) .withFieldMappings( - Arrays.asList(new FieldMapping().withIdentifier("jswtwkozzwc").withColumnName("kb"), - new FieldMapping().withIdentifier("pfajnjwltlwtjj").withColumnName("ktalhsnvkcdmxz"), - new FieldMapping().withIdentifier("oaimlnw").withColumnName("aomylwea"), - new FieldMapping().withIdentifier("lcsethwwnpj").withColumnName("fz"))))) - .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("ch") - .withAlertDescriptionFormat("hfbousnfepgfew") - .withAlertTacticsColumnName("wlyxgncxyk") - .withAlertSeverityColumnName("djhlimm")) - .withAlertRuleTemplateName("qfby") - .withTemplateVersion("rfgi") - .withDescription("tcojocqwo") - .withDisplayName("fnzjvusfzldm") + Arrays.asList(new FieldMapping().withIdentifier("unkbebx").withColumnName("byyntwlrbqt"), + new FieldMapping().withIdentifier("ievseotgqrllt").withColumnName("wlauwzizxbmpg"), + new FieldMapping().withIdentifier("efuzmuvpbttd").withColumnName("orppxebmnzbtb"), + new FieldMapping().withIdentifier("pglkf").withColumnName("hdneuelfph"))), + new EntityMapping().withEntityType(EntityMappingType.MAIL_CLUSTER) + .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("zfikd").withColumnName("wq"))))) + .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("xzxcl") + .withAlertDescriptionFormat("thhqzonosggbh") + .withAlertTacticsColumnName("hfwdsjnkaljutiis") + .withAlertSeverityColumnName("cffgdkzzewk") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.PRODUCT_COMPONENT_NAME).withValue("a"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.SUB_TECHNIQUES).withValue("n"), + new AlertPropertyMapping().withAlertProperty(AlertProperty.EXTENDED_LINKS).withValue("flrwd")))) + .withSentinelEntitiesMappings(Arrays.asList(new SentinelEntityMapping().withColumnName("xyjrxsagafcnih"), + new SentinelEntityMapping().withColumnName("qapnedgfbcv"))) + .withAlertRuleTemplateName("bnw") + .withTemplateVersion("wgdrjervnaenqp") + .withDescription("indoygmifthnzd") + .withDisplayName("dslgnayqigynduh") .withEnabled(true) - .withSuppressionDuration(Duration.parse("PT132H40M7S")) + .withSuppressionDuration(Duration.parse("PT176H21M4S")) .withSuppressionEnabled(true) - .withTactics(Arrays.asList(AttackTactic.INITIAL_ACCESS, AttackTactic.DEFENSE_EVASION, - AttackTactic.DEFENSE_EVASION, AttackTactic.INHIBIT_RESPONSE_FUNCTION)) - .withTechniques(Arrays.asList("ysownbtgkbug", "jqctojcmisofie")) - .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(true) + .withTactics( + Arrays.asList(AttackTactic.IMPACT, AttackTactic.PRIVILEGE_ESCALATION, AttackTactic.RECONNAISSANCE)) + .withTechniques(Arrays.asList("lbg", "cdui", "r", "gccymvaolpssl")) + .withSubTechniques(Arrays.asList("mmdnbbglzps", "iydmcwyhzdxs")) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(false) .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) .withReopenClosedIncident(false) - .withLookbackDuration(Duration.parse("PT66H50M3S")) + .withLookbackDuration(Duration.parse("PT186H49M40S")) .withMatchingMethod(MatchingMethod.SELECTED) - .withGroupByEntities(Arrays.asList(EntityMappingType.HOST, EntityMappingType.IP)) - .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME, AlertDetail.DISPLAY_NAME)) - .withGroupByCustomDetails(Arrays.asList("wkhihihlhzdsqt", "bsrgnowc")))); + .withGroupByEntities(Arrays.asList(EntityMappingType.URL, EntityMappingType.MAIL_CLUSTER, + EntityMappingType.MAIL_CLUSTER)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails(Arrays.asList("xzb", "cblylpstdbhhxsr")))); model = BinaryData.fromObject(model).toObject(ScheduledAlertRuleProperties.class); - Assertions.assertEquals("fgmvecactxmwo", model.query()); - Assertions.assertEquals(Duration.parse("PT44H36M46S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT110H48M2S"), model.queryPeriod()); + Assertions.assertEquals("zucerscdntnev", model.query()); + Assertions.assertEquals(Duration.parse("PT81H33M30S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT48H24M19S"), model.queryPeriod()); Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(TriggerOperator.EQUAL, model.triggerOperator()); - Assertions.assertEquals(1896348924, model.triggerThreshold()); + Assertions.assertEquals(TriggerOperator.LESS_THAN, model.triggerOperator()); + Assertions.assertEquals(1448354996, model.triggerThreshold()); Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("qo", model.customDetails().get("wifzmp")); - Assertions.assertEquals(EntityMappingType.MAILBOX, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("bgq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("rtalmet", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("ch", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("hfbousnfepgfew", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("wlyxgncxyk", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("djhlimm", model.alertDetailsOverride().alertSeverityColumnName()); - Assertions.assertEquals("qfby", model.alertRuleTemplateName()); - Assertions.assertEquals("rfgi", model.templateVersion()); - Assertions.assertEquals("tcojocqwo", model.description()); - Assertions.assertEquals("fnzjvusfzldm", model.displayName()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(Duration.parse("PT132H40M7S"), model.suppressionDuration()); - Assertions.assertEquals(true, model.suppressionEnabled()); - Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.tactics().get(0)); - Assertions.assertEquals("ysownbtgkbug", model.techniques().get(0)); - Assertions.assertEquals(true, model.incidentConfiguration().createIncident()); - Assertions.assertEquals(true, model.incidentConfiguration().groupingConfiguration().enabled()); - Assertions.assertEquals(false, model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT66H50M3S"), + Assertions.assertEquals("weriofzpyqsem", model.customDetails().get("abnetshh")); + Assertions.assertEquals(EntityMappingType.MALWARE, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("dltfz", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("hhvh", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("xzxcl", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("thhqzonosggbh", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("hfwdsjnkaljutiis", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("cffgdkzzewk", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.PRODUCT_COMPONENT_NAME, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("a", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("xyjrxsagafcnih", model.sentinelEntitiesMappings().get(0).columnName()); + Assertions.assertEquals("bnw", model.alertRuleTemplateName()); + Assertions.assertEquals("wgdrjervnaenqp", model.templateVersion()); + Assertions.assertEquals("indoygmifthnzd", model.description()); + Assertions.assertEquals("dslgnayqigynduh", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(Duration.parse("PT176H21M4S"), model.suppressionDuration()); + Assertions.assertTrue(model.suppressionEnabled()); + Assertions.assertEquals(AttackTactic.IMPACT, model.tactics().get(0)); + Assertions.assertEquals("lbg", model.techniques().get(0)); + Assertions.assertEquals("mmdnbbglzps", model.subTechniques().get(0)); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertFalse(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT186H49M40S"), model.incidentConfiguration().groupingConfiguration().lookbackDuration()); Assertions.assertEquals(MatchingMethod.SELECTED, model.incidentConfiguration().groupingConfiguration().matchingMethod()); - Assertions.assertEquals(EntityMappingType.HOST, + Assertions.assertEquals(EntityMappingType.URL, model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); - Assertions.assertEquals("wkhihihlhzdsqt", + Assertions.assertEquals("xzb", model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplatePropertiesTests.java index 0bddd6ed05d3..77441d75bb28 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplatePropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplatePropertiesTests.java @@ -1,137 +1,56 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.ScheduledAlertRuleTemplateProperties; -import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; 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.TemplateStatus; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ScheduledAlertRuleTemplatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledAlertRuleTemplateProperties model = BinaryData.fromString( - "{\"alertRulesCreatedByTemplateCount\":1428181970,\"createdDateUTC\":\"2021-06-30T10:02:52Z\",\"lastUpdatedDateUTC\":\"2021-01-29T18:46:46Z\",\"description\":\"hzbezkgi\",\"displayName\":\"idxas\",\"requiredDataConnectors\":[{\"connectorId\":\"yvvjskgfmo\",\"dataTypes\":[\"hpqgatjeaahhvj\"]},{\"connectorId\":\"na\",\"dataTypes\":[\"bbjjidjksyxk\",\"xvxevblbjednljla\",\"euaulxu\"]},{\"connectorId\":\"mjbnk\",\"dataTypes\":[\"ynenlsvxeizz\",\"wklnsrmffeyc\"]}],\"status\":\"NotAvailable\",\"query\":\"piymerteea\",\"queryFrequency\":\"PT193H10M30S\",\"queryPeriod\":\"PT111H41M8S\",\"severity\":\"High\",\"triggerOperator\":\"NotEqual\",\"triggerThreshold\":416757302,\"tactics\":[\"Execution\",\"Exfiltration\",\"DefenseEvasion\",\"Discovery\"],\"techniques\":[\"bmxva\",\"refdee\",\"vecuijpx\"],\"version\":\"s\",\"eventGroupingSettings\":{\"aggregationKind\":\"AlertPerResult\"},\"customDetails\":{\"vit\":\"jwsawddjibab\",\"ecdmdqbwpy\":\"tvtzeexavoxtfg\",\"gsfjac\":\"q\",\"d\":\"slhhxudbxv\"},\"entityMappings\":[{\"entityType\":\"RegistryKey\",\"fieldMappings\":[{\"identifier\":\"hzmme\",\"columnName\":\"kdlpa\"}]},{\"entityType\":\"RegistryValue\",\"fieldMappings\":[{\"identifier\":\"a\",\"columnName\":\"cfxwmdbox\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"sftufqobrjlna\",\"alertDescriptionFormat\":\"cc\",\"alertTacticsColumnName\":\"nhxk\",\"alertSeverityColumnName\":\"v\"}}") + "{\"alertRulesCreatedByTemplateCount\":838821681,\"createdDateUTC\":\"2021-03-18T22:39:02Z\",\"lastUpdatedDateUTC\":\"2021-05-26T18:50:42Z\",\"description\":\"udtjuewbc\",\"displayName\":\"xuuwhcj\",\"requiredDataConnectors\":[{\"connectorId\":\"ybvpay\",\"dataTypes\":[\"udzpxgwjplmagstc\",\"ohpfkyrkdbdgiog\",\"jkmnwq\"]},{\"connectorId\":\"obaiyhddviaceg\",\"dataTypes\":[\"ntfpmvmemfnc\"]}],\"status\":\"NotAvailable\",\"query\":\"vbalxlllc\",\"queryFrequency\":\"PT100H24M31S\",\"queryPeriod\":\"PT41H52M41S\",\"severity\":\"Low\",\"triggerOperator\":\"GreaterThan\",\"triggerThreshold\":1468769987,\"tactics\":[\"LateralMovement\"],\"techniques\":[\"uvsj\",\"swsmys\",\"uluqypfc\"],\"subTechniques\":[\"rchpqbmfpjbabwid\"],\"version\":\"xsspuunnoxyhk\",\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"customDetails\":{\"pfhoqcaaewdao\":\"i\",\"xkzb\":\"djvlpj\"},\"entityMappings\":[{\"entityType\":\"Account\",\"fieldMappings\":[{\"identifier\":\"iykzkdncjdx\",\"columnName\":\"bzo\"},{\"identifier\":\"culapzwyrpgogtq\",\"columnName\":\"pnylb\"},{\"identifier\":\"ajlyjtlvofqzhv\",\"columnName\":\"ibyfmo\"},{\"identifier\":\"xrkjpvdw\",\"columnName\":\"zwiivwzjbhyzs\"}]},{\"entityType\":\"SubmissionMail\",\"fieldMappings\":[{\"identifier\":\"btrnegvm\",\"columnName\":\"uqeqv\"},{\"identifier\":\"spastjbkkdmf\",\"columnName\":\"est\"},{\"identifier\":\"lx\",\"columnName\":\"ilozapeewchpxlk\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"uziycsl\",\"alertDescriptionFormat\":\"ufuztcktyhjtq\",\"alertTacticsColumnName\":\"cgzulwmmrqzzr\",\"alertSeverityColumnName\":\"vpglydz\",\"alertDynamicProperties\":[{\"alertProperty\":\"SubTechniques\",\"value\":\"ev\"},{\"alertProperty\":\"ProductComponentName\",\"value\":\"r\"},{\"alertProperty\":\"ConfidenceScore\",\"value\":\"wytpzdmovz\"},{\"alertProperty\":\"ExtendedLinks\",\"value\":\"awzqadfl\"}]},\"sentinelEntitiesMappings\":[{\"columnName\":\"iglaecx\"}]}") .toObject(ScheduledAlertRuleTemplateProperties.class); - Assertions.assertEquals(1428181970, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("hzbezkgi", model.description()); - Assertions.assertEquals("idxas", model.displayName()); - Assertions.assertEquals("yvvjskgfmo", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("hpqgatjeaahhvj", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(838821681, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("udtjuewbc", model.description()); + Assertions.assertEquals("xuuwhcj", model.displayName()); + Assertions.assertEquals("ybvpay", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("udzpxgwjplmagstc", model.requiredDataConnectors().get(0).dataTypes().get(0)); Assertions.assertEquals(TemplateStatus.NOT_AVAILABLE, model.status()); - Assertions.assertEquals("piymerteea", model.query()); - Assertions.assertEquals(Duration.parse("PT193H10M30S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT111H41M8S"), model.queryPeriod()); - Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); - Assertions.assertEquals(TriggerOperator.NOT_EQUAL, model.triggerOperator()); - Assertions.assertEquals(416757302, model.triggerThreshold()); - Assertions.assertEquals(AttackTactic.EXECUTION, model.tactics().get(0)); - Assertions.assertEquals("bmxva", model.techniques().get(0)); - Assertions.assertEquals("s", model.version()); - Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, + Assertions.assertEquals("vbalxlllc", model.query()); + Assertions.assertEquals(Duration.parse("PT100H24M31S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT41H52M41S"), model.queryPeriod()); + Assertions.assertEquals(AlertSeverity.LOW, model.severity()); + Assertions.assertEquals(TriggerOperator.GREATER_THAN, model.triggerOperator()); + Assertions.assertEquals(1468769987, model.triggerThreshold()); + Assertions.assertEquals(AttackTactic.LATERAL_MOVEMENT, model.tactics().get(0)); + Assertions.assertEquals("uvsj", model.techniques().get(0)); + Assertions.assertEquals("rchpqbmfpjbabwid", model.subTechniques().get(0)); + Assertions.assertEquals("xsspuunnoxyhk", model.version()); + Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("jwsawddjibab", model.customDetails().get("vit")); - Assertions.assertEquals(EntityMappingType.REGISTRY_KEY, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("hzmme", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("kdlpa", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("sftufqobrjlna", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("cc", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("nhxk", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("v", model.alertDetailsOverride().alertSeverityColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduledAlertRuleTemplateProperties model - = new ScheduledAlertRuleTemplateProperties().withAlertRulesCreatedByTemplateCount(1428181970) - .withDescription("hzbezkgi") - .withDisplayName("idxas") - .withRequiredDataConnectors(Arrays.asList( - new AlertRuleTemplateDataSource().withConnectorId("yvvjskgfmo") - .withDataTypes(Arrays.asList("hpqgatjeaahhvj")), - new AlertRuleTemplateDataSource().withConnectorId("na") - .withDataTypes(Arrays.asList("bbjjidjksyxk", "xvxevblbjednljla", "euaulxu")), - new AlertRuleTemplateDataSource().withConnectorId("mjbnk") - .withDataTypes(Arrays.asList("ynenlsvxeizz", "wklnsrmffeyc")))) - .withStatus(TemplateStatus.NOT_AVAILABLE) - .withQuery("piymerteea") - .withQueryFrequency(Duration.parse("PT193H10M30S")) - .withQueryPeriod(Duration.parse("PT111H41M8S")) - .withSeverity(AlertSeverity.HIGH) - .withTriggerOperator(TriggerOperator.NOT_EQUAL) - .withTriggerThreshold(416757302) - .withTactics(Arrays.asList(AttackTactic.EXECUTION, AttackTactic.EXFILTRATION, - AttackTactic.DEFENSE_EVASION, AttackTactic.DISCOVERY)) - .withTechniques(Arrays.asList("bmxva", "refdee", "vecuijpx")) - .withVersion("s") - .withEventGroupingSettings( - new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.ALERT_PER_RESULT)) - .withCustomDetails( - mapOf("vit", "jwsawddjibab", "ecdmdqbwpy", "tvtzeexavoxtfg", "gsfjac", "q", "d", "slhhxudbxv")) - .withEntityMappings(Arrays.asList( - new EntityMapping().withEntityType(EntityMappingType.REGISTRY_KEY) - .withFieldMappings( - Arrays.asList(new FieldMapping().withIdentifier("hzmme").withColumnName("kdlpa"))), - new EntityMapping().withEntityType(EntityMappingType.REGISTRY_VALUE) - .withFieldMappings( - Arrays.asList(new FieldMapping().withIdentifier("a").withColumnName("cfxwmdbox"))))) - .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("sftufqobrjlna") - .withAlertDescriptionFormat("cc") - .withAlertTacticsColumnName("nhxk") - .withAlertSeverityColumnName("v")); - model = BinaryData.fromObject(model).toObject(ScheduledAlertRuleTemplateProperties.class); - Assertions.assertEquals(1428181970, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("hzbezkgi", model.description()); - Assertions.assertEquals("idxas", model.displayName()); - Assertions.assertEquals("yvvjskgfmo", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("hpqgatjeaahhvj", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.NOT_AVAILABLE, model.status()); - Assertions.assertEquals("piymerteea", model.query()); - Assertions.assertEquals(Duration.parse("PT193H10M30S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT111H41M8S"), model.queryPeriod()); - Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); - Assertions.assertEquals(TriggerOperator.NOT_EQUAL, model.triggerOperator()); - Assertions.assertEquals(416757302, model.triggerThreshold()); - Assertions.assertEquals(AttackTactic.EXECUTION, model.tactics().get(0)); - Assertions.assertEquals("bmxva", model.techniques().get(0)); - Assertions.assertEquals("s", model.version()); - Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, - model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("jwsawddjibab", model.customDetails().get("vit")); - Assertions.assertEquals(EntityMappingType.REGISTRY_KEY, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("hzmme", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("kdlpa", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("sftufqobrjlna", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("cc", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("nhxk", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("v", model.alertDetailsOverride().alertSeverityColumnName()); - } - - // Use "Map.of" if available - @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; + Assertions.assertEquals("i", model.customDetails().get("pfhoqcaaewdao")); + Assertions.assertEquals(EntityMappingType.ACCOUNT, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("iykzkdncjdx", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("bzo", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("uziycsl", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("ufuztcktyhjtq", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("cgzulwmmrqzzr", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("vpglydz", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.SUB_TECHNIQUES, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("ev", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("iglaecx", model.sentinelEntitiesMappings().get(0).columnName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplateTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplateTests.java index 9faa1646af2c..d14d773d39ea 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplateTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTemplateTests.java @@ -1,129 +1,56 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; -import com.azure.resourcemanager.securityinsights.models.AlertRuleTemplateDataSource; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; 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.ScheduledAlertRuleTemplate; import com.azure.resourcemanager.securityinsights.models.TemplateStatus; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.time.Duration; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ScheduledAlertRuleTemplateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledAlertRuleTemplate model = BinaryData.fromString( - "{\"kind\":\"Scheduled\",\"properties\":{\"alertRulesCreatedByTemplateCount\":1311687390,\"createdDateUTC\":\"2021-05-12T20:14:31Z\",\"lastUpdatedDateUTC\":\"2021-08-20T10:37:04Z\",\"description\":\"r\",\"displayName\":\"eranokqgukkjqnv\",\"requiredDataConnectors\":[{\"connectorId\":\"laxxulc\",\"dataTypes\":[\"dosfjbjsvgjrw\",\"r\",\"vyc\",\"t\"]},{\"connectorId\":\"lxgccknfnwmbtm\",\"dataTypes\":[\"vjdhttzaefedxih\",\"hrphkmcrjdqn\",\"dfzpbgtgkylkdg\"]}],\"status\":\"Installed\",\"query\":\"uutlwxezwzhok\",\"queryFrequency\":\"PT8H14M23S\",\"queryPeriod\":\"PT58H5M9S\",\"severity\":\"Low\",\"triggerOperator\":\"LessThan\",\"triggerThreshold\":1214606185,\"tactics\":[\"ImpairProcessControl\",\"CommandAndControl\"],\"techniques\":[\"ifhpf\",\"oajvgcxtxjcs\",\"eafidltugsresm\",\"ssjhoiftxfkf\"],\"version\":\"gpr\",\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"customDetails\":{\"qtgdqohmcwsl\":\"ucb\",\"tpwb\":\"riz\",\"llibphbqzmizak\":\"a\",\"jpdn\":\"kan\"},\"entityMappings\":[{\"entityType\":\"File\",\"fieldMappings\":[{\"identifier\":\"hjlmu\",\"columnName\":\"xprimrsop\"},{\"identifier\":\"ecj\",\"columnName\":\"islstv\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"lwxdzaum\",\"alertDescriptionFormat\":\"oohgu\",\"alertTacticsColumnName\":\"uzboyjathw\",\"alertSeverityColumnName\":\"olbaemwmdx\"}},\"id\":\"bwjscjpahlxveab\",\"name\":\"qxnmwmqt\",\"type\":\"bxyijddtvq\"}") + "{\"kind\":\"Scheduled\",\"properties\":{\"alertRulesCreatedByTemplateCount\":901267810,\"createdDateUTC\":\"2021-11-22T09:46:17Z\",\"lastUpdatedDateUTC\":\"2021-07-29T21:27:53Z\",\"description\":\"futacoebjvewzc\",\"displayName\":\"nmwcpmgu\",\"requiredDataConnectors\":[{\"connectorId\":\"aufactkahzovajjz\",\"dataTypes\":[\"xps\",\"neekulfg\",\"lqubkwdlen\"]},{\"connectorId\":\"sutujba\",\"dataTypes\":[\"uo\",\"minyflnorwm\",\"uvwpklvxwmyg\",\"xpgpq\"]},{\"connectorId\":\"isze\",\"dataTypes\":[\"bjcrxgibbdaxco\"]}],\"status\":\"NotAvailable\",\"query\":\"auorsukokw\",\"queryFrequency\":\"PT204H49M48S\",\"queryPeriod\":\"PT89H49M23S\",\"severity\":\"Medium\",\"triggerOperator\":\"NotEqual\",\"triggerThreshold\":991430117,\"tactics\":[\"CredentialAccess\",\"CommandAndControl\"],\"techniques\":[\"wzsoldweyuqdunv\"],\"subTechniques\":[\"rwrbi\",\"rk\",\"alywjhhgdn\"],\"version\":\"msi\",\"eventGroupingSettings\":{\"aggregationKind\":\"AlertPerResult\"},\"customDetails\":{\"gdufiqnd\":\"ox\",\"chvcyyysfgdo\":\"euzaof\",\"qonmacj\":\"cubiipuipw\"},\"entityMappings\":[{\"entityType\":\"MailMessage\",\"fieldMappings\":[{\"identifier\":\"vcimpev\",\"columnName\":\"mblrrilbywd\"},{\"identifier\":\"miccwrwfscjfnyn\",\"columnName\":\"qujizdvo\"},{\"identifier\":\"tiby\",\"columnName\":\"bblgyavut\"},{\"identifier\":\"hjoxo\",\"columnName\":\"msksbp\"}]},{\"entityType\":\"Mailbox\",\"fieldMappings\":[{\"identifier\":\"jxkcgxxlxsff\",\"columnName\":\"vizqzdwl\"},{\"identifier\":\"lyoupfgfbkju\",\"columnName\":\"yhgk\"}]},{\"entityType\":\"Account\",\"fieldMappings\":[{\"identifier\":\"owzfttsttkt\",\"columnName\":\"hbq\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"xtgzukxitmmqtgqq\",\"alertDescriptionFormat\":\"hrnxrxc\",\"alertTacticsColumnName\":\"uisavokq\",\"alertSeverityColumnName\":\"fvazivjlfrqttba\",\"alertDynamicProperties\":[{\"alertProperty\":\"AlertLink\",\"value\":\"wxyiopidkqq\"},{\"alertProperty\":\"Techniques\",\"value\":\"s\"}]},\"sentinelEntitiesMappings\":[{\"columnName\":\"mligov\"},{\"columnName\":\"rxkpmloazuruoc\"},{\"columnName\":\"oorb\"}]},\"id\":\"oybfhjxakvvj\",\"name\":\"slordilmyww\",\"type\":\"kgkxn\"}") .toObject(ScheduledAlertRuleTemplate.class); - Assertions.assertEquals(1311687390, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("r", model.description()); - Assertions.assertEquals("eranokqgukkjqnv", model.displayName()); - Assertions.assertEquals("laxxulc", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("dosfjbjsvgjrw", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); - Assertions.assertEquals("uutlwxezwzhok", model.query()); - Assertions.assertEquals(Duration.parse("PT8H14M23S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT58H5M9S"), model.queryPeriod()); - Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(TriggerOperator.LESS_THAN, model.triggerOperator()); - Assertions.assertEquals(1214606185, model.triggerThreshold()); - Assertions.assertEquals(AttackTactic.IMPAIR_PROCESS_CONTROL, model.tactics().get(0)); - Assertions.assertEquals("ifhpf", model.techniques().get(0)); - Assertions.assertEquals("gpr", model.version()); - Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, + Assertions.assertEquals(901267810, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("futacoebjvewzc", model.description()); + Assertions.assertEquals("nmwcpmgu", model.displayName()); + Assertions.assertEquals("aufactkahzovajjz", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("xps", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.NOT_AVAILABLE, model.status()); + Assertions.assertEquals("auorsukokw", model.query()); + Assertions.assertEquals(Duration.parse("PT204H49M48S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT89H49M23S"), model.queryPeriod()); + Assertions.assertEquals(AlertSeverity.MEDIUM, model.severity()); + Assertions.assertEquals(TriggerOperator.NOT_EQUAL, model.triggerOperator()); + Assertions.assertEquals(991430117, model.triggerThreshold()); + Assertions.assertEquals(AttackTactic.CREDENTIAL_ACCESS, model.tactics().get(0)); + Assertions.assertEquals("wzsoldweyuqdunv", model.techniques().get(0)); + Assertions.assertEquals("rwrbi", model.subTechniques().get(0)); + Assertions.assertEquals("msi", model.version()); + Assertions.assertEquals(EventGroupingAggregationKind.ALERT_PER_RESULT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("ucb", model.customDetails().get("qtgdqohmcwsl")); - Assertions.assertEquals(EntityMappingType.FILE, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("hjlmu", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("xprimrsop", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("lwxdzaum", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("oohgu", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("uzboyjathw", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("olbaemwmdx", model.alertDetailsOverride().alertSeverityColumnName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduledAlertRuleTemplate model = new ScheduledAlertRuleTemplate() - .withAlertRulesCreatedByTemplateCount(1311687390) - .withDescription("r") - .withDisplayName("eranokqgukkjqnv") - .withRequiredDataConnectors(Arrays.asList( - new AlertRuleTemplateDataSource().withConnectorId("laxxulc") - .withDataTypes(Arrays.asList("dosfjbjsvgjrw", "r", "vyc", "t")), - new AlertRuleTemplateDataSource().withConnectorId("lxgccknfnwmbtm") - .withDataTypes(Arrays.asList("vjdhttzaefedxih", "hrphkmcrjdqn", "dfzpbgtgkylkdg")))) - .withStatus(TemplateStatus.INSTALLED) - .withQuery("uutlwxezwzhok") - .withQueryFrequency(Duration.parse("PT8H14M23S")) - .withQueryPeriod(Duration.parse("PT58H5M9S")) - .withSeverity(AlertSeverity.LOW) - .withTriggerOperator(TriggerOperator.LESS_THAN) - .withTriggerThreshold(1214606185) - .withTactics(Arrays.asList(AttackTactic.IMPAIR_PROCESS_CONTROL, AttackTactic.COMMAND_AND_CONTROL)) - .withTechniques(Arrays.asList("ifhpf", "oajvgcxtxjcs", "eafidltugsresm", "ssjhoiftxfkf")) - .withVersion("gpr") - .withEventGroupingSettings( - new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.SINGLE_ALERT)) - .withCustomDetails(mapOf("qtgdqohmcwsl", "ucb", "tpwb", "riz", "llibphbqzmizak", "a", "jpdn", "kan")) - .withEntityMappings(Arrays.asList(new EntityMapping().withEntityType(EntityMappingType.FILE) - .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("hjlmu").withColumnName("xprimrsop"), - new FieldMapping().withIdentifier("ecj").withColumnName("islstv"))))) - .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("lwxdzaum") - .withAlertDescriptionFormat("oohgu") - .withAlertTacticsColumnName("uzboyjathw") - .withAlertSeverityColumnName("olbaemwmdx")); - model = BinaryData.fromObject(model).toObject(ScheduledAlertRuleTemplate.class); - Assertions.assertEquals(1311687390, model.alertRulesCreatedByTemplateCount()); - Assertions.assertEquals("r", model.description()); - Assertions.assertEquals("eranokqgukkjqnv", model.displayName()); - Assertions.assertEquals("laxxulc", model.requiredDataConnectors().get(0).connectorId()); - Assertions.assertEquals("dosfjbjsvgjrw", model.requiredDataConnectors().get(0).dataTypes().get(0)); - Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); - Assertions.assertEquals("uutlwxezwzhok", model.query()); - Assertions.assertEquals(Duration.parse("PT8H14M23S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT58H5M9S"), model.queryPeriod()); - Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - Assertions.assertEquals(TriggerOperator.LESS_THAN, model.triggerOperator()); - Assertions.assertEquals(1214606185, model.triggerThreshold()); - Assertions.assertEquals(AttackTactic.IMPAIR_PROCESS_CONTROL, model.tactics().get(0)); - Assertions.assertEquals("ifhpf", model.techniques().get(0)); - Assertions.assertEquals("gpr", model.version()); - Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, - model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("ucb", model.customDetails().get("qtgdqohmcwsl")); - Assertions.assertEquals(EntityMappingType.FILE, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("hjlmu", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("xprimrsop", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("lwxdzaum", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("oohgu", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("uzboyjathw", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("olbaemwmdx", model.alertDetailsOverride().alertSeverityColumnName()); - } - - // Use "Map.of" if available - @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; + Assertions.assertEquals("ox", model.customDetails().get("gdufiqnd")); + Assertions.assertEquals(EntityMappingType.MAIL_MESSAGE, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("vcimpev", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("mblrrilbywd", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("xtgzukxitmmqtgqq", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("hrnxrxc", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("uisavokq", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("fvazivjlfrqttba", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.ALERT_LINK, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("wxyiopidkqq", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("mligov", model.sentinelEntitiesMappings().get(0).columnName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTests.java index ae904508a745..80d9ffa3b405 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ScheduledAlertRuleTests.java @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.AlertDetail; import com.azure.resourcemanager.securityinsights.models.AlertDetailsOverride; +import com.azure.resourcemanager.securityinsights.models.AlertProperty; +import com.azure.resourcemanager.securityinsights.models.AlertPropertyMapping; import com.azure.resourcemanager.securityinsights.models.AlertSeverity; import com.azure.resourcemanager.securityinsights.models.AttackTactic; import com.azure.resourcemanager.securityinsights.models.EntityMapping; @@ -18,6 +20,7 @@ import com.azure.resourcemanager.securityinsights.models.IncidentConfiguration; import com.azure.resourcemanager.securityinsights.models.MatchingMethod; import com.azure.resourcemanager.securityinsights.models.ScheduledAlertRule; +import com.azure.resourcemanager.securityinsights.models.SentinelEntityMapping; import com.azure.resourcemanager.securityinsights.models.TriggerOperator; import java.time.Duration; import java.util.Arrays; @@ -29,140 +32,162 @@ public final class ScheduledAlertRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ScheduledAlertRule model = BinaryData.fromString( - "{\"kind\":\"Scheduled\",\"properties\":{\"alertRuleTemplateName\":\"zgkrvqe\",\"templateVersion\":\"toepryu\",\"description\":\"wytpzdmovz\",\"displayName\":\"fvaawzqa\",\"enabled\":false,\"lastModifiedUtc\":\"2021-08-12T09:55:05Z\",\"suppressionDuration\":\"PT90H15M52S\",\"suppressionEnabled\":false,\"tactics\":[\"InitialAccess\",\"InhibitResponseFunction\"],\"techniques\":[\"cx\"],\"incidentConfiguration\":{\"createIncident\":false,\"groupingConfiguration\":{\"enabled\":false,\"reopenClosedIncident\":false,\"lookbackDuration\":\"PT157H29M48S\",\"matchingMethod\":\"AllEntities\",\"groupByEntities\":[\"URL\",\"SecurityGroup\",\"FileHash\"],\"groupByAlertDetails\":[\"DisplayName\",\"Severity\",\"Severity\"],\"groupByCustomDetails\":[\"bf\",\"rclnpkc\",\"ayzri\"]}},\"query\":\"hya\",\"queryFrequency\":\"PT53H1M13S\",\"queryPeriod\":\"PT47H45M53S\",\"severity\":\"Informational\",\"triggerOperator\":\"Equal\",\"triggerThreshold\":1339269194,\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"customDetails\":{\"nraauzz\":\"omdynhdwdigum\"},\"entityMappings\":[{\"entityType\":\"MailMessage\",\"fieldMappings\":[{\"identifier\":\"zhezwwvaiq\",\"columnName\":\"vv\"},{\"identifier\":\"nk\",\"columnName\":\"hqyikvy\"}]},{\"entityType\":\"RegistryKey\",\"fieldMappings\":[{\"identifier\":\"luwmncst\",\"columnName\":\"jfybvpoekrsgsgb\"},{\"identifier\":\"uzqgnjdgkynsc\",\"columnName\":\"qhzvhxnkomt\"},{\"identifier\":\"bo\",\"columnName\":\"pnvdxz\"}]},{\"entityType\":\"FileHash\",\"fieldMappings\":[{\"identifier\":\"bbc\",\"columnName\":\"qagt\"},{\"identifier\":\"dhlfkqojpykvgt\",\"columnName\":\"cnifm\"}]},{\"entityType\":\"Process\",\"fieldMappings\":[{\"identifier\":\"brn\",\"columnName\":\"u\"},{\"identifier\":\"prafwgckhoc\",\"columnName\":\"d\"},{\"identifier\":\"fwafqrouda\",\"columnName\":\"avehhrvkbunzo\"},{\"identifier\":\"dhcxgkmoy\",\"columnName\":\"dyuib\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"dnbzydvfvfcjn\",\"alertDescriptionFormat\":\"oisrvhmgorffu\",\"alertTacticsColumnName\":\"scvwmzhwplef\",\"alertSeverityColumnName\":\"vxilcbt\"}},\"etag\":\"hnze\",\"id\":\"xtjjfzqlqhycav\",\"name\":\"dggxdbeesmi\",\"type\":\"knlrariaawiuagy\"}") + "{\"kind\":\"Scheduled\",\"properties\":{\"alertRuleTemplateName\":\"savjcbpwxqps\",\"templateVersion\":\"nftguvriuhpr\",\"description\":\"dyvxqtayriww\",\"displayName\":\"oyq\",\"enabled\":true,\"lastModifiedUtc\":\"2021-11-09T09:01:55Z\",\"suppressionDuration\":\"PT35H51M15S\",\"suppressionEnabled\":true,\"tactics\":[\"PrivilegeEscalation\",\"Discovery\"],\"techniques\":[\"ojvknmefqsgzvaha\",\"jyzhpvgq\",\"cjrvxdjzlmwlxkv\"],\"subTechniques\":[\"hzovawjvzunlut\",\"nnprn\",\"i\",\"eilpjzuaejxdu\"],\"incidentConfiguration\":{\"createIncident\":false,\"groupingConfiguration\":{\"enabled\":true,\"reopenClosedIncident\":true,\"lookbackDuration\":\"PT128H31M17S\",\"matchingMethod\":\"AnyAlert\",\"groupByEntities\":[\"SubmissionMail\",\"SecurityGroup\",\"Account\"],\"groupByAlertDetails\":[\"DisplayName\"],\"groupByCustomDetails\":[\"wozuhkf\"]}},\"query\":\"sjyofdx\",\"queryFrequency\":\"PT110H56M24S\",\"queryPeriod\":\"PT23H24M10S\",\"severity\":\"Low\",\"triggerOperator\":\"Equal\",\"triggerThreshold\":1713449860,\"eventGroupingSettings\":{\"aggregationKind\":\"SingleAlert\"},\"customDetails\":{\"elnsmvbxw\":\"v\",\"sxyawjoyaqcs\":\"jsflhhcaalnjix\"},\"entityMappings\":[{\"entityType\":\"Malware\",\"fieldMappings\":[{\"identifier\":\"zyexzn\",\"columnName\":\"ixhnrztf\"},{\"identifier\":\"hb\",\"columnName\":\"knalaulppg\"},{\"identifier\":\"tpnapnyiropuhpig\",\"columnName\":\"gylgqgitxmedjvcs\"},{\"identifier\":\"n\",\"columnName\":\"wncwzzhxgktrmg\"}]},{\"entityType\":\"IP\",\"fieldMappings\":[{\"identifier\":\"t\",\"columnName\":\"ellwptfdy\"},{\"identifier\":\"fqbuaceopzf\",\"columnName\":\"hhuao\"}]},{\"entityType\":\"URL\",\"fieldMappings\":[{\"identifier\":\"qxolzdahzx\",\"columnName\":\"obgbkdmoizp\"},{\"identifier\":\"tmgrcfbun\",\"columnName\":\"fqjhhkxbpvjymj\"}]},{\"entityType\":\"Malware\",\"fieldMappings\":[{\"identifier\":\"gudivkrtswbxqz\",\"columnName\":\"zjf\"},{\"identifier\":\"vjfdx\",\"columnName\":\"vetvt\"}]}],\"alertDetailsOverride\":{\"alertDisplayNameFormat\":\"qtdo\",\"alertDescriptionFormat\":\"cbxvwvxyslqbh\",\"alertTacticsColumnName\":\"xoblytkbl\",\"alertSeverityColumnName\":\"ewwwfbkrvrnsv\",\"alertDynamicProperties\":[{\"alertProperty\":\"ExtendedLinks\",\"value\":\"xc\"}]},\"sentinelEntitiesMappings\":[{\"columnName\":\"ovasrruvwbhsqfsu\"},{\"columnName\":\"gjb\"},{\"columnName\":\"xb\"},{\"columnName\":\"bsrfbj\"}]},\"etag\":\"twss\",\"id\":\"ftpvjzbexil\",\"name\":\"znfqqnvwpmqtar\",\"type\":\"oujmkcjhwqytj\"}") .toObject(ScheduledAlertRule.class); - Assertions.assertEquals("hnze", model.etag()); - Assertions.assertEquals("zgkrvqe", model.alertRuleTemplateName()); - Assertions.assertEquals("toepryu", model.templateVersion()); - Assertions.assertEquals("wytpzdmovz", model.description()); - Assertions.assertEquals("fvaawzqa", model.displayName()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Duration.parse("PT90H15M52S"), model.suppressionDuration()); - Assertions.assertEquals(false, model.suppressionEnabled()); - Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.tactics().get(0)); - Assertions.assertEquals("cx", model.techniques().get(0)); - Assertions.assertEquals(false, model.incidentConfiguration().createIncident()); - Assertions.assertEquals(false, model.incidentConfiguration().groupingConfiguration().enabled()); - Assertions.assertEquals(false, model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT157H29M48S"), + Assertions.assertEquals("twss", model.etag()); + Assertions.assertEquals("savjcbpwxqps", model.alertRuleTemplateName()); + Assertions.assertEquals("nftguvriuhpr", model.templateVersion()); + Assertions.assertEquals("dyvxqtayriww", model.description()); + Assertions.assertEquals("oyq", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(Duration.parse("PT35H51M15S"), model.suppressionDuration()); + Assertions.assertTrue(model.suppressionEnabled()); + Assertions.assertEquals(AttackTactic.PRIVILEGE_ESCALATION, model.tactics().get(0)); + Assertions.assertEquals("ojvknmefqsgzvaha", model.techniques().get(0)); + Assertions.assertEquals("hzovawjvzunlut", model.subTechniques().get(0)); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT128H31M17S"), model.incidentConfiguration().groupingConfiguration().lookbackDuration()); - Assertions.assertEquals(MatchingMethod.ALL_ENTITIES, + Assertions.assertEquals(MatchingMethod.ANY_ALERT, model.incidentConfiguration().groupingConfiguration().matchingMethod()); - Assertions.assertEquals(EntityMappingType.URL, + Assertions.assertEquals(EntityMappingType.SUBMISSION_MAIL, model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); - Assertions.assertEquals("bf", + Assertions.assertEquals("wozuhkf", model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); - Assertions.assertEquals("hya", model.query()); - Assertions.assertEquals(Duration.parse("PT53H1M13S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT47H45M53S"), model.queryPeriod()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); + Assertions.assertEquals("sjyofdx", model.query()); + Assertions.assertEquals(Duration.parse("PT110H56M24S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT23H24M10S"), model.queryPeriod()); + Assertions.assertEquals(AlertSeverity.LOW, model.severity()); Assertions.assertEquals(TriggerOperator.EQUAL, model.triggerOperator()); - Assertions.assertEquals(1339269194, model.triggerThreshold()); + Assertions.assertEquals(1713449860, model.triggerThreshold()); Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("omdynhdwdigum", model.customDetails().get("nraauzz")); - Assertions.assertEquals(EntityMappingType.MAIL_MESSAGE, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("zhezwwvaiq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("vv", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("dnbzydvfvfcjn", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("oisrvhmgorffu", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("scvwmzhwplef", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("vxilcbt", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals("v", model.customDetails().get("elnsmvbxw")); + Assertions.assertEquals(EntityMappingType.MALWARE, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("zyexzn", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("ixhnrztf", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("qtdo", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("cbxvwvxyslqbh", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("xoblytkbl", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("ewwwfbkrvrnsv", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.EXTENDED_LINKS, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("xc", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("ovasrruvwbhsqfsu", model.sentinelEntitiesMappings().get(0).columnName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ScheduledAlertRule model = new ScheduledAlertRule().withEtag("hnze") - .withAlertRuleTemplateName("zgkrvqe") - .withTemplateVersion("toepryu") - .withDescription("wytpzdmovz") - .withDisplayName("fvaawzqa") - .withEnabled(false) - .withSuppressionDuration(Duration.parse("PT90H15M52S")) - .withSuppressionEnabled(false) - .withTactics(Arrays.asList(AttackTactic.INITIAL_ACCESS, AttackTactic.INHIBIT_RESPONSE_FUNCTION)) - .withTechniques(Arrays.asList("cx")) - .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(false) - .withGroupingConfiguration(new GroupingConfiguration().withEnabled(false) - .withReopenClosedIncident(false) - .withLookbackDuration(Duration.parse("PT157H29M48S")) - .withMatchingMethod(MatchingMethod.ALL_ENTITIES) - .withGroupByEntities(Arrays.asList(EntityMappingType.URL, EntityMappingType.SECURITY_GROUP, - EntityMappingType.FILE_HASH)) - .withGroupByAlertDetails( - Arrays.asList(AlertDetail.DISPLAY_NAME, AlertDetail.SEVERITY, AlertDetail.SEVERITY)) - .withGroupByCustomDetails(Arrays.asList("bf", "rclnpkc", "ayzri")))) - .withQuery("hya") - .withQueryFrequency(Duration.parse("PT53H1M13S")) - .withQueryPeriod(Duration.parse("PT47H45M53S")) - .withSeverity(AlertSeverity.INFORMATIONAL) - .withTriggerOperator(TriggerOperator.EQUAL) - .withTriggerThreshold(1339269194) - .withEventGroupingSettings( - new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.SINGLE_ALERT)) - .withCustomDetails(mapOf("nraauzz", "omdynhdwdigum")) - .withEntityMappings(Arrays.asList(new EntityMapping().withEntityType(EntityMappingType.MAIL_MESSAGE) - .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("zhezwwvaiq").withColumnName("vv"), - new FieldMapping().withIdentifier("nk").withColumnName("hqyikvy"))), - new EntityMapping().withEntityType(EntityMappingType.REGISTRY_KEY) - .withFieldMappings( - Arrays.asList(new FieldMapping().withIdentifier("luwmncst").withColumnName("jfybvpoekrsgsgb"), - new FieldMapping().withIdentifier("uzqgnjdgkynsc").withColumnName("qhzvhxnkomt"), - new FieldMapping().withIdentifier("bo").withColumnName("pnvdxz"))), - new EntityMapping().withEntityType(EntityMappingType.FILE_HASH) - .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("bbc").withColumnName("qagt"), - new FieldMapping().withIdentifier("dhlfkqojpykvgt").withColumnName("cnifm"))), - new EntityMapping().withEntityType(EntityMappingType.PROCESS) - .withFieldMappings(Arrays.asList(new FieldMapping().withIdentifier("brn").withColumnName("u"), - new FieldMapping().withIdentifier("prafwgckhoc").withColumnName("d"), - new FieldMapping().withIdentifier("fwafqrouda").withColumnName("avehhrvkbunzo"), - new FieldMapping().withIdentifier("dhcxgkmoy").withColumnName("dyuib"))))) - .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("dnbzydvfvfcjn") - .withAlertDescriptionFormat("oisrvhmgorffu") - .withAlertTacticsColumnName("scvwmzhwplef") - .withAlertSeverityColumnName("vxilcbt")); + ScheduledAlertRule model + = new ScheduledAlertRule().withEtag("twss") + .withAlertRuleTemplateName("savjcbpwxqps") + .withTemplateVersion("nftguvriuhpr") + .withDescription("dyvxqtayriww") + .withDisplayName("oyq") + .withEnabled(true) + .withSuppressionDuration(Duration.parse("PT35H51M15S")) + .withSuppressionEnabled(true) + .withTactics(Arrays.asList(AttackTactic.PRIVILEGE_ESCALATION, AttackTactic.DISCOVERY)) + .withTechniques(Arrays.asList("ojvknmefqsgzvaha", "jyzhpvgq", "cjrvxdjzlmwlxkv")) + .withSubTechniques(Arrays.asList("hzovawjvzunlut", "nnprn", "i", "eilpjzuaejxdu")) + .withIncidentConfiguration(new IncidentConfiguration().withCreateIncident(false) + .withGroupingConfiguration(new GroupingConfiguration().withEnabled(true) + .withReopenClosedIncident(true) + .withLookbackDuration(Duration.parse("PT128H31M17S")) + .withMatchingMethod(MatchingMethod.ANY_ALERT) + .withGroupByEntities(Arrays.asList(EntityMappingType.SUBMISSION_MAIL, + EntityMappingType.SECURITY_GROUP, EntityMappingType.ACCOUNT)) + .withGroupByAlertDetails(Arrays.asList(AlertDetail.DISPLAY_NAME)) + .withGroupByCustomDetails(Arrays.asList("wozuhkf")))) + .withQuery("sjyofdx") + .withQueryFrequency(Duration.parse("PT110H56M24S")) + .withQueryPeriod(Duration.parse("PT23H24M10S")) + .withSeverity(AlertSeverity.LOW) + .withTriggerOperator(TriggerOperator.EQUAL) + .withTriggerThreshold(1713449860) + .withEventGroupingSettings( + new EventGroupingSettings().withAggregationKind(EventGroupingAggregationKind.SINGLE_ALERT)) + .withCustomDetails(mapOf("elnsmvbxw", "v", "sxyawjoyaqcs", "jsflhhcaalnjix")) + .withEntityMappings( + Arrays.asList( + new EntityMapping().withEntityType(EntityMappingType.MALWARE) + .withFieldMappings(Arrays.asList( + new FieldMapping().withIdentifier("zyexzn").withColumnName("ixhnrztf"), + new FieldMapping().withIdentifier("hb").withColumnName("knalaulppg"), + new FieldMapping().withIdentifier("tpnapnyiropuhpig") + .withColumnName("gylgqgitxmedjvcs"), + new FieldMapping().withIdentifier("n").withColumnName("wncwzzhxgktrmg"))), + new EntityMapping().withEntityType(EntityMappingType.IP) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("t").withColumnName("ellwptfdy"), + new FieldMapping().withIdentifier("fqbuaceopzf").withColumnName("hhuao"))), + new EntityMapping().withEntityType(EntityMappingType.URL) + .withFieldMappings(Arrays.asList( + new FieldMapping().withIdentifier("qxolzdahzx").withColumnName("obgbkdmoizp"), + new FieldMapping().withIdentifier("tmgrcfbun").withColumnName("fqjhhkxbpvjymj"))), + new EntityMapping().withEntityType(EntityMappingType.MALWARE) + .withFieldMappings( + Arrays.asList(new FieldMapping().withIdentifier("gudivkrtswbxqz").withColumnName("zjf"), + new FieldMapping().withIdentifier("vjfdx").withColumnName("vetvt"))))) + .withAlertDetailsOverride(new AlertDetailsOverride().withAlertDisplayNameFormat("qtdo") + .withAlertDescriptionFormat("cbxvwvxyslqbh") + .withAlertTacticsColumnName("xoblytkbl") + .withAlertSeverityColumnName("ewwwfbkrvrnsv") + .withAlertDynamicProperties(Arrays.asList( + new AlertPropertyMapping().withAlertProperty(AlertProperty.EXTENDED_LINKS).withValue("xc")))) + .withSentinelEntitiesMappings(Arrays.asList( + new SentinelEntityMapping().withColumnName("ovasrruvwbhsqfsu"), + new SentinelEntityMapping().withColumnName("gjb"), new SentinelEntityMapping().withColumnName("xb"), + new SentinelEntityMapping().withColumnName("bsrfbj"))); model = BinaryData.fromObject(model).toObject(ScheduledAlertRule.class); - Assertions.assertEquals("hnze", model.etag()); - Assertions.assertEquals("zgkrvqe", model.alertRuleTemplateName()); - Assertions.assertEquals("toepryu", model.templateVersion()); - Assertions.assertEquals("wytpzdmovz", model.description()); - Assertions.assertEquals("fvaawzqa", model.displayName()); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Duration.parse("PT90H15M52S"), model.suppressionDuration()); - Assertions.assertEquals(false, model.suppressionEnabled()); - Assertions.assertEquals(AttackTactic.INITIAL_ACCESS, model.tactics().get(0)); - Assertions.assertEquals("cx", model.techniques().get(0)); - Assertions.assertEquals(false, model.incidentConfiguration().createIncident()); - Assertions.assertEquals(false, model.incidentConfiguration().groupingConfiguration().enabled()); - Assertions.assertEquals(false, model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); - Assertions.assertEquals(Duration.parse("PT157H29M48S"), + Assertions.assertEquals("twss", model.etag()); + Assertions.assertEquals("savjcbpwxqps", model.alertRuleTemplateName()); + Assertions.assertEquals("nftguvriuhpr", model.templateVersion()); + Assertions.assertEquals("dyvxqtayriww", model.description()); + Assertions.assertEquals("oyq", model.displayName()); + Assertions.assertTrue(model.enabled()); + Assertions.assertEquals(Duration.parse("PT35H51M15S"), model.suppressionDuration()); + Assertions.assertTrue(model.suppressionEnabled()); + Assertions.assertEquals(AttackTactic.PRIVILEGE_ESCALATION, model.tactics().get(0)); + Assertions.assertEquals("ojvknmefqsgzvaha", model.techniques().get(0)); + Assertions.assertEquals("hzovawjvzunlut", model.subTechniques().get(0)); + Assertions.assertFalse(model.incidentConfiguration().createIncident()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().enabled()); + Assertions.assertTrue(model.incidentConfiguration().groupingConfiguration().reopenClosedIncident()); + Assertions.assertEquals(Duration.parse("PT128H31M17S"), model.incidentConfiguration().groupingConfiguration().lookbackDuration()); - Assertions.assertEquals(MatchingMethod.ALL_ENTITIES, + Assertions.assertEquals(MatchingMethod.ANY_ALERT, model.incidentConfiguration().groupingConfiguration().matchingMethod()); - Assertions.assertEquals(EntityMappingType.URL, + Assertions.assertEquals(EntityMappingType.SUBMISSION_MAIL, model.incidentConfiguration().groupingConfiguration().groupByEntities().get(0)); Assertions.assertEquals(AlertDetail.DISPLAY_NAME, model.incidentConfiguration().groupingConfiguration().groupByAlertDetails().get(0)); - Assertions.assertEquals("bf", + Assertions.assertEquals("wozuhkf", model.incidentConfiguration().groupingConfiguration().groupByCustomDetails().get(0)); - Assertions.assertEquals("hya", model.query()); - Assertions.assertEquals(Duration.parse("PT53H1M13S"), model.queryFrequency()); - Assertions.assertEquals(Duration.parse("PT47H45M53S"), model.queryPeriod()); - Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); + Assertions.assertEquals("sjyofdx", model.query()); + Assertions.assertEquals(Duration.parse("PT110H56M24S"), model.queryFrequency()); + Assertions.assertEquals(Duration.parse("PT23H24M10S"), model.queryPeriod()); + Assertions.assertEquals(AlertSeverity.LOW, model.severity()); Assertions.assertEquals(TriggerOperator.EQUAL, model.triggerOperator()); - Assertions.assertEquals(1339269194, model.triggerThreshold()); + Assertions.assertEquals(1713449860, model.triggerThreshold()); Assertions.assertEquals(EventGroupingAggregationKind.SINGLE_ALERT, model.eventGroupingSettings().aggregationKind()); - Assertions.assertEquals("omdynhdwdigum", model.customDetails().get("nraauzz")); - Assertions.assertEquals(EntityMappingType.MAIL_MESSAGE, model.entityMappings().get(0).entityType()); - Assertions.assertEquals("zhezwwvaiq", model.entityMappings().get(0).fieldMappings().get(0).identifier()); - Assertions.assertEquals("vv", model.entityMappings().get(0).fieldMappings().get(0).columnName()); - Assertions.assertEquals("dnbzydvfvfcjn", model.alertDetailsOverride().alertDisplayNameFormat()); - Assertions.assertEquals("oisrvhmgorffu", model.alertDetailsOverride().alertDescriptionFormat()); - Assertions.assertEquals("scvwmzhwplef", model.alertDetailsOverride().alertTacticsColumnName()); - Assertions.assertEquals("vxilcbt", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals("v", model.customDetails().get("elnsmvbxw")); + Assertions.assertEquals(EntityMappingType.MALWARE, model.entityMappings().get(0).entityType()); + Assertions.assertEquals("zyexzn", model.entityMappings().get(0).fieldMappings().get(0).identifier()); + Assertions.assertEquals("ixhnrztf", model.entityMappings().get(0).fieldMappings().get(0).columnName()); + Assertions.assertEquals("qtdo", model.alertDetailsOverride().alertDisplayNameFormat()); + Assertions.assertEquals("cbxvwvxyslqbh", model.alertDetailsOverride().alertDescriptionFormat()); + Assertions.assertEquals("xoblytkbl", model.alertDetailsOverride().alertTacticsColumnName()); + Assertions.assertEquals("ewwwfbkrvrnsv", model.alertDetailsOverride().alertSeverityColumnName()); + Assertions.assertEquals(AlertProperty.EXTENDED_LINKS, + model.alertDetailsOverride().alertDynamicProperties().get(0).alertProperty()); + Assertions.assertEquals("xc", model.alertDetailsOverride().alertDynamicProperties().get(0).value()); + Assertions.assertEquals("ovasrruvwbhsqfsu", model.sentinelEntitiesMappings().get(0).columnName()); } // Use "Map.of" if available diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesConfidenceReasonsItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesConfidenceReasonsItemTests.java index 5138684d69c8..27fdc38841e0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesConfidenceReasonsItemTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesConfidenceReasonsItemTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class SecurityAlertPropertiesConfidenceReasonsItemTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityAlertPropertiesConfidenceReasonsItem model - = BinaryData.fromString("{\"reason\":\"cwzzhxgktr\",\"reasonType\":\"ucnapkteoellwp\"}") + = BinaryData.fromString("{\"reason\":\"eryekzkdhmeottaw\",\"reasonType\":\"osxw\"}") .toObject(SecurityAlertPropertiesConfidenceReasonsItem.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAlertPropertiesConfidenceReasonsItem model = new SecurityAlertPropertiesConfidenceReasonsItem(); - model = BinaryData.fromObject(model).toObject(SecurityAlertPropertiesConfidenceReasonsItem.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesTests.java index b5758e862be4..d30232c7869a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,15 +13,8 @@ public final class SecurityAlertPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityAlertProperties model = BinaryData.fromString( - "{\"alertDisplayName\":\"bbcswsrtjri\",\"alertType\":\"rbpbewtghfgblcg\",\"compromisedEntity\":\"zvlvqhjkbegib\",\"confidenceLevel\":\"Low\",\"confidenceReasons\":[{\"reason\":\"bwwaloa\",\"reasonType\":\"cgwrtzjuz\"},{\"reason\":\"yzm\",\"reasonType\":\"xongmtsavjcbpwxq\"},{\"reason\":\"rknftguvriuhprwm\",\"reasonType\":\"vxqtayriwwroyqbe\"},{\"reason\":\"mcqibycnojv\",\"reasonType\":\"mefqsgzvahapjyzh\"}],\"confidenceScore\":33.436857957529575,\"confidenceScoreStatus\":\"Final\",\"description\":\"rvxdjzlmw\",\"endTimeUtc\":\"2021-07-11T22:18:52Z\",\"intent\":\"CredentialAccess\",\"providerAlertId\":\"hzovawjvzunlut\",\"processingEndTime\":\"2021-09-06T05:22:37Z\",\"productComponentName\":\"rnxipei\",\"productName\":\"jzuaejxdultskzbb\",\"productVersion\":\"zumveekgpwo\",\"remediationSteps\":[\"kfpbs\",\"yofd\"],\"severity\":\"Low\",\"startTimeUtc\":\"2021-06-15T07:35:54Z\",\"status\":\"Dismissed\",\"systemAlertId\":\"ouwaboekqvkeln\",\"tactics\":[\"ImpairProcessControl\",\"DefenseEvasion\",\"PrivilegeEscalation\"],\"timeGenerated\":\"2021-08-14T03:50:42Z\",\"vendorName\":\"flhhcaal\",\"alertLink\":\"ixisxyawjoy\",\"resourceIdentifiers\":[\"dataslyjpkiid\",\"datayexz\"],\"additionalData\":{\"lhbnxkna\":\"dataixhnrztf\",\"pnapnyiropuh\":\"dataaulppggd\",\"git\":\"dataigvpgylg\"},\"friendlyName\":\"edjvcslynqw\"}") + "{\"alertDisplayName\":\"atvcrkdlbnbq\",\"alertType\":\"h\",\"compromisedEntity\":\"yhzlwxaeaovurexd\",\"confidenceLevel\":\"Low\",\"confidenceReasons\":[{\"reason\":\"ead\",\"reasonType\":\"zmwntopagt\"},{\"reason\":\"v\",\"reasonType\":\"agoaqylkjztji\"}],\"confidenceScore\":20.662774364835546,\"confidenceScoreStatus\":\"InProcess\",\"description\":\"xitp\",\"endTimeUtc\":\"2021-08-22T00:30:16Z\",\"intent\":\"Execution\",\"providerAlertId\":\"dltkrlg\",\"processingEndTime\":\"2021-07-05T02:16:18Z\",\"productComponentName\":\"drvcqguef\",\"productName\":\"ompheqdur\",\"productVersion\":\"yujlfyoumpckyecl\",\"remediationSteps\":[\"gptaj\",\"rzmq\",\"ucycijo\",\"lxiutgjcyzyzjdnr\"],\"severity\":\"Informational\",\"startTimeUtc\":\"2021-01-08T20:25:25Z\",\"status\":\"Dismissed\",\"systemAlertId\":\"oqa\",\"tactics\":[\"DefenseEvasion\"],\"timeGenerated\":\"2021-03-09T17:46:58Z\",\"vendorName\":\"w\",\"alertLink\":\"uatbwbqamteuliy\",\"resourceIdentifiers\":[\"\\\"datakcvmwfauxxepmy\\\"\",\"\\\"databormcqmiciijqpkz\\\"\"],\"additionalData\":{\"xv\":\"\\\"datajxjmcsmyqw\\\"\",\"alickduoi\":\"\\\"datapwnkwywzwo\\\"\",\"kn\":\"\\\"datatamtyv\\\"\",\"cfhzagxnvhycv\":\"\\\"datarwzawnvs\\\"\"},\"friendlyName\":\"mwrzregzgyufutrw\"}") .toObject(SecurityAlertProperties.class); - Assertions.assertEquals(AlertSeverity.LOW, model.severity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAlertProperties model = new SecurityAlertProperties().withSeverity(AlertSeverity.LOW); - model = BinaryData.fromObject(model).toObject(SecurityAlertProperties.class); - Assertions.assertEquals(AlertSeverity.LOW, model.severity()); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTests.java index d69a1f9fd63a..9ff0645dfe01 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,15 +13,8 @@ public final class SecurityAlertTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityAlert model = BinaryData.fromString( - "{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"kfrlhrxsbky\",\"alertType\":\"ycanuzbpzkafku\",\"compromisedEntity\":\"crnwbmeh\",\"confidenceLevel\":\"High\",\"confidenceReasons\":[{\"reason\":\"us\",\"reasonType\":\"slhs\"}],\"confidenceScore\":36.31152947614292,\"confidenceScoreStatus\":\"NotFinal\",\"description\":\"ofmxagkvtmelmqkr\",\"endTimeUtc\":\"2021-09-27T01:04:36Z\",\"intent\":\"Execution\",\"providerAlertId\":\"uahaquhcdhmd\",\"processingEndTime\":\"2021-08-16T04:58:12Z\",\"productComponentName\":\"exq\",\"productName\":\"fadmws\",\"productVersion\":\"r\",\"remediationSteps\":[\"pv\",\"omzlfmi\"],\"severity\":\"High\",\"startTimeUtc\":\"2021-01-11T23:53:59Z\",\"status\":\"New\",\"systemAlertId\":\"ldawkzbaliourqha\",\"tactics\":[\"PreAttack\",\"Execution\",\"PreAttack\"],\"timeGenerated\":\"2021-10-31T19:11:47Z\",\"vendorName\":\"wxosowzxcug\",\"alertLink\":\"jooxdjebw\",\"resourceIdentifiers\":[\"datawwfvov\",\"datavmeueci\",\"datayhz\"],\"additionalData\":{\"ytdxwit\":\"dataojgjrwjueiotwmc\",\"hniskxfbkpyc\":\"datanrjawgqwg\"},\"friendlyName\":\"lwn\"},\"id\":\"hjdauwhvylwz\",\"name\":\"tdhxujznbmpowuwp\",\"type\":\"zqlveualupjmkhf\"}") + "{\"kind\":\"SecurityAlert\",\"properties\":{\"alertDisplayName\":\"k\",\"alertType\":\"fabuiyjibu\",\"compromisedEntity\":\"hdugneiknpg\",\"confidenceLevel\":\"High\",\"confidenceReasons\":[{\"reason\":\"qhibtozipqwjedm\",\"reasonType\":\"r\"},{\"reason\":\"g\",\"reasonType\":\"pkt\"},{\"reason\":\"ylkmqp\",\"reasonType\":\"yhlfb\"},{\"reason\":\"wgcloxoebqinji\",\"reasonType\":\"wjfuj\"}],\"confidenceScore\":28.836854400373092,\"confidenceScoreStatus\":\"Final\",\"description\":\"hhpzpofoiyjwpf\",\"endTimeUtc\":\"2021-07-05T08:16:51Z\",\"intent\":\"CommandAndControl\",\"providerAlertId\":\"holvdn\",\"processingEndTime\":\"2021-08-23T00:24:23Z\",\"productComponentName\":\"uogphuartvtiuky\",\"productName\":\"chnmna\",\"productVersion\":\"nxhkxjqi\",\"remediationSteps\":[\"weooxffifhxwrs\",\"ewmozqvbu\",\"qmamhsycxhxzga\"],\"severity\":\"Low\",\"startTimeUtc\":\"2021-10-24T15:10:06Z\",\"status\":\"InProgress\",\"systemAlertId\":\"vmfqhppubo\",\"tactics\":[\"PrivilegeEscalation\",\"Persistence\",\"Exfiltration\",\"PrivilegeEscalation\"],\"timeGenerated\":\"2021-10-19T15:36:16Z\",\"vendorName\":\"dherngbtcj\",\"alertLink\":\"hokq\",\"resourceIdentifiers\":[\"\\\"datakauxof\\\"\"],\"additionalData\":{\"whslwkoj\":\"\\\"dataphwpnulaiywzej\\\"\",\"rpqaf\":\"\\\"datallndnpd\\\"\"},\"friendlyName\":\"ug\"},\"id\":\"n\",\"name\":\"hyet\",\"type\":\"fypococtfjgti\"}") .toObject(SecurityAlert.class); - Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAlert model = new SecurityAlert().withSeverity(AlertSeverity.HIGH); - model = BinaryData.fromObject(model).toObject(SecurityAlert.class); - Assertions.assertEquals(AlertSeverity.HIGH, model.severity()); + Assertions.assertEquals(AlertSeverity.LOW, model.severity()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTimelineItemTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTimelineItemTests.java new file mode 100644 index 000000000000..725543626db5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityAlertTimelineItemTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.SecurityAlertTimelineItem; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SecurityAlertTimelineItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SecurityAlertTimelineItem model = BinaryData.fromString( + "{\"kind\":\"SecurityAlert\",\"azureResourceId\":\"yf\",\"productName\":\"tkvzbdl\",\"description\":\"ki\",\"displayName\":\"magfyinmajj\",\"severity\":\"Informational\",\"endTimeUtc\":\"2021-10-16T06:41:51Z\",\"startTimeUtc\":\"2021-04-15T10:57:43Z\",\"timeGenerated\":\"2021-10-21T23:04:12Z\",\"alertType\":\"wfkflcvbzkb\",\"intent\":\"Discovery\",\"techniques\":[\"bddmcfqynml\",\"hgzzohta\"]}") + .toObject(SecurityAlertTimelineItem.class); + Assertions.assertEquals("yf", model.azureResourceId()); + Assertions.assertEquals("tkvzbdl", model.productName()); + Assertions.assertEquals("ki", model.description()); + Assertions.assertEquals("magfyinmajj", model.displayName()); + Assertions.assertEquals(AlertSeverity.INFORMATIONAL, model.severity()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-16T06:41:51Z"), model.endTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T10:57:43Z"), model.startTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T23:04:12Z"), model.timeGenerated()); + Assertions.assertEquals("wfkflcvbzkb", model.alertType()); + Assertions.assertEquals("bddmcfqynml", model.techniques().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityPropertiesTests.java index de9277bb3bb2..d05a0d136d87 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class SecurityGroupEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityGroupEntityProperties model = BinaryData.fromString( - "{\"distinguishedName\":\"oaedsxjwuivedwcg\",\"objectGuid\":\"3fbf2976-7689-4559-9a1f-9adc88bce981\",\"sid\":\"wxeiqbpsmgomg\",\"additionalData\":{\"gaufcs\":\"dataljdlrgmspl\",\"wgnxkympqanxrj\":\"datahvn\",\"bta\":\"dataixt\",\"lhkgmnsghp\":\"dataypnyghshxc\"},\"friendlyName\":\"cphdrwjjkhvyo\"}") + "{\"distinguishedName\":\"zxmdew\",\"objectGuid\":\"sxkrpl\",\"sid\":\"aze\",\"additionalData\":{\"qwjhqkbiwetpozyc\":\"\\\"dataviyoypsuhbrnnhjx\\\"\"},\"friendlyName\":\"iqyhgfse\"}") .toObject(SecurityGroupEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityGroupEntityProperties model = new SecurityGroupEntityProperties(); - model = BinaryData.fromObject(model).toObject(SecurityGroupEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityTests.java index 82fafe2300a5..1bab609bacfa 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityGroupEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class SecurityGroupEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityGroupEntity model = BinaryData.fromString( - "{\"kind\":\"SecurityGroup\",\"properties\":{\"distinguishedName\":\"mrjgeihfqlggwfi\",\"objectGuid\":\"3a7769ca-865b-49bd-861b-07935c840b63\",\"sid\":\"xmjpbyep\",\"additionalData\":{\"ljvrcmyfqipgxhnp\":\"datat\"},\"friendlyName\":\"yqwcabvnuil\"},\"id\":\"yaswlpaugmr\",\"name\":\"fjlrxwtoauk\",\"type\":\"fkvcisi\"}") + "{\"kind\":\"SecurityGroup\",\"properties\":{\"distinguishedName\":\"excgjokjljnhvl\",\"objectGuid\":\"bekpeeksnbksdqhj\",\"sid\":\"klxesl\",\"additionalData\":{\"avnwqj\":\"\\\"dataustcpoq\\\"\",\"knlejjjkxybwfd\":\"\\\"datag\\\"\",\"jknsxfwu\":\"\\\"datakjbztensvkzykj\\\"\",\"bpkuwxeoio\":\"\\\"datahcdpkupnqrmgj\\\"\"},\"friendlyName\":\"izfavkjzwf\"},\"id\":\"yay\",\"name\":\"mmfz\",\"type\":\"bfw\"}") .toObject(SecurityGroupEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityGroupEntity model = new SecurityGroupEntity(); - model = BinaryData.fromObject(model).toObject(SecurityGroupEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingInnerTests.java index 03d0dec60668..7f221c004316 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,15 +12,15 @@ public final class SecurityMLAnalyticsSettingInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityMLAnalyticsSettingInner model = BinaryData.fromString( - "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"eyvpnqicvinvkj\",\"id\":\"dxrbuukzcle\",\"name\":\"yhmlwpaztzp\",\"type\":\"fn\"}") + "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"iggbnv\",\"id\":\"o\",\"name\":\"walzyxwhoeamoeo\",\"type\":\"doey\"}") .toObject(SecurityMLAnalyticsSettingInner.class); - Assertions.assertEquals("eyvpnqicvinvkj", model.etag()); + Assertions.assertEquals("iggbnv", model.etag()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecurityMLAnalyticsSettingInner model = new SecurityMLAnalyticsSettingInner().withEtag("eyvpnqicvinvkj"); + SecurityMLAnalyticsSettingInner model = new SecurityMLAnalyticsSettingInner().withEtag("iggbnv"); model = BinaryData.fromObject(model).toObject(SecurityMLAnalyticsSettingInner.class); - Assertions.assertEquals("eyvpnqicvinvkj", model.etag()); + Assertions.assertEquals("iggbnv", model.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java index ef40b595085c..6191349a5758 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; @@ -22,20 +22,20 @@ public final class SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTest @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"mseharx\",\"id\":\"vqnrxtmbpj\",\"name\":\"tnvw\",\"type\":\"hrsidq\"}"; + = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"h\",\"id\":\"ikruljbhgzff\",\"name\":\"mryoiao\",\"type\":\"bz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SecurityMLAnalyticsSetting response = manager.securityMLAnalyticsSettings() - .createOrUpdateWithResponse("fkd", "chlzvfi", "tnkjjwgcwnphb", - new SecurityMLAnalyticsSettingInner().withEtag("fyrtogmhmjp"), com.azure.core.util.Context.NONE) + .createOrUpdateWithResponse("qnvvw", "aorulboawzplwghf", "qoarmtuprqt", + new SecurityMLAnalyticsSettingInner().withEtag("qkohupyajkde"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mseharx", response.etag()); + Assertions.assertEquals("h", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDataSourceTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDataSourceTests.java index 1c86ce7599ae..6245e0f72396 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDataSourceTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDataSourceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,20 +12,21 @@ public final class SecurityMLAnalyticsSettingsDataSourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SecurityMLAnalyticsSettingsDataSource model = BinaryData.fromString( - "{\"connectorId\":\"xtbjwgnyfusfzsv\",\"dataTypes\":[\"kzhajqglcfhm\",\"rqryxynqn\",\"rd\",\"sovwxznptgoeiyb\"]}") + SecurityMLAnalyticsSettingsDataSource model = BinaryData + .fromString( + "{\"connectorId\":\"qbsudzpgchzpg\",\"dataTypes\":[\"mjd\",\"xhzghgodkynr\",\"eqavfdbdfmmxj\"]}") .toObject(SecurityMLAnalyticsSettingsDataSource.class); - Assertions.assertEquals("xtbjwgnyfusfzsv", model.connectorId()); - Assertions.assertEquals("kzhajqglcfhm", model.dataTypes().get(0)); + Assertions.assertEquals("qbsudzpgchzpg", model.connectorId()); + Assertions.assertEquals("mjd", model.dataTypes().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SecurityMLAnalyticsSettingsDataSource model - = new SecurityMLAnalyticsSettingsDataSource().withConnectorId("xtbjwgnyfusfzsv") - .withDataTypes(Arrays.asList("kzhajqglcfhm", "rqryxynqn", "rd", "sovwxznptgoeiyb")); + = new SecurityMLAnalyticsSettingsDataSource().withConnectorId("qbsudzpgchzpg") + .withDataTypes(Arrays.asList("mjd", "xhzghgodkynr", "eqavfdbdfmmxj")); model = BinaryData.fromObject(model).toObject(SecurityMLAnalyticsSettingsDataSource.class); - Assertions.assertEquals("xtbjwgnyfusfzsv", model.connectorId()); - Assertions.assertEquals("kzhajqglcfhm", model.dataTypes().get(0)); + Assertions.assertEquals("qbsudzpgchzpg", model.connectorId()); + Assertions.assertEquals("mjd", model.dataTypes().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java index 5f2276ab3f49..d969c55d0d6e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.securityMLAnalyticsSettings() - .deleteWithResponse("xlbtp", "kft", "gatwmykyu", com.azure.core.util.Context.NONE); + manager.securityMLAnalyticsSettings().deleteWithResponse("dl", "cqu", "v", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java index 6536d97f8479..8b79a83016ef 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSetting; @@ -21,19 +21,19 @@ public final class SecurityMLAnalyticsSettingsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"pfulube\",\"id\":\"ybpmf\",\"name\":\"fununmpzk\",\"type\":\"vfy\"}"; + = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"zfayyuq\",\"id\":\"wrtre\",\"name\":\"erzsnfgmo\",\"type\":\"hcghvsmvvfpky\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SecurityMLAnalyticsSetting response = manager.securityMLAnalyticsSettings() - .getWithResponse("vmywhsbrcarycsjj", "yvoaqajuvehzp", "dmkrrb", com.azure.core.util.Context.NONE) + .getWithResponse("wlhjlbkqygszhp", "atlt", "ekqzfwlkyrnmgsb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("pfulube", response.etag()); + Assertions.assertEquals("zfayyuq", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java index 8adbf9b88218..2c1a851d89ac 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSetting; @@ -22,18 +22,18 @@ public final class SecurityMLAnalyticsSettingsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"wbnfddepl\",\"id\":\"qjn\",\"name\":\"f\",\"type\":\"ygleexa\"}]}"; + = "{\"value\":[{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"nxxjfi\",\"id\":\"ukw\",\"name\":\"caagzlqosgzgsgz\",\"type\":\"bunmjhacfiyryw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.securityMLAnalyticsSettings() - .list("ptyrilkfbnrqqxv", "tpbnfnqtxjtoma", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.securityMLAnalyticsSettings().list("hb", "iibxol", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wbnfddepl", response.iterator().next().etag()); + Assertions.assertEquals("nxxjfi", response.iterator().next().etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListTests.java index b15b9113e35a..e095eaced77b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListTests.java @@ -1,32 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.SecurityMLAnalyticsSettingInner; -import com.azure.resourcemanager.securityinsights.models.SecurityMLAnalyticsSettingsList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.SecurityMLAnalyticsSettingsList; import org.junit.jupiter.api.Assertions; public final class SecurityMLAnalyticsSettingsListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityMLAnalyticsSettingsList model = BinaryData.fromString( - "{\"nextLink\":\"brqubp\",\"value\":[{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"exiili\",\"id\":\"dtiirqt\",\"name\":\"qoaxoruzfgs\",\"type\":\"uyfxrxxleptramxj\"},{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"wlwnwxuqlcv\",\"id\":\"ypatdooaojkniod\",\"name\":\"oo\",\"type\":\"bw\"},{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"jhemms\",\"id\":\"dkcrodt\",\"name\":\"infwjlfltkacjve\",\"type\":\"kdlfoa\"},{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"gkfpaga\",\"id\":\"pulpqblylsyxk\",\"name\":\"jnsjervtiagxsd\",\"type\":\"zuempsbzkf\"}]}") + "{\"value\":[{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"juopjyyqm\",\"id\":\"lhvcwl\",\"name\":\"q\",\"type\":\"ejkluxxr\"}],\"nextLink\":\"obuzmsxga\"}") .toObject(SecurityMLAnalyticsSettingsList.class); - Assertions.assertEquals("exiili", model.value().get(0).etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityMLAnalyticsSettingsList model = new SecurityMLAnalyticsSettingsList() - .withValue(Arrays.asList(new SecurityMLAnalyticsSettingInner().withEtag("exiili"), - new SecurityMLAnalyticsSettingInner().withEtag("wlwnwxuqlcv"), - new SecurityMLAnalyticsSettingInner().withEtag("jhemms"), - new SecurityMLAnalyticsSettingInner().withEtag("gkfpaga"))); - model = BinaryData.fromObject(model).toObject(SecurityMLAnalyticsSettingsList.class); - Assertions.assertEquals("exiili", model.value().get(0).etag()); + Assertions.assertEquals("juopjyyqm", model.value().get(0).etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelEntityMappingTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelEntityMappingTests.java new file mode 100644 index 000000000000..290ad871062e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelEntityMappingTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.SentinelEntityMapping; +import org.junit.jupiter.api.Assertions; + +public final class SentinelEntityMappingTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SentinelEntityMapping model + = BinaryData.fromString("{\"columnName\":\"ogjltdtbnnhad\"}").toObject(SentinelEntityMapping.class); + Assertions.assertEquals("ogjltdtbnnhad", model.columnName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SentinelEntityMapping model = new SentinelEntityMapping().withColumnName("ogjltdtbnnhad"); + model = BinaryData.fromObject(model).toObject(SentinelEntityMapping.class); + Assertions.assertEquals("ogjltdtbnnhad", model.columnName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java index af10894f33f8..30993d4a395b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.sentinelOnboardingStates() - .deleteWithResponse("myck", "exn", "akckywym", com.azure.core.util.Context.NONE); + .deleteWithResponse("ec", "sybiazfvxdkw", "ceql", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingListTests.java new file mode 100644 index 000000000000..cef5c140f394 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingListTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.SettingList; +import org.junit.jupiter.api.Assertions; + +public final class SettingListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SettingList model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"Settings\",\"etag\":\"znxsuloutnpbm\",\"id\":\"oqohgp\",\"name\":\"cdmwk\",\"type\":\"upf\"}],\"nextLink\":\"ldqdzauiunyevdyz\"}") + .toObject(SettingList.class); + Assertions.assertEquals("znxsuloutnpbm", model.value().get(0).etag()); + Assertions.assertEquals("ldqdzauiunyevdyz", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingsInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingsInnerTests.java new file mode 100644 index 000000000000..66e73ea3f21b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SettingsInnerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.SettingsInner; +import org.junit.jupiter.api.Assertions; + +public final class SettingsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SettingsInner model = BinaryData.fromString( + "{\"kind\":\"Settings\",\"etag\":\"lhipcukvbljpxpr\",\"id\":\"chyluqa\",\"name\":\"pcufjjfxtizt\",\"type\":\"dst\"}") + .toObject(SettingsInner.class); + Assertions.assertEquals("lhipcukvbljpxpr", model.etag()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SettingsInner model = new SettingsInner().withEtag("lhipcukvbljpxpr"); + model = BinaryData.fromObject(model).toObject(SettingsInner.class); + Assertions.assertEquals("lhipcukvbljpxpr", model.etag()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityPropertiesTests.java index d546c9864440..3f33fee6ad71 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class SubmissionMailEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubmissionMailEntityProperties model = BinaryData.fromString( - "{\"networkMessageId\":\"09792fe3-0a81-469d-8aa4-bafbee39423f\",\"submissionId\":\"e70c4d1c-6897-4885-a064-b2462c12363b\",\"submitter\":\"m\",\"submissionDate\":\"2021-09-03T01:56:24Z\",\"timestamp\":\"2021-09-20T20:14:10Z\",\"recipient\":\"hspnxwqagnepz\",\"sender\":\"klsbsbqqqagw\",\"senderIp\":\"xaomzisglrrc\",\"subject\":\"zkhhltnjadhqo\",\"reportType\":\"jqoyueayfbpcm\",\"additionalData\":{\"mg\":\"databyrrueqth\",\"gdhxi\":\"datambscbbx\"},\"friendlyName\":\"lopedbwdpyqyyb\"}") + "{\"networkMessageId\":\"xly\",\"submissionId\":\"phvxz\",\"submitter\":\"xhmpejtlkex\",\"submissionDate\":\"2021-07-21T06:13:34Z\",\"timestamp\":\"2021-09-17T09:38:18Z\",\"recipient\":\"kcq\",\"sender\":\"xhxknlc\",\"senderIp\":\"mmkyu\",\"subject\":\"jubyqjfkakfq\",\"reportType\":\"kemyil\",\"additionalData\":{\"owvfdjkpdxph\":\"\\\"dataxjas\\\"\",\"nmgzvyfijdkzuqnw\":\"\\\"datakk\\\"\",\"uqoly\":\"\\\"datait\\\"\"},\"friendlyName\":\"luqw\"}") .toObject(SubmissionMailEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubmissionMailEntityProperties model = new SubmissionMailEntityProperties(); - model = BinaryData.fromObject(model).toObject(SubmissionMailEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityTests.java index 11da8f05b310..75df051aea9f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SubmissionMailEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class SubmissionMailEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubmissionMailEntity model = BinaryData.fromString( - "{\"kind\":\"SubmissionMail\",\"properties\":{\"networkMessageId\":\"70dd29cb-b486-4ae4-bfe1-27271c47a3c5\",\"submissionId\":\"5c651281-e263-4736-b0fa-dc622e6d86d4\",\"submitter\":\"zvxnqmhrp\",\"submissionDate\":\"2021-05-17T11:48:53Z\",\"timestamp\":\"2021-11-23T19:55:35Z\",\"recipient\":\"kois\",\"sender\":\"ssffxuifmc\",\"senderIp\":\"p\",\"subject\":\"kdqzrdzsylo\",\"reportType\":\"gtrczzydmxzjijpv\",\"additionalData\":{\"fx\":\"datarkihcirld\",\"ja\":\"datadcoxnbk\"},\"friendlyName\":\"rnnqb\"},\"id\":\"bpizxqltgr\",\"name\":\"ogypxrxvbfihwu\",\"type\":\"vctafsrb\"}") + "{\"kind\":\"SubmissionMail\",\"properties\":{\"networkMessageId\":\"e\",\"submissionId\":\"sfledyn\",\"submitter\":\"pziuwfbzkkdtnh\",\"submissionDate\":\"2021-09-26T00:23:44Z\",\"timestamp\":\"2021-06-07T11:46:36Z\",\"recipient\":\"selpkpbaf\",\"sender\":\"fhlbylccbev\",\"senderIp\":\"hyzdfwrs\",\"subject\":\"pl\",\"reportType\":\"bmairrhvhfnracwn\",\"additionalData\":{\"uuj\":\"\\\"datag\\\"\",\"bxsjybvitvqkj\":\"\\\"dataouhdawsigrb\\\"\"},\"friendlyName\":\"znumtggmuwdchoz\"},\"id\":\"kfexlv\",\"name\":\"noakiz\",\"type\":\"oaiknaqlnuwig\"}") .toObject(SubmissionMailEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubmissionMailEntity model = new SubmissionMailEntity(); - model = BinaryData.fromObject(model).toObject(SubmissionMailEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..7dcfb4f5e7b1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TICheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class TICheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TICheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"htctxxregyk\"}").toObject(TICheckRequirementsProperties.class); + Assertions.assertEquals("htctxxregyk", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TICheckRequirementsProperties model = new TICheckRequirementsProperties().withTenantId("htctxxregyk"); + model = BinaryData.fromObject(model).toObject(TICheckRequirementsProperties.class); + Assertions.assertEquals("htctxxregyk", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsTests.java new file mode 100644 index 000000000000..9eb658cbeba1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TICheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.TICheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class TICheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TICheckRequirements model + = BinaryData.fromString("{\"kind\":\"ThreatIntelligence\",\"properties\":{\"tenantId\":\"gqq\"}}") + .toObject(TICheckRequirements.class); + Assertions.assertEquals("gqq", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TICheckRequirements model = new TICheckRequirements().withTenantId("gqq"); + model = BinaryData.fromObject(model).toObject(TICheckRequirements.class); + Assertions.assertEquals("gqq", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesIndicatorsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesIndicatorsTests.java index e5791c167151..4f5e3060e335 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesIndicatorsTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesIndicatorsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesTests.java index 260016f76572..acd6afdbb9eb 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorDataTypesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,16 +13,16 @@ public final class TIDataConnectorDataTypesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TIDataConnectorDataTypes model = BinaryData.fromString("{\"indicators\":{\"state\":\"Enabled\"}}") + TIDataConnectorDataTypes model = BinaryData.fromString("{\"indicators\":{\"state\":\"Disabled\"}}") .toObject(TIDataConnectorDataTypes.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.indicators().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.indicators().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TIDataConnectorDataTypes model = new TIDataConnectorDataTypes() - .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED)); + .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.DISABLED)); model = BinaryData.fromObject(model).toObject(TIDataConnectorDataTypes.class); - Assertions.assertEquals(DataTypeState.ENABLED, model.indicators().state()); + Assertions.assertEquals(DataTypeState.DISABLED, model.indicators().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorPropertiesTests.java index f7904c8361c3..2f0b7dcd3712 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -16,22 +16,22 @@ public final class TIDataConnectorPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TIDataConnectorProperties model = BinaryData.fromString( - "{\"tenantId\":\"ypundmbxhugc\",\"tipLookbackPeriod\":\"2021-02-05T12:35:53Z\",\"dataTypes\":{\"indicators\":{\"state\":\"Disabled\"}}}") + "{\"tipLookbackPeriod\":\"2021-05-20T10:33:18Z\",\"dataTypes\":{\"indicators\":{\"state\":\"Enabled\"}},\"tenantId\":\"gx\"}") .toObject(TIDataConnectorProperties.class); - Assertions.assertEquals("ypundmbxhugc", model.tenantId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T12:35:53Z"), model.tipLookbackPeriod()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().indicators().state()); + Assertions.assertEquals("gx", model.tenantId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T10:33:18Z"), model.tipLookbackPeriod()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().indicators().state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TIDataConnectorProperties model = new TIDataConnectorProperties().withTenantId("ypundmbxhugc") - .withTipLookbackPeriod(OffsetDateTime.parse("2021-02-05T12:35:53Z")) + TIDataConnectorProperties model = new TIDataConnectorProperties().withTenantId("gx") + .withTipLookbackPeriod(OffsetDateTime.parse("2021-05-20T10:33:18Z")) .withDataTypes(new TIDataConnectorDataTypes() - .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.DISABLED))); + .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))); model = BinaryData.fromObject(model).toObject(TIDataConnectorProperties.class); - Assertions.assertEquals("ypundmbxhugc", model.tenantId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T12:35:53Z"), model.tipLookbackPeriod()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().indicators().state()); + Assertions.assertEquals("gx", model.tenantId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T10:33:18Z"), model.tipLookbackPeriod()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().indicators().state()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorTests.java index f47b6b20c386..8ad8a1b4aa38 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIDataConnectorTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -16,25 +16,25 @@ public final class TIDataConnectorTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TIDataConnector model = BinaryData.fromString( - "{\"kind\":\"ThreatIntelligence\",\"properties\":{\"tenantId\":\"znuciqdsm\",\"tipLookbackPeriod\":\"2021-05-19T04:46:27Z\",\"dataTypes\":{\"indicators\":{\"state\":\"Disabled\"}}},\"etag\":\"xtyasiibmiyb\",\"id\":\"ustgnljhnmgixhc\",\"name\":\"avmqfoudor\",\"type\":\"cgyypro\"}") + "{\"kind\":\"ThreatIntelligence\",\"properties\":{\"tipLookbackPeriod\":\"2021-01-07T15:54:10Z\",\"dataTypes\":{\"indicators\":{\"state\":\"Enabled\"}},\"tenantId\":\"eakhtmhobcya\"},\"etag\":\"fvqtvkhgvoo\",\"id\":\"kfnaoaqymhc\",\"name\":\"topuowyrn\",\"type\":\"kbyhqu\"}") .toObject(TIDataConnector.class); - Assertions.assertEquals("xtyasiibmiyb", model.etag()); - Assertions.assertEquals("znuciqdsm", model.tenantId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T04:46:27Z"), model.tipLookbackPeriod()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().indicators().state()); + Assertions.assertEquals("fvqtvkhgvoo", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-07T15:54:10Z"), model.tipLookbackPeriod()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().indicators().state()); + Assertions.assertEquals("eakhtmhobcya", model.tenantId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TIDataConnector model = new TIDataConnector().withEtag("xtyasiibmiyb") - .withTenantId("znuciqdsm") - .withTipLookbackPeriod(OffsetDateTime.parse("2021-05-19T04:46:27Z")) + TIDataConnector model = new TIDataConnector().withEtag("fvqtvkhgvoo") + .withTipLookbackPeriod(OffsetDateTime.parse("2021-01-07T15:54:10Z")) .withDataTypes(new TIDataConnectorDataTypes() - .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.DISABLED))); + .withIndicators(new TIDataConnectorDataTypesIndicators().withState(DataTypeState.ENABLED))) + .withTenantId("eakhtmhobcya"); model = BinaryData.fromObject(model).toObject(TIDataConnector.class); - Assertions.assertEquals("xtyasiibmiyb", model.etag()); - Assertions.assertEquals("znuciqdsm", model.tenantId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T04:46:27Z"), model.tipLookbackPeriod()); - Assertions.assertEquals(DataTypeState.DISABLED, model.dataTypes().indicators().state()); + Assertions.assertEquals("fvqtvkhgvoo", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-07T15:54:10Z"), model.tipLookbackPeriod()); + Assertions.assertEquals(DataTypeState.ENABLED, model.dataTypes().indicators().state()); + Assertions.assertEquals("eakhtmhobcya", model.tenantId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectCommonPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectCommonPropertiesTests.java new file mode 100644 index 000000000000..b2e2455c82c4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectCommonPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectCommonProperties; + +public final class TIObjectCommonPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TIObjectCommonProperties model = BinaryData.fromString( + "{\"data\":{\"hoqpbfjfcbweabpt\":\"\\\"dataemny\\\"\"},\"createdBy\":{\"email\":\"uqu\",\"name\":\"gvnomlcldoyohuaf\",\"objectId\":\"lop\"},\"source\":\"ms\",\"firstIngestedTimeUtc\":\"2021-11-07T03:57:47Z\",\"lastIngestedTimeUtc\":\"2021-07-16T05:07:26Z\",\"ingestionRulesVersion\":\"oowfrg\",\"lastUpdateMethod\":\"bgbhtpo\",\"lastModifiedBy\":{\"email\":\"stkqywabhl\",\"name\":\"rskvtzbkeeo\",\"objectId\":\"fedxgd\"},\"lastUpdatedDateTimeUtc\":\"2021-02-25T16:56:52Z\",\"relationshipHints\":[{\"fieldName\":\"xh\",\"source\":\"mehcdfd\"}]}") + .toObject(TIObjectCommonProperties.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectInnerTests.java new file mode 100644 index 000000000000..ceb867ac5cf2 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TIObjectInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TIObjectInner; + +public final class TIObjectInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TIObjectInner model = BinaryData.fromString( + "{\"kind\":\"TIObject\",\"properties\":{\"data\":{\"uqgneorqtrkxeikq\":\"\\\"datajmgswtwms\\\"\",\"omzvgjynuwcqu\":\"\\\"dataaagnzbkqqbjcdauc\\\"\"},\"createdBy\":{\"email\":\"nqdmmro\",\"name\":\"gtblmxblcb\",\"objectId\":\"sqpeavlcbb\"},\"source\":\"epcgirsfilxusyzc\",\"firstIngestedTimeUtc\":\"2021-05-10T18:43:23Z\",\"lastIngestedTimeUtc\":\"2021-03-16T02:55:05Z\",\"ingestionRulesVersion\":\"eh\",\"lastUpdateMethod\":\"bburbxovgjipbnn\",\"lastModifiedBy\":{\"email\":\"jxwjnwgoxenhpyix\",\"name\":\"rsaeuzso\",\"objectId\":\"lyygfticuyd\"},\"lastUpdatedDateTimeUtc\":\"2021-10-15T13:29:32Z\",\"relationshipHints\":[{\"fieldName\":\"euyqtzoeaotrbn\",\"source\":\"ephttoq\"}]},\"id\":\"fdvxrlrsrf\",\"name\":\"xylmdjpspipkpcvh\",\"type\":\"adjcasncg\"}") + .toObject(TIObjectInner.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TeamInformationTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TeamInformationTests.java new file mode 100644 index 000000000000..3646d05fb7ac --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TeamInformationTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.TeamInformation; + +public final class TeamInformationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TeamInformation model = BinaryData.fromString( + "{\"teamId\":\"eeebtijvacv\",\"primaryChannelUrl\":\"qzbqqxlajrnwxa\",\"teamCreationTimeUtc\":\"2021-06-29T17:46:16Z\",\"name\":\"h\",\"description\":\"uyxoaf\"}") + .toObject(TeamInformation.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TeamInformation model = new TeamInformation(); + model = BinaryData.fromObject(model).toObject(TeamInformation.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateListTests.java new file mode 100644 index 000000000000..edf231316fab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateListTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.TemplateList; +import com.azure.resourcemanager.securityinsights.models.Kind; +import com.azure.resourcemanager.securityinsights.models.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import org.junit.jupiter.api.Assertions; + +public final class TemplateListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TemplateList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"contentId\":\"fddkhxvevwxmnb\",\"contentProductId\":\"xadxgnpyhtuhal\",\"packageVersion\":\"ildnao\",\"version\":\"xznpnytkqja\",\"displayName\":\"azbtgtzp\",\"contentKind\":\"WatchlistTemplate\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"oujfgtgxuupczegq\",\"sourceId\":\"idvssvgyoggkztzt\"},\"author\":{\"name\":\"knpbq\",\"email\":\"kuobclobnaqeizpl\",\"link\":\"lyugpnn\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"kffeon\",\"email\":\"vmujyiqywlp\",\"link\":\"liytdegcrun\"},\"dependencies\":{\"contentId\":\"lxstekbirhyvs\",\"kind\":\"DataConnector\",\"version\":\"iemorszffiukltr\",\"name\":\"ioguoxcsdqo\",\"operator\":\"AND\",\"criteria\":[{},{}]},\"categories\":{\"domains\":[\"gxgrggy\"],\"verticals\":[\"bnqinrsxvvm\",\"nj\"]},\"providers\":[\"joxqsw\",\"ychdcjggc\",\"pncjqbgbnoqnowv\"],\"customVersion\":\"tzgwjeky\",\"contentSchemaVersion\":\"rv\",\"icon\":\"o\",\"threatAnalysisTactics\":[\"gpppdilbdvxlfh\",\"zzgapspxwwblscrm\"],\"threatAnalysisTechniques\":[\"uz\",\"wkgouxnro\",\"ht\",\"esywywnvgy\"],\"previewImages\":[\"ifrzcwuejmxlfzl\"],\"previewImagesDark\":[\"rgrlhchra\"],\"packageId\":\"jovlxqtvmvzpniq\",\"packageKind\":\"Solution\",\"packageName\":\"gmnkgtlh\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datazkioiyecznvz\\\"\",\"dependantTemplates\":[{\"contentId\":\"ngheqzhehgvmmno\",\"contentProductId\":\"gnbnypluzypkfcd\",\"packageVersion\":\"xilzvxot\",\"version\":\"ilqcdvhyefqhx\",\"displayName\":\"sqmbwcacwaaqa\",\"contentKind\":\"ResourcesDataConnector\",\"source\":{\"kind\":\"LocalWorkspace\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"lreq\",\"rc\",\"mdts\",\"zumxucznbabowrcy\"],\"customVersion\":\"wkowxqz\",\"contentSchemaVersion\":\"agve\",\"icon\":\"mnaphrskmpeajzzy\",\"threatAnalysisTactics\":[\"amzmzfnt\"],\"threatAnalysisTechniques\":[\"r\"],\"previewImages\":[\"ytj\",\"ypjdrjli\"],\"previewImagesDark\":[\"vbfaehjji\",\"vjqxav\",\"mdmracfsffdralih\",\"sscygyzhcvlavyrj\"],\"packageId\":\"dxrmyzvti\",\"packageKind\":\"Standalone\",\"packageName\":\"drubxaxoyjy\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataedigiv\\\"\",\"dependantTemplates\":[{},{},{},{}]},{\"contentId\":\"cxf\",\"contentProductId\":\"tntmc\",\"packageVersion\":\"bqpmfhjik\",\"version\":\"nbdqitghnm\",\"displayName\":\"zvrchmyuc\",\"contentKind\":\"Solution\",\"source\":{\"kind\":\"SourceRepository\"},\"author\":{},\"support\":{\"tier\":\"Community\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"gqqqgrbrhh\"],\"customVersion\":\"tipaaoylwhf\",\"contentSchemaVersion\":\"bweasgypjixd\",\"icon\":\"badydwqeuwdvcl\",\"threatAnalysisTactics\":[\"qdchnzib\",\"xr\",\"srwx\",\"qkwargcbgdgos\"],\"threatAnalysisTechniques\":[\"qexqwqykmvugfl\",\"dho\",\"urhcnnkvth\"],\"previewImages\":[\"mvmbgyvxhfmuhkez\"],\"previewImagesDark\":[\"qic\"],\"packageId\":\"dxvbeqzjdwxt\",\"packageKind\":\"Solution\",\"packageName\":\"wnee\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datalxug\\\"\",\"dependantTemplates\":[{}]},{\"contentId\":\"nffaofkvfruxzkfb\",\"contentProductId\":\"gykzovstvymdqa\",\"packageVersion\":\"qmyrnzgubqkf\",\"version\":\"xhvo\",\"displayName\":\"dgfkrqsjrvpakxr\",\"contentKind\":\"AzureFunction\",\"source\":{\"kind\":\"Community\"},\"author\":{},\"support\":{\"tier\":\"Microsoft\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"xbohpzurn\",\"oytkbeadyfenro\",\"oijoxcbpkiwse\"],\"customVersion\":\"axdrpanhsxw\",\"contentSchemaVersion\":\"rztdacrqcwk\",\"icon\":\"qy\",\"threatAnalysisTactics\":[\"jmmczupdcb\",\"rufs\",\"b\",\"uxkdiumgsivxw\"],\"threatAnalysisTechniques\":[\"wbs\",\"fihvlmsceylaulpu\",\"xyigxzty\"],\"previewImages\":[\"d\",\"lspgnndefyhsb\",\"hwlvsvs\"],\"previewImagesDark\":[\"aprqtfkmvz\",\"kpmonxdwfcuh\",\"gftfvquk\",\"mvzenegpdqrjy\"],\"packageId\":\"qqsemjhhxlsube\",\"packageKind\":\"Standalone\",\"packageName\":\"ejrdzwyktdpfzwuf\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datawjhmjkykqfl\\\"\",\"dependantTemplates\":[{}]}]},\"etag\":\"kx\",\"id\":\"smkb\",\"name\":\"dnrihp\",\"type\":\"axhcbeejnoign\"},{\"properties\":{\"contentId\":\"krnp\",\"contentProductId\":\"nmrmhkipja\",\"packageVersion\":\"vdpfgwd\",\"version\":\"iae\",\"displayName\":\"pbie\",\"contentKind\":\"Watchlist\",\"source\":{\"kind\":\"Community\",\"name\":\"vjlpbjszq\",\"sourceId\":\"skjvaycxrwknsbg\"},\"author\":{\"name\":\"brzwiypz\",\"email\":\"hkecebtpgvutb\",\"link\":\"sfd\"},\"support\":{\"tier\":\"Community\",\"name\":\"qcowkendgrc\",\"email\":\"flxq\",\"link\":\"ugtcuyuwgnyj\"},\"dependencies\":{\"contentId\":\"jticw\",\"kind\":\"Solution\",\"version\":\"lhibfm\",\"name\":\"xbktu\",\"operator\":\"OR\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"dgnmei\",\"mnobbai\",\"cfbfy\"],\"verticals\":[\"i\"]},\"providers\":[\"fgvmrkmgifmy\",\"buhdnhhcmtslptbd\",\"onhbl\"],\"customVersion\":\"nuqfpzjzzbpcwtw\",\"contentSchemaVersion\":\"chkcmruawqesqs\",\"icon\":\"iekx\",\"threatAnalysisTactics\":[\"qchf\",\"tykkvjjlba\",\"cu\"],\"threatAnalysisTechniques\":[\"qokbgumuej\",\"xpxxizchmbuzg\",\"nrkjkng\",\"fsu\"],\"previewImages\":[\"bhozlsbufnhbvc\",\"tpo\",\"eytrsljzm\",\"uicsggsxznbppmkq\"],\"previewImagesDark\":[\"bbnjldicqoman\",\"fwl\"],\"packageId\":\"itvkyahfoyfzoi\",\"packageKind\":\"Standalone\",\"packageName\":\"prev\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datafalwceechca\\\"\",\"dependantTemplates\":[{\"contentId\":\"eqpucnus\",\"contentProductId\":\"lfhicrjr\",\"packageVersion\":\"bfbydrlqllbo\",\"version\":\"nqocybrhxgiknrlu\",\"displayName\":\"eiqb\",\"contentKind\":\"AzureFunction\",\"source\":{\"kind\":\"Community\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"dgp\",\"sgotbunvnjqldr\"],\"customVersion\":\"ugusqlx\",\"contentSchemaVersion\":\"edthfwlnvqacbyfi\",\"icon\":\"lnlmpuyypaggpaih\",\"threatAnalysisTactics\":[\"yzwloqrmgd\"],\"threatAnalysisTechniques\":[\"ipvlxtywukhj\",\"spllitxrrgkw\",\"yoy\"],\"previewImages\":[\"ivxcodwkwoytcach\",\"sizfuewlf\",\"fiikqcdnzsfiu\",\"gne\"],\"previewImagesDark\":[\"mcrxlyzoaho\",\"ufakrxjjwnbrmdwt\"],\"packageId\":\"nlsyia\",\"packageKind\":\"Standalone\",\"packageName\":\"tcjhatclpphcs\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datacpanap\\\"\",\"dependantTemplates\":[{},{}]},{\"contentId\":\"zrinlpxngzzx\",\"contentProductId\":\"gqnzmzctbxzjkpif\",\"packageVersion\":\"cvbdozwbsk\",\"version\":\"afzsq\",\"displayName\":\"i\",\"contentKind\":\"Standalone\",\"source\":{\"kind\":\"SourceRepository\"},\"author\":{},\"support\":{\"tier\":\"Community\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"vrdukcd\"],\"customVersion\":\"labuxtwgbaws\",\"contentSchemaVersion\":\"am\",\"icon\":\"ugqcglmadfztof\",\"threatAnalysisTactics\":[\"lauua\",\"wayfmcerfxf\",\"iqba\"],\"threatAnalysisTechniques\":[\"zwjipssvnon\"],\"previewImages\":[\"qcj\",\"zzjkugpdqqbt\",\"kvocu\"],\"previewImagesDark\":[\"lbpwarhwettohg\",\"z\",\"xyvtkzbhizxp\",\"sddmwnfhmju\"],\"packageId\":\"qnkushvlxud\",\"packageKind\":\"Solution\",\"packageName\":\"qnirmidtvhjcgs\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataygkxrlfojlclp\\\"\",\"dependantTemplates\":[{},{},{},{}]},{\"contentId\":\"ybodhrv\",\"contentProductId\":\"duumw\",\"packageVersion\":\"umjvegpdxtsaujt\",\"version\":\"ojybolqoxuptsli\",\"displayName\":\"mlkwk\",\"contentKind\":\"WorkbookTemplate\",\"source\":{\"kind\":\"Community\"},\"author\":{},\"support\":{\"tier\":\"Microsoft\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"zdekfx\"],\"customVersion\":\"zdozktkdpczeoh\",\"contentSchemaVersion\":\"rgcnbvmhvqpkedax\",\"icon\":\"yorfjid\",\"threatAnalysisTactics\":[\"aweog\"],\"threatAnalysisTechniques\":[\"yihuzsbpwn\"],\"previewImages\":[\"cypazwiimdlzg\",\"ooagrlw\",\"amesit\",\"qadewhuwxk\"],\"previewImagesDark\":[\"atfamrna\",\"fllxc\",\"prkiyfoz\",\"homyd\"],\"packageId\":\"tuqbvf\",\"packageKind\":\"Standalone\",\"packageName\":\"hirqvvke\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataaqoktssgvqxer\\\"\",\"dependantTemplates\":[{}]}]},\"etag\":\"rraqgb\",\"id\":\"lvihylrxsi\",\"name\":\"zsyiumtitlq\",\"type\":\"cf\"},{\"properties\":{\"contentId\":\"nnkqpka\",\"contentProductId\":\"ivbigdrqg\",\"packageVersion\":\"tboyztgnmu\",\"version\":\"pwp\",\"displayName\":\"m\",\"contentKind\":\"PlaybookTemplate\",\"source\":{\"kind\":\"Solution\",\"name\":\"hzbbdwrjenco\",\"sourceId\":\"ii\"},\"author\":{\"name\":\"bd\",\"email\":\"ljonmajokbxxc\",\"link\":\"hxjwtkftgzljuep\"},\"support\":{\"tier\":\"Partner\",\"name\":\"jpgbml\",\"email\":\"jhgvte\",\"link\":\"runudmakkshrna\"},\"dependencies\":{\"contentId\":\"zkwohdigeyuocft\",\"kind\":\"Notebook\",\"version\":\"dwqbaktvxero\",\"name\":\"zvrnnbegra\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},\"categories\":{\"domains\":[\"xgd\"],\"verticals\":[\"azhkqqsjkn\",\"q\"]},\"providers\":[\"wgpmdmwiwevvesw\",\"hh\"],\"customVersion\":\"dldargkwimt\",\"contentSchemaVersion\":\"eeeuq\",\"icon\":\"wczzcujwxvbkirgk\",\"threatAnalysisTactics\":[\"wla\",\"wdajyd\",\"bjgipvspe\",\"yzhydtkbmtrsdpl\"],\"threatAnalysisTechniques\":[\"igarmawokgcnevic\",\"wb\",\"ysclwbjgiynqr\"],\"previewImages\":[\"sweofvsxauphzefi\"],\"previewImagesDark\":[\"y\",\"xwgtiivzkdeexc\"],\"packageId\":\"ldgfquywmwt\",\"packageKind\":\"Solution\",\"packageName\":\"cfcncrv\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datalmfwfpoeowos\\\"\",\"dependantTemplates\":[{\"contentId\":\"csjgfxvc\",\"contentProductId\":\"ubyguq\",\"packageVersion\":\"nmsvj\",\"version\":\"rpryyircbajxjr\",\"displayName\":\"yrkb\",\"contentKind\":\"WatchlistTemplate\",\"source\":{\"kind\":\"LocalWorkspace\"},\"author\":{},\"support\":{\"tier\":\"Microsoft\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"xogkevdayvxzkxi\",\"mz\",\"r\"],\"customVersion\":\"lrjwaezply\",\"contentSchemaVersion\":\"psbomt\",\"icon\":\"p\",\"threatAnalysisTactics\":[\"fcfsuiw\",\"xpasckpgbm\",\"yxbwslx\"],\"threatAnalysisTechniques\":[\"xtoejtqvq\",\"tmlidk\",\"zxoluzntbpca\"],\"previewImages\":[\"x\"],\"previewImagesDark\":[\"iperrplfmfvmj\"],\"packageId\":\"zizxlbiqqeb\",\"packageKind\":\"Solution\",\"packageName\":\"nfvbsymag\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"databtjmk\\\"\",\"dependantTemplates\":[{}]}]},\"etag\":\"rklbizrxhuqfvpa\",\"id\":\"oqovvcxgqt\",\"name\":\"uirgopgzatucu\",\"type\":\"tjuzvyj\"}],\"nextLink\":\"xchquo\"}") + .toObject(TemplateList.class); + Assertions.assertEquals("kx", model.value().get(0).etag()); + Assertions.assertEquals("fddkhxvevwxmnb", model.value().get(0).contentId()); + Assertions.assertEquals("xadxgnpyhtuhal", model.value().get(0).contentProductId()); + Assertions.assertEquals("ildnao", model.value().get(0).packageVersion()); + Assertions.assertEquals("xznpnytkqja", model.value().get(0).version()); + Assertions.assertEquals("azbtgtzp", model.value().get(0).displayName()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, model.value().get(0).contentKind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, model.value().get(0).source().kind()); + Assertions.assertEquals("oujfgtgxuupczegq", model.value().get(0).source().name()); + Assertions.assertEquals("idvssvgyoggkztzt", model.value().get(0).source().sourceId()); + Assertions.assertEquals("knpbq", model.value().get(0).author().name()); + Assertions.assertEquals("kuobclobnaqeizpl", model.value().get(0).author().email()); + Assertions.assertEquals("lyugpnn", model.value().get(0).author().link()); + Assertions.assertEquals(SupportTier.MICROSOFT, model.value().get(0).support().tier()); + Assertions.assertEquals("kffeon", model.value().get(0).support().name()); + Assertions.assertEquals("vmujyiqywlp", model.value().get(0).support().email()); + Assertions.assertEquals("liytdegcrun", model.value().get(0).support().link()); + Assertions.assertEquals("lxstekbirhyvs", model.value().get(0).dependencies().contentId()); + Assertions.assertEquals(Kind.DATA_CONNECTOR, model.value().get(0).dependencies().kind()); + Assertions.assertEquals("iemorszffiukltr", model.value().get(0).dependencies().version()); + Assertions.assertEquals("ioguoxcsdqo", model.value().get(0).dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.value().get(0).dependencies().operator()); + Assertions.assertEquals("gxgrggy", model.value().get(0).categories().domains().get(0)); + Assertions.assertEquals("bnqinrsxvvm", model.value().get(0).categories().verticals().get(0)); + Assertions.assertEquals("joxqsw", model.value().get(0).providers().get(0)); + Assertions.assertEquals("tzgwjeky", model.value().get(0).customVersion()); + Assertions.assertEquals("rv", model.value().get(0).contentSchemaVersion()); + Assertions.assertEquals("o", model.value().get(0).icon()); + Assertions.assertEquals("gpppdilbdvxlfh", model.value().get(0).threatAnalysisTactics().get(0)); + Assertions.assertEquals("uz", model.value().get(0).threatAnalysisTechniques().get(0)); + Assertions.assertEquals("ifrzcwuejmxlfzl", model.value().get(0).previewImages().get(0)); + Assertions.assertEquals("rgrlhchra", model.value().get(0).previewImagesDark().get(0)); + Assertions.assertEquals("jovlxqtvmvzpniq", model.value().get(0).packageId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.value().get(0).packageKind()); + Assertions.assertEquals("gmnkgtlh", model.value().get(0).packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateModelInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateModelInnerTests.java new file mode 100644 index 000000000000..9d0d6e7837ce --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplateModelInnerTests.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateModelInner; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TemplateModelInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TemplateModelInner model = BinaryData.fromString( + "{\"properties\":{\"contentId\":\"uhzmolhveolng\",\"contentProductId\":\"mhwdxqupyml\",\"packageVersion\":\"lmnjqzm\",\"version\":\"nhitrnwqgqrbth\",\"displayName\":\"piqnrjoc\",\"contentKind\":\"WatchlistTemplate\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"ywzrqeiadd\",\"sourceId\":\"huvnlmdcnutie\"},\"author\":{\"name\":\"z\",\"email\":\"zbqvioyn\",\"link\":\"fqhhvvwzprj\"},\"support\":{\"tier\":\"Partner\",\"name\":\"aibtvavlyaqtl\",\"email\":\"n\",\"link\":\"efzvzuzqcrlk\"},\"dependencies\":{\"contentId\":\"bzgy\",\"kind\":\"AzureFunction\",\"version\":\"sfyqncowm\",\"name\":\"ozf\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"aosladag\",\"kind\":\"Playbook\",\"version\":\"ktbjortztkaj\",\"name\":\"snsejplislxy\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},{\"contentId\":\"wlfjwxgvtk\",\"kind\":\"Parser\",\"version\":\"rpea\",\"name\":\"zkvfccozvqxsph\",\"operator\":\"AND\",\"criteria\":[{},{}]},{\"contentId\":\"msukxtuytgcptct\",\"kind\":\"ResourcesDataConnector\",\"version\":\"gyckm\",\"name\":\"fvrcclcl\",\"operator\":\"AND\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"mwrv\"],\"verticals\":[\"pjylxtebvsewf\"]},\"providers\":[\"paysqwh\",\"dcyandblkb\"],\"customVersion\":\"pvdfmoqqc\",\"contentSchemaVersion\":\"vxuos\",\"icon\":\"ffa\",\"threatAnalysisTactics\":[\"jmsbzzj\",\"nyfowyj\",\"uakkiubeq\",\"it\"],\"threatAnalysisTechniques\":[\"glhxsoanguhb\"],\"previewImages\":[\"gsez\",\"enegg\",\"dtyzpx\",\"itwkejmg\"],\"previewImagesDark\":[\"dupe\",\"skvsdfvhryp\",\"zammpk\",\"pvnpeukgnmfakeqn\"],\"packageId\":\"romlcs\",\"packageKind\":\"Solution\",\"packageName\":\"psrowshvf\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datalaw\\\"\",\"dependantTemplates\":[{\"contentId\":\"qabjropxfqdmllz\",\"contentProductId\":\"jyuwq\",\"packageVersion\":\"wgdp\",\"version\":\"wiril\",\"displayName\":\"qtr\",\"contentKind\":\"WatchlistTemplate\",\"source\":{\"kind\":\"Community\",\"name\":\"egacde\",\"sourceId\":\"kw\"},\"author\":{\"name\":\"bpgdcidpdaqe\",\"email\":\"nddlirqq\",\"link\":\"saqifepdur\"},\"support\":{\"tier\":\"Partner\",\"name\":\"vk\",\"email\":\"lioklsuffp\",\"link\":\"swctlfy\"},\"dependencies\":{\"contentId\":\"tytvnpbgces\",\"kind\":\"Standalone\",\"version\":\"clmowurofo\",\"name\":\"b\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},\"categories\":{\"domains\":[\"blbtdqzhixc\",\"nkfs\",\"gvyoxmyqzyqe\",\"gbbzdsl\"],\"verticals\":[\"ce\",\"oxdddpwmgwxwuk\"]},\"providers\":[\"qglaxseisvvv\"],\"customVersion\":\"heo\",\"contentSchemaVersion\":\"jkpalecztl\",\"icon\":\"rtzpuvfssr\",\"threatAnalysisTactics\":[\"efnquo\",\"louurmuzembqq\",\"ehdhjofywwna\"],\"threatAnalysisTechniques\":[\"lorxgslqc\"],\"previewImages\":[\"hvpaglyyhrgma\"],\"previewImagesDark\":[\"mlutyjukkedp\",\"tocrbfgqicmdrgcu\"],\"packageId\":\"m\",\"packageKind\":\"Solution\",\"packageName\":\"r\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datagcmlj\\\"\",\"dependantTemplates\":[{\"contentId\":\"imybqjvfiomhca\",\"contentProductId\":\"v\",\"packageVersion\":\"zope\",\"version\":\"uf\",\"displayName\":\"wbsskgqjemo\",\"contentKind\":\"AutomationRule\",\"source\":{\"kind\":\"SourceRepository\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"qgipdzy\",\"zkhxfp\",\"cuudqhadxjvvl\"],\"customVersion\":\"e\",\"contentSchemaVersion\":\"u\",\"icon\":\"xlz\",\"threatAnalysisTactics\":[\"qxtvytzqlyldjvzm\",\"yrazzstjvcszb\"],\"threatAnalysisTechniques\":[\"lbozltyol\"],\"previewImages\":[\"ib\",\"keiec\",\"pmwxdsokrlnrpeyl\",\"iiul\"],\"previewImagesDark\":[\"iqlnh\"],\"packageId\":\"w\",\"packageKind\":\"Standalone\",\"packageName\":\"nknsgvx\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"dataeatr\\\"\",\"dependantTemplates\":[{},{},{},{}]},{\"contentId\":\"fjvifbm\",\"contentProductId\":\"tehqyoytrcoufkq\",\"packageVersion\":\"hu\",\"version\":\"fpknvkivozj\",\"displayName\":\"chmeodhzj\",\"contentKind\":\"LogicAppsCustomConnector\",\"source\":{\"kind\":\"Solution\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"eqkwqphfvsfts\"],\"customVersion\":\"p\",\"contentSchemaVersion\":\"achdtezgfctu\",\"icon\":\"owqrzvuxn\",\"threatAnalysisTactics\":[\"ohshzultdb\",\"mjdhypngo\",\"bdxvrivptbczsuzg\",\"zukekytkzvt\"],\"threatAnalysisTechniques\":[\"atvogpycein\",\"arhbdx\",\"byp\",\"s\"],\"previewImages\":[\"fjuda\"],\"previewImagesDark\":[\"psezs\",\"gdpftfcb\"],\"packageId\":\"srdp\",\"packageKind\":\"Standalone\",\"packageName\":\"zaci\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datarguzliyvsbfsin\\\"\",\"dependantTemplates\":[{}]},{\"contentId\":\"juljgxotu\",\"contentProductId\":\"mkiyaosthulzug\",\"packageVersion\":\"gspxldlnoc\",\"version\":\"ygimiz\",\"displayName\":\"kjbwmgksrlmspppo\",\"contentKind\":\"AzureFunction\",\"source\":{\"kind\":\"Community\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"diylgzzuqixp\",\"ybqowgvmxwbohxdh\",\"oexb\",\"h\"],\"customVersion\":\"ajwscmneev\",\"contentSchemaVersion\":\"mqeumzyyhmgqa\",\"icon\":\"vjqutxrbgbzgfhzd\",\"threatAnalysisTactics\":[\"k\"],\"threatAnalysisTechniques\":[\"cbicfecthotb\",\"jwhz\",\"pxjvtwk\",\"jdpayx\"],\"previewImages\":[\"iwuzrgqztjfkgbtq\"],\"previewImagesDark\":[\"bsynne\",\"ion\",\"q\",\"dheos\"],\"packageId\":\"wfudmpf\",\"packageKind\":\"Standalone\",\"packageName\":\"p\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datantc\\\"\",\"dependantTemplates\":[{},{}]},{\"contentId\":\"bb\",\"contentProductId\":\"aecct\",\"packageVersion\":\"fspvjrds\",\"version\":\"vrm\",\"displayName\":\"ftyptwjwiyyeo\",\"contentKind\":\"AzureFunction\",\"source\":{\"kind\":\"Community\"},\"author\":{},\"support\":{\"tier\":\"Microsoft\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"fnug\",\"lv\"],\"customVersion\":\"ox\",\"contentSchemaVersion\":\"omvueprpmofxnwcg\",\"icon\":\"oxi\",\"threatAnalysisTactics\":[\"xxajseh\",\"knnrn\",\"yjfawpcb\"],\"threatAnalysisTechniques\":[\"zehcz\",\"nivco\",\"sxvppkjealkdb\"],\"previewImages\":[\"otvbmyzuqf\",\"qdkt\",\"jtoqszhhqn\",\"jndkvzmx\"],\"previewImagesDark\":[\"qgdodn\"],\"packageId\":\"yipgkmjt\",\"packageKind\":\"Standalone\",\"packageName\":\"dz\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"dataeftgdrfzjlflz\\\"\",\"dependantTemplates\":[{},{}]}]},{\"contentId\":\"avabxiefco\",\"contentProductId\":\"bidaeb\",\"packageVersion\":\"nicewd\",\"version\":\"jwiylciobb\",\"displayName\":\"ws\",\"contentKind\":\"Watchlist\",\"source\":{\"kind\":\"Community\",\"name\":\"ecuuuex\",\"sourceId\":\"nteevfgaxfez\"},\"author\":{\"name\":\"sddkodkgxq\",\"email\":\"yrx\",\"link\":\"zzeglwdzfss\"},\"support\":{\"tier\":\"Community\",\"name\":\"aoksddkkrajfyu\",\"email\":\"xke\",\"link\":\"zpyqbwhuecx\"},\"dependencies\":{\"contentId\":\"ingmhpavsfg\",\"kind\":\"Watchlist\",\"version\":\"r\",\"name\":\"bd\",\"operator\":\"AND\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"nzpqhqqsarky\",\"lfameaasjq\",\"nhekzazvgeytlpls\"],\"verticals\":[\"vedksuowtolkyqf\"]},\"providers\":[\"crhnx\"],\"customVersion\":\"mwunr\",\"contentSchemaVersion\":\"srawwhyxfshmby\",\"icon\":\"vwnbu\",\"threatAnalysisTactics\":[\"dtevzs\",\"qykebmp\",\"haezcldkc\",\"rnovqdmh\"],\"threatAnalysisTechniques\":[\"stfsma\",\"jakgk\"],\"previewImages\":[\"qdsoqzhxwdjoxwkb\",\"hsobvcnsbioez\"],\"previewImagesDark\":[\"hn\",\"z\"],\"packageId\":\"fzqyugtkxnc\",\"packageKind\":\"Solution\",\"packageName\":\"nlrlcm\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"dataywwwvnhwwkr\\\"\",\"dependantTemplates\":[{\"contentId\":\"rhhafqfud\",\"contentProductId\":\"ziruqvgnjxiakgyj\",\"packageVersion\":\"bmxgiky\",\"version\":\"yugmb\",\"displayName\":\"c\",\"contentKind\":\"DataConnector\",\"source\":{\"kind\":\"Solution\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"yhmmglvnbenkps\",\"okkyankxvcptf\"],\"customVersion\":\"nkxaso\",\"contentSchemaVersion\":\"fe\",\"icon\":\"z\",\"threatAnalysisTactics\":[\"dxp\",\"pautfz\",\"trcdzytrtffvpkd\",\"cyuwenbqvpraw\"],\"threatAnalysisTechniques\":[\"atdjkaldpmec\",\"mxfzynfem\",\"yqkkpgwgss\",\"qu\"],\"previewImages\":[\"rnbnlqyvdsq\",\"kjwd\"],\"previewImagesDark\":[\"irzyudrq\",\"xrxhxmlfouqp\"],\"packageId\":\"vandbpmrrhyj\",\"packageKind\":\"Standalone\",\"packageName\":\"acz\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataezttqjqyfy\\\"\",\"dependantTemplates\":[{}]},{\"contentId\":\"ysl\",\"contentProductId\":\"f\",\"packageVersion\":\"dsvkllrzhs\",\"version\":\"kbchcazkgdjthprg\",\"displayName\":\"hfz\",\"contentKind\":\"Watchlist\",\"source\":{\"kind\":\"Solution\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"cnibzqrsd\",\"cuqddldaoyvfz\"],\"customVersion\":\"qjojesxjht\",\"contentSchemaVersion\":\"zwqocygoyineuaxp\",\"icon\":\"zitrguzlwe\",\"threatAnalysisTactics\":[\"foafzdypz\"],\"threatAnalysisTechniques\":[\"mndhgwhlbpju\",\"jzqx\",\"vmitn\",\"lyhbujys\"],\"previewImages\":[\"yy\",\"dbhatmabtpgn\",\"tjtnnrjewih\"],\"previewImagesDark\":[\"a\",\"hmdfspkdn\",\"qxzxtert\"],\"packageId\":\"rrwsci\",\"packageKind\":\"Solution\",\"packageName\":\"wi\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"dataolzjyf\\\"\",\"dependantTemplates\":[{},{},{}]},{\"contentId\":\"sghaknklthqwp\",\"contentProductId\":\"ihbmwrvpvdr\",\"packageVersion\":\"ulobkabhvxju\",\"version\":\"vxznirnygtixkg\",\"displayName\":\"bmk\",\"contentKind\":\"AnalyticsRule\",\"source\":{\"kind\":\"Community\"},\"author\":{},\"support\":{\"tier\":\"Community\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"itudc\"],\"customVersion\":\"ieileemw\",\"contentSchemaVersion\":\"ehldopj\",\"icon\":\"vbb\",\"threatAnalysisTactics\":[\"i\",\"km\",\"bn\"],\"threatAnalysisTechniques\":[\"idipwt\"],\"previewImages\":[\"mzhcm\"],\"previewImagesDark\":[\"qa\",\"styzavkyjjlu\",\"nmbj\",\"bngzldvvd\"],\"packageId\":\"pty\",\"packageKind\":\"Standalone\",\"packageName\":\"o\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datamqnerwh\\\"\",\"dependantTemplates\":[{},{},{},{}]}]},{\"contentId\":\"dsssfzsgzguspej\",\"contentProductId\":\"eqgxhwispso\",\"packageVersion\":\"blw\",\"version\":\"baqxaxtuxirppb\",\"displayName\":\"c\",\"contentKind\":\"AnalyticsRule\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"uixwonkrnizd\",\"sourceId\":\"wabkitnipaptgv\"},\"author\":{\"name\":\"yjukkajn\",\"email\":\"wltonopffem\",\"link\":\"fhhaw\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"z\",\"email\":\"cdikqnxydgzfoiqz\",\"link\":\"spa\"},\"dependencies\":{\"contentId\":\"slqeronz\",\"kind\":\"Playbook\",\"version\":\"xf\",\"name\":\"wd\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},\"categories\":{\"domains\":[\"uymkdeuqxlvzpfd\",\"axgbiwpgop\"],\"verticals\":[\"tth\",\"mrrmtr\",\"gjmpd\"]},\"providers\":[\"zwawpewajc\",\"sdjuzmuijtickzo\"],\"customVersion\":\"p\",\"contentSchemaVersion\":\"xhhboigzxk\",\"icon\":\"qlrzhtocjzfp\",\"threatAnalysisTactics\":[\"uvatzwnkjw\",\"iitvjcmimbmsw\"],\"threatAnalysisTechniques\":[\"bb\",\"oypplo\",\"aqrbkpozffsob\"],\"previewImages\":[\"alcr\",\"ax\",\"mb\",\"tvt\"],\"previewImagesDark\":[\"mlplgtlayyxhx\",\"voysxa\"],\"packageId\":\"j\",\"packageKind\":\"Standalone\",\"packageName\":\"faob\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datasbozv\\\"\",\"dependantTemplates\":[{\"contentId\":\"ssy\",\"contentProductId\":\"wrybi\",\"packageVersion\":\"wot\",\"version\":\"juvtz\",\"displayName\":\"rdlxbaeyocpkv\",\"contentKind\":\"DataType\",\"source\":{\"kind\":\"LocalWorkspace\"},\"author\":{},\"support\":{\"tier\":\"Partner\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"rcibjxnnnoztnhvd\",\"u\",\"amqobqehs\"],\"customVersion\":\"isyzfe\",\"contentSchemaVersion\":\"trzjwnzwckzebm\",\"icon\":\"wdxgyypm\",\"threatAnalysisTactics\":[\"lmlnxrcatkuh\",\"k\"],\"threatAnalysisTechniques\":[\"kvvii\",\"yeshoxfzzjdmu\",\"busxyugozwp\"],\"previewImages\":[\"gzumnotii\",\"kkbyg\",\"giq\",\"wyshybbnhtt\"],\"previewImagesDark\":[\"onzsurqcoj\",\"sfzhzzcarciuoxyi\",\"dthjfvnhwsgnsput\",\"e\"],\"packageId\":\"ch\",\"packageKind\":\"Standalone\",\"packageName\":\"sjgbfbbach\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datazunf\\\"\",\"dependantTemplates\":[{},{}]},{\"contentId\":\"ceeiv\",\"contentProductId\":\"uxlepghcn\",\"packageVersion\":\"hqpvtwttf\",\"version\":\"lggag\",\"displayName\":\"ntbfytnhdnihu\",\"contentKind\":\"DataType\",\"source\":{\"kind\":\"Community\"},\"author\":{},\"support\":{\"tier\":\"Microsoft\"},\"dependencies\":{},\"categories\":{},\"providers\":[\"orb\",\"wnyfzdpxctsu\"],\"customVersion\":\"tejobjzrl\",\"contentSchemaVersion\":\"idcnz\",\"icon\":\"g\",\"threatAnalysisTactics\":[\"pjhltylyuud\",\"bgvzlzjsbkpcutza\"],\"threatAnalysisTechniques\":[\"dpok\",\"seaimbdq\"],\"previewImages\":[\"kdarl\",\"o\",\"bva\"],\"previewImagesDark\":[\"z\",\"nyujxysvc\",\"f\"],\"packageId\":\"clvildlf\",\"packageKind\":\"Standalone\",\"packageName\":\"irmtxfqpfildcg\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataz\\\"\",\"dependantTemplates\":[{},{},{},{}]}]}]},\"etag\":\"cryvidbzdylbvj\",\"id\":\"gngwn\",\"name\":\"jftecgprzsqmp\",\"type\":\"q\"}") + .toObject(TemplateModelInner.class); + Assertions.assertEquals("cryvidbzdylbvj", model.etag()); + Assertions.assertEquals("uhzmolhveolng", model.contentId()); + Assertions.assertEquals("mhwdxqupyml", model.contentProductId()); + Assertions.assertEquals("lmnjqzm", model.packageVersion()); + Assertions.assertEquals("nhitrnwqgqrbth", model.version()); + Assertions.assertEquals("piqnrjoc", model.displayName()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, model.contentKind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("ywzrqeiadd", model.source().name()); + Assertions.assertEquals("huvnlmdcnutie", model.source().sourceId()); + Assertions.assertEquals("z", model.author().name()); + Assertions.assertEquals("zbqvioyn", model.author().email()); + Assertions.assertEquals("fqhhvvwzprj", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("aibtvavlyaqtl", model.support().name()); + Assertions.assertEquals("n", model.support().email()); + Assertions.assertEquals("efzvzuzqcrlk", model.support().link()); + Assertions.assertEquals("bzgy", model.dependencies().contentId()); + Assertions.assertEquals(Kind.AZURE_FUNCTION, model.dependencies().kind()); + Assertions.assertEquals("sfyqncowm", model.dependencies().version()); + Assertions.assertEquals("ozf", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("aosladag", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.PLAYBOOK, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("ktbjortztkaj", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("snsejplislxy", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("mwrv", model.categories().domains().get(0)); + Assertions.assertEquals("pjylxtebvsewf", model.categories().verticals().get(0)); + Assertions.assertEquals("paysqwh", model.providers().get(0)); + Assertions.assertEquals("pvdfmoqqc", model.customVersion()); + Assertions.assertEquals("vxuos", model.contentSchemaVersion()); + Assertions.assertEquals("ffa", model.icon()); + Assertions.assertEquals("jmsbzzj", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("glhxsoanguhb", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("gsez", model.previewImages().get(0)); + Assertions.assertEquals("dupe", model.previewImagesDark().get(0)); + Assertions.assertEquals("romlcs", model.packageId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.packageKind()); + Assertions.assertEquals("psrowshvf", model.packageName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TemplateModelInner model = new TemplateModelInner().withEtag("cryvidbzdylbvj") + .withContentId("uhzmolhveolng") + .withContentProductId("mhwdxqupyml") + .withPackageVersion("lmnjqzm") + .withVersion("nhitrnwqgqrbth") + .withDisplayName("piqnrjoc") + .withContentKind(Kind.WATCHLIST_TEMPLATE) + .withSource(new MetadataSource().withKind(SourceKind.SOURCE_REPOSITORY) + .withName("ywzrqeiadd") + .withSourceId("huvnlmdcnutie")) + .withAuthor(new MetadataAuthor().withName("z").withEmail("zbqvioyn").withLink("fqhhvvwzprj")) + .withSupport(new MetadataSupport().withTier(SupportTier.PARTNER) + .withName("aibtvavlyaqtl") + .withEmail("n") + .withLink("efzvzuzqcrlk")) + .withDependencies(new MetadataDependencies().withContentId("bzgy") + .withKind(Kind.AZURE_FUNCTION) + .withVersion("sfyqncowm") + .withName("ozf") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("aosladag") + .withKind(Kind.PLAYBOOK) + .withVersion("ktbjortztkaj") + .withName("snsejplislxy") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())), + new MetadataDependencies().withContentId("wlfjwxgvtk") + .withKind(Kind.PARSER) + .withVersion("rpea") + .withName("zkvfccozvqxsph") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("msukxtuytgcptct") + .withKind(Kind.RESOURCES_DATA_CONNECTOR) + .withVersion("gyckm") + .withName("fvrcclcl") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies()))))) + .withCategories(new MetadataCategories().withDomains(Arrays.asList("mwrv")) + .withVerticals(Arrays.asList("pjylxtebvsewf"))) + .withProviders(Arrays.asList("paysqwh", "dcyandblkb")) + .withCustomVersion("pvdfmoqqc") + .withContentSchemaVersion("vxuos") + .withIcon("ffa") + .withThreatAnalysisTactics(Arrays.asList("jmsbzzj", "nyfowyj", "uakkiubeq", "it")) + .withThreatAnalysisTechniques(Arrays.asList("glhxsoanguhb")) + .withPreviewImages(Arrays.asList("gsez", "enegg", "dtyzpx", "itwkejmg")) + .withPreviewImagesDark(Arrays.asList("dupe", "skvsdfvhryp", "zammpk", "pvnpeukgnmfakeqn")) + .withPackageId("romlcs") + .withPackageKind(PackageKind.SOLUTION) + .withPackageName("psrowshvf") + .withMainTemplate("\"datalaw\""); + model = BinaryData.fromObject(model).toObject(TemplateModelInner.class); + Assertions.assertEquals("cryvidbzdylbvj", model.etag()); + Assertions.assertEquals("uhzmolhveolng", model.contentId()); + Assertions.assertEquals("mhwdxqupyml", model.contentProductId()); + Assertions.assertEquals("lmnjqzm", model.packageVersion()); + Assertions.assertEquals("nhitrnwqgqrbth", model.version()); + Assertions.assertEquals("piqnrjoc", model.displayName()); + Assertions.assertEquals(Kind.WATCHLIST_TEMPLATE, model.contentKind()); + Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, model.source().kind()); + Assertions.assertEquals("ywzrqeiadd", model.source().name()); + Assertions.assertEquals("huvnlmdcnutie", model.source().sourceId()); + Assertions.assertEquals("z", model.author().name()); + Assertions.assertEquals("zbqvioyn", model.author().email()); + Assertions.assertEquals("fqhhvvwzprj", model.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, model.support().tier()); + Assertions.assertEquals("aibtvavlyaqtl", model.support().name()); + Assertions.assertEquals("n", model.support().email()); + Assertions.assertEquals("efzvzuzqcrlk", model.support().link()); + Assertions.assertEquals("bzgy", model.dependencies().contentId()); + Assertions.assertEquals(Kind.AZURE_FUNCTION, model.dependencies().kind()); + Assertions.assertEquals("sfyqncowm", model.dependencies().version()); + Assertions.assertEquals("ozf", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().operator()); + Assertions.assertEquals("aosladag", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.PLAYBOOK, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("ktbjortztkaj", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("snsejplislxy", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("mwrv", model.categories().domains().get(0)); + Assertions.assertEquals("pjylxtebvsewf", model.categories().verticals().get(0)); + Assertions.assertEquals("paysqwh", model.providers().get(0)); + Assertions.assertEquals("pvdfmoqqc", model.customVersion()); + Assertions.assertEquals("vxuos", model.contentSchemaVersion()); + Assertions.assertEquals("ffa", model.icon()); + Assertions.assertEquals("jmsbzzj", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("glhxsoanguhb", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("gsez", model.previewImages().get(0)); + Assertions.assertEquals("dupe", model.previewImagesDark().get(0)); + Assertions.assertEquals("romlcs", model.packageId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.packageKind()); + Assertions.assertEquals("psrowshvf", model.packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplatePropertiesTests.java new file mode 100644 index 000000000000..8866b64b71d1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TemplatePropertiesTests.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TemplateProperties; +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.MetadataDependencyOperator; +import com.azure.resourcemanager.securityinsights.models.MetadataSource; +import com.azure.resourcemanager.securityinsights.models.MetadataSupport; +import com.azure.resourcemanager.securityinsights.models.PackageKind; +import com.azure.resourcemanager.securityinsights.models.SourceKind; +import com.azure.resourcemanager.securityinsights.models.SupportTier; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TemplatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TemplateProperties model = BinaryData.fromString( + "{\"contentId\":\"kzb\",\"contentProductId\":\"haa\",\"packageVersion\":\"xoyxuuco\",\"version\":\"syruxrzhhlhrvmg\",\"displayName\":\"pgmncrvtp\",\"contentKind\":\"Standalone\",\"source\":{\"kind\":\"Community\",\"name\":\"ppzsauqmeuhplfc\",\"sourceId\":\"uaiugoceqtl\"},\"author\":{\"name\":\"jymwiccu\",\"email\":\"cfunlakgixhqjqh\",\"link\":\"wb\"},\"support\":{\"tier\":\"Community\",\"name\":\"twfgoclalvemn\",\"email\":\"ugabkyydsyweoh\",\"link\":\"tsnvonvbftswcdop\"},\"dependencies\":{\"contentId\":\"ptvdti\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"lgzwkopxdkb\",\"name\":\"oqhgppwxnik\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"nd\",\"kind\":\"InvestigationQuery\",\"version\":\"jnnuwwvj\",\"name\":\"f\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"qjkbkjc\",\"kind\":\"Solution\",\"version\":\"jwyzrieitqmlzuw\",\"name\":\"dzqajxkmpebfh\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"djg\",\"kind\":\"Standalone\",\"version\":\"xrfeszun\",\"name\":\"afm\",\"operator\":\"AND\",\"criteria\":[{},{}]},{\"contentId\":\"mi\",\"kind\":\"WorkbookTemplate\",\"version\":\"n\",\"name\":\"vvequz\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},{\"contentId\":\"dhzbjecdsysxnk\",\"kind\":\"DataType\",\"version\":\"nlsevzcrrwnkk\",\"name\":\"wq\",\"operator\":\"OR\",\"criteria\":[{},{}]}]}]},\"categories\":{\"domains\":[\"xdqeluvmsaq\",\"viawg\",\"rwuhvvzfznfgpbc\",\"kcpympdjieask\"],\"verticals\":[\"clnfusrgnos\",\"khb\",\"jphlyyuahvy\",\"ikbvqzrurgbqaucp\"]},\"providers\":[\"jnohafwm\",\"pgjl\"],\"customVersion\":\"gpeametsdw\",\"contentSchemaVersion\":\"amtxccfegsavbg\",\"icon\":\"ucv\",\"threatAnalysisTactics\":[\"dhoo\"],\"threatAnalysisTechniques\":[\"z\",\"mqfwbgdmfv\",\"b\",\"mpotalopfigrx\"],\"previewImages\":[\"codbqeo\"],\"previewImagesDark\":[\"mxxbjhs\",\"vamsxrwq\",\"wdflgq\",\"plze\"],\"packageId\":\"v\",\"packageKind\":\"Solution\",\"packageName\":\"ffgxtaelxtpfc\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"dataxdwrvyvtkmxvz\\\"\",\"dependantTemplates\":[{\"contentId\":\"ugf\",\"contentProductId\":\"eigkflvovriqt\",\"packageVersion\":\"wbkqcgzygtdjhtb\",\"version\":\"ptxursuoyyumhzps\",\"displayName\":\"cqacvttyh\",\"contentKind\":\"CustomDetection\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"zyjbuwuuusyd\",\"sourceId\":\"izvkayio\"},\"author\":{\"name\":\"gq\",\"email\":\"l\",\"link\":\"efeombo\"},\"support\":{\"tier\":\"Partner\",\"name\":\"fuakqsjymcfvvzc\",\"email\":\"yuq\",\"link\":\"cktnbpkfnxrl\"},\"dependencies\":{\"contentId\":\"lzvvrmes\",\"kind\":\"Watchlist\",\"version\":\"acj\",\"name\":\"revfwcbawapn\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"kmzv\",\"kind\":\"Playbook\",\"version\":\"fblsxyfqgtodg\",\"name\":\"lefmizdcsr\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"gfyxhsxcgqbmxbp\",\"kind\":\"Playbook\",\"version\":\"skehojvm\",\"name\":\"uflf\",\"operator\":\"OR\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"nco\",\"qrgivbhmnimj\"],\"verticals\":[\"b\",\"fnmmib\",\"wcduyrgcay\"]},\"providers\":[\"qeobrwreudgsawha\",\"igsqzmfkiaag\",\"k\"],\"customVersion\":\"cg\",\"contentSchemaVersion\":\"nubr\",\"icon\":\"jfkxnwtzsroeqcr\",\"threatAnalysisTactics\":[\"jskqsfnmiwapd\",\"nhdikatzmtuvfn\",\"itjkbibxlwzlvkc\"],\"threatAnalysisTechniques\":[\"iaunlodincfbao\"],\"previewImages\":[\"ahkppsva\"],\"previewImagesDark\":[\"sax\",\"eedvpmod\",\"tdut\",\"dvvgkmorbpcje\"],\"packageId\":\"yvuz\",\"packageKind\":\"Standalone\",\"packageName\":\"mshkkgygfohr\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datalclpkr\\\"\",\"dependantTemplates\":[{\"contentId\":\"mjjviut\",\"contentProductId\":\"rfnztxtmrmgf\",\"packageVersion\":\"viilohlgrjcxhhf\",\"version\":\"nsjxwfogb\",\"displayName\":\"ylyumb\",\"contentKind\":\"Playbook\",\"source\":{\"kind\":\"Community\",\"name\":\"uomsxhdkhmemxk\",\"sourceId\":\"apesnbyoullyfz\"},\"author\":{\"name\":\"rmxxjvwbat\",\"email\":\"zkmwfwzlmpxfm\",\"link\":\"s\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"dzp\",\"email\":\"ulxrcbdnpfcg\",\"link\":\"ttowqx\"},\"dependencies\":{\"contentId\":\"bzxp\",\"kind\":\"CustomDetection\",\"version\":\"vhatiywtcvzuzp\",\"name\":\"eomotq\",\"operator\":\"AND\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"gq\"],\"verticals\":[\"sdpfvlsqmmetwtl\"]},\"providers\":[\"kjtefbdp\",\"u\"],\"customVersion\":\"grlly\",\"contentSchemaVersion\":\"smocbxhrchm\",\"icon\":\"vz\",\"threatAnalysisTactics\":[\"gdykgdskwvbqca\",\"wayqt\"],\"threatAnalysisTechniques\":[\"yotgnmze\",\"creluedcmk\",\"yhheexz\"],\"previewImages\":[\"lxwknooxdjklfsdn\",\"kqiymmddslwnlgjd\"],\"previewImagesDark\":[\"kspybnnnl\",\"qdnnskat\"],\"packageId\":\"mrslwknrd\",\"packageKind\":\"Solution\",\"packageName\":\"jerndzzywxqraqx\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"dataetnnefputlkszux\\\"\",\"dependantTemplates\":[{}]},{\"contentId\":\"sxwasfwqjz\",\"contentProductId\":\"mfqdnppfcfgua\",\"packageVersion\":\"vamuvkgd\",\"version\":\"jbblukgct\",\"displayName\":\"spjvsyydjlhd\",\"contentKind\":\"WatchlistTemplate\",\"source\":{\"kind\":\"Solution\",\"name\":\"y\",\"sourceId\":\"gxhulojwum\"},\"author\":{\"name\":\"ym\",\"email\":\"vnxpf\",\"link\":\"djspnonxe\"},\"support\":{\"tier\":\"Partner\",\"name\":\"zhn\",\"email\":\"wvgcmcvdjlwwef\",\"link\":\"twllqypmjc\"},\"dependencies\":{\"contentId\":\"fwgkzuhk\",\"kind\":\"Standalone\",\"version\":\"kckwbqwjyfmmkwa\",\"name\":\"ooyzhob\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},\"categories\":{\"domains\":[\"oerohextigukfk\",\"sycbdymbnp\",\"enlqtqyvlfbs\",\"vqdvfjdsqephtosh\"],\"verticals\":[\"arjwgu\"]},\"providers\":[\"nxaeyp\",\"q\"],\"customVersion\":\"yasydd\",\"contentSchemaVersion\":\"wscjwyyeomifl\",\"icon\":\"feowctshwfrhha\",\"threatAnalysisTactics\":[\"vauznw\"],\"threatAnalysisTechniques\":[\"kbpgci\"],\"previewImages\":[\"tpwbjlpfwuqp\",\"pdgitenyuksl\",\"zmpnxghamrplanch\"],\"previewImagesDark\":[\"mmxlmxejwy\",\"jzbjwvtuekbbypqs\",\"psbeqieiux\",\"juwndal\"],\"packageId\":\"jhrg\",\"packageKind\":\"Standalone\",\"packageName\":\"cpihlzyxvtajfj\",\"isDeprecated\":\"true\",\"mainTemplate\":\"\\\"datadnekurdgcpz\\\"\",\"dependantTemplates\":[{}]},{\"contentId\":\"vengn\",\"contentProductId\":\"elr\",\"packageVersion\":\"nb\",\"version\":\"ko\",\"displayName\":\"xfbagegjtjltcki\",\"contentKind\":\"WorkbookTemplate\",\"source\":{\"kind\":\"Solution\",\"name\":\"gijxmdboe\",\"sourceId\":\"hxhahuq\"},\"author\":{\"name\":\"vzsodmokrqdbs\",\"email\":\"qyjkotyp\",\"link\":\"xhyzzlocjhzppd\"},\"support\":{\"tier\":\"Partner\",\"name\":\"cxbofpr\",\"email\":\"iva\",\"link\":\"sbfzl\"},\"dependencies\":{\"contentId\":\"rw\",\"kind\":\"AzureFunction\",\"version\":\"tghqx\",\"name\":\"blmfcleuovelvsp\",\"operator\":\"OR\",\"criteria\":[{}]},\"categories\":{\"domains\":[\"jtoudode\",\"wmv\",\"sr\",\"ciexu\"],\"verticals\":[\"tgtg\",\"bymmcgsksc\",\"sxehaxi\"]},\"providers\":[\"jxolknshgwa\",\"ptbhm\",\"glmnlbnatln\"],\"customVersion\":\"cdkxo\",\"contentSchemaVersion\":\"d\",\"icon\":\"vhbujkaho\",\"threatAnalysisTactics\":[\"wojdzccq\",\"wsr\"],\"threatAnalysisTechniques\":[\"sdiicdzfbvexrv\"],\"previewImages\":[\"mfsnqpvjtshl\",\"vrsksdzmhwt\"],\"previewImagesDark\":[\"pwfbwoetxiz\",\"fwxhflgdunga\"],\"packageId\":\"xsazbxsnxyks\",\"packageKind\":\"Standalone\",\"packageName\":\"tmprvgrandz\",\"isDeprecated\":\"false\",\"mainTemplate\":\"\\\"datamlpczlqboomzg\\\"\",\"dependantTemplates\":[{},{},{},{}]}]}]}") + .toObject(TemplateProperties.class); + Assertions.assertEquals("kzb", model.contentId()); + Assertions.assertEquals("haa", model.contentProductId()); + Assertions.assertEquals("xoyxuuco", model.packageVersion()); + Assertions.assertEquals("syruxrzhhlhrvmg", model.version()); + Assertions.assertEquals("pgmncrvtp", model.displayName()); + Assertions.assertEquals(Kind.STANDALONE, model.contentKind()); + Assertions.assertEquals(SourceKind.COMMUNITY, model.source().kind()); + Assertions.assertEquals("ppzsauqmeuhplfc", model.source().name()); + Assertions.assertEquals("uaiugoceqtl", model.source().sourceId()); + Assertions.assertEquals("jymwiccu", model.author().name()); + Assertions.assertEquals("cfunlakgixhqjqh", model.author().email()); + Assertions.assertEquals("wb", model.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.support().tier()); + Assertions.assertEquals("twfgoclalvemn", model.support().name()); + Assertions.assertEquals("ugabkyydsyweoh", model.support().email()); + Assertions.assertEquals("tsnvonvbftswcdop", model.support().link()); + Assertions.assertEquals("ptvdti", model.dependencies().contentId()); + Assertions.assertEquals(Kind.ANALYTICS_RULE_TEMPLATE, model.dependencies().kind()); + Assertions.assertEquals("lgzwkopxdkb", model.dependencies().version()); + Assertions.assertEquals("oqhgppwxnik", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("nd", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.INVESTIGATION_QUERY, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("jnnuwwvj", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("f", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("qjkbkjc", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.SOLUTION, model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("jwyzrieitqmlzuw", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("dzqajxkmpebfh", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("xdqeluvmsaq", model.categories().domains().get(0)); + Assertions.assertEquals("clnfusrgnos", model.categories().verticals().get(0)); + Assertions.assertEquals("jnohafwm", model.providers().get(0)); + Assertions.assertEquals("gpeametsdw", model.customVersion()); + Assertions.assertEquals("amtxccfegsavbg", model.contentSchemaVersion()); + Assertions.assertEquals("ucv", model.icon()); + Assertions.assertEquals("dhoo", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("z", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("codbqeo", model.previewImages().get(0)); + Assertions.assertEquals("mxxbjhs", model.previewImagesDark().get(0)); + Assertions.assertEquals("v", model.packageId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.packageKind()); + Assertions.assertEquals("ffgxtaelxtpfc", model.packageName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TemplateProperties model = new TemplateProperties().withContentId("kzb") + .withContentProductId("haa") + .withPackageVersion("xoyxuuco") + .withVersion("syruxrzhhlhrvmg") + .withDisplayName("pgmncrvtp") + .withContentKind(Kind.STANDALONE) + .withSource(new MetadataSource().withKind(SourceKind.COMMUNITY) + .withName("ppzsauqmeuhplfc") + .withSourceId("uaiugoceqtl")) + .withAuthor(new MetadataAuthor().withName("jymwiccu").withEmail("cfunlakgixhqjqh").withLink("wb")) + .withSupport(new MetadataSupport().withTier(SupportTier.COMMUNITY) + .withName("twfgoclalvemn") + .withEmail("ugabkyydsyweoh") + .withLink("tsnvonvbftswcdop")) + .withDependencies(new MetadataDependencies().withContentId("ptvdti") + .withKind(Kind.ANALYTICS_RULE_TEMPLATE) + .withVersion("lgzwkopxdkb") + .withName("oqhgppwxnik") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies().withContentId("nd") + .withKind(Kind.INVESTIGATION_QUERY) + .withVersion("jnnuwwvj") + .withName("f") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList( + new MetadataDependencies().withContentId("qjkbkjc") + .withKind(Kind.SOLUTION) + .withVersion("jwyzrieitqmlzuw") + .withName("dzqajxkmpebfh") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies())), + new MetadataDependencies().withContentId("djg") + .withKind(Kind.STANDALONE) + .withVersion("xrfeszun") + .withName("afm") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), + new MetadataDependencies().withContentId("mi") + .withKind(Kind.WORKBOOK_TEMPLATE) + .withVersion("n") + .withName("vvequz") + .withOperator(MetadataDependencyOperator.AND) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), + new MetadataDependencies())), + new MetadataDependencies().withContentId("dhzbjecdsysxnk") + .withKind(Kind.DATA_TYPE) + .withVersion("nlsevzcrrwnkk") + .withName("wq") + .withOperator(MetadataDependencyOperator.OR) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies()))))))) + .withCategories(new MetadataCategories() + .withDomains(Arrays.asList("xdqeluvmsaq", "viawg", "rwuhvvzfznfgpbc", "kcpympdjieask")) + .withVerticals(Arrays.asList("clnfusrgnos", "khb", "jphlyyuahvy", "ikbvqzrurgbqaucp"))) + .withProviders(Arrays.asList("jnohafwm", "pgjl")) + .withCustomVersion("gpeametsdw") + .withContentSchemaVersion("amtxccfegsavbg") + .withIcon("ucv") + .withThreatAnalysisTactics(Arrays.asList("dhoo")) + .withThreatAnalysisTechniques(Arrays.asList("z", "mqfwbgdmfv", "b", "mpotalopfigrx")) + .withPreviewImages(Arrays.asList("codbqeo")) + .withPreviewImagesDark(Arrays.asList("mxxbjhs", "vamsxrwq", "wdflgq", "plze")) + .withPackageId("v") + .withPackageKind(PackageKind.SOLUTION) + .withPackageName("ffgxtaelxtpfc") + .withMainTemplate("\"dataxdwrvyvtkmxvz\""); + model = BinaryData.fromObject(model).toObject(TemplateProperties.class); + Assertions.assertEquals("kzb", model.contentId()); + Assertions.assertEquals("haa", model.contentProductId()); + Assertions.assertEquals("xoyxuuco", model.packageVersion()); + Assertions.assertEquals("syruxrzhhlhrvmg", model.version()); + Assertions.assertEquals("pgmncrvtp", model.displayName()); + Assertions.assertEquals(Kind.STANDALONE, model.contentKind()); + Assertions.assertEquals(SourceKind.COMMUNITY, model.source().kind()); + Assertions.assertEquals("ppzsauqmeuhplfc", model.source().name()); + Assertions.assertEquals("uaiugoceqtl", model.source().sourceId()); + Assertions.assertEquals("jymwiccu", model.author().name()); + Assertions.assertEquals("cfunlakgixhqjqh", model.author().email()); + Assertions.assertEquals("wb", model.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, model.support().tier()); + Assertions.assertEquals("twfgoclalvemn", model.support().name()); + Assertions.assertEquals("ugabkyydsyweoh", model.support().email()); + Assertions.assertEquals("tsnvonvbftswcdop", model.support().link()); + Assertions.assertEquals("ptvdti", model.dependencies().contentId()); + Assertions.assertEquals(Kind.ANALYTICS_RULE_TEMPLATE, model.dependencies().kind()); + Assertions.assertEquals("lgzwkopxdkb", model.dependencies().version()); + Assertions.assertEquals("oqhgppwxnik", model.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().operator()); + Assertions.assertEquals("nd", model.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.INVESTIGATION_QUERY, model.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("jnnuwwvj", model.dependencies().criteria().get(0).version()); + Assertions.assertEquals("f", model.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, model.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("qjkbkjc", model.dependencies().criteria().get(0).criteria().get(0).contentId()); + Assertions.assertEquals(Kind.SOLUTION, model.dependencies().criteria().get(0).criteria().get(0).kind()); + Assertions.assertEquals("jwyzrieitqmlzuw", model.dependencies().criteria().get(0).criteria().get(0).version()); + Assertions.assertEquals("dzqajxkmpebfh", model.dependencies().criteria().get(0).criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.OR, + model.dependencies().criteria().get(0).criteria().get(0).operator()); + Assertions.assertEquals("xdqeluvmsaq", model.categories().domains().get(0)); + Assertions.assertEquals("clnfusrgnos", model.categories().verticals().get(0)); + Assertions.assertEquals("jnohafwm", model.providers().get(0)); + Assertions.assertEquals("gpeametsdw", model.customVersion()); + Assertions.assertEquals("amtxccfegsavbg", model.contentSchemaVersion()); + Assertions.assertEquals("ucv", model.icon()); + Assertions.assertEquals("dhoo", model.threatAnalysisTactics().get(0)); + Assertions.assertEquals("z", model.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("codbqeo", model.previewImages().get(0)); + Assertions.assertEquals("mxxbjhs", model.previewImagesDark().get(0)); + Assertions.assertEquals("v", model.packageId()); + Assertions.assertEquals(PackageKind.SOLUTION, model.packageKind()); + Assertions.assertEquals("ffgxtaelxtpfc", model.packageName()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatActorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatActorTests.java new file mode 100644 index 000000000000..a71ff784ed29 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatActorTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ThreatActor; + +public final class ThreatActorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThreatActor model = BinaryData.fromString( + "{\"kind\":\"ThreatActor\",\"properties\":{\"data\":{\"cjkexybxyrc\":\"\\\"datauqvatstkvoivcktj\\\"\",\"zhyunwmbf\":\"\\\"datagptx\\\"\",\"lblwmfudpnt\":\"\\\"datajs\\\"\",\"fm\":\"\\\"datas\\\"\"},\"createdBy\":{\"email\":\"ytrivfleqvefnzvh\",\"name\":\"wbakszxcm\",\"objectId\":\"ezasjyilhvtrox\"},\"source\":\"bddxebdh\",\"firstIngestedTimeUtc\":\"2021-02-22T18:03:05Z\",\"lastIngestedTimeUtc\":\"2021-07-30T23:16:02Z\",\"ingestionRulesVersion\":\"jgrepbrbmc\",\"lastUpdateMethod\":\"vxjwpvqrexlui\",\"lastModifiedBy\":{\"email\":\"qwbrfiovpdlt\",\"name\":\"rfiwerlbcetrvird\",\"objectId\":\"dswpvnloopzy\"},\"lastUpdatedDateTimeUtc\":\"2021-10-02T17:04:34Z\",\"relationshipHints\":[{\"fieldName\":\"abhacjlfqzcklvv\",\"source\":\"pfqtp\"},{\"fieldName\":\"hmlnfvyhdhffn\",\"source\":\"mhawbxnlkmazhlew\"},{\"fieldName\":\"oksayehfzzip\",\"source\":\"tmdhbctk\"}]},\"id\":\"wxzlphzujkqaxbej\",\"name\":\"xopeh\",\"type\":\"lysy\"}") + .toObject(ThreatActor.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRulePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRulePropertiesTests.java new file mode 100644 index 000000000000..40d4b534e9e6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRulePropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleProperties; +import org.junit.jupiter.api.Assertions; + +public final class ThreatIntelligenceAlertRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThreatIntelligenceAlertRuleProperties model = BinaryData.fromString( + "{\"alertRuleTemplateName\":\"udxytlmoyrx\",\"description\":\"fudwpznt\",\"displayName\":\"dzhlrq\",\"enabled\":false,\"lastModifiedUtc\":\"2021-06-26T16:57:35Z\",\"severity\":\"High\",\"tactics\":[\"Impact\",\"LateralMovement\",\"Reconnaissance\"],\"techniques\":[\"kyv\",\"ycanuzbpzkafku\"],\"subTechniques\":[\"rnwb\",\"ehhseyvjusrts\"]}") + .toObject(ThreatIntelligenceAlertRuleProperties.class); + Assertions.assertEquals("udxytlmoyrx", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThreatIntelligenceAlertRuleProperties model + = new ThreatIntelligenceAlertRuleProperties().withAlertRuleTemplateName("udxytlmoyrx").withEnabled(false); + model = BinaryData.fromObject(model).toObject(ThreatIntelligenceAlertRuleProperties.class); + Assertions.assertEquals("udxytlmoyrx", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplatePropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplatePropertiesTests.java new file mode 100644 index 000000000000..1440a9d0eacf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplatePropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceAlertRuleTemplateProperties; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import org.junit.jupiter.api.Assertions; + +public final class ThreatIntelligenceAlertRuleTemplatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThreatIntelligenceAlertRuleTemplateProperties model = BinaryData.fromString( + "{\"severity\":\"Low\",\"tactics\":[\"Collection\",\"Discovery\"],\"techniques\":[\"ox\",\"rgguf\",\"yaomtb\",\"hhavgrvkffovjz\"],\"alertRulesCreatedByTemplateCount\":1314543858,\"lastUpdatedDateUTC\":\"2021-10-06T16:12:23Z\",\"createdDateUTC\":\"2021-07-16T09:53:39Z\",\"description\":\"mfxumvfcluyovw\",\"displayName\":\"bkfezzxscyhwzdgi\",\"requiredDataConnectors\":[{\"connectorId\":\"zbomvzzbtdcqvpni\",\"dataTypes\":[\"viylwdshfssnrbgy\",\"frymsgaojfmwnc\",\"tmr\"]},{\"connectorId\":\"irctymoxoftpipiw\",\"dataTypes\":[\"uh\"]},{\"connectorId\":\"cpqjlihhyu\",\"dataTypes\":[\"kasdvlm\",\"wdgzxulucv\",\"amrsreuzv\",\"urisjnhnytxifqj\"]},{\"connectorId\":\"xmrhu\",\"dataTypes\":[\"pcesutrg\"]}],\"status\":\"Installed\"}") + .toObject(ThreatIntelligenceAlertRuleTemplateProperties.class); + Assertions.assertEquals(1314543858, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("mfxumvfcluyovw", model.description()); + Assertions.assertEquals("bkfezzxscyhwzdgi", model.displayName()); + Assertions.assertEquals("zbomvzzbtdcqvpni", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("viylwdshfssnrbgy", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.INSTALLED, model.status()); + Assertions.assertEquals(AttackTactic.COLLECTION, model.tactics().get(0)); + Assertions.assertEquals("ox", model.techniques().get(0)); + Assertions.assertEquals(AlertSeverity.LOW, model.severity()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplateTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplateTests.java new file mode 100644 index 000000000000..0665117e2002 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTemplateTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.AlertSeverity; +import com.azure.resourcemanager.securityinsights.models.AttackTactic; +import com.azure.resourcemanager.securityinsights.models.TemplateStatus; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRuleTemplate; +import org.junit.jupiter.api.Assertions; + +public final class ThreatIntelligenceAlertRuleTemplateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThreatIntelligenceAlertRuleTemplate model = BinaryData.fromString( + "{\"kind\":\"ThreatIntelligence\",\"properties\":{\"severity\":\"Medium\",\"tactics\":[\"Discovery\"],\"techniques\":[\"dfdlwggyts\",\"wtovvtgsein\"],\"alertRulesCreatedByTemplateCount\":405729519,\"lastUpdatedDateUTC\":\"2021-05-10T20:16:44Z\",\"createdDateUTC\":\"2021-09-17T22:17:43Z\",\"description\":\"npirgnepttw\",\"displayName\":\"sniffc\",\"requiredDataConnectors\":[{\"connectorId\":\"r\",\"dataTypes\":[\"pij\",\"k\",\"xfrdd\"]},{\"connectorId\":\"ratiz\",\"dataTypes\":[\"nasx\",\"ft\",\"zq\"]},{\"connectorId\":\"hftwesgog\",\"dataTypes\":[\"onnxkrlgnyhm\",\"ssxkkgthr\",\"gh\",\"jbdhqxvc\"]},{\"connectorId\":\"frpdsofbshrns\",\"dataTypes\":[\"swdvzyybycnun\",\"jsrtk\"]}],\"status\":\"Available\"},\"id\":\"opqgikyzirtxdyux\",\"name\":\"ejnt\",\"type\":\"sewgioilqukr\"}") + .toObject(ThreatIntelligenceAlertRuleTemplate.class); + Assertions.assertEquals(AlertSeverity.MEDIUM, model.severity()); + Assertions.assertEquals(AttackTactic.DISCOVERY, model.tactics().get(0)); + Assertions.assertEquals("dfdlwggyts", model.techniques().get(0)); + Assertions.assertEquals(405729519, model.alertRulesCreatedByTemplateCount()); + Assertions.assertEquals("npirgnepttw", model.description()); + Assertions.assertEquals("sniffc", model.displayName()); + Assertions.assertEquals("r", model.requiredDataConnectors().get(0).connectorId()); + Assertions.assertEquals("pij", model.requiredDataConnectors().get(0).dataTypes().get(0)); + Assertions.assertEquals(TemplateStatus.AVAILABLE, model.status()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTests.java new file mode 100644 index 000000000000..35082eca652d --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAlertRuleTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAlertRule; +import org.junit.jupiter.api.Assertions; + +public final class ThreatIntelligenceAlertRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThreatIntelligenceAlertRule model = BinaryData.fromString( + "{\"kind\":\"ThreatIntelligence\",\"properties\":{\"alertRuleTemplateName\":\"cnjbkcnxdhbt\",\"description\":\"phywpnvj\",\"displayName\":\"qnermclfplphoxu\",\"enabled\":false,\"lastModifiedUtc\":\"2021-02-26T20:34:01Z\",\"severity\":\"Medium\",\"tactics\":[\"Reconnaissance\"],\"techniques\":[\"bjtazqugxywpmu\"],\"subTechniques\":[\"jzwf\"]},\"etag\":\"q\",\"id\":\"ids\",\"name\":\"yonobgl\",\"type\":\"ocqxtccmg\"}") + .toObject(ThreatIntelligenceAlertRule.class); + Assertions.assertEquals("q", model.etag()); + Assertions.assertEquals("cnjbkcnxdhbt", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThreatIntelligenceAlertRule model = new ThreatIntelligenceAlertRule().withEtag("q") + .withAlertRuleTemplateName("cnjbkcnxdhbt") + .withEnabled(false); + model = BinaryData.fromObject(model).toObject(ThreatIntelligenceAlertRule.class); + Assertions.assertEquals("q", model.etag()); + Assertions.assertEquals("cnjbkcnxdhbt", model.alertRuleTemplateName()); + Assertions.assertFalse(model.enabled()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAppendTagsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAppendTagsTests.java index 3566177486ea..41ed90fd583c 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAppendTagsTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceAppendTagsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -13,16 +13,16 @@ public final class ThreatIntelligenceAppendTagsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceAppendTags model - = BinaryData.fromString("{\"threatIntelligenceTags\":[\"qufegxuvwzfbn\",\"lmctlpd\",\"gitvg\"]}") + = BinaryData.fromString("{\"threatIntelligenceTags\":[\"o\",\"sitsxhvs\",\"zp\",\"qi\"]}") .toObject(ThreatIntelligenceAppendTags.class); - Assertions.assertEquals("qufegxuvwzfbn", model.threatIntelligenceTags().get(0)); + Assertions.assertEquals("o", model.threatIntelligenceTags().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ThreatIntelligenceAppendTags model = new ThreatIntelligenceAppendTags() - .withThreatIntelligenceTags(Arrays.asList("qufegxuvwzfbn", "lmctlpd", "gitvg")); + ThreatIntelligenceAppendTags model + = new ThreatIntelligenceAppendTags().withThreatIntelligenceTags(Arrays.asList("o", "sitsxhvs", "zp", "qi")); model = BinaryData.fromObject(model).toObject(ThreatIntelligenceAppendTags.class); - Assertions.assertEquals("qufegxuvwzfbn", model.threatIntelligenceTags().get(0)); + Assertions.assertEquals("o", model.threatIntelligenceTags().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountInnerTests.java new file mode 100644 index 000000000000..e24a900721f4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceCountInnerTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceCountInner; + +public final class ThreatIntelligenceCountInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThreatIntelligenceCountInner model + = BinaryData.fromString("{\"count\":1868296433}").toObject(ThreatIntelligenceCountInner.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceExternalReferenceTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceExternalReferenceTests.java index f098e4344a0d..ee0709741ab0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceExternalReferenceTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceExternalReferenceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -14,29 +14,29 @@ public final class ThreatIntelligenceExternalReferenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceExternalReference model = BinaryData.fromString( - "{\"description\":\"swhccsphk\",\"externalId\":\"vwitqscyw\",\"sourceName\":\"gwol\",\"url\":\"czbwemhairsbr\",\"hashes\":{\"ggicccnxqhue\":\"wmsweypqwd\",\"zrncsdt\":\"mkttlstvlzywem\",\"bsfgytguslfea\":\"lusiy\"}}") + "{\"description\":\"qaxtmvmyc\",\"externalId\":\"paxjdqvv\",\"sourceName\":\"ehyv\",\"url\":\"jngoq\",\"hashes\":{\"bgtuhw\":\"v\",\"uzgzr\":\"xunwenbphyl\",\"etxpun\":\"xdusebkc\",\"uiqr\":\"erma\"}}") .toObject(ThreatIntelligenceExternalReference.class); - Assertions.assertEquals("swhccsphk", model.description()); - Assertions.assertEquals("vwitqscyw", model.externalId()); - Assertions.assertEquals("gwol", model.sourceName()); - Assertions.assertEquals("czbwemhairsbr", model.url()); - Assertions.assertEquals("wmsweypqwd", model.hashes().get("ggicccnxqhue")); + Assertions.assertEquals("qaxtmvmyc", model.description()); + Assertions.assertEquals("paxjdqvv", model.externalId()); + Assertions.assertEquals("ehyv", model.sourceName()); + Assertions.assertEquals("jngoq", model.url()); + Assertions.assertEquals("v", model.hashes().get("bgtuhw")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ThreatIntelligenceExternalReference model - = new ThreatIntelligenceExternalReference().withDescription("swhccsphk") - .withExternalId("vwitqscyw") - .withSourceName("gwol") - .withUrl("czbwemhairsbr") - .withHashes(mapOf("ggicccnxqhue", "wmsweypqwd", "zrncsdt", "mkttlstvlzywem", "bsfgytguslfea", "lusiy")); + = new ThreatIntelligenceExternalReference().withDescription("qaxtmvmyc") + .withExternalId("paxjdqvv") + .withSourceName("ehyv") + .withUrl("jngoq") + .withHashes(mapOf("bgtuhw", "v", "uzgzr", "xunwenbphyl", "etxpun", "xdusebkc", "uiqr", "erma")); model = BinaryData.fromObject(model).toObject(ThreatIntelligenceExternalReference.class); - Assertions.assertEquals("swhccsphk", model.description()); - Assertions.assertEquals("vwitqscyw", model.externalId()); - Assertions.assertEquals("gwol", model.sourceName()); - Assertions.assertEquals("czbwemhairsbr", model.url()); - Assertions.assertEquals("wmsweypqwd", model.hashes().get("ggicccnxqhue")); + Assertions.assertEquals("qaxtmvmyc", model.description()); + Assertions.assertEquals("paxjdqvv", model.externalId()); + Assertions.assertEquals("ehyv", model.sourceName()); + Assertions.assertEquals("jngoq", model.url()); + Assertions.assertEquals("v", model.hashes().get("bgtuhw")); } // Use "Map.of" if available diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceGranularMarkingModelTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceGranularMarkingModelTests.java index bfa97beed4bf..9308ad16f508 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceGranularMarkingModelTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceGranularMarkingModelTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,23 +12,23 @@ public final class ThreatIntelligenceGranularMarkingModelTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ThreatIntelligenceGranularMarkingModel model = BinaryData.fromString( - "{\"language\":\"ygqukyhejh\",\"markingRef\":435176888,\"selectors\":[\"fpel\",\"lppvksrpq\",\"ujzra\",\"htwdwrftswibyrcd\"]}") + ThreatIntelligenceGranularMarkingModel model = BinaryData + .fromString("{\"language\":\"mftubqwxvsxrb\",\"markingRef\":1985087232,\"selectors\":[\"grwjbsyc\"]}") .toObject(ThreatIntelligenceGranularMarkingModel.class); - Assertions.assertEquals("ygqukyhejh", model.language()); - Assertions.assertEquals(435176888, model.markingRef()); - Assertions.assertEquals("fpel", model.selectors().get(0)); + Assertions.assertEquals("mftubqwxvsxrb", model.language()); + Assertions.assertEquals(1985087232, model.markingRef()); + Assertions.assertEquals("grwjbsyc", model.selectors().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ThreatIntelligenceGranularMarkingModel model - = new ThreatIntelligenceGranularMarkingModel().withLanguage("ygqukyhejh") - .withMarkingRef(435176888) - .withSelectors(Arrays.asList("fpel", "lppvksrpq", "ujzra", "htwdwrftswibyrcd")); + = new ThreatIntelligenceGranularMarkingModel().withLanguage("mftubqwxvsxrb") + .withMarkingRef(1985087232) + .withSelectors(Arrays.asList("grwjbsyc")); model = BinaryData.fromObject(model).toObject(ThreatIntelligenceGranularMarkingModel.class); - Assertions.assertEquals("ygqukyhejh", model.language()); - Assertions.assertEquals(435176888, model.markingRef()); - Assertions.assertEquals("fpel", model.selectors().get(0)); + Assertions.assertEquals("mftubqwxvsxrb", model.language()); + Assertions.assertEquals(1985087232, model.markingRef()); + Assertions.assertEquals("grwjbsyc", model.selectors().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java index 9751c1f21e69..b44d569f127d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricsList; @@ -21,19 +21,19 @@ public final class ThreatIntelligenceIndicatorMetricsListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"lastUpdatedTimeUtc\":\"bicziuswswj\",\"threatTypeMetrics\":[{}],\"patternTypeMetrics\":[{},{}],\"sourceMetrics\":[{},{},{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"qqvyfscyrfw\",\"threatTypeMetrics\":[{},{}],\"patternTypeMetrics\":[{},{},{}],\"sourceMetrics\":[{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"yzwvbhlimbyqec\",\"threatTypeMetrics\":[{},{},{},{}],\"patternTypeMetrics\":[{},{}],\"sourceMetrics\":[{},{},{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"rdaasaxxo\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{}],\"sourceMetrics\":[{},{}]}}]}"; + = "{\"value\":[{\"properties\":{\"lastUpdatedTimeUtc\":\"twz\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{},{},{}],\"sourceMetrics\":[{},{},{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"npuoaorfpizybpj\",\"threatTypeMetrics\":[{},{},{},{}],\"patternTypeMetrics\":[{},{},{},{}],\"sourceMetrics\":[{},{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"wcywrbmxwlskkffw\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{}],\"sourceMetrics\":[{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"sqyjsw\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{},{}],\"sourceMetrics\":[{}]}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ThreatIntelligenceMetricsList response = manager.threatIntelligenceIndicatorMetrics() - .listWithResponse("cldpkawn", "nlaimouxwksqmudm", com.azure.core.util.Context.NONE) + .listWithResponse("elazvcfhiayro", "xeezlqw", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("bicziuswswj", response.value().get(0).properties().lastUpdatedTimeUtc()); + Assertions.assertEquals("twz", response.value().get(0).properties().lastUpdatedTimeUtc()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java index e1c59f642a16..7b4d956e31f2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceAppendTags; @@ -27,12 +27,11 @@ public void testAppendTagsWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.threatIntelligenceIndicators() - .appendTagsWithResponse( - "crdcueljti", "hxmfqryarvsxzqb", "lcjkayspthzodub", new ThreatIntelligenceAppendTags() - .withThreatIntelligenceTags(Arrays.asList("jtgblios", "kfmkmfdjxyxgbk", "qvjcteoe", "l")), + .appendTagsWithResponse("pjecjixcya", "kiitrdbtr", "vlu", new ThreatIntelligenceAppendTags() + .withThreatIntelligenceTags(Arrays.asList("su", "zfrwmctrngjqc", "sfbkrtpu")), com.azure.core.util.Context.NONE); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java index 36fad5c7d313..0c7b0a2d10c8 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.threatIntelligenceIndicators() - .deleteWithResponse("dr", "bfcmkrfts", "cwjjxsgmbawvif", com.azure.core.util.Context.NONE); + .deleteWithResponse("ifwknl", "tvxrtocadt", "mq", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java index a1a98e0a662c..6f5299d20c86 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformation; @@ -21,19 +21,19 @@ public final class ThreatIntelligenceIndicatorsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"wvaexhdctr\",\"id\":\"qnkbrupobehdm\",\"name\":\"jzacvumepjpbibn\",\"type\":\"pphepifexl\"}"; + = "{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"nveqleozqqw\",\"id\":\"wbwzyvbuifhy\",\"name\":\"atoplqc\",\"type\":\"jsrlzwu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ThreatIntelligenceInformation response = manager.threatIntelligenceIndicators() - .getWithResponse("w", "lqkznxhhllxricct", "wmuqqoajxeiygle", com.azure.core.util.Context.NONE) + .getWithResponse("tzd", "z", "bmzldplamccql", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("wvaexhdctr", response.etag()); + Assertions.assertEquals("nveqleozqqw", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java index 0eb920f27217..c7abd199b4a0 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformation; @@ -22,19 +22,19 @@ public final class ThreatIntelligenceIndicatorsOperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"nwfrkebsmhpd\",\"id\":\"dig\",\"name\":\"toleksc\",\"type\":\"ctnanqimwbzxp\"}]}"; + = "{\"value\":[{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"ujeia\",\"id\":\"yeefjss\",\"name\":\"yrwyffutezx\",\"type\":\"p\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.threatIntelligenceIndicatorsOperations() - .list("qbmfuvqarwz", "uqrebluimmbwx", "fgtdmbvx", 1608233960, "raokqkbudb", "waokbavlytta", + .list("tlxqlz", "kbxwncggamxbtqi", "ydaiolnkkgh", 455677843, "xvq", "bnwmokzxyltbpqj", com.azure.core.util.Context.NONE); - Assertions.assertEquals("nwfrkebsmhpd", response.iterator().next().etag()); + Assertions.assertEquals("ujeia", response.iterator().next().etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationInnerTests.java index 71030ba8c2a7..bf2b2073d27e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,15 +12,15 @@ public final class ThreatIntelligenceInformationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceInformationInner model = BinaryData.fromString( - "{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"h\",\"id\":\"fwpracstwi\",\"name\":\"ykhevxccedcpnmdy\",\"type\":\"dnwzxltjcvnhltiu\"}") + "{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"nddaxaogsk\",\"id\":\"mmmbipyse\",\"name\":\"yyb\",\"type\":\"bfjcvmk\"}") .toObject(ThreatIntelligenceInformationInner.class); - Assertions.assertEquals("h", model.etag()); + Assertions.assertEquals("nddaxaogsk", model.etag()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ThreatIntelligenceInformationInner model = new ThreatIntelligenceInformationInner().withEtag("h"); + ThreatIntelligenceInformationInner model = new ThreatIntelligenceInformationInner().withEtag("nddaxaogsk"); model = BinaryData.fromObject(model).toObject(ThreatIntelligenceInformationInner.class); - Assertions.assertEquals("h", model.etag()); + Assertions.assertEquals("nddaxaogsk", model.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationListTests.java index c88c01ec1765..6f4a5c622ccb 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationListTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceInformationListTests.java @@ -1,30 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceInformationInner; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceInformationList; -import java.util.Arrays; +import com.azure.resourcemanager.securityinsights.implementation.models.ThreatIntelligenceInformationList; import org.junit.jupiter.api.Assertions; public final class ThreatIntelligenceInformationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceInformationList model = BinaryData.fromString( - "{\"nextLink\":\"xnavvwxq\",\"value\":[{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"qunyowxwlmdjr\",\"id\":\"fgbvfvpdbo\",\"name\":\"acizsjqlhkrr\",\"type\":\"bdeibqipqk\"},{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"vxndz\",\"id\":\"krefajpjo\",\"name\":\"wkqnyhg\",\"type\":\"ij\"}]}") + "{\"value\":[{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"zeq\",\"id\":\"tp\",\"name\":\"nofkwhgyzwf\",\"type\":\"fdbvooelmikdsqq\"},{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"gjjsmvsiyqml\",\"id\":\"jwsmnwbmacvemmr\",\"name\":\"yzyvquesxplcsi\",\"type\":\"bul\"},{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"xxhcynnmvaiz\",\"id\":\"wqqpwcidsjqcqyz\",\"name\":\"rtfdlgp\",\"type\":\"yyjlikalbcyuwah\"}],\"nextLink\":\"agvaidzceph\"}") .toObject(ThreatIntelligenceInformationList.class); - Assertions.assertEquals("qunyowxwlmdjr", model.value().get(0).etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreatIntelligenceInformationList model = new ThreatIntelligenceInformationList() - .withValue(Arrays.asList(new ThreatIntelligenceInformationInner().withEtag("qunyowxwlmdjr"), - new ThreatIntelligenceInformationInner().withEtag("vxndz"))); - model = BinaryData.fromObject(model).toObject(ThreatIntelligenceInformationList.class); - Assertions.assertEquals("qunyowxwlmdjr", model.value().get(0).etag()); + Assertions.assertEquals("zeq", model.value().get(0).etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceKillChainPhaseTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceKillChainPhaseTests.java index 7ad3ab00507b..d3beb8c649e6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceKillChainPhaseTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceKillChainPhaseTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,18 +12,18 @@ public final class ThreatIntelligenceKillChainPhaseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceKillChainPhase model - = BinaryData.fromString("{\"killChainName\":\"rfdwoyu\",\"phaseName\":\"ziuiefozbhdm\"}") + = BinaryData.fromString("{\"killChainName\":\"e\",\"phaseName\":\"ugxpypbmzqsxblm\"}") .toObject(ThreatIntelligenceKillChainPhase.class); - Assertions.assertEquals("rfdwoyu", model.killChainName()); - Assertions.assertEquals("ziuiefozbhdm", model.phaseName()); + Assertions.assertEquals("e", model.killChainName()); + Assertions.assertEquals("ugxpypbmzqsxblm", model.phaseName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ThreatIntelligenceKillChainPhase model - = new ThreatIntelligenceKillChainPhase().withKillChainName("rfdwoyu").withPhaseName("ziuiefozbhdm"); + = new ThreatIntelligenceKillChainPhase().withKillChainName("e").withPhaseName("ugxpypbmzqsxblm"); model = BinaryData.fromObject(model).toObject(ThreatIntelligenceKillChainPhase.class); - Assertions.assertEquals("rfdwoyu", model.killChainName()); - Assertions.assertEquals("ziuiefozbhdm", model.phaseName()); + Assertions.assertEquals("e", model.killChainName()); + Assertions.assertEquals("ugxpypbmzqsxblm", model.phaseName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceListTests.java new file mode 100644 index 000000000000..b8741cf877de --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceListTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.ThreatIntelligenceList; +import org.junit.jupiter.api.Assertions; + +public final class ThreatIntelligenceListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThreatIntelligenceList model = BinaryData.fromString( + "{\"value\":[{\"kind\":\"TIObject\",\"properties\":{\"data\":{\"ogrddimnacklyrbv\":\"\\\"dataqrqtx\\\"\",\"fpjpsbcxqiyapi\":\"\\\"databdgexpnphtq\\\"\",\"wcgrzafqsozawq\":\"\\\"datacjlfugnrz\\\"\",\"xdwtfmf\":\"\\\"datanhlvagug\\\"\"},\"createdBy\":{\"email\":\"zplhaljom\",\"name\":\"orprrapt\",\"objectId\":\"jenylgebrsnvof\"},\"source\":\"zvbploazc\",\"firstIngestedTimeUtc\":\"2021-05-17T22:09:34Z\",\"lastIngestedTimeUtc\":\"2021-02-03T15:26:18Z\",\"ingestionRulesVersion\":\"mmadkbxuip\",\"lastUpdateMethod\":\"awxugpubeqk\",\"lastModifiedBy\":{\"email\":\"muzgue\",\"name\":\"gpbhauhejmswe\",\"objectId\":\"gxxzxwrnqwdjvl\"},\"lastUpdatedDateTimeUtc\":\"2021-01-18T03:10:16Z\",\"relationshipHints\":[{\"fieldName\":\"lwsfxqcmejezjcb\",\"source\":\"uagakmxg\"}]},\"id\":\"mavllp\",\"name\":\"jguzsyfwamhmeo\",\"type\":\"xbzagwnompvyis\"},{\"kind\":\"TIObject\",\"properties\":{\"data\":{\"fzmhkridip\":\"\\\"dataufysalbjfkjex\\\"\"},\"createdBy\":{\"email\":\"jnn\",\"name\":\"ifjqhjenb\",\"objectId\":\"pfpllosadjffllr\"},\"source\":\"g\",\"firstIngestedTimeUtc\":\"2021-06-27T08:18:04Z\",\"lastIngestedTimeUtc\":\"2021-11-30T02:38:16Z\",\"ingestionRulesVersion\":\"adzu\",\"lastUpdateMethod\":\"ccclsnf\",\"lastModifiedBy\":{\"email\":\"xpmny\",\"name\":\"tgslkokq\",\"objectId\":\"gzcojgdq\"},\"lastUpdatedDateTimeUtc\":\"2021-03-09T00:40:53Z\",\"relationshipHints\":[{\"fieldName\":\"jgpjnydkkgbvsqks\",\"source\":\"kvgavnr\"},{\"fieldName\":\"qqiwfysuj\",\"source\":\"hclgpexrxyrpwzsm\"},{\"fieldName\":\"ebpsk\",\"source\":\"cifdvtwuncn\"},{\"fieldName\":\"yjwjmyubhtmlgjai\",\"source\":\"ymjdwirglqibj\"}]},\"id\":\"mka\",\"name\":\"uuxbzfhur\",\"type\":\"wk\"},{\"kind\":\"TIObject\",\"properties\":{\"data\":{\"l\":\"\\\"datatzmxxi\\\"\",\"yp\":\"\\\"datahylbna\\\"\",\"hoem\":\"\\\"datax\\\"\"},\"createdBy\":{\"email\":\"mmpvo\",\"name\":\"fgukrxumw\",\"objectId\":\"wydnawzeleq\"},\"source\":\"kqxkrumhaeqboigw\",\"firstIngestedTimeUtc\":\"2021-09-13T20:18:29Z\",\"lastIngestedTimeUtc\":\"2021-03-04T19:05:01Z\",\"ingestionRulesVersion\":\"iyarfhiv\",\"lastUpdateMethod\":\"tidzvvndpr\",\"lastModifiedBy\":{\"email\":\"ex\",\"name\":\"dhpkplaseylt\",\"objectId\":\"fpfopekyzdzvhyoi\"},\"lastUpdatedDateTimeUtc\":\"2021-05-15T18:51:07Z\",\"relationshipHints\":[{\"fieldName\":\"j\",\"source\":\"vzpqrxsifixo\"},{\"fieldName\":\"nylfutgbpw\",\"source\":\"ayxtvpi\"},{\"fieldName\":\"tybww\",\"source\":\"rs\"}]},\"id\":\"jalorxeegiczr\",\"name\":\"n\",\"type\":\"zlcvndihkph\"}],\"nextLink\":\"gkk\"}") + .toObject(ThreatIntelligenceList.class); + Assertions.assertEquals("gkk", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricEntityTests.java index 6b1a80e25cce..16db75f24b89 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,18 +12,9 @@ public final class ThreatIntelligenceMetricEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceMetricEntity model - = BinaryData.fromString("{\"metricName\":\"vyhgs\",\"metricValue\":2121939227}") + = BinaryData.fromString("{\"metricName\":\"lkgjhomywlypghhu\",\"metricValue\":69043588}") .toObject(ThreatIntelligenceMetricEntity.class); - Assertions.assertEquals("vyhgs", model.metricName()); - Assertions.assertEquals(2121939227, model.metricValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreatIntelligenceMetricEntity model - = new ThreatIntelligenceMetricEntity().withMetricName("vyhgs").withMetricValue(2121939227); - model = BinaryData.fromObject(model).toObject(ThreatIntelligenceMetricEntity.class); - Assertions.assertEquals("vyhgs", model.metricName()); - Assertions.assertEquals(2121939227, model.metricValue()); + Assertions.assertEquals("lkgjhomywlypghhu", model.metricName()); + Assertions.assertEquals(69043588, model.metricValue()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricTests.java index 6101e329c21c..a0c2a230a8c1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricTests.java @@ -1,52 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetric; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricEntity; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ThreatIntelligenceMetricTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceMetric model = BinaryData.fromString( - "{\"lastUpdatedTimeUtc\":\"epbqpcrfkbw\",\"threatTypeMetrics\":[{\"metricName\":\"jvcdwxlpqekf\",\"metricValue\":839437170},{\"metricName\":\"tjsyin\",\"metricValue\":291919724},{\"metricName\":\"atmtdhtmdvy\",\"metricValue\":932898449},{\"metricName\":\"dgszywkbirryuzh\",\"metricValue\":524454595}],\"patternTypeMetrics\":[{\"metricName\":\"rvqqaatj\",\"metricValue\":379667314},{\"metricName\":\"goupmfiibfg\",\"metricValue\":2107533163},{\"metricName\":\"olvrw\",\"metricValue\":148831092}],\"sourceMetrics\":[{\"metricName\":\"gllqwjy\",\"metricValue\":104545862},{\"metricName\":\"yvblmhvkzu\",\"metricValue\":919724990}]}") + "{\"lastUpdatedTimeUtc\":\"ehy\",\"threatTypeMetrics\":[{\"metricName\":\"jrgfbmpszwkbcstz\",\"metricValue\":1564723464}],\"patternTypeMetrics\":[{\"metricName\":\"smaxdwxr\",\"metricValue\":1056899177}],\"sourceMetrics\":[{\"metricName\":\"sdta\",\"metricValue\":102821362}]}") .toObject(ThreatIntelligenceMetric.class); - Assertions.assertEquals("epbqpcrfkbw", model.lastUpdatedTimeUtc()); - Assertions.assertEquals("jvcdwxlpqekf", model.threatTypeMetrics().get(0).metricName()); - Assertions.assertEquals(839437170, model.threatTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("rvqqaatj", model.patternTypeMetrics().get(0).metricName()); - Assertions.assertEquals(379667314, model.patternTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("gllqwjy", model.sourceMetrics().get(0).metricName()); - Assertions.assertEquals(104545862, model.sourceMetrics().get(0).metricValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreatIntelligenceMetric model = new ThreatIntelligenceMetric().withLastUpdatedTimeUtc("epbqpcrfkbw") - .withThreatTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("jvcdwxlpqekf").withMetricValue(839437170), - new ThreatIntelligenceMetricEntity().withMetricName("tjsyin").withMetricValue(291919724), - new ThreatIntelligenceMetricEntity().withMetricName("atmtdhtmdvy").withMetricValue(932898449), - new ThreatIntelligenceMetricEntity().withMetricName("dgszywkbirryuzh").withMetricValue(524454595))) - .withPatternTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("rvqqaatj").withMetricValue(379667314), - new ThreatIntelligenceMetricEntity().withMetricName("goupmfiibfg").withMetricValue(2107533163), - new ThreatIntelligenceMetricEntity().withMetricName("olvrw").withMetricValue(148831092))) - .withSourceMetrics( - Arrays.asList(new ThreatIntelligenceMetricEntity().withMetricName("gllqwjy").withMetricValue(104545862), - new ThreatIntelligenceMetricEntity().withMetricName("yvblmhvkzu").withMetricValue(919724990))); - model = BinaryData.fromObject(model).toObject(ThreatIntelligenceMetric.class); - Assertions.assertEquals("epbqpcrfkbw", model.lastUpdatedTimeUtc()); - Assertions.assertEquals("jvcdwxlpqekf", model.threatTypeMetrics().get(0).metricName()); - Assertions.assertEquals(839437170, model.threatTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("rvqqaatj", model.patternTypeMetrics().get(0).metricName()); - Assertions.assertEquals(379667314, model.patternTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("gllqwjy", model.sourceMetrics().get(0).metricName()); - Assertions.assertEquals(104545862, model.sourceMetrics().get(0).metricValue()); + Assertions.assertEquals("ehy", model.lastUpdatedTimeUtc()); + Assertions.assertEquals("jrgfbmpszwkbcstz", model.threatTypeMetrics().get(0).metricName()); + Assertions.assertEquals(1564723464, model.threatTypeMetrics().get(0).metricValue()); + Assertions.assertEquals("smaxdwxr", model.patternTypeMetrics().get(0).metricName()); + Assertions.assertEquals(1056899177, model.patternTypeMetrics().get(0).metricValue()); + Assertions.assertEquals("sdta", model.sourceMetrics().get(0).metricName()); + Assertions.assertEquals(102821362, model.sourceMetrics().get(0).metricValue()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsListInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsListInnerTests.java index 757e097a6899..c68e69e18eb7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsListInnerTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsListInnerTests.java @@ -1,86 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.fluent.models.ThreatIntelligenceMetricsListInner; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetric; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricEntity; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetrics; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ThreatIntelligenceMetricsListInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceMetricsListInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"lastUpdatedTimeUtc\":\"mouwqlgzrfzeey\",\"threatTypeMetrics\":[{\"metricName\":\"ikayuhqlbjbsybb\",\"metricValue\":140703725},{\"metricName\":\"t\",\"metricValue\":1918019278},{\"metricName\":\"fp\",\"metricValue\":1408041355}],\"patternTypeMetrics\":[{\"metricName\":\"as\",\"metricValue\":753407395},{\"metricName\":\"qfxssmwutw\",\"metricValue\":1224801299},{\"metricName\":\"ezpdrhneu\",\"metricValue\":979577305},{\"metricName\":\"kdw\",\"metricValue\":227245186}],\"sourceMetrics\":[{\"metricName\":\"ircgpikpz\",\"metricValue\":2049479560}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"anlfzxiavrmbz\",\"threatTypeMetrics\":[{\"metricName\":\"i\",\"metricValue\":485732763},{\"metricName\":\"cirgzp\",\"metricValue\":1656770527},{\"metricName\":\"zszrnwoiindfpw\",\"metricValue\":2003190846}],\"patternTypeMetrics\":[{\"metricName\":\"tlhflsjcdhszf\",\"metricValue\":1868624750},{\"metricName\":\"gofel\",\"metricValue\":940217853},{\"metricName\":\"qmqhldvriii\",\"metricValue\":1756672367}],\"sourceMetrics\":[{\"metricName\":\"hfkvtvsexsowuel\",\"metricValue\":1968234640}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"hhxvrhmzkwpj\",\"threatTypeMetrics\":[{\"metricName\":\"pughftqsxh\",\"metricValue\":59449335},{\"metricName\":\"xukndxdigr\",\"metricValue\":1599924393},{\"metricName\":\"fzdm\",\"metricValue\":1621102365},{\"metricName\":\"fi\",\"metricValue\":1852140441}],\"patternTypeMetrics\":[{\"metricName\":\"z\",\"metricValue\":867678631}],\"sourceMetrics\":[{\"metricName\":\"pph\",\"metricValue\":1764475997}]}}]}") + "{\"value\":[{\"properties\":{\"lastUpdatedTimeUtc\":\"qcil\",\"threatTypeMetrics\":[{\"metricName\":\"gn\",\"metricValue\":1548550741},{\"metricName\":\"dpmcewq\",\"metricValue\":242539846},{\"metricName\":\"g\",\"metricValue\":1712838948}],\"patternTypeMetrics\":[{\"metricName\":\"bs\",\"metricValue\":325378851},{\"metricName\":\"mvdpavcjkb\",\"metricValue\":1178368406},{\"metricName\":\"hizcbqjxmhwdt\",\"metricValue\":1962450647},{\"metricName\":\"skdlr\",\"metricValue\":1011518692}],\"sourceMetrics\":[{\"metricName\":\"ltjdauuj\",\"metricValue\":1231436254},{\"metricName\":\"hddzeykud\",\"metricValue\":1477996830},{\"metricName\":\"my\",\"metricValue\":1354785186}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"qyoduk\",\"threatTypeMetrics\":[{\"metricName\":\"nqqkqxkd\",\"metricValue\":1657414459},{\"metricName\":\"uqkrbyy\",\"metricValue\":355819305},{\"metricName\":\"gbnw\",\"metricValue\":2095251473},{\"metricName\":\"llbecannvxouhd\",\"metricValue\":959507234}],\"patternTypeMetrics\":[{\"metricName\":\"cjapmfwxmcxhw\",\"metricValue\":1099088497},{\"metricName\":\"ifoyoc\",\"metricValue\":1617471481},{\"metricName\":\"hmqyufpfowweyls\",\"metricValue\":1380333563},{\"metricName\":\"g\",\"metricValue\":1522189300}],\"sourceMetrics\":[{\"metricName\":\"onfc\",\"metricValue\":309044563},{\"metricName\":\"hfycigcbmayhdtjf\",\"metricValue\":321200159},{\"metricName\":\"ajzdj\",\"metricValue\":2062973459},{\"metricName\":\"wrfrm\",\"metricValue\":652099165}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"krbgvojcks\",\"threatTypeMetrics\":[{\"metricName\":\"qu\",\"metricValue\":2073935711},{\"metricName\":\"lyxdeggnzadqmvp\",\"metricValue\":1827595290},{\"metricName\":\"s\",\"metricValue\":354094412}],\"patternTypeMetrics\":[{\"metricName\":\"pl\",\"metricValue\":249834396},{\"metricName\":\"wojsrgclxn\",\"metricValue\":123612103},{\"metricName\":\"hhaq\",\"metricValue\":2103821508}],\"sourceMetrics\":[{\"metricName\":\"mgukyw\",\"metricValue\":400356558},{\"metricName\":\"wlcexkrpitqz\",\"metricValue\":1046269355},{\"metricName\":\"eujcmtci\",\"metricValue\":1517865993},{\"metricName\":\"nnxhc\",\"metricValue\":925818016}]}}]}") .toObject(ThreatIntelligenceMetricsListInner.class); - Assertions.assertEquals("mouwqlgzrfzeey", model.value().get(0).properties().lastUpdatedTimeUtc()); - Assertions.assertEquals("ikayuhqlbjbsybb", - model.value().get(0).properties().threatTypeMetrics().get(0).metricName()); - Assertions.assertEquals(140703725, model.value().get(0).properties().threatTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("as", model.value().get(0).properties().patternTypeMetrics().get(0).metricName()); - Assertions.assertEquals(753407395, model.value().get(0).properties().patternTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("ircgpikpz", model.value().get(0).properties().sourceMetrics().get(0).metricName()); - Assertions.assertEquals(2049479560, model.value().get(0).properties().sourceMetrics().get(0).metricValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreatIntelligenceMetricsListInner model - = new ThreatIntelligenceMetricsListInner().withValue(Arrays.asList( - new ThreatIntelligenceMetrics().withProperties(new ThreatIntelligenceMetric() - .withLastUpdatedTimeUtc("mouwqlgzrfzeey") - .withThreatTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("ikayuhqlbjbsybb") - .withMetricValue(140703725), - new ThreatIntelligenceMetricEntity().withMetricName("t").withMetricValue(1918019278), - new ThreatIntelligenceMetricEntity().withMetricName("fp").withMetricValue(1408041355))) - .withPatternTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("as").withMetricValue(753407395), - new ThreatIntelligenceMetricEntity().withMetricName("qfxssmwutw").withMetricValue(1224801299), - new ThreatIntelligenceMetricEntity().withMetricName("ezpdrhneu").withMetricValue(979577305), - new ThreatIntelligenceMetricEntity().withMetricName("kdw").withMetricValue(227245186))) - .withSourceMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("ircgpikpz").withMetricValue(2049479560)))), - new ThreatIntelligenceMetrics() - .withProperties(new ThreatIntelligenceMetric().withLastUpdatedTimeUtc("anlfzxiavrmbz") - .withThreatTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("i").withMetricValue(485732763), - new ThreatIntelligenceMetricEntity().withMetricName("cirgzp").withMetricValue(1656770527), - new ThreatIntelligenceMetricEntity().withMetricName("zszrnwoiindfpw") - .withMetricValue(2003190846))) - .withPatternTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("tlhflsjcdhszf") - .withMetricValue(1868624750), - new ThreatIntelligenceMetricEntity().withMetricName("gofel").withMetricValue(940217853), - new ThreatIntelligenceMetricEntity().withMetricName("qmqhldvriii") - .withMetricValue(1756672367))) - .withSourceMetrics( - Arrays.asList(new ThreatIntelligenceMetricEntity().withMetricName("hfkvtvsexsowuel") - .withMetricValue(1968234640)))), - new ThreatIntelligenceMetrics().withProperties(new ThreatIntelligenceMetric() - .withLastUpdatedTimeUtc("hhxvrhmzkwpj") - .withThreatTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("pughftqsxh").withMetricValue(59449335), - new ThreatIntelligenceMetricEntity().withMetricName("xukndxdigr").withMetricValue(1599924393), - new ThreatIntelligenceMetricEntity().withMetricName("fzdm").withMetricValue(1621102365), - new ThreatIntelligenceMetricEntity().withMetricName("fi").withMetricValue(1852140441))) - .withPatternTypeMetrics(Arrays - .asList(new ThreatIntelligenceMetricEntity().withMetricName("z").withMetricValue(867678631))) - .withSourceMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("pph").withMetricValue(1764475997)))))); - model = BinaryData.fromObject(model).toObject(ThreatIntelligenceMetricsListInner.class); - Assertions.assertEquals("mouwqlgzrfzeey", model.value().get(0).properties().lastUpdatedTimeUtc()); - Assertions.assertEquals("ikayuhqlbjbsybb", - model.value().get(0).properties().threatTypeMetrics().get(0).metricName()); - Assertions.assertEquals(140703725, model.value().get(0).properties().threatTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("as", model.value().get(0).properties().patternTypeMetrics().get(0).metricName()); - Assertions.assertEquals(753407395, model.value().get(0).properties().patternTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("ircgpikpz", model.value().get(0).properties().sourceMetrics().get(0).metricName()); - Assertions.assertEquals(2049479560, model.value().get(0).properties().sourceMetrics().get(0).metricValue()); + Assertions.assertEquals("qcil", model.value().get(0).properties().lastUpdatedTimeUtc()); + Assertions.assertEquals("gn", model.value().get(0).properties().threatTypeMetrics().get(0).metricName()); + Assertions.assertEquals(1548550741, model.value().get(0).properties().threatTypeMetrics().get(0).metricValue()); + Assertions.assertEquals("bs", model.value().get(0).properties().patternTypeMetrics().get(0).metricName()); + Assertions.assertEquals(325378851, model.value().get(0).properties().patternTypeMetrics().get(0).metricValue()); + Assertions.assertEquals("ltjdauuj", model.value().get(0).properties().sourceMetrics().get(0).metricName()); + Assertions.assertEquals(1231436254, model.value().get(0).properties().sourceMetrics().get(0).metricValue()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsTests.java index 6793e85e1776..d6a0665b533e 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceMetricsTests.java @@ -1,53 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetric; -import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetricEntity; import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceMetrics; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ThreatIntelligenceMetricsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceMetrics model = BinaryData.fromString( - "{\"properties\":{\"lastUpdatedTimeUtc\":\"udphqamvdkfwyn\",\"threatTypeMetrics\":[{\"metricName\":\"bvkayh\",\"metricValue\":1068554694},{\"metricName\":\"yqiatkzwp\",\"metricValue\":180338782}],\"patternTypeMetrics\":[{\"metricName\":\"jaesgvvsccya\",\"metricValue\":306781812},{\"metricName\":\"fhwygzlvdnkfxus\",\"metricValue\":1736640593},{\"metricName\":\"zrmuhapfcqdps\",\"metricValue\":399879139},{\"metricName\":\"psvuoymgc\",\"metricValue\":841424592}],\"sourceMetrics\":[{\"metricName\":\"rypqlmfeo\",\"metricValue\":1208971148},{\"metricName\":\"wkyhkobopgxe\",\"metricValue\":1041237961}]}}") + "{\"properties\":{\"lastUpdatedTimeUtc\":\"xoef\",\"threatTypeMetrics\":[{\"metricName\":\"ylx\",\"metricValue\":1673715180},{\"metricName\":\"kjzvqp\",\"metricValue\":2086222472}],\"patternTypeMetrics\":[{\"metricName\":\"yjtr\",\"metricValue\":443932083},{\"metricName\":\"dsnqhyefn\",\"metricValue\":186573160},{\"metricName\":\"tpjksdlulytjxhxw\",\"metricValue\":762713500}],\"sourceMetrics\":[{\"metricName\":\"vukvupuplug\",\"metricValue\":776464126},{\"metricName\":\"vpdvc\",\"metricValue\":236052344},{\"metricName\":\"pydsfpz\",\"metricValue\":1748274002},{\"metricName\":\"ilbn\",\"metricValue\":1102673144}]}}") .toObject(ThreatIntelligenceMetrics.class); - Assertions.assertEquals("udphqamvdkfwyn", model.properties().lastUpdatedTimeUtc()); - Assertions.assertEquals("bvkayh", model.properties().threatTypeMetrics().get(0).metricName()); - Assertions.assertEquals(1068554694, model.properties().threatTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("jaesgvvsccya", model.properties().patternTypeMetrics().get(0).metricName()); - Assertions.assertEquals(306781812, model.properties().patternTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("rypqlmfeo", model.properties().sourceMetrics().get(0).metricName()); - Assertions.assertEquals(1208971148, model.properties().sourceMetrics().get(0).metricValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreatIntelligenceMetrics model = new ThreatIntelligenceMetrics() - .withProperties(new ThreatIntelligenceMetric().withLastUpdatedTimeUtc("udphqamvdkfwyn") - .withThreatTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("bvkayh").withMetricValue(1068554694), - new ThreatIntelligenceMetricEntity().withMetricName("yqiatkzwp").withMetricValue(180338782))) - .withPatternTypeMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("jaesgvvsccya").withMetricValue(306781812), - new ThreatIntelligenceMetricEntity().withMetricName("fhwygzlvdnkfxus").withMetricValue(1736640593), - new ThreatIntelligenceMetricEntity().withMetricName("zrmuhapfcqdps").withMetricValue(399879139), - new ThreatIntelligenceMetricEntity().withMetricName("psvuoymgc").withMetricValue(841424592))) - .withSourceMetrics(Arrays.asList( - new ThreatIntelligenceMetricEntity().withMetricName("rypqlmfeo").withMetricValue(1208971148), - new ThreatIntelligenceMetricEntity().withMetricName("wkyhkobopgxe").withMetricValue(1041237961)))); - model = BinaryData.fromObject(model).toObject(ThreatIntelligenceMetrics.class); - Assertions.assertEquals("udphqamvdkfwyn", model.properties().lastUpdatedTimeUtc()); - Assertions.assertEquals("bvkayh", model.properties().threatTypeMetrics().get(0).metricName()); - Assertions.assertEquals(1068554694, model.properties().threatTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("jaesgvvsccya", model.properties().patternTypeMetrics().get(0).metricName()); - Assertions.assertEquals(306781812, model.properties().patternTypeMetrics().get(0).metricValue()); - Assertions.assertEquals("rypqlmfeo", model.properties().sourceMetrics().get(0).metricName()); - Assertions.assertEquals(1208971148, model.properties().sourceMetrics().get(0).metricValue()); + Assertions.assertEquals("xoef", model.properties().lastUpdatedTimeUtc()); + Assertions.assertEquals("ylx", model.properties().threatTypeMetrics().get(0).metricName()); + Assertions.assertEquals(1673715180, model.properties().threatTypeMetrics().get(0).metricValue()); + Assertions.assertEquals("yjtr", model.properties().patternTypeMetrics().get(0).metricName()); + Assertions.assertEquals(443932083, model.properties().patternTypeMetrics().get(0).metricValue()); + Assertions.assertEquals("vukvupuplug", model.properties().sourceMetrics().get(0).metricName()); + Assertions.assertEquals(776464126, model.properties().sourceMetrics().get(0).metricValue()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceParsedPatternTypeValueTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceParsedPatternTypeValueTests.java index b5bee60c1ceb..0c80afe04938 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceParsedPatternTypeValueTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceParsedPatternTypeValueTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -12,19 +12,19 @@ public final class ThreatIntelligenceParsedPatternTypeValueTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligenceParsedPatternTypeValue model - = BinaryData.fromString("{\"valueType\":\"qhoftrmaequiah\",\"value\":\"cslfaoqzpiyylha\"}") + = BinaryData.fromString("{\"valueType\":\"bxxyfozbgodywxj\",\"value\":\"frxvlusedpnkz\"}") .toObject(ThreatIntelligenceParsedPatternTypeValue.class); - Assertions.assertEquals("qhoftrmaequiah", model.valueType()); - Assertions.assertEquals("cslfaoqzpiyylha", model.value()); + Assertions.assertEquals("bxxyfozbgodywxj", model.valueType()); + Assertions.assertEquals("frxvlusedpnkz", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ThreatIntelligenceParsedPatternTypeValue model - = new ThreatIntelligenceParsedPatternTypeValue().withValueType("qhoftrmaequiah") - .withValue("cslfaoqzpiyylha"); + = new ThreatIntelligenceParsedPatternTypeValue().withValueType("bxxyfozbgodywxj") + .withValue("frxvlusedpnkz"); model = BinaryData.fromObject(model).toObject(ThreatIntelligenceParsedPatternTypeValue.class); - Assertions.assertEquals("qhoftrmaequiah", model.valueType()); - Assertions.assertEquals("cslfaoqzpiyylha", model.value()); + Assertions.assertEquals("bxxyfozbgodywxj", model.valueType()); + Assertions.assertEquals("frxvlusedpnkz", model.value()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceTests.java index 8193496a4734..207e4281886a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class ThreatIntelligenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ThreatIntelligence model = BinaryData.fromString( - "{\"confidence\":55.75274065776033,\"providerName\":\"oyuelyetn\",\"reportLink\":\"bf\",\"threatDescription\":\"ggagfln\",\"threatName\":\"mtrwah\",\"threatType\":\"mu\"}") + "{\"confidence\":65.94421219462268,\"providerName\":\"tqpbrlcy\",\"reportLink\":\"uczkgofxyfsruc\",\"threatDescription\":\"rrp\",\"threatName\":\"ttbst\",\"threatType\":\"eaqnrmvvfkoxm\"}") .toObject(ThreatIntelligence.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThreatIntelligence model = new ThreatIntelligence(); - model = BinaryData.fromObject(model).toObject(ThreatIntelligence.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java new file mode 100644 index 000000000000..1124a881f39c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.ConditionProperties; +import com.azure.resourcemanager.securityinsights.models.CountQuery; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceCount; +import com.azure.resourcemanager.securityinsights.models.TiType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ThreatIntelligencesCountWithResponseMockTests { + @Test + public void testCountWithResponse() throws Exception { + String responseStr = "{\"count\":2097230752}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ThreatIntelligenceCount response = manager.threatIntelligences() + .countWithResponse("ayuqwntghjm", "jmmjnxhy", TiType.MAIN, + new CountQuery().withCondition( + new ConditionProperties().withClauses(Arrays.asList(new ConditionClause().withField("qpimbchiskwa") + .withOperator(Operator.GREATER_THAN_EQUAL) + .withValues(Arrays.asList("jqn"))))), + com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java new file mode 100644 index 000000000000..051929011aba --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.ConditionClause; +import com.azure.resourcemanager.securityinsights.models.Connective; +import com.azure.resourcemanager.securityinsights.models.Operator; +import com.azure.resourcemanager.securityinsights.models.Query; +import com.azure.resourcemanager.securityinsights.models.QueryCondition; +import com.azure.resourcemanager.securityinsights.models.QuerySortBy; +import com.azure.resourcemanager.securityinsights.models.SortingDirection; +import com.azure.resourcemanager.securityinsights.models.TIObject; +import com.azure.resourcemanager.securityinsights.models.TiType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ThreatIntelligencesQueryMockTests { + @Test + public void testQuery() throws Exception { + String responseStr + = "{\"value\":[{\"kind\":\"TIObject\",\"properties\":{\"data\":{\"zcdlnvupi\":\"\\\"datasmaa\\\"\",\"elv\":\"\\\"datacbzyhtbjyycac\\\"\"},\"createdBy\":{\"email\":\"tm\",\"name\":\"alqqrymjwwo\",\"objectId\":\"nefellhdsgogdu\"},\"source\":\"malthcbvuvwdp\",\"firstIngestedTimeUtc\":\"2021-01-11T01:15:25Z\",\"lastIngestedTimeUtc\":\"2021-02-23T22:06:13Z\",\"ingestionRulesVersion\":\"ghglaxj\",\"lastUpdateMethod\":\"bmfm\",\"lastModifiedBy\":{\"email\":\"atswvt\",\"name\":\"picwnbtvlrs\",\"objectId\":\"trmodknxerkaiik\"},\"lastUpdatedDateTimeUtc\":\"2021-11-23T04:16:47Z\",\"relationshipHints\":[{\"fieldName\":\"pqrke\",\"source\":\"juaezkbr\"}]},\"id\":\"aulhtqvtpkodijc\",\"name\":\"dwoyqvcyqjjx\",\"type\":\"ijbf\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.threatIntelligences() + .query("bugojzcargs", "maw", TiType.MAIN, + new Query() + .withCondition(new QueryCondition().withStixObjectType("gazryyjjwggpcdu") + .withClauses(Arrays.asList( + new ConditionClause().withField("obpcs") + .withOperator(Operator.STRING_NOT_STARTS_WITH) + .withValues(Arrays.asList("xedzmmcgqifh", "hzugwkqnmh", "m", "lorvht")), + new ConditionClause().withField("rweeqkdmpfmcrce") + .withOperator(Operator.STRING_NOT_ENDS_WITH) + .withValues(Arrays.asList("jftnfdcj", "veibntwikm", "wxysut", "ofdhrifekstrmsb")))) + .withConditionConnective(Connective.OR)) + .withSortBy(new QuerySortBy().withDirection(SortingDirection.ASC).withField("u")) + .withMaxPageSize(1662057563) + .withMinPageSize(91618654), + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsPropertiesTests.java new file mode 100644 index 000000000000..a4b93dd6f6bf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TiTaxiiCheckRequirementsProperties; +import org.junit.jupiter.api.Assertions; + +public final class TiTaxiiCheckRequirementsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TiTaxiiCheckRequirementsProperties model + = BinaryData.fromString("{\"tenantId\":\"bzjohd\"}").toObject(TiTaxiiCheckRequirementsProperties.class); + Assertions.assertEquals("bzjohd", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TiTaxiiCheckRequirementsProperties model = new TiTaxiiCheckRequirementsProperties().withTenantId("bzjohd"); + model = BinaryData.fromObject(model).toObject(TiTaxiiCheckRequirementsProperties.class); + Assertions.assertEquals("bzjohd", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsTests.java new file mode 100644 index 000000000000..ef7b1ee3926f --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiCheckRequirementsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiCheckRequirements; +import org.junit.jupiter.api.Assertions; + +public final class TiTaxiiCheckRequirementsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TiTaxiiCheckRequirements model + = BinaryData.fromString("{\"kind\":\"ThreatIntelligenceTaxii\",\"properties\":{\"tenantId\":\"pa\"}}") + .toObject(TiTaxiiCheckRequirements.class); + Assertions.assertEquals("pa", model.tenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TiTaxiiCheckRequirements model = new TiTaxiiCheckRequirements().withTenantId("pa"); + model = BinaryData.fromObject(model).toObject(TiTaxiiCheckRequirements.class); + Assertions.assertEquals("pa", model.tenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTaxiiClientTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTaxiiClientTests.java new file mode 100644 index 000000000000..9e6995c5b09c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTaxiiClientTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient; +import org.junit.jupiter.api.Assertions; + +public final class TiTaxiiDataConnectorDataTypesTaxiiClientTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TiTaxiiDataConnectorDataTypesTaxiiClient model = BinaryData.fromString("{\"state\":\"Disabled\"}") + .toObject(TiTaxiiDataConnectorDataTypesTaxiiClient.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TiTaxiiDataConnectorDataTypesTaxiiClient model + = new TiTaxiiDataConnectorDataTypesTaxiiClient().withState(DataTypeState.DISABLED); + model = BinaryData.fromObject(model).toObject(TiTaxiiDataConnectorDataTypesTaxiiClient.class); + Assertions.assertEquals(DataTypeState.DISABLED, model.state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTests.java new file mode 100644 index 000000000000..c63b16e77746 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TiTaxiiDataConnectorDataTypesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.DataTypeState; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypes; +import com.azure.resourcemanager.securityinsights.models.TiTaxiiDataConnectorDataTypesTaxiiClient; +import org.junit.jupiter.api.Assertions; + +public final class TiTaxiiDataConnectorDataTypesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TiTaxiiDataConnectorDataTypes model = BinaryData.fromString("{\"taxiiClient\":{\"state\":\"Enabled\"}}") + .toObject(TiTaxiiDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.taxiiClient().state()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TiTaxiiDataConnectorDataTypes model = new TiTaxiiDataConnectorDataTypes() + .withTaxiiClient(new TiTaxiiDataConnectorDataTypesTaxiiClient().withState(DataTypeState.ENABLED)); + model = BinaryData.fromObject(model).toObject(TiTaxiiDataConnectorDataTypes.class); + Assertions.assertEquals(DataTypeState.ENABLED, model.taxiiClient().state()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineAggregationTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineAggregationTests.java new file mode 100644 index 000000000000..aea093c44035 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineAggregationTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineKind; +import com.azure.resourcemanager.securityinsights.models.TimelineAggregation; +import org.junit.jupiter.api.Assertions; + +public final class TimelineAggregationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TimelineAggregation model + = BinaryData.fromString("{\"count\":78034116,\"kind\":\"Activity\"}").toObject(TimelineAggregation.class); + Assertions.assertEquals(78034116, model.count()); + Assertions.assertEquals(EntityTimelineKind.ACTIVITY, model.kind()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineErrorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineErrorTests.java new file mode 100644 index 000000000000..bf066706fb38 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineErrorTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineKind; +import com.azure.resourcemanager.securityinsights.models.TimelineError; +import org.junit.jupiter.api.Assertions; + +public final class TimelineErrorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TimelineError model = BinaryData + .fromString("{\"kind\":\"Anomaly\",\"queryId\":\"twnqtjcem\",\"errorMessage\":\"asichhxqnlmj\"}") + .toObject(TimelineError.class); + Assertions.assertEquals(EntityTimelineKind.ANOMALY, model.kind()); + Assertions.assertEquals("twnqtjcem", model.queryId()); + Assertions.assertEquals("asichhxqnlmj", model.errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineResultsMetadataTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineResultsMetadataTests.java new file mode 100644 index 000000000000..0759c22a82b1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TimelineResultsMetadataTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.EntityTimelineKind; +import com.azure.resourcemanager.securityinsights.models.TimelineResultsMetadata; +import org.junit.jupiter.api.Assertions; + +public final class TimelineResultsMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TimelineResultsMetadata model = BinaryData.fromString( + "{\"totalCount\":2009919482,\"aggregations\":[{\"count\":923169968,\"kind\":\"Anomaly\"},{\"count\":1636860682,\"kind\":\"Bookmark\"},{\"count\":810872677,\"kind\":\"SecurityAlert\"},{\"count\":1899712396,\"kind\":\"Anomaly\"}],\"errors\":[{\"kind\":\"Bookmark\",\"queryId\":\"eaoxxsehfl\",\"errorMessage\":\"m\"},{\"kind\":\"Activity\",\"queryId\":\"yzxcplphfstv\",\"errorMessage\":\"rtkcep\"},{\"kind\":\"SecurityAlert\",\"queryId\":\"xwzbwxxsdisxsrr\",\"errorMessage\":\"ryrbbedrnrjzzuim\"},{\"kind\":\"SecurityAlert\",\"queryId\":\"bmy\",\"errorMessage\":\"tihcgxmfbiksuvqq\"}]}") + .toObject(TimelineResultsMetadata.class); + Assertions.assertEquals(2009919482, model.totalCount()); + Assertions.assertEquals(923169968, model.aggregations().get(0).count()); + Assertions.assertEquals(EntityTimelineKind.ANOMALY, model.aggregations().get(0).kind()); + Assertions.assertEquals(EntityTimelineKind.BOOKMARK, model.errors().get(0).kind()); + Assertions.assertEquals("eaoxxsehfl", model.errors().get(0).queryId()); + Assertions.assertEquals("m", model.errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunInnerTests.java new file mode 100644 index 000000000000..087bad259721 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunInner; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class TriggeredAnalyticsRuleRunInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TriggeredAnalyticsRuleRunInner model = BinaryData.fromString( + "{\"properties\":{\"executionTimeUtc\":\"2021-06-15T18:47:17Z\",\"ruleId\":\"ytcikswhcamwu\",\"triggeredAnalyticsRuleRunId\":\"nfxkcgsfcmvhad\",\"provisioningState\":\"Canceled\",\"ruleRunAdditionalData\":{\"sy\":\"\\\"datatvyrkljqkq\\\"\",\"y\":\"\\\"datatvjkowggxawwdm\\\"\",\"g\":\"\\\"datankteiidlbovwbclp\\\"\",\"kjcnerek\":\"\\\"datagani\\\"\"}},\"etag\":\"uls\",\"id\":\"wnqhqlqgpwxtvc\",\"name\":\"bav\",\"type\":\"bvxwvegenlrjcsmw\"}") + .toObject(TriggeredAnalyticsRuleRunInner.class); + Assertions.assertEquals("uls", model.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T18:47:17Z"), model.executionTimeUtc()); + Assertions.assertEquals("ytcikswhcamwu", model.ruleId()); + Assertions.assertEquals("nfxkcgsfcmvhad", model.triggeredAnalyticsRuleRunId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..4ce88762beb8 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunOperationsGetWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.TriggeredAnalyticsRuleRun; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class TriggeredAnalyticsRuleRunOperationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"executionTimeUtc\":\"2021-01-12T15:43:20Z\",\"ruleId\":\"iyjkhjuuep\",\"triggeredAnalyticsRuleRunId\":\"juqwn\",\"provisioningState\":\"Succeeded\",\"ruleRunAdditionalData\":{\"axvq\":\"\\\"datapxqs\\\"\"}},\"etag\":\"sdwtugadxupi\",\"id\":\"cbwiwhtjox\",\"name\":\"llhkzunnwmwwxy\",\"type\":\"wxkd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TriggeredAnalyticsRuleRun response = manager.triggeredAnalyticsRuleRunOperations() + .getWithResponse("cfwlwn", "ganmopcmetdruu", "imviefbje", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("sdwtugadxupi", response.etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-12T15:43:20Z"), response.executionTimeUtc()); + Assertions.assertEquals("iyjkhjuuep", response.ruleId()); + Assertions.assertEquals("juqwn", response.triggeredAnalyticsRuleRunId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunPropertiesTests.java new file mode 100644 index 000000000000..d3ca648c7dd4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunPropertiesTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.TriggeredAnalyticsRuleRunProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class TriggeredAnalyticsRuleRunPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TriggeredAnalyticsRuleRunProperties model = BinaryData.fromString( + "{\"executionTimeUtc\":\"2021-07-17T04:57:34Z\",\"ruleId\":\"guyflnxelrjkf\",\"triggeredAnalyticsRuleRunId\":\"cdetowwezhy\",\"provisioningState\":\"Failed\",\"ruleRunAdditionalData\":{\"csfqbirtybce\":\"\\\"datalbwqlq\\\"\",\"dvuelumodpegqxso\":\"\\\"datafjnxodnjyhzfaxs\\\"\"}}") + .toObject(TriggeredAnalyticsRuleRunProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T04:57:34Z"), model.executionTimeUtc()); + Assertions.assertEquals("guyflnxelrjkf", model.ruleId()); + Assertions.assertEquals("cdetowwezhy", model.triggeredAnalyticsRuleRunId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunsTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunsTests.java new file mode 100644 index 000000000000..ac7469d0c2cf --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/TriggeredAnalyticsRuleRunsTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.TriggeredAnalyticsRuleRuns; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class TriggeredAnalyticsRuleRunsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TriggeredAnalyticsRuleRuns model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"executionTimeUtc\":\"2021-09-03T13:05:30Z\",\"ruleId\":\"ajsq\",\"triggeredAnalyticsRuleRunId\":\"pxftyifadsliif\",\"provisioningState\":\"Accepted\",\"ruleRunAdditionalData\":{\"snxmfooin\":\"\\\"datarpjspbi\\\"\"}},\"etag\":\"rfvq\",\"id\":\"uwgkmqcbrewtf\",\"name\":\"xktsxnikcgitt\",\"type\":\"mlpihtep\"},{\"properties\":{\"executionTimeUtc\":\"2021-07-10T02:32:18Z\",\"ruleId\":\"jebrinvfcdsijs\",\"triggeredAnalyticsRuleRunId\":\"nybnt\",\"provisioningState\":\"Succeeded\",\"ruleRunAdditionalData\":{\"kqtkrjuc\":\"\\\"datayxujzoxg\\\"\",\"hulxgce\":\"\\\"datazwedm\\\"\",\"anudvqannenxg\":\"\\\"datax\\\"\",\"b\":\"\\\"datahmmgblqyfg\\\"\"}},\"etag\":\"qifsgzfgxwfxji\",\"id\":\"dsohwnnayo\",\"name\":\"ghjxhpppnksqi\",\"type\":\"lmegj\"}],\"nextLink\":\"seohoygowdz\"}") + .toObject(TriggeredAnalyticsRuleRuns.class); + Assertions.assertEquals("rfvq", model.value().get(0).etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-03T13:05:30Z"), model.value().get(0).executionTimeUtc()); + Assertions.assertEquals("ajsq", model.value().get(0).ruleId()); + Assertions.assertEquals("pxftyifadsliif", model.value().get(0).triggeredAnalyticsRuleRunId()); + Assertions.assertEquals("seohoygowdz", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaPropertiesTests.java new file mode 100644 index 000000000000..21c5ba199df9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaPropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.UebaProperties; +import com.azure.resourcemanager.securityinsights.models.UebaDataSources; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class UebaPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UebaProperties model + = BinaryData.fromString("{\"dataSources\":[\"SigninLogs\"]}").toObject(UebaProperties.class); + Assertions.assertEquals(UebaDataSources.SIGNIN_LOGS, model.dataSources().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UebaProperties model = new UebaProperties().withDataSources(Arrays.asList(UebaDataSources.SIGNIN_LOGS)); + model = BinaryData.fromObject(model).toObject(UebaProperties.class); + Assertions.assertEquals(UebaDataSources.SIGNIN_LOGS, model.dataSources().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaTests.java new file mode 100644 index 000000000000..b860b04611e4 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UebaTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.Ueba; +import com.azure.resourcemanager.securityinsights.models.UebaDataSources; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class UebaTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Ueba model = BinaryData.fromString( + "{\"kind\":\"Ueba\",\"properties\":{\"dataSources\":[\"AuditLogs\"]},\"etag\":\"eysgwkcffe\",\"id\":\"nzcbivove\",\"name\":\"mkhfeqco\",\"type\":\"plfpohimgckycjp\"}") + .toObject(Ueba.class); + Assertions.assertEquals("eysgwkcffe", model.etag()); + Assertions.assertEquals(UebaDataSources.AUDIT_LOGS, model.dataSources().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Ueba model = new Ueba().withEtag("eysgwkcffe").withDataSources(Arrays.asList(UebaDataSources.AUDIT_LOGS)); + model = BinaryData.fromObject(model).toObject(Ueba.class); + Assertions.assertEquals("eysgwkcffe", model.etag()); + Assertions.assertEquals(UebaDataSources.AUDIT_LOGS, model.dataSources().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java new file mode 100644 index 000000000000..30d897a91299 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Recommendation; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatch; +import com.azure.resourcemanager.securityinsights.models.RecommendationPatchProperties; +import com.azure.resourcemanager.securityinsights.models.State; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class UpdatesRecommendationWithResponseMockTests { + @Test + public void testRecommendationWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"recommendationTypeId\":\"yxcmqcggksror\",\"state\":\"CompletedBySystem\",\"title\":\"jfharphl\",\"description\":\"lftraylxzdujpuh\",\"creationTimeUtc\":\"2021-03-23T21:19:15Z\",\"lastEvaluatedTimeUtc\":\"2021-01-25T01:06:44Z\",\"lastModifiedTimeUtc\":\"2021-08-29T04:39:28Z\",\"suggestions\":[{\"suggestionTypeId\":\"wbkxdhavegy\",\"title\":\"qsmlbzi\",\"description\":\"pdatvndvwwejvqpw\",\"action\":\"r\",\"additionalProperties\":{\"gntxregbs\":\"wmhcpuj\",\"wy\":\"qthc\",\"ffl\":\"qxprsocfxlrzj\"}}],\"resourceId\":\"muljfaulwlz\",\"additionalProperties\":{\"hiyxjqr\":\"gnepjyuxqdr\",\"pfzsf\":\"npztlac\"}},\"etag\":\"a\",\"id\":\"brwvio\",\"name\":\"vyhsorcavkfhyoi\",\"type\":\"zwedf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Recommendation response = manager.updates() + .recommendationWithResponse("xldqtmandejnemrf", "jh", "dpwlezbfgull", + new RecommendationPatch().withProperties( + new RecommendationPatchProperties().withState(State.DISMISSED)), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("a", response.etag()); + Assertions.assertEquals("yxcmqcggksror", response.recommendationTypeId()); + Assertions.assertEquals(State.COMPLETED_BY_SYSTEM, response.state()); + Assertions.assertEquals("jfharphl", response.title()); + Assertions.assertEquals("lftraylxzdujpuh", response.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T21:19:15Z"), response.creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T01:06:44Z"), response.lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-29T04:39:28Z"), response.lastModifiedTimeUtc()); + Assertions.assertEquals("wbkxdhavegy", response.suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("qsmlbzi", response.suggestions().get(0).title()); + Assertions.assertEquals("pdatvndvwwejvqpw", response.suggestions().get(0).description()); + Assertions.assertEquals("r", response.suggestions().get(0).action()); + Assertions.assertEquals("wmhcpuj", response.suggestions().get(0).additionalProperties().get("gntxregbs")); + Assertions.assertEquals("muljfaulwlz", response.resourceId()); + Assertions.assertEquals("gnepjyuxqdr", response.additionalProperties().get("hiyxjqr")); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityPropertiesTests.java index 7abe3e87f54d..854b5f333ad9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityPropertiesTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class UrlEntityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UrlEntityProperties model = BinaryData.fromString( - "{\"url\":\"klinhmdptysprq\",\"additionalData\":{\"g\":\"datazxojpslsv\",\"apcohhouc\":\"dataliufiqwoyxq\",\"rzdcgdzbenribcaw\":\"datapqojxcx\",\"jwfljhznamtua\":\"datatzqdd\"},\"friendlyName\":\"zwcjjncqtj\"}") + "{\"url\":\"kgsangpszng\",\"additionalData\":{\"lkvec\":\"\\\"datag\\\"\"},\"friendlyName\":\"jcngoadyed\"}") .toObject(UrlEntityProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UrlEntityProperties model = new UrlEntityProperties(); - model = BinaryData.fromObject(model).toObject(UrlEntityProperties.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityTests.java index c4af0f3d414e..3b9e2162f666 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UrlEntityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; @@ -11,13 +11,7 @@ public final class UrlEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UrlEntity model = BinaryData.fromString( - "{\"kind\":\"Url\",\"properties\":{\"url\":\"md\",\"additionalData\":{\"remj\":\"datacbq\",\"hdbvqvwzkjop\":\"datalaqacigele\",\"bxcea\":\"databeonrlkwzdq\"},\"friendlyName\":\"cptsoqfyiase\"},\"id\":\"hkrttzrazis\",\"name\":\"ykiue\",\"type\":\"vanbwzohmnrxxbs\"}") + "{\"kind\":\"Url\",\"properties\":{\"url\":\"sutrjbhxykfhyqe\",\"additionalData\":{\"owtljvfw\":\"\\\"dataqugdrftbcvexreuq\\\"\"},\"friendlyName\":\"eagk\"},\"id\":\"xv\",\"name\":\"qtvbczsu\",\"type\":\"mdgglmepjpfs\"}") .toObject(UrlEntity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UrlEntity model = new UrlEntity(); - model = BinaryData.fromObject(model).toObject(UrlEntity.class); - } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UserInfoTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UserInfoTests.java index c8c1172efb0a..eb35c09f58da 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UserInfoTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UserInfoTests.java @@ -1,28 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.securityinsights.models.UserInfo; -import java.util.UUID; import org.junit.jupiter.api.Assertions; public final class UserInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserInfo model = BinaryData - .fromString( - "{\"email\":\"wgqyw\",\"name\":\"drvyn\",\"objectId\":\"ff6b336d-8339-4403-92f4-094015b0b9fa\"}") - .toObject(UserInfo.class); - Assertions.assertEquals(UUID.fromString("ff6b336d-8339-4403-92f4-094015b0b9fa"), model.objectId()); + UserInfo model + = BinaryData.fromString("{\"email\":\"yetnd\",\"name\":\"fqyggagflnlgmtr\",\"objectId\":\"hzjmucftbyrp\"}") + .toObject(UserInfo.class); + Assertions.assertEquals("hzjmucftbyrp", model.objectId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserInfo model = new UserInfo().withObjectId(UUID.fromString("ff6b336d-8339-4403-92f4-094015b0b9fa")); + UserInfo model = new UserInfo().withObjectId("hzjmucftbyrp"); model = BinaryData.fromObject(model).toObject(UserInfo.class); - Assertions.assertEquals(UUID.fromString("ff6b336d-8339-4403-92f4-094015b0b9fa"), model.objectId()); + Assertions.assertEquals("hzjmucftbyrp", model.objectId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ValidationErrorTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ValidationErrorTests.java new file mode 100644 index 000000000000..7188ec0b9ab6 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ValidationErrorTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.ValidationError; +import org.junit.jupiter.api.Assertions; + +public final class ValidationErrorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationError model = BinaryData + .fromString( + "{\"recordIndex\":391967335,\"errorMessages\":[\"ugeerclbltbhpwac\",\"yeurjwmv\",\"r\",\"vdifkiikg\"]}") + .toObject(ValidationError.class); + Assertions.assertEquals(391967335, model.recordIndex()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteWithResponseMockTests.java index 52f092c0ed62..159eb94a3dbe 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WatchlistItemsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.securityinsights.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,11 @@ public void testDeleteWithResponse() throws Exception { SecurityInsightsManager manager = SecurityInsightsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.watchlistItems() - .deleteWithResponse("syril", "hxdqaol", "ylnkkbjpjvlywltm", "wob", com.azure.core.util.Context.NONE); + .deleteWithResponse("dlvccuvcvaf", "sbyjgdjvyclasdp", "knu", "fteklgsnpvq", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkloadIdentityFederationTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkloadIdentityFederationTests.java new file mode 100644 index 000000000000..dcab303111fa --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkloadIdentityFederationTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.models.WorkloadIdentityFederation; + +public final class WorkloadIdentityFederationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkloadIdentityFederation model = BinaryData.fromString( + "{\"id\":\"oxa\",\"tenantId\":\"xuvj\",\"appId\":\"mnrqstjcmetwml\",\"subject\":\"cvnpv\",\"issuer\":\"hgjnaq\"}") + .toObject(WorkloadIdentityFederation.class); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentInnerTests.java new file mode 100644 index 000000000000..2e296c531c94 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentInnerTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentInner; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerAssignmentInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerAssignmentInner model = BinaryData.fromString( + "{\"properties\":{\"targetResourceName\":\"hazrqoxz\",\"lastJobEndTime\":\"2021-08-26T05:27:01Z\",\"lastJobProvisioningState\":\"Canceled\",\"items\":[{\"resourceId\":\"hskbmpwxslajggfz\"},{\"resourceId\":\"efhawkmibuyd\"},{\"resourceId\":\"urn\"}]},\"etag\":\"updyttqm\",\"id\":\"vj\",\"name\":\"l\",\"type\":\"s\"}") + .toObject(WorkspaceManagerAssignmentInner.class); + Assertions.assertEquals("hazrqoxz", model.targetResourceName()); + Assertions.assertEquals("hskbmpwxslajggfz", model.items().get(0).resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerAssignmentInner model = new WorkspaceManagerAssignmentInner().withTargetResourceName("hazrqoxz") + .withItems(Arrays.asList(new AssignmentItem().withResourceId("hskbmpwxslajggfz"), + new AssignmentItem().withResourceId("efhawkmibuyd"), new AssignmentItem().withResourceId("urn"))); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerAssignmentInner.class); + Assertions.assertEquals("hazrqoxz", model.targetResourceName()); + Assertions.assertEquals("hskbmpwxslajggfz", model.items().get(0).resourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java new file mode 100644 index 000000000000..fe535f61f7ad --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Job; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentJobsCreateWithResponseMockTests { + @Test + public void testCreateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"endTime\":\"2021-07-14T12:48:04Z\",\"items\":[{\"resourceId\":\"zyebpatw\",\"status\":\"InProgress\",\"executionTime\":\"2021-07-09T20:09:01Z\",\"errors\":[{\"memberResourceName\":\"hnwo\",\"errorMessage\":\"lcahhfuydgdhit\"},{\"memberResourceName\":\"v\",\"errorMessage\":\"ayu\"}]},{\"resourceId\":\"zlcvib\",\"status\":\"Closed\",\"executionTime\":\"2021-03-27T09:47:09Z\",\"errors\":[{\"memberResourceName\":\"defepwkhruzzw\",\"errorMessage\":\"bbozivfoy\"},{\"memberResourceName\":\"vnlhsxeasxsqqu\",\"errorMessage\":\"vscbpkmo\"},{\"memberResourceName\":\"dukp\",\"errorMessage\":\"qyibwu\"},{\"memberResourceName\":\"vmo\",\"errorMessage\":\"syirfkxazuboi\"}]},{\"resourceId\":\"rw\",\"status\":\"Failed\",\"executionTime\":\"2021-08-12T20:43:01Z\",\"errors\":[{\"memberResourceName\":\"aqoilgkznnzpvjw\",\"errorMessage\":\"g\"},{\"memberResourceName\":\"viceqyrajdvvsaat\",\"errorMessage\":\"yper\"},{\"memberResourceName\":\"azcchvwwc\",\"errorMessage\":\"azztvotf\"}]},{\"resourceId\":\"ayfxkfgx\",\"status\":\"Closed\",\"executionTime\":\"2021-01-08T13:21:25Z\",\"errors\":[{\"memberResourceName\":\"uw\",\"errorMessage\":\"oszcmfmynljigj\"},{\"memberResourceName\":\"nk\",\"errorMessage\":\"dmwtiv\"},{\"memberResourceName\":\"knewpnpun\",\"errorMessage\":\"vjbnhbxvvuf\"}]}],\"provisioningState\":\"Succeeded\",\"startTime\":\"2021-01-01T23:00:57Z\",\"errorMessage\":\"sajq\"},\"etag\":\"rcqdthmlqam\",\"id\":\"cukdmrvr\",\"name\":\"akc\",\"type\":\"lsnprda\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Job response = manager.workspaceManagerAssignmentJobs() + .createWithResponse("bhqkvbins", "qwnpegoupdq", "flvdfaqcql", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("rcqdthmlqam", response.etag()); + Assertions.assertEquals("zyebpatw", response.items().get(0).resourceId()); + Assertions.assertEquals("hnwo", response.items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("lcahhfuydgdhit", response.items().get(0).errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..ade2e6b8a952 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.workspaceManagerAssignmentJobs() + .deleteWithResponse("kkzulmqx", "ic", "nwij", "eyxt", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java new file mode 100644 index 000000000000..4ac52d36d6a9 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Job; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentJobsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"endTime\":\"2021-09-08T22:04:34Z\",\"items\":[{\"resourceId\":\"xsnkmkcimksf\",\"status\":\"Succeeded\",\"executionTime\":\"2021-09-01T06:01:22Z\",\"errors\":[{\"memberResourceName\":\"bzmngxzpdnbj\",\"errorMessage\":\"vhddvtnbtv\"},{\"memberResourceName\":\"gkjfkaoew\",\"errorMessage\":\"myizdglzzaufi\"},{\"memberResourceName\":\"wvyxy\",\"errorMessage\":\"ykng\"},{\"memberResourceName\":\"tjgpyvjgsjyjnhwb\",\"errorMessage\":\"hwrnc\"}]},{\"resourceId\":\"zuerrvpamfpin\",\"status\":\"New\",\"executionTime\":\"2021-09-23T11:35:19Z\",\"errors\":[{\"memberResourceName\":\"fbruuhylqgeovnlb\",\"errorMessage\":\"fsol\"},{\"memberResourceName\":\"rqu\",\"errorMessage\":\"lnhxr\"},{\"memberResourceName\":\"jshicvrmwbgpc\",\"errorMessage\":\"l\"},{\"memberResourceName\":\"bxppvpgsrfshkjg\",\"errorMessage\":\"pboaevtxi\"}]}],\"provisioningState\":\"InProgress\",\"startTime\":\"2021-10-30T23:19:42Z\",\"errorMessage\":\"ijiqwxwpubdh\"},\"etag\":\"pr\",\"id\":\"ruhdjzivlaxiimqn\",\"name\":\"mbfpt\",\"type\":\"ixmksxxbdtjvvngn\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Job response = manager.workspaceManagerAssignmentJobs() + .getWithResponse("tqgabbx", "xacgm", "pkxbwobovexsnm", "whbmujlsztp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("pr", response.etag()); + Assertions.assertEquals("xsnkmkcimksf", response.items().get(0).resourceId()); + Assertions.assertEquals("bzmngxzpdnbj", response.items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("vhddvtnbtv", response.items().get(0).errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java new file mode 100644 index 000000000000..5814d1dea161 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Job; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentJobsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"endTime\":\"2021-02-16T13:46:03Z\",\"items\":[{\"resourceId\":\"hj\",\"status\":\"Succeeded\",\"executionTime\":\"2021-01-06T15:50:01Z\",\"errors\":[{\"memberResourceName\":\"utqoh\",\"errorMessage\":\"btqibqbougcwzgd\"}]},{\"resourceId\":\"rdxoutkgezulnnt\",\"status\":\"Backlog\",\"executionTime\":\"2021-09-23T23:27:05Z\",\"errors\":[{\"memberResourceName\":\"jhlxoljbpoeo\",\"errorMessage\":\"wykhhavwh\"},{\"memberResourceName\":\"ivvzrccyfrxl\",\"errorMessage\":\"ypwudeearbbxan\"},{\"memberResourceName\":\"viqkju\",\"errorMessage\":\"v\"}]}],\"provisioningState\":\"Canceled\",\"startTime\":\"2021-05-27T13:44:59Z\",\"errorMessage\":\"ppqcgbp\"},\"etag\":\"ni\",\"id\":\"hd\",\"name\":\"xup\",\"type\":\"btlharjbakp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.workspaceManagerAssignmentJobs() + .list("er", "ttobosjxb", "ytten", "uditumyycvtya", 2093579646, "yimhspjqhi", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ni", response.iterator().next().etag()); + Assertions.assertEquals("hj", response.iterator().next().items().get(0).resourceId()); + Assertions.assertEquals("utqoh", + response.iterator().next().items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("btqibqbougcwzgd", + response.iterator().next().items().get(0).errors().get(0).errorMessage()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentListTests.java new file mode 100644 index 000000000000..b81a4f73ae13 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerAssignmentList; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerAssignmentListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerAssignmentList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"targetResourceName\":\"fzxjzi\",\"lastJobEndTime\":\"2021-11-13T04:32:12Z\",\"lastJobProvisioningState\":\"Canceled\",\"items\":[{\"resourceId\":\"wnuwkkfzzetl\"},{\"resourceId\":\"dyxzlvwywjvr\"}]},\"etag\":\"qpwwlzpddarc\",\"id\":\"dwhslxebaj\",\"name\":\"dknmstb\",\"type\":\"oprwkampyh\"}],\"nextLink\":\"bldz\"}") + .toObject(WorkspaceManagerAssignmentList.class); + Assertions.assertEquals("fzxjzi", model.value().get(0).targetResourceName()); + Assertions.assertEquals("wnuwkkfzzetl", model.value().get(0).items().get(0).resourceId()); + Assertions.assertEquals("bldz", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentPropertiesTests.java new file mode 100644 index 000000000000..ef60f3eccc97 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerAssignmentProperties; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerAssignmentPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerAssignmentProperties model = BinaryData.fromString( + "{\"targetResourceName\":\"bmhhtuqmt\",\"lastJobEndTime\":\"2021-11-29T08:34:34Z\",\"lastJobProvisioningState\":\"InProgress\",\"items\":[{\"resourceId\":\"obfixngxebi\"},{\"resourceId\":\"xhnkingiqcd\"},{\"resourceId\":\"rpgupsjlbsmnda\"}]}") + .toObject(WorkspaceManagerAssignmentProperties.class); + Assertions.assertEquals("bmhhtuqmt", model.targetResourceName()); + Assertions.assertEquals("obfixngxebi", model.items().get(0).resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerAssignmentProperties model + = new WorkspaceManagerAssignmentProperties().withTargetResourceName("bmhhtuqmt") + .withItems(Arrays.asList(new AssignmentItem().withResourceId("obfixngxebi"), + new AssignmentItem().withResourceId("xhnkingiqcd"), + new AssignmentItem().withResourceId("rpgupsjlbsmnda"))); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerAssignmentProperties.class); + Assertions.assertEquals("bmhhtuqmt", model.targetResourceName()); + Assertions.assertEquals("obfixngxebi", model.items().get(0).resourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..232c839ac177 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.AssignmentItem; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignment; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"targetResourceName\":\"elokxklgl\",\"lastJobEndTime\":\"2021-08-02T05:37:54Z\",\"lastJobProvisioningState\":\"Succeeded\",\"items\":[{\"resourceId\":\"y\"},{\"resourceId\":\"oisbmv\"}]},\"etag\":\"enrcqickhvps\",\"id\":\"uiuvingmonq\",\"name\":\"ntyuq\",\"type\":\"zxyoj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerAssignment response = manager.workspaceManagerAssignments() + .define("easuw") + .withExistingWorkspace("fy", "mn") + .withTargetResourceName("q") + .withItems(Arrays.asList(new AssignmentItem().withResourceId("cc"), + new AssignmentItem().withResourceId("futfqffwvnjgjry"))) + .create(); + + Assertions.assertEquals("elokxklgl", response.targetResourceName()); + Assertions.assertEquals("y", response.items().get(0).resourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..123e771889a0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.workspaceManagerAssignments() + .deleteWithResponse("blxeyg", "suhroicj", "gqdymoanpkcmd", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetWithResponseMockTests.java new file mode 100644 index 000000000000..4bb0a822dbf3 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignment; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"targetResourceName\":\"kubljnizwztlcrx\",\"lastJobEndTime\":\"2021-08-13T06:28:06Z\",\"lastJobProvisioningState\":\"Succeeded\",\"items\":[{\"resourceId\":\"nfarmficqrd\"},{\"resourceId\":\"vtrulzlrm\"}]},\"etag\":\"csmpmhlc\",\"id\":\"a\",\"name\":\"cgcdfelvap\",\"type\":\"dbicjznt\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerAssignment response = manager.workspaceManagerAssignments() + .getWithResponse("evhyuuih", "p", "qmcvu", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("kubljnizwztlcrx", response.targetResourceName()); + Assertions.assertEquals("nfarmficqrd", response.items().get(0).resourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListMockTests.java new file mode 100644 index 000000000000..ebe10868cf3e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentsListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerAssignment; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerAssignmentsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"targetResourceName\":\"xmkrulavxeaymf\",\"lastJobEndTime\":\"2021-04-20T16:33:08Z\",\"lastJobProvisioningState\":\"InProgress\",\"items\":[{\"resourceId\":\"n\"},{\"resourceId\":\"srypjaekbwbxv\"},{\"resourceId\":\"tbxcj\"}]},\"etag\":\"ad\",\"id\":\"mjquliovrcnn\",\"name\":\"hluzey\",\"type\":\"alezk\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.workspaceManagerAssignments() + .list("xiuxqb", "algspzoafprzlvho", "zkcsjddzposmnmky", 92951174, "qmuu", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xmkrulavxeaymf", response.iterator().next().targetResourceName()); + Assertions.assertEquals("n", response.iterator().next().items().get(0).resourceId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationInnerTests.java new file mode 100644 index 000000000000..8f7b158f70c0 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationInnerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationInner; +import com.azure.resourcemanager.securityinsights.models.Mode; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerConfigurationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerConfigurationInner model = BinaryData.fromString( + "{\"properties\":{\"mode\":\"Enabled\"},\"etag\":\"rcycmwhuzymhl\",\"id\":\"hqkn\",\"name\":\"vkmnbzkopaiil\",\"type\":\"cpu\"}") + .toObject(WorkspaceManagerConfigurationInner.class); + Assertions.assertEquals(Mode.ENABLED, model.mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerConfigurationInner model = new WorkspaceManagerConfigurationInner().withMode(Mode.ENABLED); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerConfigurationInner.class); + Assertions.assertEquals(Mode.ENABLED, model.mode()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationListTests.java new file mode 100644 index 000000000000..354c5dd21643 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerConfigurationList; +import com.azure.resourcemanager.securityinsights.models.Mode; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerConfigurationListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerConfigurationList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"mode\":\"Disabled\"},\"etag\":\"syjo\",\"id\":\"gvedrobujnjg\",\"name\":\"buxmqxigidull\",\"type\":\"jgcpskgrhnytslg\"},{\"properties\":{\"mode\":\"Enabled\"},\"etag\":\"qznghx\",\"id\":\"yqz\",\"name\":\"sdkpvnrvzw\",\"type\":\"ffxsfybntmveh\"},{\"properties\":{\"mode\":\"Disabled\"},\"etag\":\"yuvbgtzqzqweu\",\"id\":\"ybnai\",\"name\":\"vhpqsvbzeogeatrc\",\"type\":\"qnvncprfcsjvjn\"}],\"nextLink\":\"iznzs\"}") + .toObject(WorkspaceManagerConfigurationList.class); + Assertions.assertEquals(Mode.DISABLED, model.value().get(0).mode()); + Assertions.assertEquals("iznzs", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationPropertiesTests.java new file mode 100644 index 000000000000..ee0dd755ee1b --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationPropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerConfigurationProperties; +import com.azure.resourcemanager.securityinsights.models.Mode; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerConfigurationProperties model + = BinaryData.fromString("{\"mode\":\"Enabled\"}").toObject(WorkspaceManagerConfigurationProperties.class); + Assertions.assertEquals(Mode.ENABLED, model.mode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerConfigurationProperties model + = new WorkspaceManagerConfigurationProperties().withMode(Mode.ENABLED); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerConfigurationProperties.class); + Assertions.assertEquals(Mode.ENABLED, model.mode()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..076a74887b36 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Mode; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerConfigurationsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"mode\":\"Enabled\"},\"etag\":\"boysquygokh\",\"id\":\"twcyigrhfevxypqu\",\"name\":\"cojyxhhv\",\"type\":\"o\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerConfiguration response = manager.workspaceManagerConfigurations() + .define("sib") + .withExistingWorkspace("rypjbyqxe", "zqnupsipclxvaov") + .withMode(Mode.DISABLED) + .create(); + + Assertions.assertEquals(Mode.ENABLED, response.mode()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..71e89df66de1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerConfigurationsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.workspaceManagerConfigurations() + .deleteWithResponse("nqrbyqhywxbowcjk", "r", "gvyuewgylol", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..9112baaf008e --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Mode; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerConfigurationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"mode\":\"Disabled\"},\"etag\":\"vmuot\",\"id\":\"eabfyjam\",\"name\":\"vwxlkhprltx\",\"type\":\"p\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerConfiguration response = manager.workspaceManagerConfigurations() + .getWithResponse("vaykfjgakaysck", "dqyjzwmf", "rqz", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(Mode.DISABLED, response.mode()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListMockTests.java new file mode 100644 index 000000000000..05b0ab05aef1 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerConfigurationsListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.Mode; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerConfigurationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"mode\":\"Disabled\"},\"etag\":\"o\",\"id\":\"wx\",\"name\":\"t\",\"type\":\"veqvpedwmhqcjr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.workspaceManagerConfigurations() + .list("xwlql", "gnbudjypl", "otgtlan", 1354096624, "kvlxsycqqdoxooxu", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(Mode.DISABLED, response.iterator().next().mode()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupInnerTests.java new file mode 100644 index 000000000000..0e33310cb341 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupInnerTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupInner; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerGroupInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerGroupInner model = BinaryData.fromString( + "{\"properties\":{\"description\":\"baaugicovj\",\"displayName\":\"mvwrmjxyvuodnx\",\"memberResourceNames\":[\"bassqfyylwpp\",\"ygkbzb\",\"o\"]},\"etag\":\"ybxhq\",\"id\":\"vdpmhttuvsqjs\",\"name\":\"vjnq\",\"type\":\"aqg\"}") + .toObject(WorkspaceManagerGroupInner.class); + Assertions.assertEquals("baaugicovj", model.description()); + Assertions.assertEquals("mvwrmjxyvuodnx", model.displayName()); + Assertions.assertEquals("bassqfyylwpp", model.memberResourceNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerGroupInner model = new WorkspaceManagerGroupInner().withDescription("baaugicovj") + .withDisplayName("mvwrmjxyvuodnx") + .withMemberResourceNames(Arrays.asList("bassqfyylwpp", "ygkbzb", "o")); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerGroupInner.class); + Assertions.assertEquals("baaugicovj", model.description()); + Assertions.assertEquals("mvwrmjxyvuodnx", model.displayName()); + Assertions.assertEquals("bassqfyylwpp", model.memberResourceNames().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupListTests.java new file mode 100644 index 000000000000..7620c36c0fa7 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupListTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerGroupList; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerGroupListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerGroupList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"description\":\"zkilmciwuh\",\"displayName\":\"zekypyovljlbzd\",\"memberResourceNames\":[\"ybpaxhpzysovsnw\",\"hanzgesfhsha\",\"pahnezp\"]},\"etag\":\"fyvynpmgg\",\"id\":\"agenvqbugihcdvf\",\"name\":\"izorbloejzs\",\"type\":\"xzgkqwvdeppjna\"},{\"properties\":{\"description\":\"f\",\"displayName\":\"fr\",\"memberResourceNames\":[\"p\"]},\"etag\":\"bpebrmj\",\"id\":\"fpghtbttpkim\",\"name\":\"khn\",\"type\":\"khbykrsmhrcme\"}],\"nextLink\":\"cpgokuthr\"}") + .toObject(WorkspaceManagerGroupList.class); + Assertions.assertEquals("zkilmciwuh", model.value().get(0).description()); + Assertions.assertEquals("zekypyovljlbzd", model.value().get(0).displayName()); + Assertions.assertEquals("ybpaxhpzysovsnw", model.value().get(0).memberResourceNames().get(0)); + Assertions.assertEquals("cpgokuthr", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupPropertiesTests.java new file mode 100644 index 000000000000..ba0eb7a1bf69 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupPropertiesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerGroupProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerGroupPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerGroupProperties model = BinaryData.fromString( + "{\"description\":\"bfkceincnrecj\",\"displayName\":\"iywevsfg\",\"memberResourceNames\":[\"mnszdosmjsqsvzvm\",\"t\",\"wghndaevhgs\",\"lwvgseufigv\"]}") + .toObject(WorkspaceManagerGroupProperties.class); + Assertions.assertEquals("bfkceincnrecj", model.description()); + Assertions.assertEquals("iywevsfg", model.displayName()); + Assertions.assertEquals("mnszdosmjsqsvzvm", model.memberResourceNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerGroupProperties model = new WorkspaceManagerGroupProperties().withDescription("bfkceincnrecj") + .withDisplayName("iywevsfg") + .withMemberResourceNames(Arrays.asList("mnszdosmjsqsvzvm", "t", "wghndaevhgs", "lwvgseufigv")); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerGroupProperties.class); + Assertions.assertEquals("bfkceincnrecj", model.description()); + Assertions.assertEquals("iywevsfg", model.displayName()); + Assertions.assertEquals("mnszdosmjsqsvzvm", model.memberResourceNames().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..a6ccfdec3b3a --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroup; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerGroupsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"tzdxtwyxpkw\",\"displayName\":\"dkkvdevdvk\",\"memberResourceNames\":[\"qxj\",\"hdnlxeiluexvm\",\"gxqpsqpfxjwtal\",\"qkguchdyxrjjdj\"]},\"etag\":\"iqtz\",\"id\":\"gddkujvqzcuqculw\",\"name\":\"xryy\",\"type\":\"tjcrp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerGroup response = manager.workspaceManagerGroups() + .define("a") + .withExistingWorkspace("omfo", "jkerdujfnb") + .withDescription("adutogbkdctsgval") + .withDisplayName("rcneclp") + .withMemberResourceNames(Arrays.asList("jsqcubyj", "nsl")) + .create(); + + Assertions.assertEquals("tzdxtwyxpkw", response.description()); + Assertions.assertEquals("dkkvdevdvk", response.displayName()); + Assertions.assertEquals("qxj", response.memberResourceNames().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..2a02d942ee36 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsDeleteWithResponseMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerGroupsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.workspaceManagerGroups().deleteWithResponse("cs", "usdrgzmmr", "w", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetWithResponseMockTests.java new file mode 100644 index 000000000000..85d7078ed856 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsGetWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroup; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerGroupsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"zukrpfbhih\",\"displayName\":\"diiuex\",\"memberResourceNames\":[\"yfku\",\"mlqp\",\"a\",\"dpwrm\"]},\"etag\":\"fiskk\",\"id\":\"pz\",\"name\":\"sxnyo\",\"type\":\"k\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerGroup response = manager.workspaceManagerGroups() + .getWithResponse("rtcsucot", "wyiq", "jnxzvjnmpvsblud", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zukrpfbhih", response.description()); + Assertions.assertEquals("diiuex", response.displayName()); + Assertions.assertEquals("yfku", response.memberResourceNames().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListMockTests.java new file mode 100644 index 000000000000..0407be72f64c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerGroupsListMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerGroup; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerGroupsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"odidgudarclajben\",\"displayName\":\"yuufvoj\",\"memberResourceNames\":[\"f\"]},\"etag\":\"zwaewpilsuhsghd\",\"id\":\"cpbwfnapga\",\"name\":\"vh\",\"type\":\"ixzcdaukhtwhhsc\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.workspaceManagerGroups() + .list("ibtkcvolaxnukgo", "oumndc", "oxyxiyhmjwsn", 452177512, "ezgvaeqiygbou", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("odidgudarclajben", response.iterator().next().description()); + Assertions.assertEquals("yuufvoj", response.iterator().next().displayName()); + Assertions.assertEquals("f", response.iterator().next().memberResourceNames().get(0)); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberInnerTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberInnerTests.java new file mode 100644 index 000000000000..cce553a4f514 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberInnerTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberInner; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerMemberInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerMemberInner model = BinaryData.fromString( + "{\"properties\":{\"targetWorkspaceResourceId\":\"bn\",\"targetWorkspaceTenantId\":\"bnvmshfuzzlapy\"},\"etag\":\"lvzcgulae\",\"id\":\"iauqsuptessjlw\",\"name\":\"tatpvblskxgxqay\",\"type\":\"aslkvcvwpvl\"}") + .toObject(WorkspaceManagerMemberInner.class); + Assertions.assertEquals("bn", model.targetWorkspaceResourceId()); + Assertions.assertEquals("bnvmshfuzzlapy", model.targetWorkspaceTenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerMemberInner model = new WorkspaceManagerMemberInner().withTargetWorkspaceResourceId("bn") + .withTargetWorkspaceTenantId("bnvmshfuzzlapy"); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerMemberInner.class); + Assertions.assertEquals("bn", model.targetWorkspaceResourceId()); + Assertions.assertEquals("bnvmshfuzzlapy", model.targetWorkspaceTenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberPropertiesTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberPropertiesTests.java new file mode 100644 index 000000000000..f8461c0d9b17 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMemberPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.fluent.models.WorkspaceManagerMemberProperties; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerMemberPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerMemberProperties model = BinaryData + .fromString("{\"targetWorkspaceResourceId\":\"jbvyezjwjkqo\",\"targetWorkspaceTenantId\":\"bwh\"}") + .toObject(WorkspaceManagerMemberProperties.class); + Assertions.assertEquals("jbvyezjwjkqo", model.targetWorkspaceResourceId()); + Assertions.assertEquals("bwh", model.targetWorkspaceTenantId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceManagerMemberProperties model + = new WorkspaceManagerMemberProperties().withTargetWorkspaceResourceId("jbvyezjwjkqo") + .withTargetWorkspaceTenantId("bwh"); + model = BinaryData.fromObject(model).toObject(WorkspaceManagerMemberProperties.class); + Assertions.assertEquals("jbvyezjwjkqo", model.targetWorkspaceResourceId()); + Assertions.assertEquals("bwh", model.targetWorkspaceTenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..81ebd0057178 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMember; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerMembersCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"targetWorkspaceResourceId\":\"ycxuyzrnn\",\"targetWorkspaceTenantId\":\"nmfhmwf\"},\"etag\":\"mm\",\"id\":\"mvditpyqa\",\"name\":\"wlirap\",\"type\":\"hsidfhsfnocz\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerMember response = manager.workspaceManagerMembers() + .define("ciwhumngi") + .withExistingWorkspace("jfty", "qdswfno") + .withTargetWorkspaceResourceId("ndsjpui") + .withTargetWorkspaceTenantId("fvr") + .create(); + + Assertions.assertEquals("ycxuyzrnn", response.targetWorkspaceResourceId()); + Assertions.assertEquals("nmfhmwf", response.targetWorkspaceTenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..ce87ac0675ab --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersDeleteWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerMembersDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.workspaceManagerMembers() + .deleteWithResponse("hpkiiunyrob", "kelow", "mrvdtqhrtnqssqy", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetWithResponseMockTests.java new file mode 100644 index 000000000000..87272ca7ea41 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMember; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerMembersGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"targetWorkspaceResourceId\":\"dci\",\"targetWorkspaceTenantId\":\"xotbvfl\"},\"etag\":\"kiu\",\"id\":\"o\",\"name\":\"afobpyeobrtae\",\"type\":\"qaf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + WorkspaceManagerMember response = manager.workspaceManagerMembers() + .getWithResponse("xwxlfxsetvdzidld", "xfqftywb", "an", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("dci", response.targetWorkspaceResourceId()); + Assertions.assertEquals("xotbvfl", response.targetWorkspaceTenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListMockTests.java new file mode 100644 index 000000000000..709d9566868c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.models.WorkspaceManagerMember; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspaceManagerMembersListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"targetWorkspaceResourceId\":\"fcfgqinaokxo\",\"targetWorkspaceTenantId\":\"knzhmzassrsqz\"},\"etag\":\"nb\",\"id\":\"tdmutdrrq\",\"name\":\"ajhk\",\"type\":\"ttliuwdrtw\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SecurityInsightsManager manager = SecurityInsightsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.workspaceManagerMembers() + .list("upski", "okphamefzzgwj", "aued", 793779609, "pndou", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fcfgqinaokxo", response.iterator().next().targetWorkspaceResourceId()); + Assertions.assertEquals("knzhmzassrsqz", response.iterator().next().targetWorkspaceTenantId()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListTests.java new file mode 100644 index 000000000000..7e1c31e1cda5 --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerMembersListTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.securityinsights.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.securityinsights.implementation.models.WorkspaceManagerMembersList; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceManagerMembersListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceManagerMembersList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"targetWorkspaceResourceId\":\"yozvrcwfpucw\",\"targetWorkspaceTenantId\":\"bcgqef\"},\"etag\":\"jvbxqcbgo\",\"id\":\"xtuuci\",\"name\":\"gvkdlhuduk\",\"type\":\"bjoaf\"},{\"properties\":{\"targetWorkspaceResourceId\":\"fex\",\"targetWorkspaceTenantId\":\"lvoepknarse\"},\"etag\":\"ncsqoacbuqd\",\"id\":\"apleq\",\"name\":\"gkxenvszglv\",\"type\":\"akeszsuuvul\"},{\"properties\":{\"targetWorkspaceResourceId\":\"cwgg\",\"targetWorkspaceTenantId\":\"hxvlqgfbrve\"},\"etag\":\"c\",\"id\":\"vphirlzbip\",\"name\":\"unnep\",\"type\":\"wz\"},{\"properties\":{\"targetWorkspaceResourceId\":\"kueruwcjom\",\"targetWorkspaceTenantId\":\"pvwkaujttwykox\"},\"etag\":\"wofxxdplrel\",\"id\":\"vga\",\"name\":\"cbtuxlbpxrhrfjen\",\"type\":\"azwef\"}],\"nextLink\":\"tlhqas\"}") + .toObject(WorkspaceManagerMembersList.class); + Assertions.assertEquals("yozvrcwfpucw", model.value().get(0).targetWorkspaceResourceId()); + Assertions.assertEquals("bcgqef", model.value().get(0).targetWorkspaceTenantId()); + Assertions.assertEquals("tlhqas", model.nextLink()); + } +} diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml b/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml new file mode 100644 index 000000000000..c8211ddc817c --- /dev/null +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/SecurityInsights +commit: 120cdc984d09afe0cf1d79b29ecfce1bc3bc90b0 +repo: Azure/azure-rest-api-specs +additionalDirectories: From 56793789be0dfc92d2297b8c25dc58823e490261 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 19 Aug 2026 08:01:19 +0000 Subject: [PATCH 2/4] Configurations: 'specification/securityinsights/resource-manager/Microsoft.SecurityInsights/SecurityInsights/tspconfig.yaml', and CommitSHA: 'e4431efcc0a59119bf36fc0288c5a1e2e249d8f7' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6719022 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 247 ++++++++---------- .../SAMPLE.md | 24 +- .../SecurityInsightsManager.java | 4 +- .../implementation/BookmarkRelationsImpl.java | 120 ++------- .../implementation/IncidentRelationsImpl.java | 120 +++++++-- .../implementation/RelationImpl.java | 32 +-- .../models/BookmarkRelations.java | 87 +++--- .../models/IncidentRelations.java | 87 +++--- .../securityinsights/models/Relation.java | 8 +- ...ookmarkRelationsCreateOrUpdateSamples.java | 12 +- ...ncidentRelationsCreateOrUpdateSamples.java | 12 +- ...nsCreateOrUpdateWithResponseMockTests.java | 16 +- ...kRelationsDeleteWithResponseMockTests.java | 3 +- .../BookmarkRelationsListMockTests.java | 8 +- ...GetTimelinesListWithResponseMockTests.java | 24 +- .../EntitiesRelationsListMockTests.java | 8 +- ...tionsGetRelationWithResponseMockTests.java | 9 +- .../GetRecommendationsListMockTests.java | 36 +-- ...iggeredAnalyticsRuleRunsListMockTests.java | 14 +- ...leRecommendationWithResponseMockTests.java | 36 +-- ...nsCreateOrUpdateWithResponseMockTests.java | 16 +- ...tRelationsDeleteWithResponseMockTests.java | 2 +- .../IncidentRelationsListMockTests.java | 8 +- ...ksCreateOrUpdateWithResponseMockTests.java | 52 ++-- ...identTasksDeleteWithResponseMockTests.java | 3 +- ...IncidentTasksGetWithResponseMockTests.java | 26 +- .../generated/IncidentTasksListMockTests.java | 28 +- .../MetadatasCreateWithResponseMockTests.java | 162 ++++++------ .../MetadatasDeleteWithResponseMockTests.java | 3 +- .../MetadatasGetWithResponseMockTests.java | 70 ++--- .../generated/MetadatasListMockTests.java | 66 ++--- ...esRecommendationWithResponseMockTests.java | 7 +- ...gsCreateOrUpdateWithResponseMockTests.java | 8 +- ...csSettingsDeleteWithResponseMockTests.java | 3 +- ...yticsSettingsGetWithResponseMockTests.java | 6 +- ...urityMLAnalyticsSettingsListMockTests.java | 2 +- ...dingStatesDeleteWithResponseMockTests.java | 2 +- ...catorMetricsListWithResponseMockTests.java | 6 +- ...catorsAppendTagsWithResponseMockTests.java | 4 +- ...IndicatorsDeleteWithResponseMockTests.java | 2 +- ...nceIndicatorsGetWithResponseMockTests.java | 6 +- ...enceIndicatorsOperationsListMockTests.java | 6 +- ...telligencesCountWithResponseMockTests.java | 21 +- .../ThreatIntelligencesQueryMockTests.java | 42 +-- ...esRecommendationWithResponseMockTests.java | 45 ++-- ...gnmentJobsCreateWithResponseMockTests.java | 12 +- ...gnmentJobsDeleteWithResponseMockTests.java | 2 +- ...ssignmentJobsGetWithResponseMockTests.java | 12 +- ...aceManagerAssignmentJobsListMockTests.java | 13 +- .../tsp-location.yaml | 2 +- 50 files changed, 765 insertions(+), 779 deletions(-) diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md index 70c3a907bf4b..78f838be9b6c 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md @@ -36,10 +36,6 @@ #### `models.DataConnectorList` was removed -#### `models.Relation$DefinitionStages` was modified - -* `withExistingIncident(java.lang.String,java.lang.String,java.lang.String)` was removed in stage 1 - #### `models.AutomationRuleCondition` was modified * `validate()` was removed @@ -67,25 +63,25 @@ #### `models.ScheduledAlertRuleTemplate` was modified * `ScheduledAlertRuleTemplate()` was changed to private access -* `withQueryFrequency(java.time.Duration)` was removed -* `withAlertDetailsOverride(models.AlertDetailsOverride)` was removed -* `withTactics(java.util.List)` was removed -* `validate()` was removed -* `withCustomDetails(java.util.Map)` was removed +* `withSeverity(models.AlertSeverity)` was removed * `withTriggerThreshold(java.lang.Integer)` was removed +* `withEventGroupingSettings(models.EventGroupingSettings)` was removed +* `withAlertDetailsOverride(models.AlertDetailsOverride)` was removed * `withDisplayName(java.lang.String)` was removed +* `validate()` was removed * `withRequiredDataConnectors(java.util.List)` was removed +* `withEntityMappings(java.util.List)` was removed +* `withTriggerOperator(models.TriggerOperator)` was removed +* `withTechniques(java.util.List)` was removed +* `withQueryFrequency(java.time.Duration)` was removed +* `withCustomDetails(java.util.Map)` was removed +* `withVersion(java.lang.String)` was removed +* `withTactics(java.util.List)` was removed +* `withQueryPeriod(java.time.Duration)` was removed * `withDescription(java.lang.String)` was removed +* `withQuery(java.lang.String)` was removed * `withStatus(models.TemplateStatus)` was removed -* `withQueryPeriod(java.time.Duration)` was removed -* `withVersion(java.lang.String)` was removed -* `withTechniques(java.util.List)` was removed -* `withSeverity(models.AlertSeverity)` was removed * `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed -* `withQuery(java.lang.String)` was removed -* `withTriggerOperator(models.TriggerOperator)` was removed -* `withEventGroupingSettings(models.EventGroupingSettings)` was removed -* `withEntityMappings(java.util.List)` was removed #### `models.ActionPropertiesBase` was modified @@ -98,15 +94,15 @@ #### `models.FusionAlertRuleTemplate` was modified * `FusionAlertRuleTemplate()` was changed to private access +* `withSeverity(models.AlertSeverity)` was removed * `withTechniques(java.util.List)` was removed -* `validate()` was removed -* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed +* `withStatus(models.TemplateStatus)` was removed * `withDescription(java.lang.String)` was removed -* `withSeverity(models.AlertSeverity)` was removed -* `withDisplayName(java.lang.String)` was removed +* `validate()` was removed * `withRequiredDataConnectors(java.util.List)` was removed -* `withStatus(models.TemplateStatus)` was removed +* `withDisplayName(java.lang.String)` was removed * `withTactics(java.util.List)` was removed +* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed #### `models.Watchlist$Update` was modified @@ -115,8 +111,8 @@ #### `models.IoTDeviceEntity` was modified * `IoTDeviceEntity()` was changed to private access -* `java.util.UUID iotSecurityAgentId()` -> `java.lang.String iotSecurityAgentId()` * `validate()` was removed +* `java.util.UUID iotSecurityAgentId()` -> `java.lang.String iotSecurityAgentId()` #### `models.GeoLocation` was modified @@ -181,10 +177,6 @@ * `validate()` was removed -#### `models.Relation$Definition` was modified - -* `withExistingIncident(java.lang.String,java.lang.String,java.lang.String)` was removed - #### `models.GroupingConfiguration` was modified * `validate()` was removed @@ -197,8 +189,8 @@ * `ThreatIntelligenceMetric()` was changed to private access * `withLastUpdatedTimeUtc(java.lang.String)` was removed -* `withThreatTypeMetrics(java.util.List)` was removed * `withPatternTypeMetrics(java.util.List)` was removed +* `withThreatTypeMetrics(java.util.List)` was removed * `validate()` was removed * `withSourceMetrics(java.util.List)` was removed @@ -227,9 +219,9 @@ #### `models.AlertRuleTemplateDataSource` was modified * `AlertRuleTemplateDataSource()` was changed to private access +* `withConnectorId(java.lang.String)` was removed * `validate()` was removed * `withDataTypes(java.util.List)` was removed -* `withConnectorId(java.lang.String)` was removed #### `models.EventGroupingSettings` was modified @@ -237,22 +229,22 @@ #### `models.MdatpDataConnector` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.OperationDisplay` was modified * `OperationDisplay()` was changed to private access -* `validate()` was removed * `withDescription(java.lang.String)` was removed -* `withResource(java.lang.String)` was removed * `withOperation(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed +* `validate()` was removed * `withProvider(java.lang.String)` was removed #### `models.MicrosoftSecurityIncidentCreationAlertRule` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.Entity` was modified @@ -273,9 +265,9 @@ #### `models.SubmissionMailEntity` was modified * `SubmissionMailEntity()` was changed to private access -* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` -* `validate()` was removed * `java.util.UUID submissionId()` -> `java.lang.String submissionId()` +* `validate()` was removed +* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` #### `models.AadDataConnector` was modified @@ -306,8 +298,8 @@ #### `models.SecurityAlert` was modified * `SecurityAlert()` was changed to private access -* `validate()` was removed * `withSeverity(models.AlertSeverity)` was removed +* `validate()` was removed #### `models.CloudApplicationEntity` was modified @@ -325,8 +317,8 @@ #### `models.McasDataConnector` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.IncidentConfiguration` was modified @@ -343,8 +335,8 @@ #### `models.ThreatIntelligenceMetricEntity` was modified * `ThreatIntelligenceMetricEntity()` was changed to private access -* `validate()` was removed * `withMetricName(java.lang.String)` was removed +* `validate()` was removed * `withMetricValue(java.lang.Integer)` was removed #### `models.MailboxEntity` was modified @@ -360,8 +352,8 @@ #### `models.HostEntity` was modified * `HostEntity()` was changed to private access -* `withOsFamily(models.OSFamily)` was removed * `validate()` was removed +* `withOsFamily(models.OSFamily)` was removed #### `models.AlertsDataTypeOfDataConnector` was modified @@ -395,14 +387,14 @@ #### `models.ThreatIntelligenceMetrics` was modified * `ThreatIntelligenceMetrics()` was changed to private access -* `validate()` was removed * `withProperties(models.ThreatIntelligenceMetric)` was removed +* `validate()` was removed #### `models.SecurityGroupEntity` was modified * `SecurityGroupEntity()` was changed to private access -* `validate()` was removed * `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` +* `validate()` was removed #### `models.ActionRequest` was modified @@ -414,14 +406,14 @@ #### `models.AatpDataConnector` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.AnomalySecurityMLAnalyticsSettings` was modified -* `java.util.UUID settingsDefinitionId()` -> `java.lang.String settingsDefinitionId()` -* `withSettingsDefinitionId(java.util.UUID)` was removed * `withEtag(java.lang.String)` was removed +* `withSettingsDefinitionId(java.util.UUID)` was removed +* `java.util.UUID settingsDefinitionId()` -> `java.lang.String settingsDefinitionId()` * `validate()` was removed #### `models.AwsCloudTrailDataConnectorDataTypes` was modified @@ -434,8 +426,8 @@ #### `models.ThreatIntelligenceIndicatorModel` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.EntityMapping` was modified @@ -449,16 +441,16 @@ #### `models.MicrosoftSecurityIncidentCreationAlertRuleTemplate` was modified * `MicrosoftSecurityIncidentCreationAlertRuleTemplate()` was changed to private access -* `validate()` was removed * `withRequiredDataConnectors(java.util.List)` was removed +* `withStatus(models.TemplateStatus)` was removed +* `validate()` was removed +* `withDisplayNamesExcludeFilter(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed * `withSeveritiesFilter(java.util.List)` was removed -* `withDisplayNamesFilter(java.util.List)` was removed -* `withDescription(java.lang.String)` was removed * `withProductFilter(models.MicrosoftSecurityProductName)` was removed -* `withDisplayNamesExcludeFilter(java.util.List)` was removed +* `withDisplayNamesFilter(java.util.List)` was removed * `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed -* `withDisplayName(java.lang.String)` was removed -* `withStatus(models.TemplateStatus)` was removed +* `withDescription(java.lang.String)` was removed #### `models.ThreatIntelligenceParsedPatternTypeValue` was modified @@ -490,18 +482,18 @@ #### `models.HuntingBookmark` was modified * `HuntingBookmark()` was changed to private access -* `withCreated(java.time.OffsetDateTime)` was removed -* `withCreatedBy(models.UserInfo)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withEventTime(java.time.OffsetDateTime)` was removed +* `withNotes(java.lang.String)` was removed +* `withQuery(java.lang.String)` was removed * `withIncidentInfo(models.IncidentInfo)` was removed -* `withQueryResult(java.lang.String)` was removed +* `withCreated(java.time.OffsetDateTime)` was removed * `withLabels(java.util.List)` was removed +* `withUpdatedBy(models.UserInfo)` was removed +* `withQueryResult(java.lang.String)` was removed * `withUpdated(java.time.OffsetDateTime)` was removed -* `withQuery(java.lang.String)` was removed -* `withDisplayName(java.lang.String)` was removed +* `withCreatedBy(models.UserInfo)` was removed * `validate()` was removed -* `withUpdatedBy(models.UserInfo)` was removed -* `withNotes(java.lang.String)` was removed -* `withEventTime(java.time.OffsetDateTime)` was removed #### `models.ThreatIntelligenceAppendTags` was modified @@ -524,14 +516,6 @@ * `validate()` was removed * `withEtag(java.lang.String)` was removed -#### `models.IncidentRelations` was modified - -* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed -* `define(java.lang.String)` was removed -* `deleteById(java.lang.String)` was removed -* `getById(java.lang.String)` was removed -* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed - #### `models.TIDataConnectorDataTypes` was modified * `validate()` was removed @@ -547,22 +531,22 @@ #### `models.UserInfo` was modified * `validate()` was removed -* `java.util.UUID objectId()` -> `java.lang.String objectId()` * `withObjectId(java.util.UUID)` was removed +* `java.util.UUID objectId()` -> `java.lang.String objectId()` #### `models.MailMessageEntity` was modified * `MailMessageEntity()` was changed to private access -* `withDeliveryLocation(models.DeliveryLocation)` was removed +* `withAntispamDirection(models.AntispamMailDirection)` was removed +* `withBodyFingerprintBin1(java.lang.Integer)` was removed * `withBodyFingerprintBin3(java.lang.Integer)` was removed +* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` * `withBodyFingerprintBin2(java.lang.Integer)` was removed +* `withDeliveryLocation(models.DeliveryLocation)` was removed +* `validate()` was removed +* `withBodyFingerprintBin5(java.lang.Integer)` was removed * `withDeliveryAction(models.DeliveryAction)` was removed * `withBodyFingerprintBin4(java.lang.Integer)` was removed -* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` -* `withAntispamDirection(models.AntispamMailDirection)` was removed -* `withBodyFingerprintBin5(java.lang.Integer)` was removed -* `withBodyFingerprintBin1(java.lang.Integer)` was removed -* `validate()` was removed #### `models.ThreatIntelligenceParsedPattern` was modified @@ -594,8 +578,8 @@ #### `models.ProcessEntity` was modified * `ProcessEntity()` was changed to private access -* `withElevationToken(models.ElevationToken)` was removed * `validate()` was removed +* `withElevationToken(models.ElevationToken)` was removed #### `models.IncidentInfo` was modified @@ -1487,15 +1471,15 @@ #### `models.IncidentAdditionalData` was modified +* `techniques()` was added * `mergedIncidentUrl()` was added * `providerIncidentUrl()` was added -* `techniques()` was added * `mergedIncidentNumber()` was added #### `models.ScheduledAlertRuleTemplate` was modified -* `subTechniques()` was added * `sentinelEntitiesMappings()` was added +* `subTechniques()` was added #### `models.FusionAlertRuleTemplate` was modified @@ -1509,17 +1493,17 @@ #### `models.IoTDeviceEntity` was modified -* `deviceSubType()` was added * `zone()` was added +* `site()` was added * `nicEntityIds()` was added -* `owners()` was added +* `isProgramming()` was added +* `isAuthorized()` was added +* `deviceSubType()` was added * `sensor()` was added * `isScanner()` was added -* `purdueLayer()` was added -* `site()` was added -* `isAuthorized()` was added -* `isProgramming()` was added * `importance()` was added +* `owners()` was added +* `purdueLayer()` was added #### `models.Watchlist$Definition` was modified @@ -1581,10 +1565,6 @@ * `REST_API_POLLER` was added * `THREAT_INTELLIGENCE_TAXII` was added -#### `models.Relation$Definition` was modified - -* `withExistingBookmark(java.lang.String,java.lang.String,java.lang.String)` was added - #### `models.Incident$Definition` was modified * `withTeamInformation(models.TeamInformation)` was added @@ -1596,21 +1576,21 @@ #### `models.ScheduledAlertRule` was modified -* `withSubTechniques(java.util.List)` was added * `withSentinelEntitiesMappings(java.util.List)` was added +* `withSubTechniques(java.util.List)` was added * `subTechniques()` was added * `sentinelEntitiesMappings()` was added #### `models.Bookmark$Definition` was modified -* `withTechniques(java.util.List)` was added * `withTactics(java.util.List)` was added * `withEntityMappings(java.util.List)` was added +* `withTechniques(java.util.List)` was added #### `models.AlertDetailsOverride` was modified -* `withAlertDynamicProperties(java.util.List)` was added * `alertDynamicProperties()` was added +* `withAlertDynamicProperties(java.util.List)` was added #### `models.Watchlist` was modified @@ -1635,67 +1615,67 @@ #### `models.DataConnectors` was modified +* `connect(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody)` was added * `disconnectWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added -* `connectWithResponse(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody,com.azure.core.util.Context)` was added * `disconnect(java.lang.String,java.lang.String,java.lang.String)` was added -* `connect(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody)` was added +* `connectWithResponse(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody,com.azure.core.util.Context)` was added #### `models.Incidents` was modified -* `runPlaybook(java.lang.String,java.lang.String,java.lang.String)` was added * `runPlaybookWithResponse(java.lang.String,java.lang.String,java.lang.String,models.ManualTriggerRequestBody,com.azure.core.util.Context)` was added +* `runPlaybook(java.lang.String,java.lang.String,java.lang.String)` was added #### `models.Incident` was modified +* `providerName()` was added * `providerIncidentId()` was added * `teamInformation()` was added -* `providerName()` was added #### `SecurityInsightsManager` was modified -* `fileImports()` was added -* `huntComments()` was added -* `productTemplates()` was added +* `workspaceManagerAssignments()` was added +* `workspaceManagerAssignmentJobs()` was added +* `metadatas()` was added * `contentPackageOperations()` was added -* `workspaceManagerGroups()` was added -* `triggeredAnalyticsRuleRunOperations()` was added -* `workspaceManagerMembers()` was added -* `entitiesGetTimelines()` was added -* `billingStatistics()` was added -* `productPackagesOperations()` was added -* `gets()` was added +* `productTemplates()` was added * `threatIntelligences()` was added -* `sourceControls()` was added -* `getTriggeredAnalyticsRuleRuns()` was added -* `dataConnectorDefinitions()` was added -* `officeConsents()` was added -* `productPackages()` was added -* `sourceControlOperations()` was added -* `hunts()` was added -* `huntRelations()` was added -* `reevaluates()` was added -* `metadatas()` was added -* `workspaceManagerAssignmentJobs()` was added -* `workspaceManagerConfigurations()` was added -* `entitiesRelations()` was added -* `productTemplatesOperations()` was added -* `bookmarkRelations()` was added -* `updates()` was added * `entities()` was added +* `productTemplatesOperations()` was added * `entityQueries()` was added +* `fileImports()` was added +* `dataConnectorsCheckRequirementsOperations()` was added * `resourceProviders()` was added -* `entityRelations()` was added -* `contentPackages()` was added -* `getRecommendations()` was added * `productSettings()` was added -* `dataConnectorsCheckRequirementsOperations()` was added -* `workspaceManagerAssignments()` was added -* `bookmarkOperations()` was added -* `contentTemplates()` was added +* `entityQueryTemplates()` was added +* `workspaceManagerMembers()` was added * `contentTemplatesOperations()` was added +* `workspaceManagerGroups()` was added +* `sourceControls()` was added +* `huntRelations()` was added +* `contentTemplates()` was added * `incidentTasks()` was added +* `bookmarkRelations()` was added +* `updates()` was added +* `entitiesGetTimelines()` was added +* `entityRelations()` was added +* `getRecommendations()` was added * `alertRuleOperations()` was added -* `entityQueryTemplates()` was added +* `reevaluates()` was added +* `productPackages()` was added +* `hunts()` was added +* `bookmarkOperations()` was added +* `productPackagesOperations()` was added +* `huntComments()` was added +* `dataConnectorDefinitions()` was added +* `entitiesRelations()` was added +* `billingStatistics()` was added +* `contentPackages()` was added +* `officeConsents()` was added +* `getTriggeredAnalyticsRuleRuns()` was added +* `gets()` was added +* `triggeredAnalyticsRuleRunOperations()` was added +* `workspaceManagerConfigurations()` was added +* `sourceControlOperations()` was added #### `models.EntityKindEnum` was modified @@ -1711,16 +1691,11 @@ #### `models.FusionAlertRule` was modified +* `scenarioExclusionPatterns()` was added +* `withScenarioExclusionPatterns(java.util.List)` was added * `withSourceSettings(java.util.List)` was added -* `subTechniques()` was added * `sourceSettings()` was added -* `withScenarioExclusionPatterns(java.util.List)` was added -* `scenarioExclusionPatterns()` was added - -#### `models.IncidentRelations` was modified - -* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.RelationInner)` was added -* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.RelationInner,com.azure.core.util.Context)` was added +* `subTechniques()` was added #### `models.UserInfo` was modified diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md index 660ed50438b7..ac6bf4ace83d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/SAMPLE.md @@ -1232,6 +1232,8 @@ public final class BookmarkOperationExpandSamples { ### BookmarkRelations_CreateOrUpdate ```java +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + /** * Samples for BookmarkRelations CreateOrUpdate. */ @@ -1247,11 +1249,11 @@ public final class BookmarkRelationsCreateOrUpdateSamples { 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(); + .createOrUpdateWithResponse("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + new RelationInner().withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812"), + com.azure.core.util.Context.NONE); } } ``` @@ -4588,8 +4590,6 @@ public final class IncidentCommentsListSamples { ### IncidentRelations_CreateOrUpdate ```java -import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; - /** * Samples for IncidentRelations CreateOrUpdate. */ @@ -4605,11 +4605,11 @@ public final class IncidentRelationsCreateOrUpdateSamples { public static void createsOrUpdatesARelationForAGivenIncident( 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"), - com.azure.core.util.Context.NONE); + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingIncident("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812") + .withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096") + .create(); } } ``` 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 index f1b53a16e0fc..e91672b4c6ea 100644 --- 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 @@ -616,7 +616,7 @@ public IncidentComments incidentComments() { } /** - * Gets the resource collection API of BookmarkRelations. It manages Relation. + * Gets the resource collection API of BookmarkRelations. * * @return Resource collection API of BookmarkRelations. */ @@ -1035,7 +1035,7 @@ public ContentTemplatesOperations contentTemplatesOperations() { } /** - * Gets the resource collection API of IncidentRelations. + * Gets the resource collection API of IncidentRelations. It manages Relation. * * @return Resource collection API of IncidentRelations. */ 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 index 83564450210e..768d77fa72d6 100644 --- 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 @@ -44,6 +44,25 @@ public Relation get(String resourceGroupName, String workspaceName, String bookm } } + public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String bookmarkId, String relationName, RelationInner relation, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, relation, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RelationImpl(inner.getValue(), this.manager())); + } + + public Relation createOrUpdate(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, RelationInner relation) { + RelationInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, bookmarkId, relationName, relation); + if (inner != null) { + return new RelationImpl(inner, this.manager()); + } else { + return null; + } + } + public Response deleteWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, String relationName, Context context) { return this.serviceClient() @@ -66,103 +85,6 @@ public PagedIterable list(String resourceGroupName, String workspaceNa return ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); } - public Relation getById(String id) { - String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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; } @@ -170,8 +92,4 @@ private BookmarkRelationsClient serviceClient() { 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/IncidentRelationsImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/IncidentRelationsImpl.java index 9b3eb9e60569..58f909e95abe 100644 --- 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 @@ -44,25 +44,6 @@ public Relation get(String resourceGroupName, String workspaceName, String incid } } - 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); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RelationImpl(inner.getValue(), this.manager())); - } - - 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 deleteWithResponse(String resourceGroupName, String workspaceName, String incidentId, String relationName, Context context) { return this.serviceClient() @@ -85,6 +66,103 @@ public PagedIterable list(String resourceGroupName, String workspaceNa return ResourceManagerUtils.mapPage(inner, inner1 -> new RelationImpl(inner1, this.manager())); } + public Relation getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 relationName = ResourceManagerUtils.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, incidentId, relationName, context); + } + private IncidentRelationsClient serviceClient() { return this.innerClient; } @@ -92,4 +170,8 @@ private IncidentRelationsClient serviceClient() { 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/RelationImpl.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/implementation/RelationImpl.java index 4d24b7ab162c..9dbcc8b5572a 100644 --- 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 @@ -66,21 +66,21 @@ private com.azure.resourcemanager.securityinsights.SecurityInsightsManager manag private String workspaceName; - private String bookmarkId; + private String incidentId; private String relationName; - public RelationImpl withExistingBookmark(String resourceGroupName, String workspaceName, String bookmarkId) { + public RelationImpl withExistingIncident(String resourceGroupName, String workspaceName, String incidentId) { this.resourceGroupName = resourceGroupName; this.workspaceName = workspaceName; - this.bookmarkId = bookmarkId; + this.incidentId = incidentId; return this; } public Relation create() { this.innerObject = serviceManager.serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + .getIncidentRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), Context.NONE) .getValue(); return this; @@ -88,8 +88,8 @@ public Relation create() { public Relation create(Context context) { this.innerObject = serviceManager.serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + .getIncidentRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), context) .getValue(); return this; @@ -107,8 +107,8 @@ public RelationImpl update() { public Relation apply() { this.innerObject = serviceManager.serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + .getIncidentRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), Context.NONE) .getValue(); return this; @@ -116,8 +116,8 @@ public Relation apply() { public Relation apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getBookmarkRelations() - .createOrUpdateWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, this.innerModel(), + .getIncidentRelations() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, incidentId, relationName, this.innerModel(), context) .getValue(); return this; @@ -129,22 +129,22 @@ public Relation apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); - this.bookmarkId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "bookmarks"); + this.incidentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "incidents"); this.relationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "relations"); } public Relation refresh() { this.innerObject = serviceManager.serviceClient() - .getBookmarkRelations() - .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, Context.NONE) + .getIncidentRelations() + .getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, Context.NONE) .getValue(); return this; } public Relation refresh(Context context) { this.innerObject = serviceManager.serviceClient() - .getBookmarkRelations() - .getWithResponse(resourceGroupName, workspaceName, bookmarkId, relationName, context) + .getIncidentRelations() + .getWithResponse(resourceGroupName, workspaceName, incidentId, relationName, context) .getValue(); return this; } 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 index e69c775a2796..c98e8bbd14d9 100644 --- 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 @@ -7,6 +7,7 @@ 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 BookmarkRelations. @@ -42,6 +43,39 @@ Response getWithResponse(String resourceGroupName, String workspaceNam */ Relation get(String resourceGroupName, String workspaceName, String bookmarkId, String relationName); + /** + * 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 Resource create parameters. + * @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 along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String bookmarkId, + String relationName, RelationInner relation, 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 Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 bookmarkId, String relationName, + RelationInner relation); + /** * Delete the bookmark relation. * @@ -104,57 +138,4 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ PagedIterable list(String resourceGroupName, String workspaceName, String bookmarkId, String filter, String orderby, Integer top, String skipToken, 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 along with {@link Response}. - */ - 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 along with {@link Response}. - */ - 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 {@link 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/IncidentRelations.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/IncidentRelations.java index 299d604acf17..a04cb05bf37f 100644 --- 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 @@ -7,7 +7,6 @@ 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. @@ -43,39 +42,6 @@ Response getWithResponse(String resourceGroupName, String workspaceNam */ Relation get(String resourceGroupName, String workspaceName, String incidentId, String relationName); - /** - * 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 monitor 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 along with {@link Response}. - */ - Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String incidentId, - String relationName, RelationInner relation, 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 monitor 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); - /** * Deletes a relation for a given incident. * @@ -138,4 +104,57 @@ Response deleteWithResponse(String resourceGroupName, String workspaceName */ PagedIterable list(String resourceGroupName, String workspaceName, String incidentId, String filter, String orderby, Integer top, String skipToken, Context context); + + /** + * Gets a relation for a given 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 a relation for a given incident along with {@link Response}. + */ + Relation getById(String id); + + /** + * Gets a relation for a given 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 a relation for a given incident along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a relation for a given 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); + + /** + * Deletes a relation for a given 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 {@link 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/Relation.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Relation.java index a1456f8e8d40..887055461f6e 100644 --- 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 @@ -111,14 +111,14 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, workspaceName, bookmarkId. + * 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 bookmarkId Bookmark ID. + * @param workspaceName The name of the monitor workspace. + * @param incidentId Incident ID. * @return the next definition stage. */ - WithCreate withExistingBookmark(String resourceGroupName, String workspaceName, String bookmarkId); + WithCreate withExistingIncident(String resourceGroupName, String workspaceName, String incidentId); } /** 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 index 7e66f925a94e..19e75d69638e 100644 --- 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 @@ -4,6 +4,8 @@ package com.azure.resourcemanager.securityinsights.generated; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; + /** * Samples for BookmarkRelations CreateOrUpdate. */ @@ -19,10 +21,10 @@ public final class BookmarkRelationsCreateOrUpdateSamples { 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(); + .createOrUpdateWithResponse("myRg", "myWorkspace", "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + new RelationInner().withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812"), + com.azure.core.util.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 index 64d316523686..3906a7a89e3e 100644 --- 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 @@ -4,8 +4,6 @@ package com.azure.resourcemanager.securityinsights.generated; -import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; - /** * Samples for IncidentRelations CreateOrUpdate. */ @@ -21,10 +19,10 @@ public final class IncidentRelationsCreateOrUpdateSamples { public static void createsOrUpdatesARelationForAGivenIncident( 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"), - com.azure.core.util.Context.NONE); + .define("4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014") + .withExistingIncident("myRg", "myWorkspace", "afbd324f-6c48-459c-8710-8d1e1cd03812") + .withRelatedResourceId( + "/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096") + .create(); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java index 029b94c82e6e..b4f6b84783eb 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsCreateOrUpdateWithResponseMockTests.java @@ -10,6 +10,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; +import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; import com.azure.resourcemanager.securityinsights.models.Relation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -21,7 +22,7 @@ public final class BookmarkRelationsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"relatedResourceId\":\"nqbkpobjufksddxk\",\"relatedResourceName\":\"wxlylxfpvoylf\",\"relatedResourceType\":\"srgu\",\"relatedResourceKind\":\"bthauivgbimededq\"},\"etag\":\"rvulzg\",\"id\":\"ckpdpdcnr\",\"name\":\"qskikq\",\"type\":\"qiybqtlvofjjse\"}"; + = "{\"properties\":{\"relatedResourceId\":\"iecurfs\",\"relatedResourceName\":\"shfmgi\",\"relatedResourceType\":\"urveekhsmulvmywo\",\"relatedResourceKind\":\"kpuuuxiuwhcyc\"},\"etag\":\"kmufipygtmoycp\",\"id\":\"maosongtbh\",\"name\":\"hsqvubwwqgiyu\",\"type\":\"nrvwjxmwalh\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,13 +32,12 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Relation response = manager.bookmarkRelations() - .define("yujnrvwjxmwalhlj") - .withExistingBookmark("gtmoy", "potmaosongt", "hvhsqvubwwqg") - .withEtag("vpjydwmaqeytjp") - .withRelatedResourceId("snbpiuvqhodfm") - .create(); + .createOrUpdateWithResponse("uveljfa", "in", "fziztgddahymvk", "jtdhmig", + new RelationInner().withEtag("llbpegcetezaa").withRelatedResourceId("aoexgienylsijqyg"), + com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("rvulzg", response.etag()); - Assertions.assertEquals("nqbkpobjufksddxk", response.relatedResourceId()); + Assertions.assertEquals("kmufipygtmoycp", response.etag()); + Assertions.assertEquals("iecurfs", response.relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java index 567d00b6dd2d..b0277ab85dd6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsDeleteWithResponseMockTests.java @@ -28,7 +28,8 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.bookmarkRelations() - .deleteWithResponse("uveljfa", "in", "fziztgddahymvk", "jtdhmig", com.azure.core.util.Context.NONE); + .deleteWithResponse("jtnsnbpiuvqho", "fmortrsnpbsungn", "kkmkzfbjucg", "gzjyrdiiwhmrhz", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java index 8b61ce99c04d..4c1262b43505 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/BookmarkRelationsListMockTests.java @@ -22,7 +22,7 @@ public final class BookmarkRelationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"llbpegcetezaa\",\"relatedResourceName\":\"szrbttz\",\"relatedResourceType\":\"eyrw\",\"relatedResourceKind\":\"fgoyxxszpaiecurf\"},\"etag\":\"fshfmgiixurve\",\"id\":\"hsmulvmy\",\"name\":\"oefkpuuuxiuwhc\",\"type\":\"ckekmufip\"}]}"; + = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"wxlylxfpvoylf\",\"relatedResourceName\":\"srgu\",\"relatedResourceType\":\"bthauivgbimededq\",\"relatedResourceKind\":\"rvulzg\"},\"etag\":\"ckpdpdcnr\",\"id\":\"skikqdqiybqtl\",\"name\":\"of\",\"type\":\"jsetiznn\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.bookmarkRelations() - .list("waoex", "ienyls", "jqygo", "shd", "ehxv", 1570316766, "fdsafgkysymhuxs", + .list("qvpjydwmaq", "ytjpua", "pqupdcsvzugiur", "gqlvl", "jzscrjtnq", 1243121546, "pobjufksddxk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("fshfmgiixurve", response.iterator().next().etag()); - Assertions.assertEquals("llbpegcetezaa", response.iterator().next().relatedResourceId()); + Assertions.assertEquals("ckpdpdcnr", response.iterator().next().etag()); + Assertions.assertEquals("wxlylxfpvoylf", response.iterator().next().relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java index c71378d5812b..0f8595aa38e2 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesGetTimelinesListWithResponseMockTests.java @@ -24,7 +24,7 @@ public final class EntitiesGetTimelinesListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { String responseStr - = "{\"metaData\":{\"totalCount\":1819451335,\"aggregations\":[{\"count\":2113245920,\"kind\":\"Anomaly\"},{\"count\":1381680700,\"kind\":\"Activity\"},{\"count\":222118864,\"kind\":\"SecurityAlert\"},{\"count\":1629493159,\"kind\":\"Activity\"}],\"errors\":[{\"kind\":\"SecurityAlert\",\"queryId\":\"jeitkfhzvscndb\",\"errorMessage\":\"lscokafaqqipv\"},{\"kind\":\"Anomaly\",\"queryId\":\"zsss\",\"errorMessage\":\"ncghgi\"},{\"kind\":\"Anomaly\",\"queryId\":\"otx\",\"errorMessage\":\"dbxzhadm\"}]},\"value\":[{\"kind\":\"EntityTimelineItem\"},{\"kind\":\"EntityTimelineItem\"}]}"; + = "{\"metaData\":{\"totalCount\":1314215082,\"aggregations\":[{\"count\":229496652,\"kind\":\"Activity\"}],\"errors\":[{\"kind\":\"SecurityAlert\",\"queryId\":\"j\",\"errorMessage\":\"emrfqjh\"}]},\"value\":[{\"kind\":\"EntityTimelineItem\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,21 +34,21 @@ public void testListWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); EntityTimelineResponse response = manager.entitiesGetTimelines() - .listWithResponse("yuhoxulevp", "birhgjmphyacd", "jmpnvgkxs", + .listWithResponse("vhcgtctnqdcg", "bkceb", "rtputmtjsklkw", new EntityTimelineParameters() - .withKinds(Arrays.asList(EntityTimelineKind.SECURITY_ALERT, EntityTimelineKind.BOOKMARK, - EntityTimelineKind.BOOKMARK, EntityTimelineKind.BOOKMARK)) - .withStartTime(OffsetDateTime.parse("2021-03-01T00:07:04Z")) - .withEndTime(OffsetDateTime.parse("2021-08-01T22:45:02Z")) - .withNumberOfBucket(1992312292), + .withKinds(Arrays.asList(EntityTimelineKind.SECURITY_ALERT, EntityTimelineKind.ANOMALY, + EntityTimelineKind.SECURITY_ALERT, EntityTimelineKind.BOOKMARK)) + .withStartTime(OffsetDateTime.parse("2021-03-20T01:04:34Z")) + .withEndTime(OffsetDateTime.parse("2021-03-04T17:12:22Z")) + .withNumberOfBucket(1958960939), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(1819451335, response.metaData().totalCount()); - Assertions.assertEquals(2113245920, response.metaData().aggregations().get(0).count()); - Assertions.assertEquals(EntityTimelineKind.ANOMALY, response.metaData().aggregations().get(0).kind()); + Assertions.assertEquals(1314215082, response.metaData().totalCount()); + Assertions.assertEquals(229496652, response.metaData().aggregations().get(0).count()); + Assertions.assertEquals(EntityTimelineKind.ACTIVITY, response.metaData().aggregations().get(0).kind()); Assertions.assertEquals(EntityTimelineKind.SECURITY_ALERT, response.metaData().errors().get(0).kind()); - Assertions.assertEquals("jeitkfhzvscndb", response.metaData().errors().get(0).queryId()); - Assertions.assertEquals("lscokafaqqipv", response.metaData().errors().get(0).errorMessage()); + Assertions.assertEquals("j", response.metaData().errors().get(0).queryId()); + Assertions.assertEquals("emrfqjh", response.metaData().errors().get(0).errorMessage()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java index 88e6e3dd9be5..a7394dc94693 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntitiesRelationsListMockTests.java @@ -22,7 +22,7 @@ public final class EntitiesRelationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"vwrc\",\"relatedResourceName\":\"hllmblls\",\"relatedResourceType\":\"fdrimoopfr\",\"relatedResourceKind\":\"jjrhxornuoqpob\"},\"etag\":\"rsdx\",\"id\":\"mq\",\"name\":\"vxbqyavcxj\",\"type\":\"lseoixqp\"}]}"; + = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"w\",\"relatedResourceName\":\"evxbqyavcxjols\",\"relatedResourceType\":\"i\",\"relatedResourceKind\":\"pnms\"},\"etag\":\"ntakr\",\"id\":\"ku\",\"name\":\"fsuwcmzpwkca\",\"type\":\"fq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.entitiesRelations() - .list("gvjmllzykalbaumm", "dwqiucpj", "r", "bssjtjwzelx", "ftt", 1897092555, "ylvrofhhitjhh", + .list("vrofhhit", "hhuavwrcuahl", "mblls", "kfdrimoopf", "dfjjrhxornuoq", 2035794154, "bwarsd", com.azure.core.util.Context.NONE); - Assertions.assertEquals("rsdx", response.iterator().next().etag()); - Assertions.assertEquals("vwrc", response.iterator().next().relatedResourceId()); + Assertions.assertEquals("ntakr", response.iterator().next().etag()); + Assertions.assertEquals("w", response.iterator().next().relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java index bd7eac473a5b..13283ecaa257 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/EntityRelationsGetRelationWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class EntityRelationsGetRelationWithResponseMockTests { @Test public void testGetRelationWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"relatedResourceId\":\"qjrytymfnojjh\",\"relatedResourceName\":\"nthjqgovviv\",\"relatedResourceType\":\"xytrafettwytavp\",\"relatedResourceKind\":\"lgyql\"},\"etag\":\"lgspy\",\"id\":\"apnhhvp\",\"name\":\"ukourqviyf\",\"type\":\"segwez\"}"; + = "{\"properties\":{\"relatedResourceId\":\"yb\",\"relatedResourceName\":\"bhmpmeglolpotclm\",\"relatedResourceType\":\"pqjryty\",\"relatedResourceKind\":\"no\"},\"etag\":\"ht\",\"id\":\"thjqgovvivlr\",\"name\":\"y\",\"type\":\"rafet\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,10 @@ public void testGetRelationWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Relation response = manager.entityRelations() - .getRelationWithResponse("iznnnadn", "isbpxlserq", "xnhfcccdutxybnjb", "mpmeglolpotclmb", - com.azure.core.util.Context.NONE) + .getRelationWithResponse("adnpi", "bpxlserqgxnhfc", "c", "u", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("lgspy", response.etag()); - Assertions.assertEquals("qjrytymfnojjh", response.relatedResourceId()); + Assertions.assertEquals("ht", response.etag()); + Assertions.assertEquals("yb", response.relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java index b92f610977bf..5d3178991a99 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetRecommendationsListMockTests.java @@ -23,7 +23,7 @@ public final class GetRecommendationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"recommendationTypeId\":\"fjdiwzgwmumuc\",\"state\":\"Dismissed\",\"title\":\"q\",\"description\":\"hscvaqdxge\",\"creationTimeUtc\":\"2021-09-05T11:29:27Z\",\"lastEvaluatedTimeUtc\":\"2021-03-05T04:37:39Z\",\"lastModifiedTimeUtc\":\"2021-07-06T04:43:57Z\",\"suggestions\":[{\"suggestionTypeId\":\"tqkgavgoullxpayl\",\"title\":\"rast\",\"description\":\"kskkziebm\",\"action\":\"yodfmp\",\"additionalProperties\":{\"txbrdbwwqtxpfo\":\"x\",\"rlkdoukqscmdsjg\":\"rfvhbbnoevk\",\"lgu\":\"ws\"}},{\"suggestionTypeId\":\"peqlhhmbyfacexp\",\"title\":\"pqykicesqpvmoxil\",\"description\":\"pkqiqs\",\"action\":\"iubemxmuygmr\",\"additionalProperties\":{\"yngm\":\"bngcafmophtkyzsg\",\"g\":\"wvcnv\",\"roqxrvycjdni\":\"xqhysuapdns\"}}],\"resourceId\":\"ggyxmpmsacbamto\",\"additionalProperties\":{\"gz\":\"amoyxdigk\",\"fiottdawgkaohh\":\"ylqhqeosxdsxil\"}},\"etag\":\"tyhypi\",\"id\":\"jjjfcysk\",\"name\":\"nkkxoicb\",\"type\":\"smfvltbocqhv\"}]}"; + = "{\"value\":[{\"properties\":{\"recommendationTypeId\":\"b\",\"state\":\"CompletedByUser\",\"title\":\"stqwnpegoupdq\",\"description\":\"flvdfaqcql\",\"creationTimeUtc\":\"2021-07-17T17:47:44Z\",\"lastEvaluatedTimeUtc\":\"2020-12-22T05:27:09Z\",\"lastModifiedTimeUtc\":\"2021-07-14T12:48:04Z\",\"suggestions\":[{\"suggestionTypeId\":\"ekzyebpatwbbfjdf\",\"title\":\"hnwo\",\"description\":\"lcahhfuydgdhit\",\"action\":\"v\",\"additionalProperties\":{\"vibp\":\"uspzl\",\"efepwkhruzzwgbb\":\"uzeeb\"}},{\"suggestionTypeId\":\"zivfoyqv\",\"title\":\"lhsxeasxs\",\"description\":\"quvvsc\",\"action\":\"pkmohd\",\"additionalProperties\":{\"uzvmorsyirf\":\"rqyib\"}},{\"suggestionTypeId\":\"xazuboigorwpbbjz\",\"title\":\"vaqoilgkznn\",\"description\":\"pvjwegoviceqyraj\",\"action\":\"vvsaatyyp\",\"additionalProperties\":{\"azztvotf\":\"azcchvwwc\"}}],\"resourceId\":\"ayfxkfgx\",\"additionalProperties\":{\"zcmfmyn\":\"zliguwqo\",\"kadmwtivs\":\"jigjc\"}},\"etag\":\"ewpnpu\",\"id\":\"vjbnhbxvvuf\",\"name\":\"ukjuo\",\"type\":\"ajqnsrcqd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,26 +33,26 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.getRecommendations().list("eratvpkg", "wrmujizdmh", com.azure.core.util.Context.NONE); + = manager.getRecommendations().list("ecffb", "q", com.azure.core.util.Context.NONE); - Assertions.assertEquals("tyhypi", response.iterator().next().etag()); - Assertions.assertEquals("fjdiwzgwmumuc", response.iterator().next().recommendationTypeId()); - Assertions.assertEquals(State.DISMISSED, response.iterator().next().state()); - Assertions.assertEquals("q", response.iterator().next().title()); - Assertions.assertEquals("hscvaqdxge", response.iterator().next().description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T11:29:27Z"), + Assertions.assertEquals("ewpnpu", response.iterator().next().etag()); + Assertions.assertEquals("b", response.iterator().next().recommendationTypeId()); + Assertions.assertEquals(State.COMPLETED_BY_USER, response.iterator().next().state()); + Assertions.assertEquals("stqwnpegoupdq", response.iterator().next().title()); + Assertions.assertEquals("flvdfaqcql", response.iterator().next().description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T17:47:44Z"), response.iterator().next().creationTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T04:37:39Z"), + Assertions.assertEquals(OffsetDateTime.parse("2020-12-22T05:27:09Z"), response.iterator().next().lastEvaluatedTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T04:43:57Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-14T12:48:04Z"), response.iterator().next().lastModifiedTimeUtc()); - Assertions.assertEquals("tqkgavgoullxpayl", response.iterator().next().suggestions().get(0).suggestionTypeId()); - Assertions.assertEquals("rast", response.iterator().next().suggestions().get(0).title()); - Assertions.assertEquals("kskkziebm", response.iterator().next().suggestions().get(0).description()); - Assertions.assertEquals("yodfmp", response.iterator().next().suggestions().get(0).action()); - Assertions.assertEquals("x", - response.iterator().next().suggestions().get(0).additionalProperties().get("txbrdbwwqtxpfo")); - Assertions.assertEquals("ggyxmpmsacbamto", response.iterator().next().resourceId()); - Assertions.assertEquals("amoyxdigk", response.iterator().next().additionalProperties().get("gz")); + Assertions.assertEquals("ekzyebpatwbbfjdf", response.iterator().next().suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("hnwo", response.iterator().next().suggestions().get(0).title()); + Assertions.assertEquals("lcahhfuydgdhit", response.iterator().next().suggestions().get(0).description()); + Assertions.assertEquals("v", response.iterator().next().suggestions().get(0).action()); + Assertions.assertEquals("uspzl", + response.iterator().next().suggestions().get(0).additionalProperties().get("vibp")); + Assertions.assertEquals("ayfxkfgx", response.iterator().next().resourceId()); + Assertions.assertEquals("zliguwqo", response.iterator().next().additionalProperties().get("zcmfmyn")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java index 59b9e0a916e8..f65089f9c3d6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetTriggeredAnalyticsRuleRunsListMockTests.java @@ -22,7 +22,7 @@ public final class GetTriggeredAnalyticsRuleRunsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"executionTimeUtc\":\"2021-02-10T02:35:16Z\",\"ruleId\":\"vzqhv\",\"triggeredAnalyticsRuleRunId\":\"jdsnv\",\"provisioningState\":\"Canceled\",\"ruleRunAdditionalData\":{\"ozjrc\":\"\\\"dataani\\\"\"}},\"etag\":\"qugjalmzpfylq\",\"id\":\"wwvzn\",\"name\":\"dxcizropzgjle\",\"type\":\"cf\"}]}"; + = "{\"value\":[{\"properties\":{\"executionTimeUtc\":\"2021-03-04T06:39:50Z\",\"ruleId\":\"q\",\"triggeredAnalyticsRuleRunId\":\"kdl\",\"provisioningState\":\"Canceled\",\"ruleRunAdditionalData\":{\"mksfejzmyvlbz\":\"\\\"datamkc\\\"\",\"xzpdnb\":\"\\\"datan\\\"\",\"kjfkaoe\":\"\\\"dataovhddvtnbtvl\\\"\",\"vyxyrykn\":\"\\\"dataimyizdglzzaufin\\\"\"}},\"etag\":\"tjgpyvjgsjyjnhwb\",\"id\":\"wrncxw\",\"name\":\"uerrvpam\",\"type\":\"piniopbfkmfbru\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,13 +31,13 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.getTriggeredAnalyticsRuleRuns().list("moramsh", "vkuq", com.azure.core.util.Context.NONE); + PagedIterable response = manager.getTriggeredAnalyticsRuleRuns() + .list("obovexsnm", "whbmujlsztp", com.azure.core.util.Context.NONE); - Assertions.assertEquals("qugjalmzpfylq", response.iterator().next().etag()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T02:35:16Z"), + Assertions.assertEquals("tjgpyvjgsjyjnhwb", response.iterator().next().etag()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T06:39:50Z"), response.iterator().next().executionTimeUtc()); - Assertions.assertEquals("vzqhv", response.iterator().next().ruleId()); - Assertions.assertEquals("jdsnv", response.iterator().next().triggeredAnalyticsRuleRunId()); + Assertions.assertEquals("q", response.iterator().next().ruleId()); + Assertions.assertEquals("kdl", response.iterator().next().triggeredAnalyticsRuleRunId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java index b5bce29e9c8e..d0c9a0a42d86 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/GetsSingleRecommendationWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class GetsSingleRecommendationWithResponseMockTests { @Test public void testSingleRecommendationWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"recommendationTypeId\":\"wjrs\",\"state\":\"Dismissed\",\"title\":\"rykkhxawohs\",\"description\":\"e\",\"creationTimeUtc\":\"2021-04-14T11:58:22Z\",\"lastEvaluatedTimeUtc\":\"2021-05-10T22:32:39Z\",\"lastModifiedTimeUtc\":\"2021-06-25T05:05:03Z\",\"suggestions\":[{\"suggestionTypeId\":\"lweyzvrixcv\",\"title\":\"serltlhc\",\"description\":\"gjuopvkrmspksf\",\"action\":\"dmbxfy\",\"additionalProperties\":{\"xgoxsveiu\":\"iqvhfyv\",\"vygttd\":\"uxwnojvcrgqmbn\",\"ngguucp\":\"fjalpsycvcksz\",\"wffthbziieo\":\"tsxnu\"}}],\"resourceId\":\"bccccrauabdevj\",\"additionalProperties\":{\"bksvvyvoibvvuqwl\":\"cdxqgsteek\"}},\"etag\":\"zpyukrwvvhcgtc\",\"id\":\"qdcgobkcebzrtput\",\"name\":\"tjsk\",\"type\":\"kwtnqqiqckm\"}"; + = "{\"properties\":{\"recommendationTypeId\":\"ltlftraylxz\",\"state\":\"InProgress\",\"title\":\"jpu\",\"description\":\"baogfwbkxdha\",\"creationTimeUtc\":\"2021-01-08T23:47:25Z\",\"lastEvaluatedTimeUtc\":\"2021-11-11T02:46:54Z\",\"lastModifiedTimeUtc\":\"2021-05-26T06:41:16Z\",\"suggestions\":[{\"suggestionTypeId\":\"qsmlbzi\",\"title\":\"pdatvndvwwejvqpw\",\"description\":\"r\",\"action\":\"oqwmhcpujygntx\",\"additionalProperties\":{\"socfxlrzjjffl\":\"bssqthcywyoqxp\",\"ljf\":\"zm\",\"ygnepj\":\"ulwlze\",\"yxjqranpztla\":\"uxqdrph\"}}],\"resourceId\":\"pfzsf\",\"additionalProperties\":{\"cavk\":\"apbrwviovvyhso\"}},\"etag\":\"y\",\"id\":\"gzwedfteratvpkga\",\"name\":\"rmujizd\",\"type\":\"hepfjdiwzg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,23 +32,25 @@ public void testSingleRecommendationWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Recommendation response = manager.gets() - .singleRecommendationWithResponse("nootcyyupa", "d", "odhnzkmjoyby", com.azure.core.util.Context.NONE) + .singleRecommendationWithResponse("wlezbfgullq", "cijyxcmqcggksror", "ejfhar", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zpyukrwvvhcgtc", response.etag()); - Assertions.assertEquals("wjrs", response.recommendationTypeId()); - Assertions.assertEquals(State.DISMISSED, response.state()); - Assertions.assertEquals("rykkhxawohs", response.title()); - Assertions.assertEquals("e", response.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-14T11:58:22Z"), response.creationTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T22:32:39Z"), response.lastEvaluatedTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T05:05:03Z"), response.lastModifiedTimeUtc()); - Assertions.assertEquals("lweyzvrixcv", response.suggestions().get(0).suggestionTypeId()); - Assertions.assertEquals("serltlhc", response.suggestions().get(0).title()); - Assertions.assertEquals("gjuopvkrmspksf", response.suggestions().get(0).description()); - Assertions.assertEquals("dmbxfy", response.suggestions().get(0).action()); - Assertions.assertEquals("iqvhfyv", response.suggestions().get(0).additionalProperties().get("xgoxsveiu")); - Assertions.assertEquals("bccccrauabdevj", response.resourceId()); - Assertions.assertEquals("cdxqgsteek", response.additionalProperties().get("bksvvyvoibvvuqwl")); + Assertions.assertEquals("y", response.etag()); + Assertions.assertEquals("ltlftraylxz", response.recommendationTypeId()); + Assertions.assertEquals(State.IN_PROGRESS, response.state()); + Assertions.assertEquals("jpu", response.title()); + Assertions.assertEquals("baogfwbkxdha", response.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-08T23:47:25Z"), response.creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-11T02:46:54Z"), response.lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-26T06:41:16Z"), response.lastModifiedTimeUtc()); + Assertions.assertEquals("qsmlbzi", response.suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("pdatvndvwwejvqpw", response.suggestions().get(0).title()); + Assertions.assertEquals("r", response.suggestions().get(0).description()); + Assertions.assertEquals("oqwmhcpujygntx", response.suggestions().get(0).action()); + Assertions.assertEquals("bssqthcywyoqxp", + response.suggestions().get(0).additionalProperties().get("socfxlrzjjffl")); + Assertions.assertEquals("pfzsf", response.resourceId()); + Assertions.assertEquals("apbrwviovvyhso", response.additionalProperties().get("cavk")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java index 96c7d3955934..960766345d0b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsCreateOrUpdateWithResponseMockTests.java @@ -10,7 +10,6 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.securityinsights.SecurityInsightsManager; -import com.azure.resourcemanager.securityinsights.fluent.models.RelationInner; import com.azure.resourcemanager.securityinsights.models.Relation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -22,7 +21,7 @@ public final class IncidentRelationsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"relatedResourceId\":\"defmebpalzpy\",\"relatedResourceName\":\"gwmrzrhcf\",\"relatedResourceType\":\"vmptnrzilvc\",\"relatedResourceKind\":\"dazw\"},\"etag\":\"goravovqpn\",\"id\":\"ufvggv\",\"name\":\"gmezf\",\"type\":\"elfxlbkbhjdkqf\"}"; + = "{\"properties\":{\"relatedResourceId\":\"anbadk\",\"relatedResourceName\":\"qctupl\",\"relatedResourceType\":\"jexqnrnzlalu\",\"relatedResourceKind\":\"eftrbxoma\"},\"etag\":\"varfqverxelquqze\",\"id\":\"vjmllzykalbaum\",\"name\":\"ddwqiucpjprtbs\",\"type\":\"jtjwzelxrfttdby\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,12 +31,13 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Relation response = manager.incidentRelations() - .createOrUpdateWithResponse("askrgoo", "fhpyuegdynydd", "jlizlzxh", "cuglgmfznholaf", - new RelationInner().withEtag("elxrfnp").withRelatedResourceId("jwawlkqmznk"), - com.azure.core.util.Context.NONE) - .getValue(); + .define("ynkihbfix") + .withExistingIncident("jdkqfjzgy", "j", "makhga") + .withEtag("tudwchsrps") + .withRelatedResourceId("towjzoopzaenl") + .create(); - Assertions.assertEquals("goravovqpn", response.etag()); - Assertions.assertEquals("defmebpalzpy", response.relatedResourceId()); + Assertions.assertEquals("varfqverxelquqze", response.etag()); + Assertions.assertEquals("anbadk", response.relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java index 47775de82b72..7d3fe388881d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsDeleteWithResponseMockTests.java @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.incidentRelations() - .deleteWithResponse("zgyzjtmakh", "atynkihbfixybtow", "zoopzaenlzjx", "tgduwun", + .deleteWithResponse("askrgoo", "fhpyuegdynydd", "jlizlzxh", "cuglgmfznholaf", com.azure.core.util.Context.NONE); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java index 6804d82c9cb6..39d346a7b45d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentRelationsListMockTests.java @@ -22,7 +22,7 @@ public final class IncidentRelationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"wupciokdrjd\",\"relatedResourceName\":\"fnqanba\",\"relatedResourceType\":\"zpqctuplpkj\",\"relatedResourceKind\":\"qnrnzla\"},\"etag\":\"goeftrbxomaa\",\"id\":\"arf\",\"name\":\"verxelq\",\"type\":\"qze\"}]}"; + = "{\"value\":[{\"properties\":{\"relatedResourceId\":\"ogjiowandefmebp\",\"relatedResourceName\":\"zpyptgwm\",\"relatedResourceType\":\"rhc\",\"relatedResourceKind\":\"svmp\"},\"etag\":\"rzilvcncdazw\",\"id\":\"goravovqpn\",\"name\":\"pufvg\",\"type\":\"vfgmezfyelfxlbkb\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.incidentRelations() - .list("wva", "lfgvtczzvqzhtme", "iptudw", "h", "rpsjkq", 478857066, "bjuakt", + .list("sjwawl", "qmznkcwiok", "yk", "vxmobnehbb", "htcoelx", 897815683, "npxumgnjmskuv", com.azure.core.util.Context.NONE); - Assertions.assertEquals("goeftrbxomaa", response.iterator().next().etag()); - Assertions.assertEquals("wupciokdrjd", response.iterator().next().relatedResourceId()); + Assertions.assertEquals("rzilvcncdazw", response.iterator().next().etag()); + Assertions.assertEquals("ogjiowandefmebp", response.iterator().next().relatedResourceId()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java index ed2ebe596143..7eaacf7e26d1 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksCreateOrUpdateWithResponseMockTests.java @@ -23,7 +23,7 @@ public final class IncidentTasksCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"title\":\"lqwkddgep\",\"description\":\"ambzfxgshaq\",\"status\":\"New\",\"createdTimeUtc\":\"2021-09-12T08:50:16Z\",\"lastModifiedTimeUtc\":\"2021-02-25T03:35:03Z\",\"createdBy\":{\"email\":\"gzmyxsoxqarjt\",\"name\":\"lllmtiyguuhylzbd\",\"objectId\":\"tdohjxfqyyu\",\"userPrincipalName\":\"ilxzn\"},\"lastModifiedBy\":{\"email\":\"ttkkicxjxueilixz\",\"name\":\"kqjrbbl\",\"objectId\":\"mxxxpnk\",\"userPrincipalName\":\"ljnkmsfsquxxqcim\"}},\"etag\":\"hvkjwriva\",\"id\":\"smrtepsybdg\",\"name\":\"foz\",\"type\":\"sfjdcokb\"}"; + = "{\"properties\":{\"title\":\"xaodbhgxbadbor\",\"description\":\"mihggvyhqwyxb\",\"status\":\"New\",\"createdTimeUtc\":\"2021-05-01T04:18:11Z\",\"lastModifiedTimeUtc\":\"2021-01-31T01:11:52Z\",\"createdBy\":{\"email\":\"slgxifkd\",\"name\":\"lqwkddgep\",\"objectId\":\"ambzfxgshaq\",\"userPrincipalName\":\"eqfniag\"},\"lastModifiedBy\":{\"email\":\"xsoxqarjt\",\"name\":\"lllmtiyguuhylzbd\",\"objectId\":\"tdohjxfqyyu\",\"userPrincipalName\":\"ilxzn\"}},\"etag\":\"bttk\",\"id\":\"cxjxueilixzjvkqj\",\"name\":\"bblh\",\"type\":\"mxxxpnk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,33 +33,33 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IncidentTask response = manager.incidentTasks() - .define("hkpko") - .withExistingIncident("vmrnwgeajyifei", "riomjdnkn", "tlxrdepqtz") - .withTitle("o") - .withStatus(IncidentTaskStatus.COMPLETED) - .withEtag("qo") - .withDescription("nobuwhutvcdtgx") - .withCreatedBy(new ClientInfo().withEmail("zxpsrlbppjq") - .withName("cpdaoskgtalljsoa") - .withObjectId("jjklmpbgrosxfdx") - .withUserPrincipalName("b")) - .withLastModifiedBy(new ClientInfo().withEmail("bhluvdc") - .withName("uevnomzlre") - .withObjectId("dskie") - .withUserPrincipalName("aenalepta")) + .define("n") + .withExistingIncident("zynxbuvyglfyfcs", "kjhoxtbsyb", "efojpnixdgqjkfvm") + .withTitle("geajyifeiiri") + .withStatus(IncidentTaskStatus.NEW) + .withEtag("evnom") + .withDescription("jdnknbt") + .withCreatedBy(new ClientInfo().withEmail("zzhkpko") + .withName("vfno") + .withObjectId("whutvcdtgxsyfuh") + .withUserPrincipalName("mzxpsrlbppjqcwc")) + .withLastModifiedBy(new ClientInfo().withEmail("oskgtall") + .withName("oasxjjklm") + .withObjectId("grosxfdxrc") + .withUserPrincipalName("mbbhluvdce")) .create(); - Assertions.assertEquals("hvkjwriva", response.etag()); - Assertions.assertEquals("lqwkddgep", response.title()); - Assertions.assertEquals("ambzfxgshaq", response.description()); + Assertions.assertEquals("bttk", response.etag()); + Assertions.assertEquals("xaodbhgxbadbor", response.title()); + Assertions.assertEquals("mihggvyhqwyxb", response.description()); Assertions.assertEquals(IncidentTaskStatus.NEW, response.status()); - Assertions.assertEquals("gzmyxsoxqarjt", response.createdBy().email()); - Assertions.assertEquals("lllmtiyguuhylzbd", response.createdBy().name()); - Assertions.assertEquals("tdohjxfqyyu", response.createdBy().objectId()); - Assertions.assertEquals("ilxzn", response.createdBy().userPrincipalName()); - Assertions.assertEquals("ttkkicxjxueilixz", response.lastModifiedBy().email()); - Assertions.assertEquals("kqjrbbl", response.lastModifiedBy().name()); - Assertions.assertEquals("mxxxpnk", response.lastModifiedBy().objectId()); - Assertions.assertEquals("ljnkmsfsquxxqcim", response.lastModifiedBy().userPrincipalName()); + Assertions.assertEquals("slgxifkd", response.createdBy().email()); + Assertions.assertEquals("lqwkddgep", response.createdBy().name()); + Assertions.assertEquals("ambzfxgshaq", response.createdBy().objectId()); + Assertions.assertEquals("eqfniag", response.createdBy().userPrincipalName()); + Assertions.assertEquals("xsoxqarjt", response.lastModifiedBy().email()); + Assertions.assertEquals("lllmtiyguuhylzbd", response.lastModifiedBy().name()); + Assertions.assertEquals("tdohjxfqyyu", response.lastModifiedBy().objectId()); + Assertions.assertEquals("ilxzn", response.lastModifiedBy().userPrincipalName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java index f7ae5091e9ba..81b1a267a403 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksDeleteWithResponseMockTests.java @@ -28,8 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.incidentTasks() - .deleteWithResponse("bpqghxdp", "ihfimlyxdmix", "udbiacuqouc", "fuvuslvbuj", - com.azure.core.util.Context.NONE); + .deleteWithResponse("u", "de", "bpqghxdp", "ihfimlyxdmix", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java index 6355581d0508..b16652af13ef 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksGetWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class IncidentTasksGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"title\":\"jckakikkkajmnvb\",\"description\":\"mnkrqdyc\",\"status\":\"New\",\"createdTimeUtc\":\"2021-03-27T03:11:33Z\",\"lastModifiedTimeUtc\":\"2021-02-07T05:27:50Z\",\"createdBy\":{\"email\":\"klqr\",\"name\":\"cg\",\"objectId\":\"adaypxeqedftkigm\",\"userPrincipalName\":\"kt\"},\"lastModifiedBy\":{\"email\":\"yvzixmusiidiv\",\"name\":\"rtzfli\",\"objectId\":\"tnoegxoqpuc\",\"userPrincipalName\":\"dytwdaiexisa\"}},\"etag\":\"giiouka\",\"id\":\"zzfgivfiy\",\"name\":\"fvwyzjsix\",\"type\":\"rvigrxmptufde\"}"; + = "{\"properties\":{\"title\":\"urqviyfksegwezgf\",\"description\":\"ujtcpdtdz\",\"status\":\"New\",\"createdTimeUtc\":\"2021-03-03T11:47:10Z\",\"lastModifiedTimeUtc\":\"2021-04-09T12:25:33Z\",\"createdBy\":{\"email\":\"jckakikkkajmnvb\",\"name\":\"mnkrqdyc\",\"objectId\":\"bgkxxpklq\",\"userPrincipalName\":\"bcgsa\"},\"lastModifiedBy\":{\"email\":\"ypxeqedftkig\",\"name\":\"n\",\"objectId\":\"tvzyvzixmusiidi\",\"userPrincipalName\":\"brtzfliqntnoeg\"}},\"etag\":\"qpuclid\",\"id\":\"wdaiexisapygii\",\"name\":\"ukaffzzfgivfiypf\",\"type\":\"wyzjsixorvigrxmp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,20 +32,20 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); IncidentTask response = manager.incidentTasks() - .getWithResponse("fq", "ujtcpdtdz", "y", "gzba", com.azure.core.util.Context.NONE) + .getWithResponse("wyt", "vpiilgy", "luolgspyqsapnh", "vpbuk", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("giiouka", response.etag()); - Assertions.assertEquals("jckakikkkajmnvb", response.title()); - Assertions.assertEquals("mnkrqdyc", response.description()); + Assertions.assertEquals("qpuclid", response.etag()); + Assertions.assertEquals("urqviyfksegwezgf", response.title()); + Assertions.assertEquals("ujtcpdtdz", response.description()); Assertions.assertEquals(IncidentTaskStatus.NEW, response.status()); - Assertions.assertEquals("klqr", response.createdBy().email()); - Assertions.assertEquals("cg", response.createdBy().name()); - Assertions.assertEquals("adaypxeqedftkigm", response.createdBy().objectId()); - Assertions.assertEquals("kt", response.createdBy().userPrincipalName()); - Assertions.assertEquals("yvzixmusiidiv", response.lastModifiedBy().email()); - Assertions.assertEquals("rtzfli", response.lastModifiedBy().name()); - Assertions.assertEquals("tnoegxoqpuc", response.lastModifiedBy().objectId()); - Assertions.assertEquals("dytwdaiexisa", response.lastModifiedBy().userPrincipalName()); + Assertions.assertEquals("jckakikkkajmnvb", response.createdBy().email()); + Assertions.assertEquals("mnkrqdyc", response.createdBy().name()); + Assertions.assertEquals("bgkxxpklq", response.createdBy().objectId()); + Assertions.assertEquals("bcgsa", response.createdBy().userPrincipalName()); + Assertions.assertEquals("ypxeqedftkig", response.lastModifiedBy().email()); + Assertions.assertEquals("n", response.lastModifiedBy().name()); + Assertions.assertEquals("tvzyvzixmusiidi", response.lastModifiedBy().objectId()); + Assertions.assertEquals("brtzfliqntnoeg", response.lastModifiedBy().userPrincipalName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java index fb9ac8367a00..4c128f1ca6e6 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/IncidentTasksListMockTests.java @@ -23,7 +23,7 @@ public final class IncidentTasksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"title\":\"xw\",\"description\":\"thivapuaxosw\",\"status\":\"Completed\",\"createdTimeUtc\":\"2021-08-11T03:49:35Z\",\"lastModifiedTimeUtc\":\"2021-06-17T16:33:55Z\",\"createdBy\":{\"email\":\"gkcnpdkwerxfezl\",\"name\":\"sekvsuzyo\",\"objectId\":\"af\",\"userPrincipalName\":\"fr\"},\"lastModifiedBy\":{\"email\":\"v\",\"name\":\"pltnyyeyj\",\"objectId\":\"fpbxnretpg\",\"userPrincipalName\":\"tohruqtximrxeyz\"}},\"etag\":\"nxb\",\"id\":\"yglfyfcsbkjhoxtb\",\"name\":\"ybpefojpnix\",\"type\":\"gqjk\"}]}"; + = "{\"value\":[{\"properties\":{\"title\":\"wdsthktsaljk\",\"description\":\"pgtpgxkkoyp\",\"status\":\"New\",\"createdTimeUtc\":\"2021-12-07T14:48:53Z\",\"lastModifiedTimeUtc\":\"2021-06-30T07:27:21Z\",\"createdBy\":{\"email\":\"a\",\"name\":\"axoswqw\",\"objectId\":\"lrzlgk\",\"userPrincipalName\":\"pd\"},\"lastModifiedBy\":{\"email\":\"rxfezlmzse\",\"name\":\"su\",\"objectId\":\"owrafvofre\",\"userPrincipalName\":\"v\"}},\"etag\":\"pltnyyeyj\",\"id\":\"fpbxnretpg\",\"name\":\"xtoh\",\"type\":\"uqtximrxey\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,19 +33,19 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.incidentTasks() - .list("pnzijpyyvecruhqy", "wdsthktsaljk", "lpgtpgxkkoy", com.azure.core.util.Context.NONE); + .list("udbiacuqouc", "fuvuslvbuj", "pnzijpyyvecruhqy", com.azure.core.util.Context.NONE); - Assertions.assertEquals("nxb", response.iterator().next().etag()); - Assertions.assertEquals("xw", response.iterator().next().title()); - Assertions.assertEquals("thivapuaxosw", response.iterator().next().description()); - Assertions.assertEquals(IncidentTaskStatus.COMPLETED, response.iterator().next().status()); - Assertions.assertEquals("gkcnpdkwerxfezl", response.iterator().next().createdBy().email()); - Assertions.assertEquals("sekvsuzyo", response.iterator().next().createdBy().name()); - Assertions.assertEquals("af", response.iterator().next().createdBy().objectId()); - Assertions.assertEquals("fr", response.iterator().next().createdBy().userPrincipalName()); - Assertions.assertEquals("v", response.iterator().next().lastModifiedBy().email()); - Assertions.assertEquals("pltnyyeyj", response.iterator().next().lastModifiedBy().name()); - Assertions.assertEquals("fpbxnretpg", response.iterator().next().lastModifiedBy().objectId()); - Assertions.assertEquals("tohruqtximrxeyz", response.iterator().next().lastModifiedBy().userPrincipalName()); + Assertions.assertEquals("pltnyyeyj", response.iterator().next().etag()); + Assertions.assertEquals("wdsthktsaljk", response.iterator().next().title()); + Assertions.assertEquals("pgtpgxkkoyp", response.iterator().next().description()); + Assertions.assertEquals(IncidentTaskStatus.NEW, response.iterator().next().status()); + Assertions.assertEquals("a", response.iterator().next().createdBy().email()); + Assertions.assertEquals("axoswqw", response.iterator().next().createdBy().name()); + Assertions.assertEquals("lrzlgk", response.iterator().next().createdBy().objectId()); + Assertions.assertEquals("pd", response.iterator().next().createdBy().userPrincipalName()); + Assertions.assertEquals("rxfezlmzse", response.iterator().next().lastModifiedBy().email()); + Assertions.assertEquals("su", response.iterator().next().lastModifiedBy().name()); + Assertions.assertEquals("owrafvofre", response.iterator().next().lastModifiedBy().objectId()); + Assertions.assertEquals("v", response.iterator().next().lastModifiedBy().userPrincipalName()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java index 032e0655a14f..ede6cbeda268 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasCreateWithResponseMockTests.java @@ -31,7 +31,7 @@ public final class MetadatasCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"contentId\":\"plmytnhvyjz\",\"parentId\":\"erh\",\"version\":\"stiawywppq\",\"kind\":\"ujxbdyczplm\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"s\",\"sourceId\":\"wsftytpjmu\"},\"author\":{\"name\":\"nhqlzantahuykxs\",\"email\":\"mpsxmoadwiqnsm\",\"link\":\"eyjvlzqsyv\"},\"support\":{\"tier\":\"Community\",\"name\":\"eq\",\"email\":\"corkemobobxfh\",\"link\":\"tuvwzjyc\"},\"dependencies\":{\"contentId\":\"eagxikzvnghtknrw\",\"kind\":\"ResourcesDataConnector\",\"version\":\"nm\",\"name\":\"v\",\"operator\":\"OR\",\"criteria\":[{\"contentId\":\"apxwt\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"elf\",\"name\":\"ehr\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]},{\"contentId\":\"jcziytfwk\",\"kind\":\"Workbook\",\"version\":\"brdo\",\"name\":\"qahn\",\"operator\":\"AND\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"dzvuhw\"],\"verticals\":[\"azjv\",\"iiezdnezxtq\",\"dbrmyutzttroym\",\"vkkuzrvcegyz\"]},\"providers\":[\"cfuwmxezzum\",\"lro\"],\"customVersion\":\"h\",\"contentSchemaVersion\":\"spxblyokjwsszye\",\"icon\":\"oukdhnf\",\"threatAnalysisTactics\":[\"gg\",\"ihnzvoeh\",\"wgqgc\",\"kghg\"],\"threatAnalysisTechniques\":[\"xouxi\",\"dwpgmhqhvne\",\"nwxqwcxaqlymm\"],\"previewImages\":[\"netecfyusfkcwfpo\",\"flgkzgzx\",\"wvvfkqbgk\"],\"previewImagesDark\":[\"gdvllbbdfulvhpw\",\"sxygrniqnxpsebaz\",\"tyrj\",\"oqgnsfzrrapi\"]},\"etag\":\"u\",\"id\":\"qzgy\",\"name\":\"myywhfdkjykvez\",\"type\":\"o\"}"; + = "{\"properties\":{\"contentId\":\"apxwt\",\"parentId\":\"pxoelfobehr\",\"version\":\"glojjcziytf\",\"kind\":\"kvirmb\",\"source\":{\"kind\":\"Community\",\"name\":\"nqahnkmsfy\",\"sourceId\":\"kdzv\"},\"author\":{\"name\":\"senazjvyiiezdne\",\"email\":\"tqzdbrmyutztt\",\"link\":\"y\"},\"support\":{\"tier\":\"Partner\",\"name\":\"kuz\",\"email\":\"cegyztzhcfuwm\",\"link\":\"z\"},\"dependencies\":{\"contentId\":\"k\",\"kind\":\"ResourcesDataConnector\",\"version\":\"gflhhospxblyokj\",\"name\":\"szye\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"hn\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"gg\",\"name\":\"hnzvoehgwgqgc\",\"operator\":\"OR\",\"criteria\":[{},{}]},{\"contentId\":\"zjxouxigdwpgmh\",\"kind\":\"Solution\",\"version\":\"exnwxqw\",\"name\":\"aqlymmhzvnetecfy\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"fpoaflgkzgzxqwvv\",\"kind\":\"AzureFunction\",\"version\":\"gkssygdvllbbd\",\"name\":\"l\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"xygrniqnxpsebazb\",\"kind\":\"Playbook\",\"version\":\"roq\",\"name\":\"sfzrrapimtuojqz\",\"operator\":\"OR\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"fdkjykvezso\",\"tzd\",\"z\",\"bmzldplamccql\"],\"verticals\":[\"veqleozqqwiawb\",\"zyvbu\",\"fhysatoplqcujsrl\"]},\"providers\":[\"qkprf\",\"ocowtoqfwbsbko\",\"bdssjhwhfcxwrjbr\"],\"customVersion\":\"etttul\",\"contentSchemaVersion\":\"ajb\",\"icon\":\"spfgmosiskihfsl\",\"threatAnalysisTactics\":[\"jzgmxqa\",\"pypxg\",\"ypokoo\"],\"threatAnalysisTechniques\":[\"ysnozjnlfucmhon\"],\"previewImages\":[\"seuqxelmmxwmp\",\"iyc\"],\"previewImagesDark\":[\"swe\",\"kfofyfw\",\"u\",\"wpcutzlvx\"]},\"etag\":\"lvedzrjkrpormvdd\",\"id\":\"o\",\"name\":\"rdglk\",\"type\":\"gcxmkrldfoidyhcw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -41,99 +41,91 @@ public void testCreateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MetadataModel response = manager.metadatas() - .define("nc") - .withExistingWorkspace("vgyafttbetzydt", "p") - .withEtag("jplk") - .withContentId("oybjkuokajkyrh") - .withParentId("cbfkaql") - .withVersion("zpteron") - .withKind("qaktao") - .withSource(new MetadataSource().withKind(SourceKind.SOLUTION) - .withName("fobcqvzmywvsyns") - .withSourceId("mosqvojgolmkklz")) - .withAuthor(new MetadataAuthor().withName("uvnclntaoidjhoy").withEmail("tyvrn").withLink("kiree")) - .withSupport(new MetadataSupport().withTier(SupportTier.PARTNER) - .withName("izafdgjhnuvndg") - .withEmail("l") - .withLink("a")) - .withDependencies(new MetadataDependencies().withContentId("ipfwl") - .withKind(Kind.WATCHLIST_TEMPLATE) - .withVersion("jd") - .withName("mqteirrjjmvrzfpp") - .withOperator(MetadataDependencyOperator.AND) + .define("ql") + .withExistingWorkspace("w", "dipnd") + .withEtag("xfhtbtuvw") + .withContentId("hctbr") + .withParentId("e") + .withVersion("amoyvqfjpkezq") + .withKind("izbyczmepcacgvln") + .withSource(new MetadataSource().withKind(SourceKind.LOCAL_WORKSPACE).withName("yryrk").withSourceId("vde")) + .withAuthor(new MetadataAuthor().withName("rulnhbqtvyhs").withEmail("crff").withLink("exupcuizvx")) + .withSupport(new MetadataSupport().withTier(SupportTier.MICROSOFT) + .withName("h") + .withEmail("eotdscqkxzrfloqz") + .withLink("emliyddfqfnf")) + .withDependencies(new MetadataDependencies().withContentId("hhgwawi") + .withKind(Kind.SOLUTION) + .withVersion("vcfxdvk") + .withName("fg") + .withOperator(MetadataDependencyOperator.OR) .withCriteria(Arrays.asList( - new MetadataDependencies().withContentId("gzhnpxbuwauytqd") - .withKind(Kind.HUNTING_QUERY) - .withVersion("loafwsuaxqrok") - .withName("dipnd") + new MetadataDependencies().withContentId("xhq") + .withKind(Kind.WORKBOOK_TEMPLATE) + .withVersion("dyya") + .withName("xnepub") .withOperator(MetadataDependencyOperator.OR) - .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies())), - new MetadataDependencies().withContentId("hctbr") - .withKind(Kind.SUMMARY_RULE) - .withVersion("amoyvqfjpkezq") - .withName("zbyczm") - .withOperator(MetadataDependencyOperator.AND) .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), new MetadataDependencies(), new MetadataDependencies())), - new MetadataDependencies().withContentId("vlnpjjbyr") - .withKind(Kind.SOLUTION) - .withVersion("uvdestarul") - .withName("b") - .withOperator(MetadataDependencyOperator.AND) + new MetadataDependencies().withContentId("uytm") + .withKind(Kind.RESOURCES_DATA_CONNECTOR) + .withVersion("yqyjkmfotwmxedlc") + .withName("y") + .withOperator(MetadataDependencyOperator.OR) .withCriteria(Arrays.asList(new MetadataDependencies())), - new MetadataDependencies().withContentId("xhcrffj") - .withKind(Kind.WORKBOOK) - .withVersion("pcuizvxjsvzh") - .withName("eotdscqkxzrfloqz") + new MetadataDependencies().withContentId("oj") + .withKind(Kind.RESOURCES_DATA_CONNECTOR) + .withVersion("antlpsp") + .withName("pfgdnq") .withOperator(MetadataDependencyOperator.OR) - .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies(), - new MetadataDependencies()))))) - .withCategories(new MetadataCategories().withDomains(Arrays.asList("dfqfnftrrhhgwaw", "zhanvcf", "dvkdnf")) - .withVerticals(Arrays.asList("xultxhqqvdhdyy", "dtxnep", "bs", "infauytmqvsdyqyj"))) - .withProviders(Arrays.asList("otwmxedlcxmyxt", "bapojkn", "xantlpspi", "pfgdnq")) - .withCustomVersion("rhoqy") - .withContentSchemaVersion("d") - .withIcon("ruoduexhskh") - .withThreatAnalysisTactics(Arrays.asList("vocrddqxhegco")) - .withThreatAnalysisTechniques(Arrays.asList("zcklqrunqw")) - .withPreviewImages(Arrays.asList("kabyxxyfnipywgjg", "bsfsvay", "ejypokk", "ptnwpwskck")) - .withPreviewImagesDark(Arrays.asList("mfyxpgvqioqrebwa")) + .withCriteria(Arrays.asList(new MetadataDependencies(), new MetadataDependencies()))))) + .withCategories(new MetadataCategories() + .withDomains(Arrays.asList("yvqdvnruoduexhs", "hkqlvocr", "dqxhegcolhqz", "klq")) + .withVerticals(Arrays.asList("q", "crkkab", "xxyfnipywgjgfbsf", "vayge"))) + .withProviders(Arrays.asList("okkiptnwpwskck", "wymfy", "pgvqioq", "ebwarljplkp")) + .withCustomVersion("dreqaqvspsyve") + .withContentSchemaVersion("wtkrbscw") + .withIcon("wvwmcrhyo") + .withThreatAnalysisTactics(Arrays.asList("plmytnhvyjz", "erh")) + .withThreatAnalysisTechniques(Arrays.asList("tiawywp", "qxujxbdyczplmlj", "isxbwsftytpjm")) + .withPreviewImages(Arrays.asList("ynhqlzantahuy", "xsjympsxmoadwiq")) + .withPreviewImagesDark(Arrays.asList("pfeyjvlzq", "yvryoleqikco", "kemob")) .create(); - Assertions.assertEquals("u", response.etag()); - Assertions.assertEquals("plmytnhvyjz", response.contentId()); - Assertions.assertEquals("erh", response.parentId()); - Assertions.assertEquals("stiawywppq", response.version()); - Assertions.assertEquals("ujxbdyczplm", response.kind()); - Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, response.source().kind()); - Assertions.assertEquals("s", response.source().name()); - Assertions.assertEquals("wsftytpjmu", response.source().sourceId()); - Assertions.assertEquals("nhqlzantahuykxs", response.author().name()); - Assertions.assertEquals("mpsxmoadwiqnsm", response.author().email()); - Assertions.assertEquals("eyjvlzqsyv", response.author().link()); - Assertions.assertEquals(SupportTier.COMMUNITY, response.support().tier()); - Assertions.assertEquals("eq", response.support().name()); - Assertions.assertEquals("corkemobobxfh", response.support().email()); - Assertions.assertEquals("tuvwzjyc", response.support().link()); - Assertions.assertEquals("eagxikzvnghtknrw", response.dependencies().contentId()); + Assertions.assertEquals("lvedzrjkrpormvdd", response.etag()); + Assertions.assertEquals("apxwt", response.contentId()); + Assertions.assertEquals("pxoelfobehr", response.parentId()); + Assertions.assertEquals("glojjcziytf", response.version()); + Assertions.assertEquals("kvirmb", response.kind()); + Assertions.assertEquals(SourceKind.COMMUNITY, response.source().kind()); + Assertions.assertEquals("nqahnkmsfy", response.source().name()); + Assertions.assertEquals("kdzv", response.source().sourceId()); + Assertions.assertEquals("senazjvyiiezdne", response.author().name()); + Assertions.assertEquals("tqzdbrmyutztt", response.author().email()); + Assertions.assertEquals("y", response.author().link()); + Assertions.assertEquals(SupportTier.PARTNER, response.support().tier()); + Assertions.assertEquals("kuz", response.support().name()); + Assertions.assertEquals("cegyztzhcfuwm", response.support().email()); + Assertions.assertEquals("z", response.support().link()); + Assertions.assertEquals("k", response.dependencies().contentId()); Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, response.dependencies().kind()); - Assertions.assertEquals("nm", response.dependencies().version()); - Assertions.assertEquals("v", response.dependencies().name()); - Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().operator()); - Assertions.assertEquals("apxwt", response.dependencies().criteria().get(0).contentId()); - Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, response.dependencies().criteria().get(0).kind()); - Assertions.assertEquals("elf", response.dependencies().criteria().get(0).version()); - Assertions.assertEquals("ehr", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals("gflhhospxblyokj", response.dependencies().version()); + Assertions.assertEquals("szye", response.dependencies().name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().operator()); + Assertions.assertEquals("hn", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.ANALYTICS_RULE_TEMPLATE, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("gg", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("hnzvoehgwgqgc", response.dependencies().criteria().get(0).name()); Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); - Assertions.assertEquals("dzvuhw", response.categories().domains().get(0)); - Assertions.assertEquals("azjv", response.categories().verticals().get(0)); - Assertions.assertEquals("cfuwmxezzum", response.providers().get(0)); - Assertions.assertEquals("h", response.customVersion()); - Assertions.assertEquals("spxblyokjwsszye", response.contentSchemaVersion()); - Assertions.assertEquals("oukdhnf", response.icon()); - Assertions.assertEquals("gg", response.threatAnalysisTactics().get(0)); - Assertions.assertEquals("xouxi", response.threatAnalysisTechniques().get(0)); - Assertions.assertEquals("netecfyusfkcwfpo", response.previewImages().get(0)); - Assertions.assertEquals("gdvllbbdfulvhpw", response.previewImagesDark().get(0)); + Assertions.assertEquals("fdkjykvezso", response.categories().domains().get(0)); + Assertions.assertEquals("veqleozqqwiawb", response.categories().verticals().get(0)); + Assertions.assertEquals("qkprf", response.providers().get(0)); + Assertions.assertEquals("etttul", response.customVersion()); + Assertions.assertEquals("ajb", response.contentSchemaVersion()); + Assertions.assertEquals("spfgmosiskihfsl", response.icon()); + Assertions.assertEquals("jzgmxqa", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("ysnozjnlfucmhon", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("seuqxelmmxwmp", response.previewImages().get(0)); + Assertions.assertEquals("swe", response.previewImagesDark().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java index 08c7aec1e4d8..fec476c0fab9 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasDeleteWithResponseMockTests.java @@ -27,8 +27,7 @@ public void testDeleteWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.metadatas() - .deleteWithResponse("nimuaeokympwq", "utlzofuzthszjya", "hsliqeft", com.azure.core.util.Context.NONE); + manager.metadatas().deleteWithResponse("esisdkcuhq", "sk", "b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java index 1db3ae4a6bba..336817574b0a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasGetWithResponseMockTests.java @@ -25,7 +25,7 @@ public final class MetadatasGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"contentId\":\"gmjjprdpvblon\",\"parentId\":\"h\",\"version\":\"exwjhicuzqa\",\"kind\":\"imxnhyl\",\"source\":{\"kind\":\"Community\",\"name\":\"vl\",\"sourceId\":\"gd\"},\"author\":{\"name\":\"nhdxlfntdc\",\"email\":\"mg\",\"link\":\"zlfyxaiafe\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"kfvycvhwduoa\",\"email\":\"pzzcxku\",\"link\":\"bahcassqe\"},\"dependencies\":{\"contentId\":\"nzeyakg\",\"kind\":\"Workbook\",\"version\":\"fqmxzkicx\",\"name\":\"mqi\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"arboxaluoadmcv\",\"kind\":\"SummaryRule\",\"version\":\"pe\",\"name\":\"wevlohuahl\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"gpmmz\",\"kind\":\"Watchlist\",\"version\":\"llxcmahzylspzc\",\"name\":\"hynlbtriaecvagu\",\"operator\":\"OR\",\"criteria\":[{}]},{\"contentId\":\"yhqrasxeomjq\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"xiuhi\",\"name\":\"bhzdjvdyrzijggb\",\"operator\":\"AND\",\"criteria\":[{},{},{},{}]}]},\"categories\":{\"domains\":[\"znxzaliicrutyhm\",\"lvxilaytj\",\"wfqzwn\"],\"verticals\":[\"q\"]},\"providers\":[\"qwqng\"],\"customVersion\":\"buknvkutlszxuu\",\"contentSchemaVersion\":\"uvpbeswgkreozp\",\"icon\":\"kc\",\"threatAnalysisTactics\":[\"cbzgiklqpe\",\"cgdndpbsieymmcb\"],\"threatAnalysisTechniques\":[\"etzvqtcesvcsby\",\"mygswduzpdnb\",\"qweohmlkzhxadmau\",\"nxzr\"],\"previewImages\":[\"haerhxd\",\"hkbrkhjjbwelicrx\",\"bqmoguy\"],\"previewImagesDark\":[\"elwszqv\",\"akddxljjzdb\",\"k\"]},\"etag\":\"gw\",\"id\":\"ujshcsnk\",\"name\":\"ygpqxqevtfdvyyp\",\"type\":\"kjirvjogsalvjl\"}"; + = "{\"properties\":{\"contentId\":\"xwjhicuzqavimxnh\",\"parentId\":\"lwogtvlrbgda\",\"version\":\"nhdxlfntdc\",\"kind\":\"k\",\"source\":{\"kind\":\"LocalWorkspace\",\"name\":\"zlfyxaiafe\",\"sourceId\":\"xekfvycvhw\"},\"author\":{\"name\":\"ayapzzcxkuusbah\",\"email\":\"ssqeybdnzeyak\",\"link\":\"kohfqmxz\"},\"support\":{\"tier\":\"Community\",\"name\":\"tumqinawcta\",\"email\":\"boxaluoadmcv\",\"link\":\"jnpef\"},\"dependencies\":{\"contentId\":\"vlohuahlqmcbo\",\"kind\":\"Workbook\",\"version\":\"mzhxoy\",\"name\":\"xcmahzy\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"rhynlbtr\",\"kind\":\"Playbook\",\"version\":\"vagudrh\",\"name\":\"gyhqr\",\"operator\":\"AND\",\"criteria\":[{},{},{}]},{\"contentId\":\"jqqhbkxiu\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"bhzdjvdyrzijggb\",\"name\":\"pzgvq\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"liic\",\"kind\":\"Workbook\",\"version\":\"hmflvxilaytjyw\",\"name\":\"zwnoghqdljqw\",\"operator\":\"AND\",\"criteria\":[{},{}]},{\"contentId\":\"nbuknvku\",\"kind\":\"ResourcesDataConnector\",\"version\":\"xuuqb\",\"name\":\"pbeswgkreozpufk\",\"operator\":\"AND\",\"criteria\":[{},{},{}]}]},\"categories\":{\"domains\":[\"iklqpegcgdnd\",\"b\",\"ieymmcbiktetzv\",\"tcesvcsbyim\"],\"verticals\":[\"wduzp\",\"nbzqweohml\",\"zhxadmaua\"]},\"providers\":[\"rqtm\",\"aerhx\",\"sh\"],\"customVersion\":\"hj\",\"contentSchemaVersion\":\"welicrxbbqmoguy\",\"icon\":\"selwszqveakd\",\"threatAnalysisTactics\":[\"jjz\",\"bzkmwgwv\"],\"threatAnalysisTechniques\":[\"shc\",\"nkiygpqxqevtfdv\",\"ypjkjirvj\",\"gsa\"],\"previewImages\":[\"lhnimuae\"],\"previewImagesDark\":[\"mpwquutlzofuzths\",\"jyanhsliqe\",\"tgunropdp\"]},\"etag\":\"qsdtqzxjbxol\",\"id\":\"hquqihgibog\",\"name\":\"ojupenoupc\",\"type\":\"lxcwrszwa\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -35,43 +35,43 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MetadataModel response = manager.metadatas() - .getWithResponse("msfqntakroxku", "fsuwcmzpwkca", "fq", com.azure.core.util.Context.NONE) + .getWithResponse("zq", "mj", "prdpvblonlh", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("gw", response.etag()); - Assertions.assertEquals("gmjjprdpvblon", response.contentId()); - Assertions.assertEquals("h", response.parentId()); - Assertions.assertEquals("exwjhicuzqa", response.version()); - Assertions.assertEquals("imxnhyl", response.kind()); - Assertions.assertEquals(SourceKind.COMMUNITY, response.source().kind()); - Assertions.assertEquals("vl", response.source().name()); - Assertions.assertEquals("gd", response.source().sourceId()); - Assertions.assertEquals("nhdxlfntdc", response.author().name()); - Assertions.assertEquals("mg", response.author().email()); - Assertions.assertEquals("zlfyxaiafe", response.author().link()); - Assertions.assertEquals(SupportTier.MICROSOFT, response.support().tier()); - Assertions.assertEquals("kfvycvhwduoa", response.support().name()); - Assertions.assertEquals("pzzcxku", response.support().email()); - Assertions.assertEquals("bahcassqe", response.support().link()); - Assertions.assertEquals("nzeyakg", response.dependencies().contentId()); + Assertions.assertEquals("qsdtqzxjbxol", response.etag()); + Assertions.assertEquals("xwjhicuzqavimxnh", response.contentId()); + Assertions.assertEquals("lwogtvlrbgda", response.parentId()); + Assertions.assertEquals("nhdxlfntdc", response.version()); + Assertions.assertEquals("k", response.kind()); + Assertions.assertEquals(SourceKind.LOCAL_WORKSPACE, response.source().kind()); + Assertions.assertEquals("zlfyxaiafe", response.source().name()); + Assertions.assertEquals("xekfvycvhw", response.source().sourceId()); + Assertions.assertEquals("ayapzzcxkuusbah", response.author().name()); + Assertions.assertEquals("ssqeybdnzeyak", response.author().email()); + Assertions.assertEquals("kohfqmxz", response.author().link()); + Assertions.assertEquals(SupportTier.COMMUNITY, response.support().tier()); + Assertions.assertEquals("tumqinawcta", response.support().name()); + Assertions.assertEquals("boxaluoadmcv", response.support().email()); + Assertions.assertEquals("jnpef", response.support().link()); + Assertions.assertEquals("vlohuahlqmcbo", response.dependencies().contentId()); Assertions.assertEquals(Kind.WORKBOOK, response.dependencies().kind()); - Assertions.assertEquals("fqmxzkicx", response.dependencies().version()); - Assertions.assertEquals("mqi", response.dependencies().name()); + Assertions.assertEquals("mzhxoy", response.dependencies().version()); + Assertions.assertEquals("xcmahzy", response.dependencies().name()); Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().operator()); - Assertions.assertEquals("arboxaluoadmcv", response.dependencies().criteria().get(0).contentId()); - Assertions.assertEquals(Kind.SUMMARY_RULE, response.dependencies().criteria().get(0).kind()); - Assertions.assertEquals("pe", response.dependencies().criteria().get(0).version()); - Assertions.assertEquals("wevlohuahl", response.dependencies().criteria().get(0).name()); - Assertions.assertEquals(MetadataDependencyOperator.OR, response.dependencies().criteria().get(0).operator()); - Assertions.assertEquals("znxzaliicrutyhm", response.categories().domains().get(0)); - Assertions.assertEquals("q", response.categories().verticals().get(0)); - Assertions.assertEquals("qwqng", response.providers().get(0)); - Assertions.assertEquals("buknvkutlszxuu", response.customVersion()); - Assertions.assertEquals("uvpbeswgkreozp", response.contentSchemaVersion()); - Assertions.assertEquals("kc", response.icon()); - Assertions.assertEquals("cbzgiklqpe", response.threatAnalysisTactics().get(0)); - Assertions.assertEquals("etzvqtcesvcsby", response.threatAnalysisTechniques().get(0)); - Assertions.assertEquals("haerhxd", response.previewImages().get(0)); - Assertions.assertEquals("elwszqv", response.previewImagesDark().get(0)); + Assertions.assertEquals("rhynlbtr", response.dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.PLAYBOOK, response.dependencies().criteria().get(0).kind()); + Assertions.assertEquals("vagudrh", response.dependencies().criteria().get(0).version()); + Assertions.assertEquals("gyhqr", response.dependencies().criteria().get(0).name()); + Assertions.assertEquals(MetadataDependencyOperator.AND, response.dependencies().criteria().get(0).operator()); + Assertions.assertEquals("iklqpegcgdnd", response.categories().domains().get(0)); + Assertions.assertEquals("wduzp", response.categories().verticals().get(0)); + Assertions.assertEquals("rqtm", response.providers().get(0)); + Assertions.assertEquals("hj", response.customVersion()); + Assertions.assertEquals("welicrxbbqmoguy", response.contentSchemaVersion()); + Assertions.assertEquals("selwszqveakd", response.icon()); + Assertions.assertEquals("jjz", response.threatAnalysisTactics().get(0)); + Assertions.assertEquals("shc", response.threatAnalysisTechniques().get(0)); + Assertions.assertEquals("lhnimuae", response.previewImages().get(0)); + Assertions.assertEquals("mpwquutlzofuzths", response.previewImagesDark().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java index 01e20bd41317..1fc4fd86c804 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/MetadatasListMockTests.java @@ -26,7 +26,7 @@ public final class MetadatasListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"contentId\":\"glojupenoupcol\",\"parentId\":\"cwrszwades\",\"version\":\"dkcuhqtskybyue\",\"kind\":\"eucvv\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"rgelgodue\",\"sourceId\":\"f\"},\"author\":{\"name\":\"rzenvkqtvtqpwqz\",\"email\":\"tnozwphka\",\"link\":\"acvcbr\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"ohbzbbjxkamitgvq\",\"email\":\"dvdbyelrteunkwyp\",\"link\":\"qfm\"},\"dependencies\":{\"contentId\":\"tdfqlfd\",\"kind\":\"ResourcesDataConnector\",\"version\":\"zdbrw\",\"name\":\"wft\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"qjsfgkwrcb\",\"kind\":\"LogicAppsCustomConnector\",\"version\":\"rabpywec\",\"name\":\"izabjb\",\"operator\":\"OR\",\"criteria\":[{}]}]},\"categories\":{\"domains\":[\"kktig\"],\"verticals\":[\"epl\",\"rerxydsompncea\",\"kjtm\",\"aczkjkfakgrwt\"]},\"providers\":[\"fanmj\",\"pceuwmfdy\",\"vpyhhgqy\"],\"customVersion\":\"ijzhv\",\"contentSchemaVersion\":\"qjekol\",\"icon\":\"lpykjpakaouyaan\",\"threatAnalysisTactics\":[\"ichey\"],\"threatAnalysisTechniques\":[\"konaydp\",\"wyha\",\"zyxaanhwuq\"],\"previewImages\":[\"n\"],\"previewImagesDark\":[\"sfbkxfkeeqofw\",\"ekpeerwssw\",\"mrpdjrylfpdudx\",\"igeurieh\"]},\"etag\":\"an\",\"id\":\"qfhatqssngeviyf\",\"name\":\"gohrhjspsyhda\",\"type\":\"yn\"}]}"; + = "{\"value\":[{\"properties\":{\"contentId\":\"qtvt\",\"parentId\":\"pwqzvqtnozw\",\"version\":\"kaqracvcbrtlt\",\"kind\":\"ohbzbbjxkamitgvq\",\"source\":{\"kind\":\"SourceRepository\",\"name\":\"dbyelrte\",\"sourceId\":\"kwypumqfms\"},\"author\":{\"name\":\"dfqlfdmly\",\"email\":\"dbrwjlwfthf\",\"link\":\"w\"},\"support\":{\"tier\":\"Microsoft\",\"name\":\"fgkwr\",\"email\":\"gxyprabp\",\"link\":\"eczoizabjbhyyddi\"},\"dependencies\":{\"contentId\":\"ktigiseeplzrerx\",\"kind\":\"PlaybookTemplate\",\"version\":\"mpnceark\",\"name\":\"mpa\",\"operator\":\"AND\",\"criteria\":[{\"contentId\":\"akgrwtpes\",\"kind\":\"AnalyticsRuleTemplate\",\"version\":\"j\",\"name\":\"ceuwm\",\"operator\":\"OR\",\"criteria\":[{},{}]},{\"contentId\":\"yhhgqys\",\"kind\":\"AnalyticsRule\",\"version\":\"jzhvej\",\"name\":\"ekolnylpykjp\",\"operator\":\"OR\",\"criteria\":[{},{},{}]},{\"contentId\":\"aanfxaich\",\"kind\":\"HuntingQuery\",\"version\":\"kkonaydpdwy\",\"name\":\"dzyxaanhwuqewcnh\",\"operator\":\"OR\",\"criteria\":[{},{},{},{}]}]},\"categories\":{\"domains\":[\"keeqofw\",\"ekpeerwssw\",\"mrpdjrylfpdudx\",\"igeurieh\"],\"verticals\":[\"nfsqfhatqssn\"]},\"providers\":[\"iyffgoh\",\"hj\"],\"customVersion\":\"hdapynpvgyaf\",\"contentSchemaVersion\":\"betzydtgpvnczf\",\"icon\":\"ybjku\",\"threatAnalysisTactics\":[\"jkyrhucbfkaqlp\",\"zpteron\",\"qaktao\",\"mgefobcqvzm\"],\"threatAnalysisTechniques\":[\"synsccmo\",\"qvojgolmkk\",\"zabauvncl\"],\"previewImages\":[\"oidjhoykg\",\"yvrn\",\"ikireetvjfizafd\",\"jhnuvndgrolgxa\"],\"previewImagesDark\":[\"ipfwl\",\"eia\",\"dp\"]},\"etag\":\"qteirrjjmvr\",\"id\":\"ppopw\",\"name\":\"xdgzhnpxbuwauytq\",\"type\":\"kgaxloafwsuaxqro\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,44 +36,44 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.metadatas() - .list("unropd", "ufqsdt", "zxj", "xolmehquqi", 1304228238, 1142549709, com.azure.core.util.Context.NONE); + .list("ueeeucvvnbymrgel", "oduexx", "d", "fr", 264768219, 1378289232, com.azure.core.util.Context.NONE); - Assertions.assertEquals("an", response.iterator().next().etag()); - Assertions.assertEquals("glojupenoupcol", response.iterator().next().contentId()); - Assertions.assertEquals("cwrszwades", response.iterator().next().parentId()); - Assertions.assertEquals("dkcuhqtskybyue", response.iterator().next().version()); - Assertions.assertEquals("eucvv", response.iterator().next().kind()); + Assertions.assertEquals("qteirrjjmvr", response.iterator().next().etag()); + Assertions.assertEquals("qtvt", response.iterator().next().contentId()); + Assertions.assertEquals("pwqzvqtnozw", response.iterator().next().parentId()); + Assertions.assertEquals("kaqracvcbrtlt", response.iterator().next().version()); + Assertions.assertEquals("ohbzbbjxkamitgvq", response.iterator().next().kind()); Assertions.assertEquals(SourceKind.SOURCE_REPOSITORY, response.iterator().next().source().kind()); - Assertions.assertEquals("rgelgodue", response.iterator().next().source().name()); - Assertions.assertEquals("f", response.iterator().next().source().sourceId()); - Assertions.assertEquals("rzenvkqtvtqpwqz", response.iterator().next().author().name()); - Assertions.assertEquals("tnozwphka", response.iterator().next().author().email()); - Assertions.assertEquals("acvcbr", response.iterator().next().author().link()); + Assertions.assertEquals("dbyelrte", response.iterator().next().source().name()); + Assertions.assertEquals("kwypumqfms", response.iterator().next().source().sourceId()); + Assertions.assertEquals("dfqlfdmly", response.iterator().next().author().name()); + Assertions.assertEquals("dbrwjlwfthf", response.iterator().next().author().email()); + Assertions.assertEquals("w", response.iterator().next().author().link()); Assertions.assertEquals(SupportTier.MICROSOFT, response.iterator().next().support().tier()); - Assertions.assertEquals("ohbzbbjxkamitgvq", response.iterator().next().support().name()); - Assertions.assertEquals("dvdbyelrteunkwyp", response.iterator().next().support().email()); - Assertions.assertEquals("qfm", response.iterator().next().support().link()); - Assertions.assertEquals("tdfqlfd", response.iterator().next().dependencies().contentId()); - Assertions.assertEquals(Kind.RESOURCES_DATA_CONNECTOR, response.iterator().next().dependencies().kind()); - Assertions.assertEquals("zdbrw", response.iterator().next().dependencies().version()); - Assertions.assertEquals("wft", response.iterator().next().dependencies().name()); + Assertions.assertEquals("fgkwr", response.iterator().next().support().name()); + Assertions.assertEquals("gxyprabp", response.iterator().next().support().email()); + Assertions.assertEquals("eczoizabjbhyyddi", response.iterator().next().support().link()); + Assertions.assertEquals("ktigiseeplzrerx", response.iterator().next().dependencies().contentId()); + Assertions.assertEquals(Kind.PLAYBOOK_TEMPLATE, response.iterator().next().dependencies().kind()); + Assertions.assertEquals("mpnceark", response.iterator().next().dependencies().version()); + Assertions.assertEquals("mpa", response.iterator().next().dependencies().name()); Assertions.assertEquals(MetadataDependencyOperator.AND, response.iterator().next().dependencies().operator()); - Assertions.assertEquals("qjsfgkwrcb", response.iterator().next().dependencies().criteria().get(0).contentId()); - Assertions.assertEquals(Kind.LOGIC_APPS_CUSTOM_CONNECTOR, + Assertions.assertEquals("akgrwtpes", response.iterator().next().dependencies().criteria().get(0).contentId()); + Assertions.assertEquals(Kind.ANALYTICS_RULE_TEMPLATE, response.iterator().next().dependencies().criteria().get(0).kind()); - Assertions.assertEquals("rabpywec", response.iterator().next().dependencies().criteria().get(0).version()); - Assertions.assertEquals("izabjb", response.iterator().next().dependencies().criteria().get(0).name()); + Assertions.assertEquals("j", response.iterator().next().dependencies().criteria().get(0).version()); + Assertions.assertEquals("ceuwm", response.iterator().next().dependencies().criteria().get(0).name()); Assertions.assertEquals(MetadataDependencyOperator.OR, response.iterator().next().dependencies().criteria().get(0).operator()); - Assertions.assertEquals("kktig", response.iterator().next().categories().domains().get(0)); - Assertions.assertEquals("epl", response.iterator().next().categories().verticals().get(0)); - Assertions.assertEquals("fanmj", response.iterator().next().providers().get(0)); - Assertions.assertEquals("ijzhv", response.iterator().next().customVersion()); - Assertions.assertEquals("qjekol", response.iterator().next().contentSchemaVersion()); - Assertions.assertEquals("lpykjpakaouyaan", response.iterator().next().icon()); - Assertions.assertEquals("ichey", response.iterator().next().threatAnalysisTactics().get(0)); - Assertions.assertEquals("konaydp", response.iterator().next().threatAnalysisTechniques().get(0)); - Assertions.assertEquals("n", response.iterator().next().previewImages().get(0)); - Assertions.assertEquals("sfbkxfkeeqofw", response.iterator().next().previewImagesDark().get(0)); + Assertions.assertEquals("keeqofw", response.iterator().next().categories().domains().get(0)); + Assertions.assertEquals("nfsqfhatqssn", response.iterator().next().categories().verticals().get(0)); + Assertions.assertEquals("iyffgoh", response.iterator().next().providers().get(0)); + Assertions.assertEquals("hdapynpvgyaf", response.iterator().next().customVersion()); + Assertions.assertEquals("betzydtgpvnczf", response.iterator().next().contentSchemaVersion()); + Assertions.assertEquals("ybjku", response.iterator().next().icon()); + Assertions.assertEquals("jkyrhucbfkaqlp", response.iterator().next().threatAnalysisTactics().get(0)); + Assertions.assertEquals("synsccmo", response.iterator().next().threatAnalysisTechniques().get(0)); + Assertions.assertEquals("oidjhoykg", response.iterator().next().previewImages().get(0)); + Assertions.assertEquals("ipfwl", response.iterator().next().previewImagesDark().get(0)); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java index f6cf77880f2b..6bd788ec3fcc 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ReevaluatesRecommendationWithResponseMockTests.java @@ -20,7 +20,7 @@ public final class ReevaluatesRecommendationWithResponseMockTests { @Test public void testRecommendationWithResponse() throws Exception { - String responseStr = "{\"lastEvaluatedTimeUtc\":\"2021-09-19T02:20:01Z\"}"; + String responseStr = "{\"lastEvaluatedTimeUtc\":\"2021-02-21T00:59:35Z\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,9 +30,10 @@ public void testRecommendationWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ReevaluateResponse response = manager.reevaluates() - .recommendationWithResponse("pmvppvgrigjegrl", "koqbzrc", "arrtfmfkuv", com.azure.core.util.Context.NONE) + .recommendationWithResponse("hmlqamdlcukdm", "vryakcclsnprdart", "gabbxexacgmtpk", + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-19T02:20:01Z"), response.lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-21T00:59:35Z"), response.lastEvaluatedTimeUtc()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java index 6191349a5758..33814d91259f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class SecurityMLAnalyticsSettingsCreateOrUpdateWithResponseMockTest @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"h\",\"id\":\"ikruljbhgzff\",\"name\":\"mryoiao\",\"type\":\"bz\"}"; + = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"hupyajkdejparjvs\",\"id\":\"zfjbd\",\"name\":\"yxhjf\",\"type\":\"jb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SecurityMLAnalyticsSetting response = manager.securityMLAnalyticsSettings() - .createOrUpdateWithResponse("qnvvw", "aorulboawzplwghf", "qoarmtuprqt", - new SecurityMLAnalyticsSettingInner().withEtag("qkohupyajkde"), com.azure.core.util.Context.NONE) + .createOrUpdateWithResponse("sbubzfayy", "qecwrtreder", "snfgmohhc", + new SecurityMLAnalyticsSettingInner().withEtag("vsmvvfpkym"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("h", response.etag()); + Assertions.assertEquals("hupyajkdejparjvs", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java index d969c55d0d6e..f33a383e8032 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsDeleteWithResponseMockTests.java @@ -27,7 +27,8 @@ public void testDeleteWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.securityMLAnalyticsSettings().deleteWithResponse("dl", "cqu", "v", com.azure.core.util.Context.NONE); + manager.securityMLAnalyticsSettings() + .deleteWithResponse("mrdlnb", "lhwrikrul", "bhgzffemryoiaobb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java index 8b79a83016ef..92baa59d2c7a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class SecurityMLAnalyticsSettingsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"zfayyuq\",\"id\":\"wrtre\",\"name\":\"erzsnfgmo\",\"type\":\"hcghvsmvvfpky\"}"; + = "{\"kind\":\"SecurityMLAnalyticsSetting\",\"etag\":\"hjlbk\",\"id\":\"gs\",\"name\":\"hpn\",\"type\":\"tltjekqzfwlkyrnm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +31,9 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SecurityMLAnalyticsSetting response = manager.securityMLAnalyticsSettings() - .getWithResponse("wlhjlbkqygszhp", "atlt", "ekqzfwlkyrnmgsb", com.azure.core.util.Context.NONE) + .getWithResponse("taovlyykxyfp", "ds", "dywrwvs", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zfayyuq", response.etag()); + Assertions.assertEquals("hjlbk", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java index 2c1a851d89ac..0bea829a3f93 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SecurityMLAnalyticsSettingsListMockTests.java @@ -32,7 +32,7 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.securityMLAnalyticsSettings().list("hb", "iibxol", com.azure.core.util.Context.NONE); + = manager.securityMLAnalyticsSettings().list("cdlccqumvb", "bliibxol", com.azure.core.util.Context.NONE); Assertions.assertEquals("nxxjfi", response.iterator().next().etag()); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java index 30993d4a395b..d2d2d8744a86 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/SentinelOnboardingStatesDeleteWithResponseMockTests.java @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.sentinelOnboardingStates() - .deleteWithResponse("ec", "sybiazfvxdkw", "ceql", com.azure.core.util.Context.NONE); + .deleteWithResponse("rtepsybdgtfozys", "jdcokbpbpqelmszo", "tneltnbyvb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java index b44d569f127d..0022c5d17cc7 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorMetricsListWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class ThreatIntelligenceIndicatorMetricsListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"lastUpdatedTimeUtc\":\"twz\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{},{},{}],\"sourceMetrics\":[{},{},{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"npuoaorfpizybpj\",\"threatTypeMetrics\":[{},{},{},{}],\"patternTypeMetrics\":[{},{},{},{}],\"sourceMetrics\":[{},{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"wcywrbmxwlskkffw\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{}],\"sourceMetrics\":[{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"sqyjsw\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{},{}],\"sourceMetrics\":[{}]}}]}"; + = "{\"value\":[{\"properties\":{\"lastUpdatedTimeUtc\":\"bntwikmgwxysut\",\"threatTypeMetrics\":[{},{},{},{}],\"patternTypeMetrics\":[{},{}],\"sourceMetrics\":[{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"kstrmsbmdgrzke\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{}],\"sourceMetrics\":[{},{}]}},{\"properties\":{\"lastUpdatedTimeUtc\":\"smaa\",\"threatTypeMetrics\":[{},{},{}],\"patternTypeMetrics\":[{},{}],\"sourceMetrics\":[{},{},{},{}]}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +31,9 @@ public void testListWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ThreatIntelligenceMetricsList response = manager.threatIntelligenceIndicatorMetrics() - .listWithResponse("elazvcfhiayro", "xeezlqw", com.azure.core.util.Context.NONE) + .listWithResponse("qkdmpf", "crcelsnjftnfdcj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("twz", response.value().get(0).properties().lastUpdatedTimeUtc()); + Assertions.assertEquals("bntwikmgwxysut", response.value().get(0).properties().lastUpdatedTimeUtc()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java index 7b4d956e31f2..3329075df885 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsAppendTagsWithResponseMockTests.java @@ -30,8 +30,8 @@ public void testAppendTagsWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.threatIntelligenceIndicators() - .appendTagsWithResponse("pjecjixcya", "kiitrdbtr", "vlu", new ThreatIntelligenceAppendTags() - .withThreatIntelligenceTags(Arrays.asList("su", "zfrwmctrngjqc", "sfbkrtpu")), + .appendTagsWithResponse("dvtv", "yqlthnnd", "plksdie", + new ThreatIntelligenceAppendTags().withThreatIntelligenceTags(Arrays.asList("jbat")), com.azure.core.util.Context.NONE); } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java index 0c7b0a2d10c8..c4f31d7ca56c 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsDeleteWithResponseMockTests.java @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.threatIntelligenceIndicators() - .deleteWithResponse("ifwknl", "tvxrtocadt", "mq", com.azure.core.util.Context.NONE); + .deleteWithResponse("noveabw", "aiqikzysdha", "swhqmrpdxn", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java index 6f5299d20c86..fdfda2cab114 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class ThreatIntelligenceIndicatorsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"nveqleozqqw\",\"id\":\"wbwzyvbuifhy\",\"name\":\"atoplqc\",\"type\":\"jsrlzwu\"}"; + = "{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"fwknlytvx\",\"id\":\"ocadtnmqrpjecj\",\"name\":\"xcyai\",\"type\":\"ii\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +31,9 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ThreatIntelligenceInformation response = manager.threatIntelligenceIndicators() - .getWithResponse("tzd", "z", "bmzldplamccql", com.azure.core.util.Context.NONE) + .getWithResponse("gvyuusexenywwkd", "qqg", "sxpaapmthdqv", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("nveqleozqqw", response.etag()); + Assertions.assertEquals("fwknlytvx", response.etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java index c7abd199b4a0..dd49a24eda0a 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligenceIndicatorsOperationsListMockTests.java @@ -22,7 +22,7 @@ public final class ThreatIntelligenceIndicatorsOperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"ujeia\",\"id\":\"yeefjss\",\"name\":\"yrwyffutezx\",\"type\":\"p\"}]}"; + = "{\"value\":[{\"kind\":\"ThreatIntelligenceInformation\",\"etag\":\"maw\",\"id\":\"aagazryyjjwggpc\",\"name\":\"ugwd\",\"type\":\"obpcs\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,9 +32,9 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.threatIntelligenceIndicatorsOperations() - .list("tlxqlz", "kbxwncggamxbtqi", "ydaiolnkkgh", 455677843, "xvq", "bnwmokzxyltbpqj", + .list("nidbaykvlrsbrni", "c", "oqpim", 1041196550, "hiskwaffsjqnj", "cybugojzcarg", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ujeia", response.iterator().next().etag()); + Assertions.assertEquals("maw", response.iterator().next().etag()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java index 1124a881f39c..4953c6dec554 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesCountWithResponseMockTests.java @@ -25,7 +25,7 @@ public final class ThreatIntelligencesCountWithResponseMockTests { @Test public void testCountWithResponse() throws Exception { - String responseStr = "{\"count\":2097230752}"; + String responseStr = "{\"count\":1857906000}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -35,11 +35,20 @@ public void testCountWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ThreatIntelligenceCount response = manager.threatIntelligences() - .countWithResponse("ayuqwntghjm", "jmmjnxhy", TiType.MAIN, - new CountQuery().withCondition( - new ConditionProperties().withClauses(Arrays.asList(new ConditionClause().withField("qpimbchiskwa") - .withOperator(Operator.GREATER_THAN_EQUAL) - .withValues(Arrays.asList("jqn"))))), + .countWithResponse("u", "iscbz", TiType.MAIN, + new CountQuery().withCondition(new ConditionProperties().withClauses(Arrays.asList( + new ConditionClause().withField("elv") + .withOperator(Operator.IS_TRUE) + .withValues(Arrays.asList("tm")), + new ConditionClause().withField("lq") + .withOperator(Operator.ARRAY_CONTAINS) + .withValues(Arrays.asList("mjwwoxan", "fell")), + new ConditionClause().withField("gog") + .withOperator(Operator.LESS_THAN_EQUAL) + .withValues(Arrays.asList("w")), + new ConditionClause().withField("thcbvuvwdpy") + .withOperator(Operator.STRING_NOT_ENDS_WITH) + .withValues(Arrays.asList("naghgla", "j", "nbmfml"))))), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java index 051929011aba..c49a2fb6e4eb 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/ThreatIntelligencesQueryMockTests.java @@ -30,7 +30,7 @@ public final class ThreatIntelligencesQueryMockTests { @Test public void testQuery() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"TIObject\",\"properties\":{\"data\":{\"zcdlnvupi\":\"\\\"datasmaa\\\"\",\"elv\":\"\\\"datacbzyhtbjyycac\\\"\"},\"createdBy\":{\"email\":\"tm\",\"name\":\"alqqrymjwwo\",\"objectId\":\"nefellhdsgogdu\"},\"source\":\"malthcbvuvwdp\",\"firstIngestedTimeUtc\":\"2021-01-11T01:15:25Z\",\"lastIngestedTimeUtc\":\"2021-02-23T22:06:13Z\",\"ingestionRulesVersion\":\"ghglaxj\",\"lastUpdateMethod\":\"bmfm\",\"lastModifiedBy\":{\"email\":\"atswvt\",\"name\":\"picwnbtvlrs\",\"objectId\":\"trmodknxerkaiik\"},\"lastUpdatedDateTimeUtc\":\"2021-11-23T04:16:47Z\",\"relationshipHints\":[{\"fieldName\":\"pqrke\",\"source\":\"juaezkbr\"}]},\"id\":\"aulhtqvtpkodijc\",\"name\":\"dwoyqvcyqjjx\",\"type\":\"ijbf\"}]}"; + = "{\"value\":[{\"kind\":\"TIObject\",\"properties\":{\"data\":{\"kotxodbxzhadm\":\"\\\"datassncghgid\\\"\",\"yy\":\"\\\"datajnnoot\\\"\",\"oodhnzkmjoy\":\"\\\"datapaq\\\"\"},\"createdBy\":{\"email\":\"gwjrssnrykkhxawo\",\"name\":\"jewxphnlweyzvri\",\"objectId\":\"veserltlhcjgjuop\"},\"source\":\"rmspksfxdmb\",\"firstIngestedTimeUtc\":\"2021-08-12T21:59:55Z\",\"lastIngestedTimeUtc\":\"2021-09-08T04:37:03Z\",\"ingestionRulesVersion\":\"iqvhfyv\",\"lastUpdateMethod\":\"goxsveiucuxwno\",\"lastModifiedBy\":{\"email\":\"rgqmbnfvyg\",\"name\":\"dcf\",\"objectId\":\"lpsycvcksz\"},\"lastUpdatedDateTimeUtc\":\"2021-10-24T13:45:47Z\",\"relationshipHints\":[{\"fieldName\":\"cp\",\"source\":\"sxnujwffthbzii\"},{\"fieldName\":\"xlbcc\",\"source\":\"rauabdevjrbgcdx\"},{\"fieldName\":\"steeksb\",\"source\":\"vvyvo\"}]},\"id\":\"vvu\",\"name\":\"wljmz\",\"type\":\"yukrw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -39,22 +39,30 @@ public void testQuery() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.threatIntelligences() - .query("bugojzcargs", "maw", TiType.MAIN, - new Query() - .withCondition(new QueryCondition().withStixObjectType("gazryyjjwggpcdu") - .withClauses(Arrays.asList( - new ConditionClause().withField("obpcs") - .withOperator(Operator.STRING_NOT_STARTS_WITH) - .withValues(Arrays.asList("xedzmmcgqifh", "hzugwkqnmh", "m", "lorvht")), - new ConditionClause().withField("rweeqkdmpfmcrce") - .withOperator(Operator.STRING_NOT_ENDS_WITH) - .withValues(Arrays.asList("jftnfdcj", "veibntwikm", "wxysut", "ofdhrifekstrmsb")))) - .withConditionConnective(Connective.OR)) - .withSortBy(new QuerySortBy().withDirection(SortingDirection.ASC).withField("u")) - .withMaxPageSize(1662057563) - .withMinPageSize(91618654), - com.azure.core.util.Context.NONE); + PagedIterable response + = manager.threatIntelligences() + .query("swvtd", "picwnbtvlrs", TiType.MAIN, + new Query() + .withCondition( + new QueryCondition().withStixObjectType("modknxerkai") + .withClauses( + Arrays.asList( + new ConditionClause().withField("f") + .withOperator(Operator.EQUALS) + .withValues(Arrays.asList("pqrke", "h", "uaez")), + new ConditionClause().withField("vtaul") + .withOperator(Operator.STRING_NOT_CONTAINS) + .withValues(Arrays.asList("vtpkodijcndwoyq", "cyqjj", "hijbfiyuho")), + new ConditionClause().withField("evpdbirh") + .withOperator(Operator.STRING_CONTAINS) + .withValues(Arrays.asList("phyacdhjm", "nvgkxshh", "jtkuyvytfuq", + "stqbxpyfawkjei")))) + .withConditionConnective(Connective.AND)) + .withSortBy( + new QuerySortBy().withDirection(SortingDirection.DESC).withField("cndbklscokafaqqi")) + .withMaxPageSize(714590623) + .withMinPageSize(545681155), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java index 30d897a91299..4550392bb256 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/UpdatesRecommendationWithResponseMockTests.java @@ -24,7 +24,7 @@ public final class UpdatesRecommendationWithResponseMockTests { @Test public void testRecommendationWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"recommendationTypeId\":\"yxcmqcggksror\",\"state\":\"CompletedBySystem\",\"title\":\"jfharphl\",\"description\":\"lftraylxzdujpuh\",\"creationTimeUtc\":\"2021-03-23T21:19:15Z\",\"lastEvaluatedTimeUtc\":\"2021-01-25T01:06:44Z\",\"lastModifiedTimeUtc\":\"2021-08-29T04:39:28Z\",\"suggestions\":[{\"suggestionTypeId\":\"wbkxdhavegy\",\"title\":\"qsmlbzi\",\"description\":\"pdatvndvwwejvqpw\",\"action\":\"r\",\"additionalProperties\":{\"gntxregbs\":\"wmhcpuj\",\"wy\":\"qthc\",\"ffl\":\"qxprsocfxlrzj\"}}],\"resourceId\":\"muljfaulwlz\",\"additionalProperties\":{\"hiyxjqr\":\"gnepjyuxqdr\",\"pfzsf\":\"npztlac\"}},\"etag\":\"a\",\"id\":\"brwvio\",\"name\":\"vyhsorcavkfhyoi\",\"type\":\"zwedf\"}"; + = "{\"properties\":{\"recommendationTypeId\":\"aylkrastbks\",\"state\":\"InProgress\",\"title\":\"ziebmw\",\"description\":\"odfmplg\",\"creationTimeUtc\":\"2021-01-22T20:48:31Z\",\"lastEvaluatedTimeUtc\":\"2021-11-24T06:50:19Z\",\"lastModifiedTimeUtc\":\"2021-01-11T05:57:43Z\",\"suggestions\":[{\"suggestionTypeId\":\"brdbwwqtxpfofrf\",\"title\":\"hbbn\",\"description\":\"ev\",\"action\":\"krlkdouk\",\"additionalProperties\":{\"guap\":\"mdsjgowsh\"}},{\"suggestionTypeId\":\"qlhhmbyfacex\",\"title\":\"opqy\",\"description\":\"icesqpvmoxilh\",\"action\":\"kqiqsriubem\",\"additionalProperties\":{\"htkyzsgayngmowv\":\"ygmrenrbngcafmo\",\"hysuapdns\":\"nvfgqx\",\"mggy\":\"roqxrvycjdni\"}},{\"suggestionTypeId\":\"mpm\",\"title\":\"acbamt\",\"description\":\"qseamoyxdi\",\"action\":\"kggzmylqhqeos\",\"additionalProperties\":{\"hhtttyhypid\":\"xilefiottdawgka\",\"nkkxoicb\":\"jjjfcysk\",\"pmvppvgrigjegrl\":\"smfvltbocqhv\",\"arrtfmfkuv\":\"koqbzrc\"}}],\"resourceId\":\"emora\",\"additionalProperties\":{\"zvzqhvzjdsn\":\"qvkuq\"}},\"etag\":\"dbeanigozjrcx\",\"id\":\"ugjalmzpfyl\",\"name\":\"evwwvznpdxcizrop\",\"type\":\"gjl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,27 +33,28 @@ public void testRecommendationWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - Recommendation response = manager.updates() - .recommendationWithResponse("xldqtmandejnemrf", "jh", "dpwlezbfgull", - new RecommendationPatch().withProperties( - new RecommendationPatchProperties().withState(State.DISMISSED)), - com.azure.core.util.Context.NONE) - .getValue(); + Recommendation response + = manager.updates() + .recommendationWithResponse("mumuc", "vqwhscvaq", "xgelnjgftqkgavgo", + new RecommendationPatch().withProperties( + new RecommendationPatchProperties().withState(State.ACTIVE)), + com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("a", response.etag()); - Assertions.assertEquals("yxcmqcggksror", response.recommendationTypeId()); - Assertions.assertEquals(State.COMPLETED_BY_SYSTEM, response.state()); - Assertions.assertEquals("jfharphl", response.title()); - Assertions.assertEquals("lftraylxzdujpuh", response.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-23T21:19:15Z"), response.creationTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T01:06:44Z"), response.lastEvaluatedTimeUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-29T04:39:28Z"), response.lastModifiedTimeUtc()); - Assertions.assertEquals("wbkxdhavegy", response.suggestions().get(0).suggestionTypeId()); - Assertions.assertEquals("qsmlbzi", response.suggestions().get(0).title()); - Assertions.assertEquals("pdatvndvwwejvqpw", response.suggestions().get(0).description()); - Assertions.assertEquals("r", response.suggestions().get(0).action()); - Assertions.assertEquals("wmhcpuj", response.suggestions().get(0).additionalProperties().get("gntxregbs")); - Assertions.assertEquals("muljfaulwlz", response.resourceId()); - Assertions.assertEquals("gnepjyuxqdr", response.additionalProperties().get("hiyxjqr")); + Assertions.assertEquals("dbeanigozjrcx", response.etag()); + Assertions.assertEquals("aylkrastbks", response.recommendationTypeId()); + Assertions.assertEquals(State.IN_PROGRESS, response.state()); + Assertions.assertEquals("ziebmw", response.title()); + Assertions.assertEquals("odfmplg", response.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T20:48:31Z"), response.creationTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T06:50:19Z"), response.lastEvaluatedTimeUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T05:57:43Z"), response.lastModifiedTimeUtc()); + Assertions.assertEquals("brdbwwqtxpfofrf", response.suggestions().get(0).suggestionTypeId()); + Assertions.assertEquals("hbbn", response.suggestions().get(0).title()); + Assertions.assertEquals("ev", response.suggestions().get(0).description()); + Assertions.assertEquals("krlkdouk", response.suggestions().get(0).action()); + Assertions.assertEquals("mdsjgowsh", response.suggestions().get(0).additionalProperties().get("guap")); + Assertions.assertEquals("emora", response.resourceId()); + Assertions.assertEquals("qvkuq", response.additionalProperties().get("zvzqhvzjdsn")); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java index fe535f61f7ad..49c1a8536d0b 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsCreateWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class WorkspaceManagerAssignmentJobsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"endTime\":\"2021-07-14T12:48:04Z\",\"items\":[{\"resourceId\":\"zyebpatw\",\"status\":\"InProgress\",\"executionTime\":\"2021-07-09T20:09:01Z\",\"errors\":[{\"memberResourceName\":\"hnwo\",\"errorMessage\":\"lcahhfuydgdhit\"},{\"memberResourceName\":\"v\",\"errorMessage\":\"ayu\"}]},{\"resourceId\":\"zlcvib\",\"status\":\"Closed\",\"executionTime\":\"2021-03-27T09:47:09Z\",\"errors\":[{\"memberResourceName\":\"defepwkhruzzw\",\"errorMessage\":\"bbozivfoy\"},{\"memberResourceName\":\"vnlhsxeasxsqqu\",\"errorMessage\":\"vscbpkmo\"},{\"memberResourceName\":\"dukp\",\"errorMessage\":\"qyibwu\"},{\"memberResourceName\":\"vmo\",\"errorMessage\":\"syirfkxazuboi\"}]},{\"resourceId\":\"rw\",\"status\":\"Failed\",\"executionTime\":\"2021-08-12T20:43:01Z\",\"errors\":[{\"memberResourceName\":\"aqoilgkznnzpvjw\",\"errorMessage\":\"g\"},{\"memberResourceName\":\"viceqyrajdvvsaat\",\"errorMessage\":\"yper\"},{\"memberResourceName\":\"azcchvwwc\",\"errorMessage\":\"azztvotf\"}]},{\"resourceId\":\"ayfxkfgx\",\"status\":\"Closed\",\"executionTime\":\"2021-01-08T13:21:25Z\",\"errors\":[{\"memberResourceName\":\"uw\",\"errorMessage\":\"oszcmfmynljigj\"},{\"memberResourceName\":\"nk\",\"errorMessage\":\"dmwtiv\"},{\"memberResourceName\":\"knewpnpun\",\"errorMessage\":\"vjbnhbxvvuf\"}]}],\"provisioningState\":\"Succeeded\",\"startTime\":\"2021-01-01T23:00:57Z\",\"errorMessage\":\"sajq\"},\"etag\":\"rcqdthmlqam\",\"id\":\"cukdmrvr\",\"name\":\"akc\",\"type\":\"lsnprda\"}"; + = "{\"properties\":{\"endTime\":\"2021-03-10T21:47:37Z\",\"items\":[{\"resourceId\":\"jshicvrmwbgpc\",\"status\":\"Active\",\"executionTime\":\"2021-01-01T12:01:51Z\",\"errors\":[{\"memberResourceName\":\"vpgsrf\",\"errorMessage\":\"hkj\"},{\"memberResourceName\":\"spb\",\"errorMessage\":\"aevtxibrooogij\"},{\"memberResourceName\":\"qwxwpubdhqnpr\",\"errorMessage\":\"vruhdjzivlaxii\"}]}],\"provisioningState\":\"Canceled\",\"startTime\":\"2021-06-17T09:12:24Z\",\"errorMessage\":\"fptzixmksxxb\"},\"etag\":\"jvvng\",\"id\":\"kkzulmqx\",\"name\":\"ic\",\"type\":\"nwij\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,12 +31,12 @@ public void testCreateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Job response = manager.workspaceManagerAssignmentJobs() - .createWithResponse("bhqkvbins", "qwnpegoupdq", "flvdfaqcql", com.azure.core.util.Context.NONE) + .createWithResponse("hylqgeovnlb", "fsol", "rqu", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rcqdthmlqam", response.etag()); - Assertions.assertEquals("zyebpatw", response.items().get(0).resourceId()); - Assertions.assertEquals("hnwo", response.items().get(0).errors().get(0).memberResourceName()); - Assertions.assertEquals("lcahhfuydgdhit", response.items().get(0).errors().get(0).errorMessage()); + Assertions.assertEquals("jvvng", response.etag()); + Assertions.assertEquals("jshicvrmwbgpc", response.items().get(0).resourceId()); + Assertions.assertEquals("vpgsrf", response.items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("hkj", response.items().get(0).errors().get(0).errorMessage()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java index ade2e6b8a952..4f330200d6aa 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsDeleteWithResponseMockTests.java @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.workspaceManagerAssignmentJobs() - .deleteWithResponse("kkzulmqx", "ic", "nwij", "eyxt", com.azure.core.util.Context.NONE); + .deleteWithResponse("rppsnlj", "uwkbozlmrhn", "hv", "vdjxb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java index 4ac52d36d6a9..6926e7be8e5f 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsGetWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class WorkspaceManagerAssignmentJobsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"endTime\":\"2021-09-08T22:04:34Z\",\"items\":[{\"resourceId\":\"xsnkmkcimksf\",\"status\":\"Succeeded\",\"executionTime\":\"2021-09-01T06:01:22Z\",\"errors\":[{\"memberResourceName\":\"bzmngxzpdnbj\",\"errorMessage\":\"vhddvtnbtv\"},{\"memberResourceName\":\"gkjfkaoew\",\"errorMessage\":\"myizdglzzaufi\"},{\"memberResourceName\":\"wvyxy\",\"errorMessage\":\"ykng\"},{\"memberResourceName\":\"tjgpyvjgsjyjnhwb\",\"errorMessage\":\"hwrnc\"}]},{\"resourceId\":\"zuerrvpamfpin\",\"status\":\"New\",\"executionTime\":\"2021-09-23T11:35:19Z\",\"errors\":[{\"memberResourceName\":\"fbruuhylqgeovnlb\",\"errorMessage\":\"fsol\"},{\"memberResourceName\":\"rqu\",\"errorMessage\":\"lnhxr\"},{\"memberResourceName\":\"jshicvrmwbgpc\",\"errorMessage\":\"l\"},{\"memberResourceName\":\"bxppvpgsrfshkjg\",\"errorMessage\":\"pboaevtxi\"}]}],\"provisioningState\":\"InProgress\",\"startTime\":\"2021-10-30T23:19:42Z\",\"errorMessage\":\"ijiqwxwpubdh\"},\"etag\":\"pr\",\"id\":\"ruhdjzivlaxiimqn\",\"name\":\"mbfpt\",\"type\":\"ixmksxxbdtjvvngn\"}"; + = "{\"properties\":{\"endTime\":\"2021-02-27T06:39:21Z\",\"items\":[{\"resourceId\":\"yycvtyablyim\",\"status\":\"Approved\",\"executionTime\":\"2021-05-25T13:15:51Z\",\"errors\":[{\"memberResourceName\":\"vxblqvwhjgtb\",\"errorMessage\":\"reoutqohp\"},{\"memberResourceName\":\"tqibqbougcwzgdfd\",\"errorMessage\":\"dxout\"},{\"memberResourceName\":\"gezulnntpbarejxj\",\"errorMessage\":\"lxoljbpoeoyw\"}]},{\"resourceId\":\"hhavwhrivvzrccy\",\"status\":\"Backlog\",\"executionTime\":\"2021-05-03T22:23:01Z\",\"errors\":[{\"memberResourceName\":\"wudeearb\",\"errorMessage\":\"xaneviqkjupvid\"}]}],\"provisioningState\":\"InProgress\",\"startTime\":\"2021-02-03T00:32:32Z\",\"errorMessage\":\"qcgb\"},\"etag\":\"enirjhdlxu\",\"id\":\"btlharjbakp\",\"name\":\"suugcngd\",\"type\":\"lvdenhguvaimko\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,12 +31,12 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Job response = manager.workspaceManagerAssignmentJobs() - .getWithResponse("tqgabbx", "xacgm", "pkxbwobovexsnm", "whbmujlsztp", com.azure.core.util.Context.NONE) + .getWithResponse("eyxt", "er", "ttobosjxb", "ytten", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("pr", response.etag()); - Assertions.assertEquals("xsnkmkcimksf", response.items().get(0).resourceId()); - Assertions.assertEquals("bzmngxzpdnbj", response.items().get(0).errors().get(0).memberResourceName()); - Assertions.assertEquals("vhddvtnbtv", response.items().get(0).errors().get(0).errorMessage()); + Assertions.assertEquals("enirjhdlxu", response.etag()); + Assertions.assertEquals("yycvtyablyim", response.items().get(0).resourceId()); + Assertions.assertEquals("vxblqvwhjgtb", response.items().get(0).errors().get(0).memberResourceName()); + Assertions.assertEquals("reoutqohp", response.items().get(0).errors().get(0).errorMessage()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java index 5814d1dea161..9b920193ed9d 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/src/test/java/com/azure/resourcemanager/securityinsights/generated/WorkspaceManagerAssignmentJobsListMockTests.java @@ -22,7 +22,7 @@ public final class WorkspaceManagerAssignmentJobsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"endTime\":\"2021-02-16T13:46:03Z\",\"items\":[{\"resourceId\":\"hj\",\"status\":\"Succeeded\",\"executionTime\":\"2021-01-06T15:50:01Z\",\"errors\":[{\"memberResourceName\":\"utqoh\",\"errorMessage\":\"btqibqbougcwzgd\"}]},{\"resourceId\":\"rdxoutkgezulnnt\",\"status\":\"Backlog\",\"executionTime\":\"2021-09-23T23:27:05Z\",\"errors\":[{\"memberResourceName\":\"jhlxoljbpoeo\",\"errorMessage\":\"wykhhavwh\"},{\"memberResourceName\":\"ivvzrccyfrxl\",\"errorMessage\":\"ypwudeearbbxan\"},{\"memberResourceName\":\"viqkju\",\"errorMessage\":\"v\"}]}],\"provisioningState\":\"Canceled\",\"startTime\":\"2021-05-27T13:44:59Z\",\"errorMessage\":\"ppqcgbp\"},\"etag\":\"ni\",\"id\":\"hd\",\"name\":\"xup\",\"type\":\"btlharjbakp\"}]}"; + = "{\"value\":[{\"properties\":{\"endTime\":\"2021-04-26T04:33:13Z\",\"items\":[{\"resourceId\":\"e\",\"status\":\"New\",\"executionTime\":\"2021-04-19T00:36:49Z\",\"errors\":[{\"memberResourceName\":\"nuglmyrkrtdkpox\",\"errorMessage\":\"wgrsni\"}]},{\"resourceId\":\"mca\",\"status\":\"Closed\",\"executionTime\":\"2021-04-24T14:46:57Z\",\"errors\":[{\"memberResourceName\":\"fjzqqgypanwejbn\",\"errorMessage\":\"ojnakswy\"},{\"memberResourceName\":\"kwtf\",\"errorMessage\":\"aafksor\"},{\"memberResourceName\":\"fhruhwxmnrdfjobh\",\"errorMessage\":\"voneaupjmjigypb\"}]},{\"resourceId\":\"rtasaurxtox\",\"status\":\"Backlog\",\"executionTime\":\"2021-03-21T21:09:49Z\",\"errors\":[{\"memberResourceName\":\"tsyrxynnfsknycis\",\"errorMessage\":\"hcp\"}]}],\"provisioningState\":\"Failed\",\"startTime\":\"2021-05-11T20:15:26Z\",\"errorMessage\":\"cduq\"},\"etag\":\"urfqaa\",\"id\":\"y\",\"name\":\"tzslfrztpnry\",\"type\":\"xxa\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,14 +32,13 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.workspaceManagerAssignmentJobs() - .list("er", "ttobosjxb", "ytten", "uditumyycvtya", 2093579646, "yimhspjqhi", + .list("qi", "bite", "vowiypyljzkx", "dfyvgcftaqydcr", 1876950395, "hmneykxewemtazmr", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ni", response.iterator().next().etag()); - Assertions.assertEquals("hj", response.iterator().next().items().get(0).resourceId()); - Assertions.assertEquals("utqoh", + Assertions.assertEquals("urfqaa", response.iterator().next().etag()); + Assertions.assertEquals("e", response.iterator().next().items().get(0).resourceId()); + Assertions.assertEquals("nuglmyrkrtdkpox", response.iterator().next().items().get(0).errors().get(0).memberResourceName()); - Assertions.assertEquals("btqibqbougcwzgd", - response.iterator().next().items().get(0).errors().get(0).errorMessage()); + Assertions.assertEquals("wgrsni", response.iterator().next().items().get(0).errors().get(0).errorMessage()); } } diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml b/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml index c8211ddc817c..eac7bcd67c6c 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/SecurityInsights -commit: 120cdc984d09afe0cf1d79b29ecfce1bc3bc90b0 +commit: e4431efcc0a59119bf36fc0288c5a1e2e249d8f7 repo: Azure/azure-rest-api-specs additionalDirectories: From 36235c4909c848016c59e50d89a156001f1ef0ca Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 19 Aug 2026 09:24:47 +0000 Subject: [PATCH 3/4] Configurations: 'specification/securityinsights/resource-manager/Microsoft.SecurityInsights/SecurityInsights/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: 'd7da39437a8330fabdc4151f75aebab8e5ca3a64' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6719295 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 220 +++++++++--------- .../tsp-location.yaml | 2 +- 2 files changed, 111 insertions(+), 111 deletions(-) diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md index 78f838be9b6c..193ef799e812 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md @@ -47,8 +47,8 @@ #### `models.TIDataConnector` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.OfficeDataConnector` was modified @@ -63,25 +63,25 @@ #### `models.ScheduledAlertRuleTemplate` was modified * `ScheduledAlertRuleTemplate()` was changed to private access -* `withSeverity(models.AlertSeverity)` was removed -* `withTriggerThreshold(java.lang.Integer)` was removed -* `withEventGroupingSettings(models.EventGroupingSettings)` was removed -* `withAlertDetailsOverride(models.AlertDetailsOverride)` was removed -* `withDisplayName(java.lang.String)` was removed * `validate()` was removed -* `withRequiredDataConnectors(java.util.List)` was removed -* `withEntityMappings(java.util.List)` was removed -* `withTriggerOperator(models.TriggerOperator)` was removed * `withTechniques(java.util.List)` was removed -* `withQueryFrequency(java.time.Duration)` was removed * `withCustomDetails(java.util.Map)` was removed +* `withSeverity(models.AlertSeverity)` was removed +* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed +* `withQueryFrequency(java.time.Duration)` was removed +* `withEntityMappings(java.util.List)` was removed +* `withTriggerThreshold(java.lang.Integer)` was removed * `withVersion(java.lang.String)` was removed -* `withTactics(java.util.List)` was removed +* `withTriggerOperator(models.TriggerOperator)` was removed +* `withAlertDetailsOverride(models.AlertDetailsOverride)` was removed * `withQueryPeriod(java.time.Duration)` was removed -* `withDescription(java.lang.String)` was removed * `withQuery(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withEventGroupingSettings(models.EventGroupingSettings)` was removed +* `withRequiredDataConnectors(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withTactics(java.util.List)` was removed * `withStatus(models.TemplateStatus)` was removed -* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed #### `models.ActionPropertiesBase` was modified @@ -95,12 +95,12 @@ * `FusionAlertRuleTemplate()` was changed to private access * `withSeverity(models.AlertSeverity)` was removed -* `withTechniques(java.util.List)` was removed -* `withStatus(models.TemplateStatus)` was removed -* `withDescription(java.lang.String)` was removed -* `validate()` was removed * `withRequiredDataConnectors(java.util.List)` was removed * `withDisplayName(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `validate()` was removed +* `withStatus(models.TemplateStatus)` was removed +* `withTechniques(java.util.List)` was removed * `withTactics(java.util.List)` was removed * `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed @@ -129,14 +129,14 @@ #### `models.ClientInfo` was modified -* `java.util.UUID objectId()` -> `java.lang.String objectId()` -* `validate()` was removed * `withObjectId(java.util.UUID)` was removed +* `validate()` was removed +* `java.util.UUID objectId()` -> `java.lang.String objectId()` #### `models.PlaybookActionProperties` was modified -* `java.util.UUID tenantId()` -> `java.lang.String tenantId()` * `withTenantId(java.util.UUID)` was removed +* `java.util.UUID tenantId()` -> `java.lang.String tenantId()` * `validate()` was removed #### `models.AccountEntity` was modified @@ -155,9 +155,9 @@ #### `models.IncidentOwnerInfo` was modified +* `withObjectId(java.util.UUID)` was removed * `validate()` was removed * `java.util.UUID objectId()` -> `java.lang.String objectId()` -* `withObjectId(java.util.UUID)` was removed #### `models.RegistryKeyEntity` was modified @@ -166,8 +166,8 @@ #### `models.AwsCloudTrailDataConnector` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.AutomationRulePropertyValuesCondition` was modified @@ -188,10 +188,10 @@ #### `models.ThreatIntelligenceMetric` was modified * `ThreatIntelligenceMetric()` was changed to private access -* `withLastUpdatedTimeUtc(java.lang.String)` was removed -* `withPatternTypeMetrics(java.util.List)` was removed * `withThreatTypeMetrics(java.util.List)` was removed * `validate()` was removed +* `withPatternTypeMetrics(java.util.List)` was removed +* `withLastUpdatedTimeUtc(java.lang.String)` was removed * `withSourceMetrics(java.util.List)` was removed #### `models.OfficeDataConnectorDataTypes` was modified @@ -237,14 +237,14 @@ * `OperationDisplay()` was changed to private access * `withDescription(java.lang.String)` was removed * `withOperation(java.lang.String)` was removed -* `withResource(java.lang.String)` was removed -* `validate()` was removed * `withProvider(java.lang.String)` was removed +* `validate()` was removed +* `withResource(java.lang.String)` was removed #### `models.MicrosoftSecurityIncidentCreationAlertRule` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.Entity` was modified @@ -266,13 +266,13 @@ * `SubmissionMailEntity()` was changed to private access * `java.util.UUID submissionId()` -> `java.lang.String submissionId()` -* `validate()` was removed * `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` +* `validate()` was removed #### `models.AadDataConnector` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.ResourceWithEtag` was modified @@ -317,8 +317,8 @@ #### `models.McasDataConnector` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.IncidentConfiguration` was modified @@ -335,8 +335,8 @@ #### `models.ThreatIntelligenceMetricEntity` was modified * `ThreatIntelligenceMetricEntity()` was changed to private access -* `withMetricName(java.lang.String)` was removed * `validate()` was removed +* `withMetricName(java.lang.String)` was removed * `withMetricValue(java.lang.Integer)` was removed #### `models.MailboxEntity` was modified @@ -387,14 +387,14 @@ #### `models.ThreatIntelligenceMetrics` was modified * `ThreatIntelligenceMetrics()` was changed to private access -* `withProperties(models.ThreatIntelligenceMetric)` was removed * `validate()` was removed +* `withProperties(models.ThreatIntelligenceMetric)` was removed #### `models.SecurityGroupEntity` was modified * `SecurityGroupEntity()` was changed to private access -* `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` * `validate()` was removed +* `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` #### `models.ActionRequest` was modified @@ -411,9 +411,9 @@ #### `models.AnomalySecurityMLAnalyticsSettings` was modified +* `java.util.UUID settingsDefinitionId()` -> `java.lang.String settingsDefinitionId()` * `withEtag(java.lang.String)` was removed * `withSettingsDefinitionId(java.util.UUID)` was removed -* `java.util.UUID settingsDefinitionId()` -> `java.lang.String settingsDefinitionId()` * `validate()` was removed #### `models.AwsCloudTrailDataConnectorDataTypes` was modified @@ -442,15 +442,15 @@ * `MicrosoftSecurityIncidentCreationAlertRuleTemplate()` was changed to private access * `withRequiredDataConnectors(java.util.List)` was removed -* `withStatus(models.TemplateStatus)` was removed -* `validate()` was removed -* `withDisplayNamesExcludeFilter(java.util.List)` was removed * `withDisplayName(java.lang.String)` was removed * `withSeveritiesFilter(java.util.List)` was removed -* `withProductFilter(models.MicrosoftSecurityProductName)` was removed -* `withDisplayNamesFilter(java.util.List)` was removed * `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed +* `withDisplayNamesExcludeFilter(java.util.List)` was removed * `withDescription(java.lang.String)` was removed +* `validate()` was removed +* `withProductFilter(models.MicrosoftSecurityProductName)` was removed +* `withStatus(models.TemplateStatus)` was removed +* `withDisplayNamesFilter(java.util.List)` was removed #### `models.ThreatIntelligenceParsedPatternTypeValue` was modified @@ -471,8 +471,8 @@ #### `models.Watchlists` was modified -* `deleteWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed * `com.azure.core.http.rest.Response deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `deleteWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed #### `models.FileEntity` was modified @@ -482,18 +482,18 @@ #### `models.HuntingBookmark` was modified * `HuntingBookmark()` was changed to private access -* `withDisplayName(java.lang.String)` was removed -* `withEventTime(java.time.OffsetDateTime)` was removed -* `withNotes(java.lang.String)` was removed -* `withQuery(java.lang.String)` was removed * `withIncidentInfo(models.IncidentInfo)` was removed -* `withCreated(java.time.OffsetDateTime)` was removed -* `withLabels(java.util.List)` was removed +* `withUpdated(java.time.OffsetDateTime)` was removed +* `withEventTime(java.time.OffsetDateTime)` was removed * `withUpdatedBy(models.UserInfo)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withNotes(java.lang.String)` was removed * `withQueryResult(java.lang.String)` was removed -* `withUpdated(java.time.OffsetDateTime)` was removed +* `withQuery(java.lang.String)` was removed * `withCreatedBy(models.UserInfo)` was removed +* `withCreated(java.time.OffsetDateTime)` was removed * `validate()` was removed +* `withLabels(java.util.List)` was removed #### `models.ThreatIntelligenceAppendTags` was modified @@ -508,13 +508,13 @@ * `IncidentEntitiesResultsMetadata()` was changed to private access * `withEntityKind(models.EntityKindEnum)` was removed -* `withCount(int)` was removed * `validate()` was removed +* `withCount(int)` was removed #### `models.FusionAlertRule` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.TIDataConnectorDataTypes` was modified @@ -537,15 +537,15 @@ #### `models.MailMessageEntity` was modified * `MailMessageEntity()` was changed to private access +* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` +* `withDeliveryAction(models.DeliveryAction)` was removed +* `withBodyFingerprintBin5(java.lang.Integer)` was removed +* `withBodyFingerprintBin3(java.lang.Integer)` was removed * `withAntispamDirection(models.AntispamMailDirection)` was removed * `withBodyFingerprintBin1(java.lang.Integer)` was removed -* `withBodyFingerprintBin3(java.lang.Integer)` was removed -* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` -* `withBodyFingerprintBin2(java.lang.Integer)` was removed -* `withDeliveryLocation(models.DeliveryLocation)` was removed * `validate()` was removed -* `withBodyFingerprintBin5(java.lang.Integer)` was removed -* `withDeliveryAction(models.DeliveryAction)` was removed +* `withDeliveryLocation(models.DeliveryLocation)` was removed +* `withBodyFingerprintBin2(java.lang.Integer)` was removed * `withBodyFingerprintBin4(java.lang.Integer)` was removed #### `models.ThreatIntelligenceParsedPattern` was modified @@ -578,8 +578,8 @@ #### `models.ProcessEntity` was modified * `ProcessEntity()` was changed to private access -* `validate()` was removed * `withElevationToken(models.ElevationToken)` was removed +* `validate()` was removed #### `models.IncidentInfo` was modified @@ -1471,15 +1471,15 @@ #### `models.IncidentAdditionalData` was modified -* `techniques()` was added +* `mergedIncidentNumber()` was added * `mergedIncidentUrl()` was added +* `techniques()` was added * `providerIncidentUrl()` was added -* `mergedIncidentNumber()` was added #### `models.ScheduledAlertRuleTemplate` was modified -* `sentinelEntitiesMappings()` was added * `subTechniques()` was added +* `sentinelEntitiesMappings()` was added #### `models.FusionAlertRuleTemplate` was modified @@ -1488,32 +1488,32 @@ #### `models.Watchlist$Update` was modified -* `withSourceType(models.SourceType)` was added * `withSource(java.lang.String)` was added +* `withSourceType(models.SourceType)` was added #### `models.IoTDeviceEntity` was modified +* `isAuthorized()` was added * `zone()` was added -* `site()` was added +* `deviceSubType()` was added * `nicEntityIds()` was added * `isProgramming()` was added -* `isAuthorized()` was added -* `deviceSubType()` was added -* `sensor()` was added * `isScanner()` was added -* `importance()` was added -* `owners()` was added * `purdueLayer()` was added +* `owners()` was added +* `site()` was added +* `sensor()` was added +* `importance()` was added #### `models.Watchlist$Definition` was modified -* `withSourceType(models.SourceType)` was added * `withSource(java.lang.String)` was added +* `withSourceType(models.SourceType)` was added #### `models.Bookmark$Update` was modified -* `withTactics(java.util.List)` was added * `withTechniques(java.util.List)` was added +* `withTactics(java.util.List)` was added * `withEntityMappings(java.util.List)` was added #### `models.ConditionType` was modified @@ -1571,8 +1571,8 @@ #### `models.ScheduledAlertRuleCommonProperties` was modified -* `sentinelEntitiesMappings()` was added * `withSentinelEntitiesMappings(java.util.List)` was added +* `sentinelEntitiesMappings()` was added #### `models.ScheduledAlertRule` was modified @@ -1583,9 +1583,9 @@ #### `models.Bookmark$Definition` was modified +* `withTechniques(java.util.List)` was added * `withTactics(java.util.List)` was added * `withEntityMappings(java.util.List)` was added -* `withTechniques(java.util.List)` was added #### `models.AlertDetailsOverride` was modified @@ -1594,8 +1594,8 @@ #### `models.Watchlist` was modified -* `sourceType()` was added * `provisioningState()` was added +* `sourceType()` was added #### `models.ActionType` was modified @@ -1603,9 +1603,9 @@ #### `models.Bookmark` was modified -* `entityMappings()` was added -* `techniques()` was added * `tactics()` was added +* `techniques()` was added +* `entityMappings()` was added #### `models.AlertRuleKind` was modified @@ -1616,9 +1616,9 @@ #### `models.DataConnectors` was modified * `connect(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody)` was added -* `disconnectWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added -* `disconnect(java.lang.String,java.lang.String,java.lang.String)` was added * `connectWithResponse(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody,com.azure.core.util.Context)` was added +* `disconnect(java.lang.String,java.lang.String,java.lang.String)` was added +* `disconnectWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added #### `models.Incidents` was modified @@ -1633,49 +1633,49 @@ #### `SecurityInsightsManager` was modified -* `workspaceManagerAssignments()` was added -* `workspaceManagerAssignmentJobs()` was added -* `metadatas()` was added -* `contentPackageOperations()` was added -* `productTemplates()` was added -* `threatIntelligences()` was added -* `entities()` was added -* `productTemplatesOperations()` was added -* `entityQueries()` was added -* `fileImports()` was added -* `dataConnectorsCheckRequirementsOperations()` was added +* `huntComments()` was added +* `officeConsents()` was added * `resourceProviders()` was added +* `entities()` was added +* `getRecommendations()` was added +* `updates()` was added +* `metadatas()` was added +* `huntRelations()` was added * `productSettings()` was added +* `entitiesRelations()` was added +* `workspaceManagerAssignmentJobs()` was added * `entityQueryTemplates()` was added -* `workspaceManagerMembers()` was added -* `contentTemplatesOperations()` was added -* `workspaceManagerGroups()` was added -* `sourceControls()` was added -* `huntRelations()` was added -* `contentTemplates()` was added +* `workspaceManagerConfigurations()` was added +* `contentPackages()` was added * `incidentTasks()` was added -* `bookmarkRelations()` was added -* `updates()` was added +* `getTriggeredAnalyticsRuleRuns()` was added +* `sourceControls()` was added +* `triggeredAnalyticsRuleRunOperations()` was added * `entitiesGetTimelines()` was added * `entityRelations()` was added -* `getRecommendations()` was added +* `workspaceManagerAssignments()` was added * `alertRuleOperations()` was added -* `reevaluates()` was added -* `productPackages()` was added -* `hunts()` was added +* `contentTemplates()` was added +* `productTemplates()` was added * `bookmarkOperations()` was added -* `productPackagesOperations()` was added -* `huntComments()` was added -* `dataConnectorDefinitions()` was added -* `entitiesRelations()` was added +* `entityQueries()` was added +* `contentTemplatesOperations()` was added * `billingStatistics()` was added -* `contentPackages()` was added -* `officeConsents()` was added -* `getTriggeredAnalyticsRuleRuns()` was added -* `gets()` was added -* `triggeredAnalyticsRuleRunOperations()` was added -* `workspaceManagerConfigurations()` was added * `sourceControlOperations()` was added +* `dataConnectorDefinitions()` was added +* `threatIntelligences()` was added +* `productPackagesOperations()` was added +* `reevaluates()` was added +* `bookmarkRelations()` was added +* `dataConnectorsCheckRequirementsOperations()` was added +* `gets()` was added +* `workspaceManagerMembers()` was added +* `productTemplatesOperations()` was added +* `fileImports()` was added +* `workspaceManagerGroups()` was added +* `contentPackageOperations()` was added +* `productPackages()` was added +* `hunts()` was added #### `models.EntityKindEnum` was modified @@ -1691,11 +1691,11 @@ #### `models.FusionAlertRule` was modified -* `scenarioExclusionPatterns()` was added * `withScenarioExclusionPatterns(java.util.List)` was added +* `scenarioExclusionPatterns()` was added +* `subTechniques()` was added * `withSourceSettings(java.util.List)` was added * `sourceSettings()` was added -* `subTechniques()` was added #### `models.UserInfo` was modified diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml b/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml index eac7bcd67c6c..48250aa6b129 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/SecurityInsights -commit: e4431efcc0a59119bf36fc0288c5a1e2e249d8f7 +commit: d7da39437a8330fabdc4151f75aebab8e5ca3a64 repo: Azure/azure-rest-api-specs additionalDirectories: From 197b21ed0e72ebfd88cd8d64e2766f743d98892d Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 19 Aug 2026 09:39:55 +0000 Subject: [PATCH 4/4] Configurations: 'specification/securityinsights/resource-manager/Microsoft.SecurityInsights/SecurityInsights/tspconfig.yaml', and CommitSHA: 'd7da39437a8330fabdc4151f75aebab8e5ca3a64' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6719344 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 234 +++++++++--------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md index 193ef799e812..44596d6d43ab 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/CHANGELOG.md @@ -47,8 +47,8 @@ #### `models.TIDataConnector` was modified -* `validate()` was removed * `withEtag(java.lang.String)` was removed +* `validate()` was removed #### `models.OfficeDataConnector` was modified @@ -63,25 +63,25 @@ #### `models.ScheduledAlertRuleTemplate` was modified * `ScheduledAlertRuleTemplate()` was changed to private access -* `validate()` was removed +* `withEntityMappings(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed * `withTechniques(java.util.List)` was removed -* `withCustomDetails(java.util.Map)` was removed +* `withQueryPeriod(java.time.Duration)` was removed +* `withStatus(models.TemplateStatus)` was removed * `withSeverity(models.AlertSeverity)` was removed -* `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed -* `withQueryFrequency(java.time.Duration)` was removed -* `withEntityMappings(java.util.List)` was removed -* `withTriggerThreshold(java.lang.Integer)` was removed -* `withVersion(java.lang.String)` was removed +* `withRequiredDataConnectors(java.util.List)` was removed +* `withCustomDetails(java.util.Map)` was removed * `withTriggerOperator(models.TriggerOperator)` was removed +* `withVersion(java.lang.String)` was removed +* `withTactics(java.util.List)` was removed * `withAlertDetailsOverride(models.AlertDetailsOverride)` was removed -* `withQueryPeriod(java.time.Duration)` was removed +* `withTriggerThreshold(java.lang.Integer)` was removed +* `validate()` was removed +* `withQueryFrequency(java.time.Duration)` was removed +* `withEventGroupingSettings(models.EventGroupingSettings)` was removed * `withQuery(java.lang.String)` was removed * `withDescription(java.lang.String)` was removed -* `withEventGroupingSettings(models.EventGroupingSettings)` was removed -* `withRequiredDataConnectors(java.util.List)` was removed -* `withDisplayName(java.lang.String)` was removed -* `withTactics(java.util.List)` was removed -* `withStatus(models.TemplateStatus)` was removed #### `models.ActionPropertiesBase` was modified @@ -95,13 +95,13 @@ * `FusionAlertRuleTemplate()` was changed to private access * `withSeverity(models.AlertSeverity)` was removed -* `withRequiredDataConnectors(java.util.List)` was removed -* `withDisplayName(java.lang.String)` was removed * `withDescription(java.lang.String)` was removed -* `validate()` was removed * `withStatus(models.TemplateStatus)` was removed -* `withTechniques(java.util.List)` was removed * `withTactics(java.util.List)` was removed +* `withRequiredDataConnectors(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withTechniques(java.util.List)` was removed +* `validate()` was removed * `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed #### `models.Watchlist$Update` was modified @@ -129,9 +129,9 @@ #### `models.ClientInfo` was modified -* `withObjectId(java.util.UUID)` was removed * `validate()` was removed * `java.util.UUID objectId()` -> `java.lang.String objectId()` +* `withObjectId(java.util.UUID)` was removed #### `models.PlaybookActionProperties` was modified @@ -142,8 +142,8 @@ #### `models.AccountEntity` was modified * `AccountEntity()` was changed to private access -* `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` * `validate()` was removed +* `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` #### `models.IncidentPropertiesAction` was modified @@ -155,9 +155,9 @@ #### `models.IncidentOwnerInfo` was modified +* `java.util.UUID objectId()` -> `java.lang.String objectId()` * `withObjectId(java.util.UUID)` was removed * `validate()` was removed -* `java.util.UUID objectId()` -> `java.lang.String objectId()` #### `models.RegistryKeyEntity` was modified @@ -166,8 +166,8 @@ #### `models.AwsCloudTrailDataConnector` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.AutomationRulePropertyValuesCondition` was modified @@ -190,9 +190,9 @@ * `ThreatIntelligenceMetric()` was changed to private access * `withThreatTypeMetrics(java.util.List)` was removed * `validate()` was removed -* `withPatternTypeMetrics(java.util.List)` was removed * `withLastUpdatedTimeUtc(java.lang.String)` was removed * `withSourceMetrics(java.util.List)` was removed +* `withPatternTypeMetrics(java.util.List)` was removed #### `models.OfficeDataConnectorDataTypes` was modified @@ -219,8 +219,8 @@ #### `models.AlertRuleTemplateDataSource` was modified * `AlertRuleTemplateDataSource()` was changed to private access -* `withConnectorId(java.lang.String)` was removed * `validate()` was removed +* `withConnectorId(java.lang.String)` was removed * `withDataTypes(java.util.List)` was removed #### `models.EventGroupingSettings` was modified @@ -229,17 +229,17 @@ #### `models.MdatpDataConnector` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.OperationDisplay` was modified * `OperationDisplay()` was changed to private access -* `withDescription(java.lang.String)` was removed -* `withOperation(java.lang.String)` was removed * `withProvider(java.lang.String)` was removed * `validate()` was removed +* `withDescription(java.lang.String)` was removed * `withResource(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed #### `models.MicrosoftSecurityIncidentCreationAlertRule` was modified @@ -265,14 +265,14 @@ #### `models.SubmissionMailEntity` was modified * `SubmissionMailEntity()` was changed to private access +* `validate()` was removed * `java.util.UUID submissionId()` -> `java.lang.String submissionId()` * `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` -* `validate()` was removed #### `models.AadDataConnector` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.ResourceWithEtag` was modified @@ -317,8 +317,8 @@ #### `models.McasDataConnector` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.IncidentConfiguration` was modified @@ -336,8 +336,8 @@ * `ThreatIntelligenceMetricEntity()` was changed to private access * `validate()` was removed -* `withMetricName(java.lang.String)` was removed * `withMetricValue(java.lang.Integer)` was removed +* `withMetricName(java.lang.String)` was removed #### `models.MailboxEntity` was modified @@ -352,8 +352,8 @@ #### `models.HostEntity` was modified * `HostEntity()` was changed to private access -* `validate()` was removed * `withOsFamily(models.OSFamily)` was removed +* `validate()` was removed #### `models.AlertsDataTypeOfDataConnector` was modified @@ -387,14 +387,14 @@ #### `models.ThreatIntelligenceMetrics` was modified * `ThreatIntelligenceMetrics()` was changed to private access -* `validate()` was removed * `withProperties(models.ThreatIntelligenceMetric)` was removed +* `validate()` was removed #### `models.SecurityGroupEntity` was modified * `SecurityGroupEntity()` was changed to private access -* `validate()` was removed * `java.util.UUID objectGuid()` -> `java.lang.String objectGuid()` +* `validate()` was removed #### `models.ActionRequest` was modified @@ -406,14 +406,14 @@ #### `models.AatpDataConnector` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.AnomalySecurityMLAnalyticsSettings` was modified +* `withSettingsDefinitionId(java.util.UUID)` was removed * `java.util.UUID settingsDefinitionId()` -> `java.lang.String settingsDefinitionId()` * `withEtag(java.lang.String)` was removed -* `withSettingsDefinitionId(java.util.UUID)` was removed * `validate()` was removed #### `models.AwsCloudTrailDataConnectorDataTypes` was modified @@ -441,16 +441,16 @@ #### `models.MicrosoftSecurityIncidentCreationAlertRuleTemplate` was modified * `MicrosoftSecurityIncidentCreationAlertRuleTemplate()` was changed to private access -* `withRequiredDataConnectors(java.util.List)` was removed -* `withDisplayName(java.lang.String)` was removed -* `withSeveritiesFilter(java.util.List)` was removed * `withAlertRulesCreatedByTemplateCount(java.lang.Integer)` was removed * `withDisplayNamesExcludeFilter(java.util.List)` was removed -* `withDescription(java.lang.String)` was removed -* `validate()` was removed -* `withProductFilter(models.MicrosoftSecurityProductName)` was removed * `withStatus(models.TemplateStatus)` was removed +* `withSeveritiesFilter(java.util.List)` was removed * `withDisplayNamesFilter(java.util.List)` was removed +* `withProductFilter(models.MicrosoftSecurityProductName)` was removed +* `withDescription(java.lang.String)` was removed +* `validate()` was removed +* `withRequiredDataConnectors(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed #### `models.ThreatIntelligenceParsedPatternTypeValue` was modified @@ -482,18 +482,18 @@ #### `models.HuntingBookmark` was modified * `HuntingBookmark()` was changed to private access +* `withLabels(java.util.List)` was removed * `withIncidentInfo(models.IncidentInfo)` was removed -* `withUpdated(java.time.OffsetDateTime)` was removed -* `withEventTime(java.time.OffsetDateTime)` was removed * `withUpdatedBy(models.UserInfo)` was removed -* `withDisplayName(java.lang.String)` was removed * `withNotes(java.lang.String)` was removed -* `withQueryResult(java.lang.String)` was removed -* `withQuery(java.lang.String)` was removed +* `validate()` was removed * `withCreatedBy(models.UserInfo)` was removed * `withCreated(java.time.OffsetDateTime)` was removed -* `validate()` was removed -* `withLabels(java.util.List)` was removed +* `withDisplayName(java.lang.String)` was removed +* `withQuery(java.lang.String)` was removed +* `withQueryResult(java.lang.String)` was removed +* `withUpdated(java.time.OffsetDateTime)` was removed +* `withEventTime(java.time.OffsetDateTime)` was removed #### `models.ThreatIntelligenceAppendTags` was modified @@ -508,13 +508,13 @@ * `IncidentEntitiesResultsMetadata()` was changed to private access * `withEntityKind(models.EntityKindEnum)` was removed -* `validate()` was removed * `withCount(int)` was removed +* `validate()` was removed #### `models.FusionAlertRule` was modified -* `withEtag(java.lang.String)` was removed * `validate()` was removed +* `withEtag(java.lang.String)` was removed #### `models.TIDataConnectorDataTypes` was modified @@ -537,16 +537,16 @@ #### `models.MailMessageEntity` was modified * `MailMessageEntity()` was changed to private access -* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` -* `withDeliveryAction(models.DeliveryAction)` was removed -* `withBodyFingerprintBin5(java.lang.Integer)` was removed -* `withBodyFingerprintBin3(java.lang.Integer)` was removed * `withAntispamDirection(models.AntispamMailDirection)` was removed -* `withBodyFingerprintBin1(java.lang.Integer)` was removed -* `validate()` was removed -* `withDeliveryLocation(models.DeliveryLocation)` was removed -* `withBodyFingerprintBin2(java.lang.Integer)` was removed +* `withBodyFingerprintBin3(java.lang.Integer)` was removed * `withBodyFingerprintBin4(java.lang.Integer)` was removed +* `withBodyFingerprintBin5(java.lang.Integer)` was removed +* `withBodyFingerprintBin2(java.lang.Integer)` was removed +* `withDeliveryAction(models.DeliveryAction)` was removed +* `java.util.UUID networkMessageId()` -> `java.lang.String networkMessageId()` +* `withDeliveryLocation(models.DeliveryLocation)` was removed +* `validate()` was removed +* `withBodyFingerprintBin1(java.lang.Integer)` was removed #### `models.ThreatIntelligenceParsedPattern` was modified @@ -578,8 +578,8 @@ #### `models.ProcessEntity` was modified * `ProcessEntity()` was changed to private access -* `withElevationToken(models.ElevationToken)` was removed * `validate()` was removed +* `withElevationToken(models.ElevationToken)` was removed #### `models.IncidentInfo` was modified @@ -1471,20 +1471,20 @@ #### `models.IncidentAdditionalData` was modified -* `mergedIncidentNumber()` was added * `mergedIncidentUrl()` was added -* `techniques()` was added +* `mergedIncidentNumber()` was added * `providerIncidentUrl()` was added +* `techniques()` was added #### `models.ScheduledAlertRuleTemplate` was modified -* `subTechniques()` was added * `sentinelEntitiesMappings()` was added +* `subTechniques()` was added #### `models.FusionAlertRuleTemplate` was modified -* `subTechniques()` was added * `sourceSettings()` was added +* `subTechniques()` was added #### `models.Watchlist$Update` was modified @@ -1493,28 +1493,28 @@ #### `models.IoTDeviceEntity` was modified -* `isAuthorized()` was added -* `zone()` was added -* `deviceSubType()` was added -* `nicEntityIds()` was added -* `isProgramming()` was added +* `importance()` was added * `isScanner()` was added -* `purdueLayer()` was added -* `owners()` was added * `site()` was added +* `owners()` was added +* `nicEntityIds()` was added +* `isAuthorized()` was added +* `purdueLayer()` was added +* `isProgramming()` was added +* `deviceSubType()` was added * `sensor()` was added -* `importance()` was added +* `zone()` was added #### `models.Watchlist$Definition` was modified -* `withSource(java.lang.String)` was added * `withSourceType(models.SourceType)` was added +* `withSource(java.lang.String)` was added #### `models.Bookmark$Update` was modified -* `withTechniques(java.util.List)` was added * `withTactics(java.util.List)` was added * `withEntityMappings(java.util.List)` was added +* `withTechniques(java.util.List)` was added #### `models.ConditionType` was modified @@ -1571,31 +1571,31 @@ #### `models.ScheduledAlertRuleCommonProperties` was modified -* `withSentinelEntitiesMappings(java.util.List)` was added * `sentinelEntitiesMappings()` was added +* `withSentinelEntitiesMappings(java.util.List)` was added #### `models.ScheduledAlertRule` was modified -* `withSentinelEntitiesMappings(java.util.List)` was added -* `withSubTechniques(java.util.List)` was added * `subTechniques()` was added +* `withSentinelEntitiesMappings(java.util.List)` was added * `sentinelEntitiesMappings()` was added +* `withSubTechniques(java.util.List)` was added #### `models.Bookmark$Definition` was modified +* `withEntityMappings(java.util.List)` was added * `withTechniques(java.util.List)` was added * `withTactics(java.util.List)` was added -* `withEntityMappings(java.util.List)` was added #### `models.AlertDetailsOverride` was modified -* `alertDynamicProperties()` was added * `withAlertDynamicProperties(java.util.List)` was added +* `alertDynamicProperties()` was added #### `models.Watchlist` was modified -* `provisioningState()` was added * `sourceType()` was added +* `provisioningState()` was added #### `models.ActionType` was modified @@ -1603,9 +1603,9 @@ #### `models.Bookmark` was modified -* `tactics()` was added * `techniques()` was added * `entityMappings()` was added +* `tactics()` was added #### `models.AlertRuleKind` was modified @@ -1615,10 +1615,10 @@ #### `models.DataConnectors` was modified -* `connect(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody)` was added -* `connectWithResponse(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody,com.azure.core.util.Context)` was added * `disconnect(java.lang.String,java.lang.String,java.lang.String)` was added * `disconnectWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `connectWithResponse(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody,com.azure.core.util.Context)` was added +* `connect(java.lang.String,java.lang.String,java.lang.String,models.DataConnectorConnectBody)` was added #### `models.Incidents` was modified @@ -1627,55 +1627,55 @@ #### `models.Incident` was modified -* `providerName()` was added * `providerIncidentId()` was added * `teamInformation()` was added +* `providerName()` was added #### `SecurityInsightsManager` was modified * `huntComments()` was added +* `entitiesGetTimelines()` was added +* `productTemplates()` was added +* `getTriggeredAnalyticsRuleRuns()` was added +* `reevaluates()` was added +* `workspaceManagerAssignmentJobs()` was added +* `fileImports()` was added +* `contentTemplatesOperations()` was added +* `contentTemplates()` was added +* `workspaceManagerAssignments()` was added * `officeConsents()` was added -* `resourceProviders()` was added -* `entities()` was added -* `getRecommendations()` was added -* `updates()` was added +* `contentPackageOperations()` was added * `metadatas()` was added -* `huntRelations()` was added -* `productSettings()` was added +* `getRecommendations()` was added +* `workspaceManagerGroups()` was added * `entitiesRelations()` was added -* `workspaceManagerAssignmentJobs()` was added -* `entityQueryTemplates()` was added +* `entities()` was added +* `sourceControlOperations()` was added * `workspaceManagerConfigurations()` was added -* `contentPackages()` was added -* `incidentTasks()` was added -* `getTriggeredAnalyticsRuleRuns()` was added -* `sourceControls()` was added +* `gets()` was added +* `productPackages()` was added +* `hunts()` was added +* `workspaceManagerMembers()` was added +* `threatIntelligences()` was added +* `updates()` was added +* `entityQueryTemplates()` was added +* `entityQueries()` was added +* `bookmarkRelations()` was added +* `productTemplatesOperations()` was added * `triggeredAnalyticsRuleRunOperations()` was added -* `entitiesGetTimelines()` was added +* `resourceProviders()` was added * `entityRelations()` was added -* `workspaceManagerAssignments()` was added -* `alertRuleOperations()` was added -* `contentTemplates()` was added -* `productTemplates()` was added +* `huntRelations()` was added * `bookmarkOperations()` was added -* `entityQueries()` was added -* `contentTemplatesOperations()` was added +* `contentPackages()` was added +* `sourceControls()` was added +* `alertRuleOperations()` was added * `billingStatistics()` was added -* `sourceControlOperations()` was added -* `dataConnectorDefinitions()` was added -* `threatIntelligences()` was added * `productPackagesOperations()` was added -* `reevaluates()` was added -* `bookmarkRelations()` was added * `dataConnectorsCheckRequirementsOperations()` was added -* `gets()` was added -* `workspaceManagerMembers()` was added -* `productTemplatesOperations()` was added -* `fileImports()` was added -* `workspaceManagerGroups()` was added -* `contentPackageOperations()` was added -* `productPackages()` was added -* `hunts()` was added +* `dataConnectorDefinitions()` was added +* `incidentTasks()` was added +* `productSettings()` was added #### `models.EntityKindEnum` was modified @@ -1692,9 +1692,9 @@ #### `models.FusionAlertRule` was modified * `withScenarioExclusionPatterns(java.util.List)` was added +* `withSourceSettings(java.util.List)` was added * `scenarioExclusionPatterns()` was added * `subTechniques()` was added -* `withSourceSettings(java.util.List)` was added * `sourceSettings()` was added #### `models.UserInfo` was modified